zardus / preeny

Some helpful preload libraries for pwning stuff.
BSD 2-Clause "Simplified" License
1.56k stars 171 forks source link

Added UID manipulation #43

Closed ZetaTwo closed 6 years ago

ZetaTwo commented 6 years ago

Now you can replace the return value of getuid() and geteuid(). I used it for a challenge which generated a decryption key based on current UID.

> ./uid 
I am running as UID = 1000
I am running as EUID = 1000
> LD_PRELOAD=../x86_64-linux-gnu/deuid.so FAKE_UID=1337 FAKE_EUID=1338 ./uid
I am running as UID = 1337
I am running as EUID = 1338
zardus commented 6 years ago

I have no idea how I missed this. Thank you for the contribution!