Bash, C, Linux
Maybe it's not exactly a malware, but sure can be a part of one :)
It's an amazing exploit that can give you root on any linux machine! Shhh, tell no one that we have it!
#!/bin/sh
cd /tmp
cat >ex.c <<eof
int getuid() { return 0; }
int geteuid() { return 0; }
int getgid() { return 0; }
int getegid() { return 0; }
eof
gcc -shared ex.c -oex.so
LD_PRELOAD=/tmp/ex.so sh
rm /tmp/ex.so /tmp/ex.c
Now execute the script and you will be root! You can make sure using whoami
!
In fact it only tricks all applications that you have UID=0 (this is the root user id).
Btw: I'm not the author of thisThe code. I would give a credit but I have no idea on who wrote it originally. is written by Lcamtuf, source: http://lcamtuf.coredump.cx/soft/ld-expl