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 / 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 September 26, 2024 12:44
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()
@TheFlash2k
TheFlash2k / brute_regex.py
Created December 18, 2023 14:05
Brute force a regular expression and match it against a flag format
#!/usr/bin/env python3
import argparse
from rstr import xeger as generate_pattern
def brute_regex(
regex: str,
count: int = 1000,
match: str = "",
show: bool = False
@TheFlash2k
TheFlash2k / install-glibc.sh
Created December 9, 2023 23:42
Install any version of GLIBC, configure automatically and setup an alias to patch binaries using that version.
#!/bin/bash
######### YOU CAN CHANGE THESE ############
TMP_FOLDER="/tmp"
INSTALL_FOLDER="/opt"
BASE_URL="https://ftp.gnu.org"
RC_FILE=`echo ~/.my_functions`
if [ ! -f $RC_FILE ]; then
touch $RC_FILE
#!/bin/bash
username=$(cat /etc/passwd | grep 1000 | cut -d ':' -f1)
if [[ -z $username ]]; then $username="root"; fi
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt update
sudo apt install -y libc6:i386 libncurses5:i386 libstdc++6:i386 snapd gcc g++ build-essential python3 python3-pip gpg ruby strace ltrace ruby-dev liblzma-dev liblzo2-dev zlib1g-dev nasm bless unzip p7zip-full cmake libcapstone-dev autoconf g++-multilib gcc-multilib curl wget git python2 docker.io docker-compose patchelf gdb dos2unix elfutils bat screen tmux libseccomp-dev
@TheFlash2k
TheFlash2k / aslr
Created October 25, 2023 17:51
manage aslr
#!/bin/bash
# Default Mode: 2
# MODES:
# 0 - disable
# 1 - stack and code segment
# 2 - stack, code and data segment (default)
# Options:
# aslr on # 2
@TheFlash2k
TheFlash2k / flag_updator.py
Last active October 17, 2023 21:57
Allows flag updating using SSH (For Linux) and SMB (For Windows). Authenticated, and allows the use of password/private key over ssh with user specific and port specific authentication. Allows flag_format to be changed at runtime by modifying the configuration file.
# For enums
from enum import Enum
# For parsing and handling
import json
import sys
import random
import string
import logging
import tempfile
@TheFlash2k
TheFlash2k / deploy.sh
Created October 3, 2023 01:21
This is used to automate the deployment of 2-Node/1-Master Kubernetes Configuration. The `deploy.sh` and `master-setup.sh` are attached as well, but to create a single script, they were base64 encoded and then included in the same script. In case of vagrant deployment, the user may only need to run `setup-kube-cluster.sh` (but the VMs must be up…
#!/bin/bash
## Author: @TheFlash2k
set -e
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF
@TheFlash2k
TheFlash2k / logger.py
Created September 17, 2023 01:49
A simple logger class with colors.
#!/usr/bin/env python3
# .~ Author: @TheFlash2k
import sys
from colorama import Fore, init
from datetime import datetime
import os
from pathlib import Path
init(autoreset=True)