Skip to content

Instantly share code, notes, and snippets.

View cryptolok's full-sized avatar

Maksym Zaitsev cryptolok

View GitHub Profile
@cryptolok
cryptolok / dotNETstaticRandom.txt
Created November 6, 2024 11:43
Windows .NET 4 Framework derandomizer
This patched clr.dll ommits windows syscall via advapi32.dll to generate random numbers, insted it will always produce 0 as result
can be tested with Get-Random in powershell
DLL : https://drive.google.com/file/d/1NnMe7jjtOyQR8AeRptv75mquE6uGnsZe/view
Put the dll file to C:\WINDOWS\Microsoft.NET\Framework64\v4.* and not forget to copy and backup the current version
or inject the dll to the process directly
Use at your own risk
@cryptolok
cryptolok / libc-unrandom.c
Created June 26, 2025 11:05
Linux libc derandomizer
#include <unistd.h>
ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) {
memset(buf, 0, buflen);
return buflen;}
//gcc -shared -fPIC -o libc-unrandom.so libc-unrandom.c -ldl
//LD_PRELOAD=./libc-unrandom.so python -c "import random; print(random.random())"
//LD_PRELOAD=./libc-unrandom.so shuf -e 1 2 3
//LD_PRELOAD=./libc-unrandom.so bash