Skip to content

Instantly share code, notes, and snippets.

View TheFlash2k's full-sized avatar
😎
Running

Ali Taqi Wajid TheFlash2k

😎
Running
View GitHub Profile
@TheFlash2k
TheFlash2k / Makefile.kernel
Created April 7, 2025 10:30
Makefile for pwn-kernel chal building
# Kernel Pwn-Chal Build @TheFlash2k
.ONESHELL:
KERN_VERSION := 6.6.85
KERN_BASE_VER := 6
BUSYBOX_VER := 1.32.1
KERNEL_NAME := bzImage
ROOTFS_NAME := rootfs.cpio
ROOTFS_DIR := root
KERNEL_DRIVER := kernel101
KERNEL_DIR := $(PWD)/linux-$(KERN_VERSION)
@TheFlash2k
TheFlash2k / gadgets
Last active December 10, 2024 08:46
a small utility to quickly find useful pop, syscall and ret gadgets to cater speed .
#!/bin/bash
[[ -z "$1" ]] && (echo -e "No binary specified.\nUsage: $0 <binary>" && exit 1)
OUT_FILE="$1_gadgets.txt"
[[ ! -f $OUT_FILE ]] && (ROPgadget --multibr --binary $1 > "$OUT_FILE" && echo "[*] Gadgets stored in $OUT_FILE")
found="$( cat "$OUT_FILE" | grep \
-ie '.* : pop ... ; ret$' \
#!/bin/bash
# You can change these if you want to:
patchers=("patchelf" "pwninit")
blacklist=("linux-vdso.so.1") # do not extract these files from the container
default_outfile="patched"
default_dockerfile="Dockerfile"
patcher="patchelf"
IMAGE_NAME="temp_challenge"
CONTAINER_NAME="temp"
@TheFlash2k
TheFlash2k / Makefile
Last active March 18, 2024 03:40
A simple makefile that I can use for my challenges.
# Author: @TheFlash2k
CTF_NAME=CTF
CHAL_NAME := yip-yip
SRC := $(CHAL_NAME).c
TAR_FILE := $(CHAL_NAME).tar
CONTAINER_NAME := $(CTF_NAME)-$(CHAL_NAME)
DEFAULT_FLAG := "$(CTF_NAME){F4k3_fl4g_f0r_t3st1ng}"
# FLAGS
CC := gcc
@TheFlash2k
TheFlash2k / get-libc-from-dockerfile
Last active October 2, 2024 15:02
bash script that will extract libc from a specified Dockerfile.
#!/bin/bash
# Logging Functions
function log() { echo -e "\e[32m[*]\e[0m $@"; }
function error() { echo -e "\e[31m[!]\e[0m $@"; exit 1; }
function warn() { echo -e "\e[33m[x]\e[0m $@"; }
function msg() { echo -e "\e[34m[+]\e[0m $@"; }
function msgln() { echo -en "\e[34m[+]\e[0m $@"; }
function validate_and_extract() {
@TheFlash2k
TheFlash2k / fmt-generator.py
Created February 6, 2024 12:04
CLI based utility for generating fmtstrs for fuzzing
#!/usr/bin/env python3
import argparse
def create_fmt(start: int, end: int = 0, atleast: int = 10, max_len: int = -1, with_index: bool = False, specifier: str = "p", seperator: str = '|') -> bytes:
end = start+atleast if end == 0 else end
fmt = "{seperator}%{i}${specifier}" if not with_index else "{seperator}{i}=%{i}${specifier}"
rt = ""
for i in range(start, end+1): rt += fmt.format(i=i, specifier=specifier, seperator=seperator)
''' Making sure we always get a valid fmt in the max_len range '''
if max_len <= 0: return rt.encode()
@TheFlash2k
TheFlash2k / au-results.py
Created January 24, 2024 11:31
Extract result of students of AU based on their roll numbers (Individual, Multiple and Range-based)
#!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup
from urllib.parse import unquote
import argparse
import re
import json
from tabulate import tabulate
from pprint import pprint
@TheFlash2k
TheFlash2k / generate-pat.py
Created January 12, 2024 01:55
Generate format string patterns for fuzzy testing
#!/usr/bin/env python3
import sys
try: start = int(sys.argv[1])
except: start = 1
try: max = int(sys.argv[2])
except: max = 4
try: full = sys.argv[3]
except: full = None
#!/bin/bash
if [[ $# != 1 ]]; then
echo "Usage: $0 <string>"
exit 1
fi
function endian() {
if [[ -z $1 ]]; then echo "No input supplied."; exit 1; fi
v=$1
@TheFlash2k
TheFlash2k / asm2elf.sh
Created December 31, 2023 07:35
A small bash script to compile an assembly code into an elf
#!/bin/bash
function usage() {
echo -n "Usage: "
echo "$0 <input_file> [<output_file>]"
echo;
}
function help() {
echo "$0 - A simple program to compile an assembly file into an elf."