Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/healeycodes/unrandom

🎲 Intercept and modify getrandom syscalls from a process (x86-64 Linux).
https://github.com/healeycodes/unrandom

getrandom ptrace syscalls

Last synced: 13 days ago
JSON representation

🎲 Intercept and modify getrandom syscalls from a process (x86-64 Linux).

Awesome Lists containing this project

README

        

# 🎲 unrandom
> My blog post: [Making Python Less Random](https://healeycodes.com/making-python-less-random)


Force `getrandom` syscalls from a process to return zeroes on x86-64 Linux.


Start a Python REPL. Then build and run `getrandom`:

```txt
gcc -o unrandom unrandom.c
./unrandom
```

Call `os.urandom` in the REPL:

```txt
>>> import os
>>> os.urandom(8)
b'\x00\x00\x00\x00\x00\x00\x00\x00'
>>> os.urandom(8)
b'\x00\x00\x00\x00\x00\x00\x00\x00'
```