Skip to content

Instantly share code, notes, and snippets.

View JorianWoltjer's full-sized avatar
💻
Hacking the mainframe

Jorian JorianWoltjer

💻
Hacking the mainframe
View GitHub Profile
import argparse
from pathlib import Path
parser = argparse.ArgumentParser()
parser.add_argument("input", type=Path, help="Input audio file (.mp3, .wav, .m4a, etc.)")
parser.add_argument("output", type=Path, help="Output text file (.txt)")
parser.add_argument("-m", "--model", choices=["small", "medium", "large"], default="medium", help="Model size")
args = parser.parse_args()
from faster_whisper import WhisperModel
@JorianWoltjer
JorianWoltjer / ysoserial-fix.py
Last active February 5, 2024 15:59
Simple script that fixes all InaccessibleObjectException or IllegalAccessError for ysoserial using Java 17
#!/usr/bin/env python3
import subprocess
import re
import sys
YSOSERIAL_PATH = "/tool/ysoserial/ysoserial-all.jar" # https://github.com/frohoff/ysoserial/releases
JAVA_COMMAND = ["java"] # May be eg. ["java", "-Xmx2g"] or a path to a java binary
def extract_missing(error):
match = re.findall(r'java\.lang\.reflect\.InaccessibleObjectException: .*?: module (.*?) does not "opens (.*?)" to unnamed module @', error)
@JorianWoltjer
JorianWoltjer / truncated_java_random.md
Last active May 7, 2023 11:43
Practical `java.util.Random` LCG attack using LLL reduction

Practical java.util.Random LCG attack using LLL reduction

An easy-to-use Python script to sync up with the state of a java.util.Random generator after supplying a few samples. The internal seed has 48 bits, and every sample you give to the program will give some amount of bits of information. Here is a table to get an idea of how many samples you should provide per amount of bits in your input number:

bits bound samples (±)
4 16 25
6 64 12
8 256 8
16 65536 4
@JorianWoltjer
JorianWoltjer / AdobeCtrlBackspace.ahk
Last active March 18, 2022 21:21
Enable Ctrl+Backspace shortcut to delete an entire word in Adobe apps
#SingleInstance Force
#IfWinActive, ahk_exe Adobe Premiere Pro.exe
^BS:: send, ^+{left}{delete}
#IfWinActive
#IfWinActive, ahk_exe AfterFX.exe
^BS:: send, ^+{left}{delete}
#IfWinActive
# A collection of bash functions I have in my .bashrc file for automating quick things
# Variables
export MANPAGER="sh -c 'col -bx | bat -l man -p'" # Read manpage formatted in color using https://github.com/sharkdp/bat
export me="$USER:$(id -g)" # Simple "user:group" string useful for setting `chown` to yourself
# Aliases
alias bashrc="nano +119 ~/.bashrc && source ~/.bashrc" # Open .bashrc file at the bottom, and reload it when done
alias pls='sudo $(history -p !!)' # Run previous command with sudo
alias untar="tar -xvf"
@JorianWoltjer
JorianWoltjer / drag.py
Last active July 16, 2022 13:37
Python script that allows you to drag and drop Windows files into a WSL terminal, and copy them to the working directory
#!/usr/bin/python3
from blessed import Terminal
import subprocess
import shlex
term = Terminal()
def read_path():
# Read input from drag
full = ""