<?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>Adventures of an apprentice</title>
	<atom:link href="http://diveintoinfosec.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://diveintoinfosec.wordpress.com</link>
	<description>Diving into infosec</description>
	<lastBuildDate>Sun, 15 Jan 2012 01:34:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='diveintoinfosec.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Adventures of an apprentice</title>
		<link>http://diveintoinfosec.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://diveintoinfosec.wordpress.com/osd.xml" title="Adventures of an apprentice" />
	<atom:link rel='hub' href='http://diveintoinfosec.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Honey, I canceled the laundry. &#8211; No factor authentication</title>
		<link>http://diveintoinfosec.wordpress.com/2011/08/08/honey-i-canceled-the-laundry/</link>
		<comments>http://diveintoinfosec.wordpress.com/2011/08/08/honey-i-canceled-the-laundry/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 13:21:02 +0000</pubDate>
		<dc:creator>ilektrojohn</dc:creator>
				<category><![CDATA[privacy]]></category>
		<category><![CDATA[aptus]]></category>
		<category><![CDATA[booking system]]></category>
		<category><![CDATA[laundry]]></category>
		<category><![CDATA[one factor authentication]]></category>
		<category><![CDATA[sssb]]></category>

		<guid isPermaLink="false">http://diveintoinfosec.wordpress.com/?p=118</guid>
		<description><![CDATA[How would you feel if you couldn&#8217;t wash your clothes ? Like , never ? Well, there&#8217;s a (web)app for that !!! Let&#8217;s take things from the start : This post applies to people living in student accommodation offered by SSSB ( Striftelsen Stockholms Studentbösteder ) in Stockholm, Sweden. Well , most of them actually, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=118&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How would you feel if you couldn&#8217;t wash your clothes ? Like , never ? Well, there&#8217;s a (web)app for that !!!</p>
<p>Let&#8217;s take things from the start : This post applies to people living in student accommodation offered by SSSB ( Striftelsen Stockholms Studentbösteder ) in Stockholm, Sweden. Well , most of them actually, specifically the ones in which the electronic lock and booking system provided by <a href="http://www.aptus.se" target="_blank">aptus</a> has been installed already.</p>
<p><strong>The situation</strong> : In the aforementioned housing establishments, external (and some internal ) ordinary door locks have been replaced with electronic <a href="http://www.aptus.se/Other/Aptus/Produkter/Produktblad/Engelska/Oppna%201100%20Produktblad_ENG.pdf" target="_blank">proximity readers</a> and keys . Those proximity keys are also used for booking (laundry) services , offered by the same company. Basically, when one needs to book a slot in the laundry rooms , he/she accesses the control unit, uses his/her proximity key to activate it and book the desired time slot. As advertised in the company brochures: &#8220;Communication between control unit and booking board is encrypted using 32-bit keys.&#8221; I&#8217;ll leave out the discussion about cloning proximity keys/cards, as it is irrelevant to the point of this post. For the time being, let&#8217;s just all assume that the proximity keys are clone-proof , the 32-bit key sufficient, and the communication is tamper-proof as implied.</p>
<p><strong>The problem</strong> : SSSB, trying to be tech-savy and helpful , offers another way to access the booking system , provided again by the same company. It is a web application, built on asp.net where users can login and manage their bookings ( book, cancel , view ) without having to physically access the installed control unit. Hm, so what is the problem , you might ask. Login credentials. Aptus portal uses a username/password authentication system , which , although not without all the potential password related  problems ) can be considered a safe practice . I copy wikipedia&#8217;s wording : &#8221; A <strong>password</strong> is a<strong> secret</strong> word or string of characters that is used for authentication, to prove identity or gain access to a resource (example: an access code is a type of password). The password <strong>should be kept secret</strong> from those not allowed access.&#8221; (emphasis is mine)  Well, SSSB went a bit over in their attempt to make things easy for users, providing themselves the username and password. What&#8217;s worse ? The username and the password is the same string. What&#8217;s worst ? The password is not secret, publicly available in many cases, and in worst case easily deduced. The string used as a username and password in the system is the object number of the apartment ( Hyresobjekt ) which is a 11 digit string in the form of <em>abcd-efgh-xyz</em> . The <em>abcd</em> part is the 4-digit code of the housing area ( for example , Lappkärrsberget has 7404 , Jerum has 1106 e.t.c. ) . The <em>efgh</em> part is somehow (not in a consistent manner from what I&#8217;ve seen ) deduced from the street number of the building and the floor number of the room ( en example room has 1308 because the address is xxxxxx 13, and it is on the seventh floor . The rooms on the sixth floor have 1307 and so on and so forth ). Lastly the xyz part is deduced from the room number inside the floor. Some correspond to the actual room number , so if the room number is 11 the code is 011 , some are deduced from some older ordering I guess . My room&#8217;s xyz part doesn&#8217;t correspond to my room&#8217;s number, but it corresponds to my kitchen cupboards number, which I suppose is a left-over from previous numbering schemes. Taking into consideration that the room&#8217;s object number is publicly available in the SSSB&#8217;s website when the room is open for biding , and that especially in some periods like August , SSSB updates the available rooms every 3 days, it shouldn&#8217;t be really difficult to deduce all the possible object numbers for all the apartments in SSSB premises. Worst case scenario, with only the abcd part available for each housing area , one could fire up his <a href="http://thc.org/thc-hydra/" target="_blank">THC Hydra</a> and get the valid object numbers from the successful logins. ***I&#8217;m not suggesting that you should go and do that ***.</p>
<p>Sure it&#8217;s not a life threatening issue , but it just comes to show how easily sophisticated access control systems can be circumvented due to bad design and implementation solutions. Your neighbor had a party at the night before your exam ? Well, no laundry for him in the next month ! Or worse, consider an automated script changing laundry booking times every hour for all the students leaving in SSSB ( That was up to 7000 rooms in 2000, sssb doesn&#8217;t have updated statistics but I guess it&#8217;s valid to argue that it is more than 10000 people ) . Really not convenient . 10000 students walking around with dirty clothes in the trendy and fashion-victim Stockholm , shouldn&#8217;t be that much fun ! One can go a bit further in the paranoia zone and claim that valuable information about the whereabouts of a tenant can be determined from the laundry bookings ( time of day that he/she is at home e.t.c. )</p>
<p><strong>The solution</strong> : The solution isn&#8217;t that hard to implement. SSSB already has an authentication system for the website and a general sssb account, based on the personal number of tenants and a password. How hard can it be to connect that to the booking portal ? I contacted SSSB in October 2010 but after the kind reply from the helpdesk thanking me about my thoughts and assuring me that it will be forwarded to the people managing the system, nothing has been done , so I guess it&#8217;s fair to come out with the issue and let all interested parties know. I , for one, am already irritated enough by my bookings moving time slots &#8220;by themselves&#8221; often enough.</p>
<p>Keep clean <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/diveintoinfosec.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diveintoinfosec.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diveintoinfosec.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diveintoinfosec.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diveintoinfosec.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diveintoinfosec.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diveintoinfosec.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diveintoinfosec.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diveintoinfosec.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diveintoinfosec.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diveintoinfosec.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diveintoinfosec.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diveintoinfosec.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diveintoinfosec.wordpress.com/118/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=118&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diveintoinfosec.wordpress.com/2011/08/08/honey-i-canceled-the-laundry/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9c62646641af53f62a772eebe518f5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ilektrojohn</media:title>
		</media:content>
	</item>
		<item>
		<title>Harvesting google profiles</title>
		<link>http://diveintoinfosec.wordpress.com/2011/05/19/harvesting-google-profiles/</link>
		<comments>http://diveintoinfosec.wordpress.com/2011/05/19/harvesting-google-profiles/#comments</comments>
		<pubDate>Thu, 19 May 2011 14:09:26 +0000</pubDate>
		<dc:creator>ilektrojohn</dc:creator>
				<category><![CDATA[privacy]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[harvesting]]></category>
		<category><![CDATA[profiles]]></category>

		<guid isPermaLink="false">http://diveintoinfosec.wordpress.com/?p=106</guid>
		<description><![CDATA[Some minutes ago, I saw an interesting tweet from Mikko H. Hypponen saying that he found out that all (yes, as in ALL &#8211; 35,513,445 )  google profiles addresses can be retrieved from a single XML file  . Looked through it and , yeap, he was quite right. Well , all these information is going [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=106&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some minutes ago, I saw an interesting tweet from <a href="https://twitter.com/#%21/mikkohypponen">Mikko H. Hypponen</a> saying that he found out that all (yes, as in ALL &#8211; 35,513,445 )  google profiles addresses can be retrieved from a single <a href="http://bit.ly/iT6p3n">XML file</a>  . Looked through it and , yeap, he was quite right.</p>
<p>Well , all these information is going to be useful somehow ,right? Right. In case it&#8217;s going to be removed here is a simple way to harvest them before that happens :</p>
<p><pre class="brush: python;">
#!/usr/bin/env python

import urllib
from BeautifulSoup import BeautifulStoneSoup as bs

xml = bs(urllib.urlopen('http://www.gstatic.com/s2/sitemaps/profiles-sitemap.xml').read())
for i in xml.findAll('loc'):
    try:
        urllib.urlretrieve(i.text, i.text[35:])
        print 'Downloaded %s' % i.text[35:]
    except Exception, err:
        print '%s could not be retrieved' % i.text
print 'All done'

</pre></p>
<p>That&#8217;s it, save it , run it and wait <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Not that I used it, but I calculate that you get around 1.7 GB worth of profile links .</p>
<p>Well , the juicy part is obviously the harvesting of the information from the profiles themselves. <a href="https://twitter.com/#!/tomokas">People </a>are mentioning on twitter that Google is aware for a long time, or at least should be. Thoughts about the potential implications from that harvesting, on a blogpost to come .</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diveintoinfosec.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diveintoinfosec.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diveintoinfosec.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diveintoinfosec.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diveintoinfosec.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diveintoinfosec.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diveintoinfosec.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diveintoinfosec.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diveintoinfosec.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diveintoinfosec.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diveintoinfosec.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diveintoinfosec.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diveintoinfosec.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diveintoinfosec.wordpress.com/106/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=106&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diveintoinfosec.wordpress.com/2011/05/19/harvesting-google-profiles/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9c62646641af53f62a772eebe518f5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ilektrojohn</media:title>
		</media:content>
	</item>
		<item>
		<title>OMNeT++ and Oversim on Ubuntu Maverick</title>
		<link>http://diveintoinfosec.wordpress.com/2011/02/09/omnet-and-oversim-on-ubuntu-maverick/</link>
		<comments>http://diveintoinfosec.wordpress.com/2011/02/09/omnet-and-oversim-on-ubuntu-maverick/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 00:25:39 +0000</pubDate>
		<dc:creator>ilektrojohn</dc:creator>
				<category><![CDATA[thesis]]></category>
		<category><![CDATA[akaroa]]></category>
		<category><![CDATA[INET]]></category>
		<category><![CDATA[omnet++]]></category>
		<category><![CDATA[oversim]]></category>
		<category><![CDATA[simulation]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[x64]]></category>

		<guid isPermaLink="false">http://diveintoinfosec.wordpress.com/?p=97</guid>
		<description><![CDATA[OMNeT++ is a C++ simulation library and framework, primarily for building network simulators and oversim is an open-source overlay and peer-to-peer network simulation framework for OMNeT++ . I will be using it for simulations related to my MSc thesis , so I tried to install it and get everything working a while back. There were [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=97&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.omnetpp.org/">OMNeT++</a> is a C++ simulation library and framework, primarily for building network simulators and <a href="http://www.oversim.org/">oversim</a> is an open-source overlay and peer-to-peer network simulation framework for OMNeT++ . I will be using it for simulations related to my MSc thesis , so I tried to install it and get everything working a while back. There were some small problems with the installation flow which , however easily solvable in the end, caused a couple of lost hours. So I wanted to note it down for future reference and in case anyone else finds it useful .</p>
<p>The goal is to install OMNeT++, the patched INET framework needed by oversim and oversim itself. So let&#8217;s start with</p>
<p><strong>OMNeT++</strong></p>
<p>create a dir to hold all the programs .i.e ~/simulations<strong><br />
</strong></p>
<p>Grab the tar.gz from the <a href="http://www.omnetpp.org/omnetpp/doc_details/2217-omnet-41-source--ide-tgz">website</a> , and unpack it to ~/simulations. The <a href="http://www.omnetpp.org/doc/omnetpp41/InstallGuide.pdf">documentation </a>is pretty straight forward regarding dependencies and other details. Install the required packets with :</p>
<pre>sudo apt-get install build-essential gcc g++ bison flex perl \
tcl-dev tk-dev blt libxml2-dev zlib1g-dev openjdk-6-jre \
doxygen graphviz openmpi-bin libopenmpi-dev libpcap-dev \
 tk8.4-dev libgmp3-dev blt-dev
<strong> </strong></pre>
<p>Now before compiling omnet++ you will need <a href="http://www.akaroa.canterbury.ac.nz/about.chtml">akaroa</a> . Register and download it, unpacking it to ~/simulations also. The problem with gcc 4.4.4 that was mentioned in omnet++ install guide seems to be fixed with gcc 4.4.5 but still if you try to compile you will get errors like the following :</p>
<pre>/bin/sh: pushd: not found</pre>
<p>This has to do with /bin/sh being linked to /bin/dash instead of /bin/bash in ubuntu&#8217;s latest releases. To fix it once and for all do the following:</p>
<pre># rm -f /bin/sh
# ln -s /bin/bash /bin/sh</pre>
<p>Now cd to the akaroa dir , and compile it with ./configure &amp;&amp; make &amp;&amp; make install as usual.</p>
<p><strong>NOTICE</strong> t<em>hat if you are on x86_64 you need to add <strong>-fPIC</strong> to the compile options for akaroa</em>, otherwise omnet++ compilation will fail later. To do that , go to the file src/Makefile.main and add -fPIC to the options on lines 110 and 114 so that it becomes like this</p>
<pre>%.o:    %.C
 @echo Compiling $&lt;
 @$(CPLUS) $(CPLUS_FLAGS) -c $(INCLUDE) -fPIC $&lt; -o $@

%.o:    %.c
 @echo Compiling $&lt;
 @$(CC) $(CC_FLAGS) -c $(INCLUDE) -fPIC $&lt; -o $@</pre>
<p>Next go back to the omnet++ unpackaged dir. You need to add omnet&#8217;s bin dir to your path, the way to do it permanently is to add the following line to your ~/.bashrc file (assuming you followed the file structure I suggested , if not edit accordingly)</p>
<pre>export PATH=$PATH:$HOME/simulations/omnetpp-4.1/bin</pre>
<p>Now compile omnet++ with ./configure &amp;&amp; make &amp;&amp; make install . To verify that it was successful , go to samples , run the demo and choose any of the available ones.</p>
<p><strong>Patched version of INET framework</strong></p>
<p>Grab the archive from <a href="http://www.oversim.org/chrome/site/INET-OverSim-20101019.tgz">here</a> and unpack it in the ~/simulations directory.</p>
<p>run make in the directory</p>
<p><strong>Oversim</strong></p>
<p>Grab the archive from <a href="http://www.oversim.org/wiki/OverSimDownload">here</a> and unpack it in the ~/simulations directory.</p>
<p>run make in the directory</p>
<p>That&#8217;s it, you should be ready now !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diveintoinfosec.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diveintoinfosec.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diveintoinfosec.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diveintoinfosec.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diveintoinfosec.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diveintoinfosec.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diveintoinfosec.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diveintoinfosec.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diveintoinfosec.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diveintoinfosec.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diveintoinfosec.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diveintoinfosec.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diveintoinfosec.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diveintoinfosec.wordpress.com/97/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=97&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diveintoinfosec.wordpress.com/2011/02/09/omnet-and-oversim-on-ubuntu-maverick/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<georss:point>59.376103 17.910908</georss:point>
		<geo:lat>59.376103</geo:lat>
		<geo:long>17.910908</geo:long>
		<media:content url="http://0.gravatar.com/avatar/c9c62646641af53f62a772eebe518f5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ilektrojohn</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing creepy &#8230;</title>
		<link>http://diveintoinfosec.wordpress.com/2011/02/03/introducing-creepy/</link>
		<comments>http://diveintoinfosec.wordpress.com/2011/02/03/introducing-creepy/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 15:54:09 +0000</pubDate>
		<dc:creator>ilektrojohn</dc:creator>
				<category><![CDATA[privacy]]></category>
		<category><![CDATA[creepy]]></category>
		<category><![CDATA[exif]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[foursquare]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://diveintoinfosec.wordpress.com/?p=87</guid>
		<description><![CDATA[or &#8220;The birdy told me where you&#8217;ve been&#8221; . Creepy &#8211; A geolocation information aggregator Background: Well, privacy concerns with regards to information shared across social networking platforms is not something new. At the same time it doesn&#8217;t get old also.  I will spare you the links session, google can fetch all the papers , [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=87&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>or &#8220;The birdy told me where you&#8217;ve been&#8221; .</p>
<p><a href="http://ilektrojohn.github.com/creepy/">Creepy</a> &#8211; A geolocation information aggregator</p>
<p><strong>Background:</strong></p>
<p>Well, privacy concerns with regards to information shared across social networking platforms is not something new. At the same time it doesn&#8217;t get old also.  I will spare you the links session, <a href="https://encrypted.google.com/search?hl=en&amp;q=privacy+social+networking&amp;aq=0&amp;aqi=g4g-m5&amp;aql=&amp;oq=privacy+social+">google</a> can fetch all the papers , articles you ll ever need. Location awareness is rolled out not only in platforms created for that reason ( foursquare, gowalla ) but also in facebook ( call me places ), twitter ( location feature(?)) . Moreover as was shown <a href="http://isc.sans.edu/diary.html?storyid=8203">here</a> , almost a year ago, by Johannes B. Ullrich (<a href="https://twitter.com/#!/johullrich">@johullrich</a>) users tend to ( even unknowingly )  share their location via EXIF tags in the pictures they share with everyone on image hosting services.  Then came <a href="http://pleaserobme.com/why">PleaseRobMe</a> and <a href="http://icanstalku.com/">iCanStalkYou</a> which really helped to made the point clear.</p>
<p><strong>What :</strong></p>
<p>Creepy is a geolocation aggregator. It searches for a users geolocation information that he/she has shared publicly in the social networking platforms that he/she uses. In the version released , twitter, flickr, foursquare (through twitter ) and a list of image hosting services are supported. You feed creepy with the twitter username and/or flickr id of the user and it retrieves all the locations the user has shared. Locations are determined by</p>
<ul>
<li>Location information on twitter</li>
<li>foursquare checkins</li>
<li>exif tags from pictures uploaded to a number of image hosting services and posted to twitter</li>
<li>geolocation information from photos posted on Flickr</li>
</ul>
<p>Locations are presented as a list and are also shown in an embedded map ( courtesy of the awesome <a href="http://nzjrs.github.com/osm-gps-map/">osmgpsmap</a> widget) . For each location, the context is also presented ( i.e. the text that the user tweeted ) . Features include automatic caching of discovered information ( retrieved tweets, determined locations ) in order to minimize API calls to twitter and flickr, and a (not so nice) GUI in pygtk.</p>
<p><strong>Why : </strong></p>
<p>Well , I have had the idea since I first read the article by Dr . Ullrich. Then came icanstalkyou and pleaserobme , but it was not exactly what i was thinking about.</p>
<p>Ok, the goal is double. First , to raise awareness . By making the process of retrieving and analyzing all the shared location-specific information that users share , easy and automated , I hope to make clear how easy it is for someone to stalk you, rob you, find out where you ve been and why e.t.c. It&#8217;s not worth to rewrite how one can defend himself and control the information he is sharing so I ll provide a link to the instructions posted on icanstalkyou  about <a href="http://icanstalku.com/how.php#disable">disabling geotagging in smartphones</a> and see <a href="http://support.twitter.com/entries/122236">here</a> about how to enable/disable the location feature in twitter.</p>
<p>The second goal is to create a tool to add in your social engineering toolbox.  The ethics are a bit blurry , so I just want to state that I do not endorse stalking or any other form of use of creepy for malicious purposes . What the app does is to aggregate information already publicly shared . If you find that useful, you&#8217; re welcome to use it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Screenshots :</p>
<p>Here are some screenshots of creepy in use</p>
<a href="http://diveintoinfosec.wordpress.com/2011/02/03/introducing-creepy/#gallery-1-slideshow">Click to view slideshow.</a>
<p>Where :</p>
<p>You can find creepy on <a href="https://github.com/ilektrojohn/creepy">github </a>. I can count on the fact that there are many bugs lurking around, so use the tool , find them, and I&#8217;ll promise I&#8217;ll fix them soon enough . Enjoy !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diveintoinfosec.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diveintoinfosec.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diveintoinfosec.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diveintoinfosec.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diveintoinfosec.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diveintoinfosec.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diveintoinfosec.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diveintoinfosec.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diveintoinfosec.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diveintoinfosec.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diveintoinfosec.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diveintoinfosec.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diveintoinfosec.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diveintoinfosec.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=87&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diveintoinfosec.wordpress.com/2011/02/03/introducing-creepy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9c62646641af53f62a772eebe518f5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ilektrojohn</media:title>
		</media:content>
	</item>
		<item>
		<title>Network forensics afternoon</title>
		<link>http://diveintoinfosec.wordpress.com/2010/12/01/network-forensics-afternoon/</link>
		<comments>http://diveintoinfosec.wordpress.com/2010/12/01/network-forensics-afternoon/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 20:05:02 +0000</pubDate>
		<dc:creator>ilektrojohn</dc:creator>
				<category><![CDATA[forensics]]></category>
		<category><![CDATA[network security]]></category>
		<category><![CDATA[arp]]></category>
		<category><![CDATA[bittorrent]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://diveintoinfosec.wordpress.com/?p=80</guid>
		<description><![CDATA[Well, strange things happened today . While working on a project , I noticed a strange high incoming network traffic on the system monitor of my ubuntu machine. High, as in ~8MBps with small bursts that lasted some minutes and produced ( according to system monitor again ) a total download traffic of 1.9 GB [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=80&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well, strange things happened today . While working on a project , I noticed a strange high incoming network traffic on the system monitor of my ubuntu machine. High, as in ~8MBps with small bursts that lasted some minutes and produced ( according to system monitor again ) a total download traffic of 1.9 GB .<br />
As you can imagine I was pretty surprised , I was sure I was not running anything that could cause such amounts of traffic . The applications running at that time were skype,  firefox , thunderbird and <a href="http://aptana.com/" target="_blank">Aptana studio</a> none of which could result to that kind of traffic (I had only one tab open in ff at the time , pointing to KTH <a href="http://www.kth.se" target="_blank">website</a> , and Aptana&#8217;s automatic update process needs user confirmation in order to download updates) . My first reaction was to run netstat , which produced uninteresting results , typical ESTABLISHED connections by thunderbird to the imap servers it was supposed to, a connection to ip 174.129.193.12 initiated by an application recognised as &#8220;python&#8221; ( which was actually the ubuntu one client ) , one regarding skype and one regarding ff as expected more or less. I didn&#8217;t keep the output somewhere but I&#8217;m pretty sure I didn&#8217;t miss anything there. As I was gradually getting from surprised to worried since the traffic seemed to continue at approx the same rate, I fired up wireshark and started capturing my wired interface. Couple of minutes after that the traffic stopped and I haven&#8217;t noticed anything peculiar since.</p>
<p>So I started to check the capture , trying to find the stream that produced the traffic I observed. From a first look there seemed to be many long UDP flows from different IP addresses (various high ports) to a specific IP address (not my interface&#8217;s though) on port 51508 . The destination address is in the same subnet as mine and I have  confirmed that is up and port 51508 (among other high ports is open). This smelled like bittorrent traffic from distance . To confirm , here is what a random packet of that stream looked like :</p>
<pre>0000  0c 60 76 61 69 98 00 12  bf d9 bf 65 08 00 45 00   .`vai... ...e..E.
0010  00 83 5f cc 00 00 0e 11  8f 96 18 71 f4 7d d5 67   .._..... ...q.}.g
0020  da b1 fb 21 c9 34 00 6f  fd 34 64 31 3a 61 64 32   ...!.4.o .4d1:ad2
0030  3a 69 64 32 30 3a 49 b8  74 ec 25 bf d6 64 bc 10   :id20:I. t.%..d..
0040  b8 94 e1 60 fd 59 b8 b0  45 15 36 3a 74 61 72 67   ...`.Y.. E.6:targ
0050  65 74 32 30 3a 49 b9 33  f4 ee 98 e2 29 bd 70 f2   et20:I.3 ....).p.
0060  a3 95 7b de d5 05 8d 38  01 65 31 3a 71 39 3a 66   ..{....8 .e1:q9:f
0070  69 6e 64 5f 6e 6f 64 65  31 3a 74 34 3a 84 8c 00   ind_node 1:t4:...
0080  00 31 3a 76 34 3a 55 54  57 b2 31 3a 79 31 3a 71   .1:v4:UT W.1:y1:q
0090  65                                                 e
</pre>
<p>which is actually a find_node DHT QUERY as described <a href="http://www.bittorrent.org/beps/bep_0005.html#find-node" target="_blank">here</a> . While this sort of explains the nature of the traffic , it doesn&#8217;t explain</p>
<p>a) Why was I apparently receiving this traffic when I was not supposed to in the first place .</p>
<p>b) If I was receiving the traffic, what was it and where was it stored in my machine.( remember we are talking about ~2GB of data.)</p>
<p>To start with b) I didn&#8217;t remember the last time I checked how much space i was using on my disk, but the current usage percentage didn&#8217;t seem alerting by itself. So , this is where <a href="http://linux.die.net/man/1/find" target="_blank">find(1)</a> came in handy</p>
<pre>~$ find . -type f -mmin -120 -printf '%p %s \n'</pre>
<p>didn&#8217;t reveal anything interesting although. There were a bunch of files modified in the past 2 hours , but none of them seemed suspicious or modified with no reason.</p>
<p>as to a)  I can only make wild guesses. One detail that might be interesting is that yesterday all the switches in the building were replaced so to support the 100/1o we are ow offered (hence the 8,4 MBps in the beginning) .It doesn&#8217;t look like an ARP attack , according to the capture. But what kind of misconfiguration would have these kind of results ? I can see a lot of packets addressed to other hosts. CAM table overflow at the switch ?But why I was seeing the traffic in the system monitor ? Shouldn&#8217;t those packets be dropped by my NIC ? It wasn&#8217;t in promiscuous mode before I ran wireshark .</p>
<p>So ? Comments, suggestions , answers to the questions ?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diveintoinfosec.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diveintoinfosec.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diveintoinfosec.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diveintoinfosec.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diveintoinfosec.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diveintoinfosec.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diveintoinfosec.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diveintoinfosec.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diveintoinfosec.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diveintoinfosec.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diveintoinfosec.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diveintoinfosec.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diveintoinfosec.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diveintoinfosec.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=80&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diveintoinfosec.wordpress.com/2010/12/01/network-forensics-afternoon/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c9c62646641af53f62a772eebe518f5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ilektrojohn</media:title>
		</media:content>
	</item>
		<item>
		<title>WE Protect not.</title>
		<link>http://diveintoinfosec.wordpress.com/2010/11/03/we-protect-not/</link>
		<comments>http://diveintoinfosec.wordpress.com/2010/11/03/we-protect-not/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 17:32:10 +0000</pubDate>
		<dc:creator>ilektrojohn</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[wireless]]></category>
		<category><![CDATA[WEP]]></category>

		<guid isPermaLink="false">http://diveintoinfosec.wordpress.com/?p=64</guid>
		<description><![CDATA[Yes, WEP is deprecated , proved to have some really nasty flaws , old story right ? Searching for &#8220;wep crack&#8221; in Google brings some 1 million results.A very nice explanation of why WEP is insecure can be found in this book . There is really no interest in discussing the matter anymore. The interesting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=64&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yes, WEP is deprecated , proved to have some really nasty <a href="http://en.wikipedia.org/wiki/Wired_Equivalent_Privacy#Flaws" target="_blank">flaws</a> , old story right ? Searching for &#8220;wep crack&#8221; in Google brings some 1 million results.A very nice explanation of why WEP is insecure can be found in <a href="http://www.amazon.com/Real-802-11-Security-Protected-802-11i/dp/0321136209">this book</a> . There is really no interest in discussing the matter anymore.</p>
<p>The interesting part of the story is how many people are still using WEP despite all that. Reasons vary from users ignorance to vendors&#8217; continuing support of WEP in home routers/AP products e.t.c . Moving around the last 2 years I was always surprised by how many WEP &#8211; &#8220;protected&#8221; wireless LANs one can find  in every city/neighborhood. The days when cracking into those was a challenging process are long behind , what I find interesting is having an overview of the amount of WEP usage in any given circumstance. Hence I came up with the following python script that takes advantage of the iwlist utility from the wireless-tools package and provides an overview of the usage of WPA/WPA2 and WEP in the wireless LANs that are detected.</p>
<p>It needs the <a href="http://pyparsing.wikispaces.com/">pyparsing</a> module (python-parsing package in debian/ubuntu)</p>
<p><pre class="brush: python; wrap-lines: false;">
#!/usr/bin/env python

import subprocess
from pyparsing import Literal, SkipTo, OneOrMore

def wepPercentage(output):
    last_line_a = Literal('Group')+SkipTo(Literal('\n').suppress())
    last_line_b = Literal('Authentication')+SkipTo(Literal('\n').suppress())
    start = Literal('Cell')+SkipTo(Literal('\n').suppress())
    end =OneOrMore(Literal('IE: ')+SkipTo(Literal('\n').suppress()))+~last_line_a|(last_line_b+~Literal('IE:'))
    line = ~end + SkipTo(Literal('\n').suppress())
    expr = start+OneOrMore(line)+end
    wpa_count = 0
    wep_count = 0
    unenc_count = 0
    for l in expr.searchString(output).asList():
        li = ''.join(l)
        if 'Encryption key:on' in l:
            if 'WPA' in li:
                wpa_count += 1
            else:
                wep_count += 1
        else:
            unenc_count += 1
    tot = wpa_count+wep_count+unenc_count
    print &quot;WPA / WPA2 :%d   Percentage : %d %% &quot; % (wpa_count, (wpa_count*100/tot))
    print &quot;WEP :%d   Percentage : %d %% &quot; % (wep_count, (wep_count*100/tot))
    print &quot;Unencrypted :%d   Percentage : %d %% &quot; % (unenc_count, (unenc_count*100/tot))
if __name__ == '__main__':
    process = subprocess.Popen('iwlist wlan0 scan', shell=True, stdout=subprocess.PIPE)
    output = process.communicate()[0]
    wepPercentage(output)

</pre></p>
<p>I live in a rather densely populated student dorm in Stockholm and at the time my output is something like :</p>
<p>WPA / WPA2 :28   Percentage : 82 %<br />
WEP :6   Percentage : 17 %<br />
Unencrypted :0   Percentage : 0 %</p>
<p>almost 20% of all people here that use some kind of wireless router , chose WEP . Great <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>How about your neighborhood ? Feel free to share percentages .</p>
<p>ps. It would probably be easier to use python&#8217;s re module instead of pyparsing . But I needed to use pyparsing for a project so I thought i d get my hands dirty with it anyhow.</p>
<p>ps2. It can probably be done in 5-6 lines in a bash shell using awk too .</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diveintoinfosec.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diveintoinfosec.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diveintoinfosec.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diveintoinfosec.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diveintoinfosec.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diveintoinfosec.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diveintoinfosec.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diveintoinfosec.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diveintoinfosec.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diveintoinfosec.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diveintoinfosec.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diveintoinfosec.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diveintoinfosec.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diveintoinfosec.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=64&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diveintoinfosec.wordpress.com/2010/11/03/we-protect-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>59.376103 17.910908</georss:point>
		<geo:lat>59.376103</geo:lat>
		<geo:long>17.910908</geo:long>
		<media:content url="http://0.gravatar.com/avatar/c9c62646641af53f62a772eebe518f5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ilektrojohn</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8220;Hello World&#8221; or &#8220;Oh mum, what a complex World&#8221;</title>
		<link>http://diveintoinfosec.wordpress.com/2010/03/01/hello-world-or-oh-mum-what-a-complex-world/</link>
		<comments>http://diveintoinfosec.wordpress.com/2010/03/01/hello-world-or-oh-mum-what-a-complex-world/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 15:44:47 +0000</pubDate>
		<dc:creator>ilektrojohn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://diveintoinfosec.wordpress.com/?p=37</guid>
		<description><![CDATA[Hello World is a typical example of a small program used as an introductory tutorial for all programming languages. It has also evolved to act as an introductory act for blogs as well . WordPress creates a &#8220;Hello World&#8221; post automatically when creating a blog. Anyway you got the point. Given that one would imagine [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=37&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello World is a typical example of a small program used as an introductory tutorial for all programming languages. It has also evolved to act as an introductory act for blogs as well . WordPress creates a &#8220;Hello World&#8221; post automatically when creating a blog. Anyway you got the point. Given that one would imagine that a Hello World in any given language is a fairly simple piece of code. And it usually is. But simple to write doesn&#8217;t necessarily mean not complex.</p>
<p>McGraw[1] defines software complexity as one of the three factors in the trinity of trouble for software security. The other two are connectivity and extensibility.</p>
<p>So we have a simple HelloWorld code snippet in Java :</p>
<pre>public class Hello {
/**
* @param args
*/
public static void main (String[] args)  {
// TODO Auto-generated method stub
System.out.println("Hello World!");
}
}</pre>
<p>Fairly simple right ? Can you imagine how many system and library calls this program makes while executing ?</p>
<p>System Calls :</p>
<pre>
<div id="_mcePaste">ilektrojohn@securebook:~$ strace -c -f -q java Hello</div>
<div id="_mcePaste">Hello World!</div>
<div id="_mcePaste">upeek: ptrace(PTRACE_PEEKUSER,19107,120,0): No such process</div>
<div id="_mcePaste">% time     seconds  usecs/call     calls    errors syscall</div>
<div id="_mcePaste">------ ----------- ----------- --------- --------- ----------------</div>
<div id="_mcePaste">100.00    0.044222         533        83         3 futex</div>
<div id="_mcePaste">  0.00    0.000000           0       632           read</div>
<div id="_mcePaste">  0.00    0.000000           0         2           write</div>
<div id="_mcePaste">  0.00    0.000000           0       109        61 open</div>
<div id="_mcePaste">  0.00    0.000000           0        49           close</div>
<div id="_mcePaste">  0.00    0.000000           0        58        28 stat</div>
<div id="_mcePaste">  0.00    0.000000           0        44           fstat</div>
<div id="_mcePaste">  0.00    0.000000           0        50         1 lstat</div>
<div id="_mcePaste">  0.00    0.000000           0       598           lseek</div>
<div id="_mcePaste">  0.00    0.000000           0       125           mmap</div>
<div id="_mcePaste">  0.00    0.000000           0        51           mprotect</div>
<div id="_mcePaste">  0.00    0.000000           0        20           munmap</div>
<div id="_mcePaste">  0.00    0.000000           0        10           brk</div>
<div id="_mcePaste">  0.00    0.000000           0        27           rt_sigaction</div>
<div id="_mcePaste">  0.00    0.000000           0        42           rt_sigprocmask</div>
<div id="_mcePaste">  0.00    0.000000           0        18        16 access</div>
<div id="_mcePaste">  0.00    0.000000           0         2           sched_yield</div>
<div id="_mcePaste">  0.00    0.000000           0         2           socket</div>
<div id="_mcePaste">  0.00    0.000000           0         2         2 connect</div>
<div id="_mcePaste">  0.00    0.000000           0        11           clone</div>
<div id="_mcePaste">  0.00    0.000000           0         2           execve</div>
<div id="_mcePaste">  0.00    0.000000           0         1           uname</div>
<div id="_mcePaste">  0.00    0.000000           0         4           fcntl</div>
<div id="_mcePaste">  0.00    0.000000           0         1           ftruncate</div>
<div id="_mcePaste">  0.00    0.000000           0         6           getdents</div>
<div id="_mcePaste">  0.00    0.000000           0         1           getcwd</div>
<div id="_mcePaste">  0.00    0.000000           0         1         1 mkdir</div>
<div id="_mcePaste">  0.00    0.000000           0         1           unlink</div>
<div id="_mcePaste">  0.00    0.000000           0         4           readlink</div>
<div id="_mcePaste">  0.00    0.000000           0         4           getrlimit</div>
<div id="_mcePaste">  0.00    0.000000           0         3           getuid</div>
<div id="_mcePaste">  0.00    0.000000           0         2           getgid</div>
<div id="_mcePaste">  0.00    0.000000           0         3           geteuid</div>
<div id="_mcePaste">  0.00    0.000000           0         2           getegid</div>
<div id="_mcePaste">  0.00    0.000000           0         2           arch_prctl</div>
<div id="_mcePaste">  0.00    0.000000           0         1           setrlimit</div>
<div id="_mcePaste">  0.00    0.000000           0        12           gettid</div>
<div id="_mcePaste">  0.00    0.000000           0        24           sched_getaffinity</div>
<div id="_mcePaste">  0.00    0.000000           0         2           set_tid_address</div>
<div id="_mcePaste">  0.00    0.000000           0         1           clock_getres</div>
<div id="_mcePaste">  0.00    0.000000           0        13           set_robust_list</div>
<div id="_mcePaste">------ ----------- ----------- --------- --------- ----------------</div>
<div id="_mcePaste">100.00    0.044222                  2025       112 total</div>
</pre>
<p>Library Calls</p>
<pre>ilektrojohn@securebook:~$ ltrace -c -f java Hello

Hello World!

% time     seconds  usecs/call     calls      function

------ ----------- ----------- --------- --------------------

 91.11    0.126965      126965         1 pthread_join

  1.68    0.002335          53        44 fgets

  1.50    0.002085        2085         1 dlopen

  0.73    0.001015          59        17 JLI_MemAlloc

  0.52    0.000727          45        16 JLI_StringDup

  0.37    0.000522          43        12 strcspn

  0.37    0.000515          42        12 strspn

  0.37    0.000511          28        18 strlen

  0.36    0.000498          33        15 JLI_MemFree

  0.30    0.000422          38        11 getenv

  0.27    0.000372          46         8 sprintf

  0.25    0.000343          42         8 strrchr

  0.21    0.000295          36         8 strcat

  0.19    0.000260         130         2 fclose

  0.17    0.000233         116         2 fopen

  0.16    0.000224         112         2 readlink

  0.14    0.000196          98         2 getuid

  0.14    0.000191          95         2 access

  0.13    0.000182          91         2 __xstat

  0.12    0.000161          80         2 getgid

  0.11    0.000154          77         2 geteuid

  0.11    0.000152          76         2 getegid

  0.10    0.000136          27         5 strchr

  0.08    0.000116         116         1 pthread_create

  0.08    0.000115          57         2 memset

  0.07    0.000103          51         2 strcpy

  0.07    0.000102          51         2 strncpy

  0.07    0.000095          47         2 JLI_FreeManifest

  0.06    0.000086          43         2 fflush

  0.04    0.000059          59         1 putenv

  0.04    0.000057          57         1 pthread_attr_destroy

  0.02    0.000034          17         2 dlsym

  0.01    0.000018          18         1 pthread_attr_init

  0.01    0.000016          16         1 JLI_WildcardExpandClasspath

  0.01    0.000016          16         1 strncmp

  0.01    0.000014          14         1 pthread_attr_setstacksize

  0.01    0.000014          14         1 getpid

  0.01    0.000013          13         1 pthread_attr_setdetachstate

------ ----------- ----------- --------- --------------------

100.00    0.139352                   215 total</pre>
<p>You can get the drill, complexity is a beast. Ah, and I almost forgot : Hello world <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>[1] Gary McGraw (2006). <em>Software Security, Building Security In</em>. Crawfordsville, Indiana: Addison-Wesley Professional. p7-10.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/diveintoinfosec.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/diveintoinfosec.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/diveintoinfosec.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/diveintoinfosec.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/diveintoinfosec.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/diveintoinfosec.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/diveintoinfosec.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/diveintoinfosec.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/diveintoinfosec.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/diveintoinfosec.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/diveintoinfosec.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/diveintoinfosec.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/diveintoinfosec.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/diveintoinfosec.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=diveintoinfosec.wordpress.com&amp;blog=12105819&amp;post=37&amp;subd=diveintoinfosec&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://diveintoinfosec.wordpress.com/2010/03/01/hello-world-or-oh-mum-what-a-complex-world/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<georss:point>59.376103 17.910908</georss:point>
		<geo:lat>59.376103</geo:lat>
		<geo:long>17.910908</geo:long>
		<media:content url="http://0.gravatar.com/avatar/c9c62646641af53f62a772eebe518f5e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ilektrojohn</media:title>
		</media:content>
	</item>
	</channel>
</rss>
