This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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$' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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." |
NewerOlder