<?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>[blog.rayfoo] &#187; tee</title>
	<atom:link href="http://blog.rayfoo.info/tag/tee/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.rayfoo.info</link>
	<description>Infosec, DFIR, tech geekery, thoughts and whatnot</description>
	<lastBuildDate>Wed, 25 Jan 2012 00:36:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>OS Profiling</title>
		<link>http://blog.rayfoo.info/2010/07/os-profiling</link>
		<comments>http://blog.rayfoo.info/2010/07/os-profiling#comments</comments>
		<pubDate>Tue, 06 Jul 2010 16:00:24 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[data mining]]></category>
		<category><![CDATA[information gathering]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[log analysis]]></category>
		<category><![CDATA[p0f]]></category>
		<category><![CDATA[Splunk]]></category>
		<category><![CDATA[tee]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=605</guid>
		<description><![CDATA[Trying out p0f along with Splunk.. p0f allows you to determine the OS of the remote machine based on the TCP fields characteristics.  It can also tell whether the machine is behind a firewall, what kind of internet connection it is running from...pretty useful for information junkies like me Here's what I did: ./p0f -t [...]]]></description>
			<content:encoded><![CDATA[<p>Trying out <a href="http://lcamtuf.coredump.cx/p0f.shtml">p0f</a> along with <a href="http://www.splunk.com/download">Splunk</a>..</p>
<p>p0f allows you to determine the OS of the remote machine based on the TCP fields characteristics.  It can also tell whether the machine is behind a firewall, what kind of internet connection it is running from...pretty useful for information junkies like me <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Here's what I did:</p>
<p><span style="color: #339966;">./p0f -t -u MyUseridHere -i eth0 'src not MyIPAddressHere' | tee -a p0f.log</span></p>
<p>Runs p0f, logging with actual timestamps (-t), chroot and setuid to MyUserIdHere (-u), listening on eth0 (-i), and filtering out packets for connections initiated from my machine itself (since I'm not interested in profiling my own machine).</p>
<p><a href="http://en.wikipedia.org/wiki/Tee_(command)">tee</a> is a (really nifty!) linux command.  What it does is to "split" the input (stdin) to two parts: stdout and the file specified.  The -a option tells it to append to the file instead of overwriting it.</p>
<p>Using this, p0f outputs logs like this one:</p>
<p><span style="color: #339966;">&lt;Sat Jul  3 07:03:56 2010&gt; 175.40.12.47:1095 - Windows 2000 SP2+, XP SP1+ (seldom 98)<br />
-&gt; 74.207.229.183:80 (distance 12, link: sometimes DSL (2))</span></p>
<p>One of the Splunk queries that I poked around with:</p>
<p><span style="color: #339966;">| file /path/to/p0f.log | rex field=_raw "&gt; (?&lt;srcip&gt;[^:]+):(?&lt;srcport&gt;[^ ]+) - (?&lt;srcos&gt;.+?) \(" | rex field=_raw "-&gt; (?&lt;dstip&gt;[^:]+):(?&lt;dstport&gt;[^ ]+) " | regex srcos!="UNKNOWN" | top limit=0 srcos</span></p>
<p>This query extracts out the source and destination IP and port, and the source OS.  Then after filtering out the OS tagged with UNKNOWN, the remaining entries are ranked...</p>
<p>The resulting chart, of not much real interest by itself, just shows that other than that the connections are predominantly from linux machines (hurhur), and there's a connection from a really old Netware machine (<a href="http://en.wikipedia.org/wiki/Novell_NetWare#NetWare_5.x">5 was released in Oct 1998!</a>).</p>
<p style="text-align: center;"><a href="http://blog.rayfoo.info/wp-content/uploads/2010/07/p0fsplunk.png"><img class="aligncenter size-full wp-image-606" title="p0fsplunk" src="http://blog.rayfoo.info/wp-content/uploads/2010/07/p0fsplunk.png" alt="" width="480" height="250" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2010/07/os-profiling/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Afterglow tests</title>
		<link>http://blog.rayfoo.info/2010/05/afterglow-tests</link>
		<comments>http://blog.rayfoo.info/2010/05/afterglow-tests#comments</comments>
		<pubDate>Sun, 30 May 2010 15:04:36 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[afterglow]]></category>
		<category><![CDATA[cut]]></category>
		<category><![CDATA[data visualization]]></category>
		<category><![CDATA[graphviz]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[neato]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[tcpdump]]></category>
		<category><![CDATA[tee]]></category>
		<category><![CDATA[uniq]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=564</guid>
		<description><![CDATA[Just tryin'... Connections from/to laptop sudo tcpdump -i wlan0 -p&#124;cut -d' ' -f3,5&#124;cut -d':' -f1&#124;tee dump cat dump &#124;uniq &#124;sed -r 's/^(.*)\.[^.]+ (.*)\.([^.]+)/\1,\3,\2/' &#62; local.csv cat local.csv &#124;./afterglow.pl &#124;neato -Tgif -o test.gif Connections from laptop Let's try again, this time only focusing on the outgoing connections initiated:]]></description>
			<content:encoded><![CDATA[<p>Just tryin'...</p>
<h2>Connections from/to laptop</h2>
<pre>sudo tcpdump -i wlan0 -p|cut -d' ' -f3,5|cut -d':' -f1|tee dump</pre>
<pre>cat dump |uniq |sed -r 's/^(.*)\.[^.]+ (.*)\.([^.]+)/\1,\3,\2/' &gt; local.csv</pre>
<pre>cat local.csv |./afterglow.pl |neato -Tgif -o test.gif</pre>
<div id="attachment_572" class="wp-caption aligncenter" style="width: 254px"><a href="http://blog.rayfoo.info/wp-content/uploads/2010/05/test.gif"><img class="size-medium wp-image-572" title="Connections to/from laptop" src="http://blog.rayfoo.info/wp-content/uploads/2010/05/test-244x300.gif" alt="Connections to/from laptop" width="244" height="300" /></a><p class="wp-caption-text">What a mess!</p></div>
<h2>Connections from laptop</h2>
<h2><span style="font-weight: normal; font-size: 13px;">Let's try again, this time only focusing on the outgoing connections initiated:</span></h2>
<p><span style="font-weight: normal; font-size: 13px;"> </span></p>
<div id="attachment_573" class="wp-caption aligncenter" style="width: 239px"><a href="http://blog.rayfoo.info/wp-content/uploads/2010/05/test1.gif"><img class="size-medium wp-image-573" title="Connections from laptop" src="http://blog.rayfoo.info/wp-content/uploads/2010/05/test1-229x300.gif" alt="Connections from laptop" width="229" height="300" /></a><p class="wp-caption-text">Much better...</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2010/05/afterglow-tests/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

