Skip to content

Instantly share code, notes, and snippets.

View MattMoony's full-sized avatar
🦆
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

Matthias Monschein MattMoony

🦆
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
View GitHub Profile
@MattMoony
MattMoony / solutions.py
Last active September 27, 2020 22:02
View CTFd solution history - exact timestamps not, e.g.: "3 days ago" ...
import json, datetime
import requests as req
from tabulate import tabulate
CTFURL=input('CTF-URL (e.g.: ctf.csaw.io): ')
SESSCOOKIE=input('Session-Cookie: ')
CHID=input('Challenge-ID: ')
print(tabulate([(e['name'], datetime.datetime.fromisoformat(e['date'][:-1]).strftime('%d.%m.%Y %H:%M:%S')) for e in json.loads(req.get(f'https://{CTFURL}/api/v1/challenges/{CHID}/solves',cookies=dict(session=SESSCOOKIE)).text)['data']], headers=('User', 'Timestamp',)))
@MattMoony
MattMoony / public_ip.py
Created September 27, 2020 22:07
View public IP address via Python Script
import requests as req;print(f'\033[92m[+]\033[39m Public IP: \033[96m{req.get("https://wtfismyip.com/text").text.strip()}\033[39m')
@MattMoony
MattMoony / ipinfo.sh
Last active September 28, 2020 18:16
Generate a JSON with GEO information on all ips contained in the output of the `last` command (in the example, the output of the `last` command is loaded from`ips`)
echo "["$(echo $(cat ips|head -n -3|awk '{print $3}'|sort|uniq|xargs -I% curl -s "https://freegeoip.app/json/%"|sed "s/\}/\},/")|rev|cut -c2-|rev)"]">ips.json
#!/usr/bin/python3
import json
import requests as req
from time import sleep
from datetime import datetime
def get_public_ip():
try:
status = json.loads(req.get('https://wtfismyip.com/json').text)
#!/usr/bin/env python3
"""
Title: IBM-Arnold
Date: March 2021
Author: mattmoony (https://github.com/MattMoony)
Quick implementation of a semi-smart assistant called 'Arnold'
(even though the name can be changed) utilizing IBM Watson services.
#!/usr/bin/env python3
"""
Title: Standalone Markdown
Date: March 2021
Author: mattmoony (https://github.com/MattMoony)
Short python script that converts a markdown file, which
requires a path to load images from to a "standalone"

Example


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce posuere, libero convallis aliquet luctus, libero odio tincidunt mi, eget dignissim nisi ante id turpis. Donec hendrerit vel libero et placerat. Donec vitae purus mi. Mauris placerat ornare tristique. Duis lobortis est nisi, eget pulvinar mauris pharetra sit amet. Suspendisse pulvinar, nibh nec semper posuere, massa urna malesuada ligula, et egestas purus nisl semper dui. 
Phasellus magna nisl, pretium eget odio dictum, posuere euismod tortor. In eleifend nisi et neque mattis molestie. Donec a ultrices mi, at molestie orci. Fusce ex nisl, pellentesque in lectus vitae, bibendum fermentum elit. Duis convallis tempor diam vitae aliquet. Ut cursus nisi est, ac volutpat felis malesuada ac. Nulla facilisi. Nulla luctus quis orci vel luctus. Etiam nec dui eget neque pe
@MattMoony
MattMoony / gdb-environ.sh
Created March 28, 2021 21:11
GDB environments - Manjaro Linux
#!/bin/bash
EXT_BASE="/mnt/d/hacking/tools"
activate () {
if [[ $1 == "peda" ]]; then
echo "source $EXT_BASE/peda/peda.py" >> $HOME/.gdbinit
elif [[ $1 == "pwngdb" ]]; then
echo "source $EXT_BASE/Pwngdb/pwngdb.py
source $EXT_BASE/Pwngdb/angelheap/gdbinit.py
@MattMoony
MattMoony / aes-ecb-recov.py
Last active March 29, 2024 16:58
Recover plaintext from encrypted AES/ECB ciphertext using an oracle.
#!/usr/bin/env python3
"""
Recover plaintext from encrypted AES/ECB ciphertext using an oracle.
Scenario:
You can send whatever you want to the server and you get it back
encrypted with an attached secret. (The secret was attached before the
encryption process). Since ECB is *stateless*, meaning each plaintext
block that is the same will result in the same ciphertext block (as long
@MattMoony
MattMoony / aes-cbc-flipping.py
Created April 28, 2021 13:25
Modify the resulting plaintext of AES/CBC ciphertext using bit-flipping.
#!/usr/bin/env python3
"""
Modify the resulting plaintext of AES/CBC ciphertext using bit-flipping.
Scenario:
You know that AES is being used in CBC mode. You know (parts of) the
plaintext + block size + IV (not too hard to determine these things most
of the time). You can simply change the content of the first encrypted
block of the plaintext by changing the IV. It's also possible to modify