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
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 April 28, 2024 17:20
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 $@"; }
# modifiable vars ##
@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."
@TheFlash2k
TheFlash2k / add-users.ps1
Last active December 31, 2023 06:57
Powershell to create admin users with RDP privileges (used in ignite23 for quick user adding )
function Check-UserExists {
param([string]$username)
net user | findstr $username
$out=$?
return $out
}
function CreateUser {
param (
[switch]$RDP,
@TheFlash2k
TheFlash2k / fmt_fuzz_all.py
Last active December 24, 2023 01:27
Fuzz Format String Vulnerabilities and get the output of all the specifiers.
#!/usr/bin/env python3
# *~ author: @TheFlash2k
'''
Printing all the specifier's value using PRINTF.
Helps in format string bugs.
'''
from pwn import *
import sys
@TheFlash2k
TheFlash2k / offset.py
Created December 23, 2023 21:37
cyclic -l alternate for both hex and ascii ;)
#!/usr/bin/env python3
import sys
from pwn import *
def find(data):
data = data[2:] if data[:2] == "0x" else data
offset = -1
try:
data = unhex(data)[::-1].decode()