Skip to content

Instantly share code, notes, and snippets.

View thistehneisen's full-sized avatar
🚩
www.offseq.com

npu thistehneisen

🚩
www.offseq.com
View GitHub Profile
@thistehneisen
thistehneisen / bruteforce.sh
Created March 19, 2024 16:14
Testing whether bruteforce protection together with lockout mechanisms is implemented
#!/bin/bash
set -x
threads=10
iterations=200
valid_username="admin"
valid_password="admin"
client_id="client"
url="https://127.0.0.1/auth/realms/realm/protocol/openid-connect/token"
@thistehneisen
thistehneisen / incremental-downloader.py
Last active February 3, 2024 11:12
Threaded Python script that incrementally downloads files from an address
import os
import time
from urllib.parse import unquote
import requests
from requests.exceptions import RequestException
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
from concurrent.futures import ThreadPoolExecutor, as_completed
# Base URL and download directory
@thistehneisen
thistehneisen / jsonnest.py
Created January 26, 2024 09:38
Create a deeply nested JSON string
def create_nested_json_string(depth):
json_string = '{"a":' * depth + '1' + '}' * depth
return json_string
depth = 10000
nested_json = create_nested_json_string(depth)
print(nested_json)
@thistehneisen
thistehneisen / decompile-jar-files.sh
Created January 23, 2024 15:30
Decompiles all jar files in current directory recursively
#!/bin/bash
output_dir="decompiled"
mkdir -p "$output_dir"
find . -name "*.jar" -exec sh -c '
for jarfile do
decompile_dir="$0/$(basename "${jarfile}" .jar)"
mkdir -p "$decompile_dir"
jd-cli "$jarfile" -od "$decompile_dir"
@thistehneisen
thistehneisen / download-everything.php
Created October 2, 2022 08:12
Downloads everything from a host
<?php
$baseUrl = 'https://[domain.tld]/?item=[item]&id=[id]';
$maxItems = 1000;
$maxId = 2000;
function getUrl($url, $headersOnly = TRUE) {
$userAgent = 'Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0';
$options = [
@thistehneisen
thistehneisen / phpdangerousfuncs.md
Created May 19, 2022 06:18 — forked from mccabe615/phpdangerousfuncs.md
Dangerous PHP Functions

Command Execution

exec           - Returns last line of commands output
passthru       - Passes commands output directly to the browser
system         - Passes commands output directly to the browser and returns last line
shell_exec     - Returns commands output
\`\` (backticks) - Same as shell_exec()
popen          - Opens read or write pipe to process of a command
proc_open      - Similar to popen() but greater degree of control
pcntl_exec - Executes a program
@thistehneisen
thistehneisen / ghostscript-poc.ai
Created October 29, 2021 10:26
GhostScript Proof of Concept Adobe Illustrator (.ai)
%!PS-Adobe-2.0 EPSF-1.2
%%Creator: Adobe Illustrator(TM) 1.2d4
%%For: OpenWindows Version 2
%%Title: vector.eps
%%CreationDate: 4/12/90 3:20 AM
%%DocumentProcSets: Adobe_Illustrator_1.2d1 0 0
%%DocumentSuppliedProcSets: Adobe_Illustrator_1.2d1 0 0
%%BoundingBox: 17 171 567 739
%%EndComments
@thistehneisen
thistehneisen / address-response-verification.php
Created February 25, 2021 07:43
Simple PHP script to verify HTTP response codes from domain list
<?php
$addresses = file('addresses.txt', FILE_IGNORE_NEW_LINES);
$responding = [];
foreach ($addresses as $address) {
if ($url = parse_url($address)) {
if (!isset($url['scheme'])) {
$address = 'http://' . $address;
}
@thistehneisen
thistehneisen / lottery649.php
Created December 15, 2020 13:15
Lottery Number Generator (6/49) - generate 6 random numbers in the range 1 - 49 inclusive
<?php
function lottery649($maxn = "49",$maxb="6") {
srand((double)microtime() * 1000000);
while (1>0) {
$lottery[] = rand(1,$maxn);
$lottery = array_unique($lottery);
if (sizeof($lottery) == $maxb) break;
}
sort($lottery);
return implode(", ",$lottery);
@thistehneisen
thistehneisen / generate_backup_wordlist.php
Created November 17, 2020 10:35
Generating wordlist for probable backup file names
<?php
$startYear = 2019;
$endYear = 2020;
for ($year = $startYear; $year <= $endYear; $year++) {
$startMonth = 1;
$endMonth = 12;
for ($month = $startMonth; $month <= $endMonth; $month++) {
$paddedMonth = sprintf("%02d", $month);