Created
June 26, 2025 11:05
-
-
Save cryptolok/0f8efe0d97a8f7a09022e956e2cf09ea to your computer and use it in GitHub Desktop.
Linux libc derandomizer
This file contains hidden or 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
#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 | |
// echo $SRANDOM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment