Skip to content

Instantly share code, notes, and snippets.

View Himan10's full-sized avatar
🎧
The Armored Entity

Himan10

🎧
The Armored Entity
View GitHub Profile
@Himan10
Himan10 / template.yaml
Created April 15, 2025 16:45
akto test template
id: REMOVE_TOKENS
info:
name: "Broken Authentication by removing auth token"
description: "API doesn't validate the authenticity of token. Attacker can remove the auth token and access the endpoint."
details: >
"The endpoint appears to be vulnerable to broken authentication attack. The original request was replayed by removing victim's <b>auth</b> token. The server responded with 2XX success codes.<br>"
"<b>Background:</b> Authentication is the process of attempting to verify the digital identity of the sender of a communication. Testing the authentication schema means understanding how the authentication process works and using that information to
circumvent the authentication mechanism. While most applications require authentication to gain access to private information or to execute tasks, not every authentication method is able to provide adequate security. Negligence, ignorance, or simple
understatement of security threats often result in authentication schemes that can be bypassed
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Engineering Blogs</title>
</head>
<body>
<outline text="Engineering Blogs" title="Engineering Blogs">
<outline type="rss" text="8th Light" title="8th Light" xmlUrl="https://8thlight.com/insights/feed/rss.xml" htmlUrl="https://8thlight.com/blog/"/>
<outline type="rss" text="AdRoll" title="AdRoll" xmlUrl="http://tech.adroll.com/feed.xml" htmlUrl="http://tech.adroll.com/blog/"/>
<outline type="rss" text="Advanced Web Machinery" title="Advanced Web Machinery" xmlUrl="https://advancedweb.hu/atom.xml" htmlUrl="https://advancedweb.hu/"/>

Secure Code Review

Semgrep

Commands: (Only works in Linux or similar distributions)

  1. Installation:
    • Create a virtual environment: python3 -m venv “my_env”
    • Activate the created virtual environment:
      • Windows: source “my_env”/Scripts/Activate
      • Linux: source “my_env”/bin/activate
      • Once activated, use “pip” to download the semgrep library: pip install semgrep
        Semgrep can also be installed directly without creating any virtual environment but it’s always recommended to have a virtual environment set-up in case things go wrong, you can switch back to your normal environment and work with it.
@Himan10
Himan10 / jobs_model.py
Created March 17, 2024 13:35
User model
class User(models.Model):
"""
Represents a user profile with related details.
This class defines the attributes associated with a user profile.
This class has two foreign keys that point to Job and Company table
"""
def media_upload_path(instance, filename):
return f"user_{instance.user_id}/data/{filename}"

Missing functionalities in API (Jobs)

  1. Jobs
    1. Industry
    2. Job Type
    3. Salary
    4. Qualification
    5. Vacency position
    6. Total applyed (we already have a number of applicants for this)
    7. About the Job:
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] ==== STARTING PLAYER ====
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] Player version: "3.3.3" 20230301-8f94f87b97
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] args: ("/opt/genymotion/player", "--vm-name", "07706b39-b5d5-437a-aa36-a71663de9778")
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] "Local socket created at path: /tmp/dcd0d36bfe6c40ac5b8d66e9efb9b069"
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] No proxy set
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] Host date and time: "02 May 2023 21:30:52 +0530"
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] "Notifying launchpad of status change: 07706b39-b5d5-437a-aa36-a71663de9778 BOOTING"
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] Progress dialog is visible. devicePixelRatio: 1
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] Device is up to date
2023-05-02T21:30:52+05:30 [Genymo
@Himan10
Himan10 / wiresharkissue.txt
Last active January 4, 2023 15:23
Journalctl stacktrace of wireshark
Jan 04 20:03:42 blackHat systemd-coredump[16912]: [🡕] Process 16904 (wireshark) of user 1000 dumped core.
Stack trace of thread 16904:
#0 0x00007ff4c08ba64c n/a (libc.so.6 + 0x8864c)
#1 0x00007ff4c086a958 raise (libc.so.6 + 0x38958)
#2 0x00007ff4c085453d abort (libc.so.6 + 0x2253d)
#3 0x00007ff4c1aea03c n/a (libwsutil.so.14 + 0xc03c)
#4 0x00007ff4c1afb02a ws_log (libwsutil.so.14 + 0x1d02a)
#5 0x0000564a86f04a63 n/a (wireshark + 0x249a63)
#6 0x00007ff4c0e38ab8 n/a (libQt5Core.so.5 + 0xe0ab8)
@Himan10
Himan10 / discordProblem.py
Created April 23, 2021 09:47
get the data stored in all the curly braces pairs
def get_data_from_file(file_path):
# Read File
with open(file_path, 'r') as file:
data = file.read()
return data
def check_paranthesis(data: str):
""" Check if the string contains valid opening/closing tag """
stack = []
@Himan10
Himan10 / vocabfetch.py
Created March 26, 2021 18:30
Fetch the meaning (short and long) of a given word
#!/usr/bin/python3.8
import types
import requests
from sys import argv
from re import match
from bs4 import BeautifulSoup
from pynput import keyboard
from functools import partial
from colorama import Fore, Style
@Himan10
Himan10 / split.py
Created January 11, 2021 05:28
Implementation of str.split() in python
# Implementation of split method
def split(string: str, separator: str, max_split=-1):
if separator.__len__() == 0 or string.__len__() == 0:
raise ValueError
result = []
temp = ''
i = 0
s_index = 0
full_match = False