<?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>Didier Stevens &#187; Quickpost</title>
	<atom:link href="http://blog.didierstevens.com/category/quickpost/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.didierstevens.com</link>
	<description>(blog 'DidierStevens)</description>
	<lastBuildDate>Tue, 09 Mar 2010 00:00:15 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='blog.didierstevens.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/60bb50c97cd147341ffb43b0e2ef0d15?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Didier Stevens &#187; Quickpost</title>
		<link>http://blog.didierstevens.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.didierstevens.com/osd.xml" title="Didier Stevens" />
	<atom:link rel='hub' href='http://blog.didierstevens.com/?pushpress=hub'/>
		<item>
		<title>Quickpost: NetworkMashup.xls</title>
		<link>http://blog.didierstevens.com/2010/03/01/quickpost-networkmashup-xls/</link>
		<comments>http://blog.didierstevens.com/2010/03/01/quickpost-networkmashup-xls/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 06:11:11 +0000</pubDate>
		<dc:creator>Didier Stevens</dc:creator>
				<category><![CDATA[My Software]]></category>
		<category><![CDATA[Quickpost]]></category>

		<guid isPermaLink="false">http://blog.didierstevens.com/?p=2029</guid>
		<description><![CDATA[NetworkMashup.xls is a spreadsheet with VBA macros I scraped from the Internet to execute pings and name/address resolution from within Excel with WIN32 API calls.
Not only is it handy when you need to do some network mapping in a restricted environment, but also if you&#8217;ve just a list of machines to monitor.
The spreadsheet contains several [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=2029&subd=didierstevens&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>NetworkMashup.xls is a spreadsheet with VBA macros I scraped from the Internet to execute pings and name/address resolution from within Excel with WIN32 API calls.</p>
<p>Not only is it handy when you need to do some network mapping in a restricted environment, but also if you&#8217;ve just a list of machines to monitor.</p>
<p>The spreadsheet contains several sheets. One sheet to perform a single ping:</p>
<p><img class="alignnone size-full wp-image-2030" title="20100228-144238" src="http://didierstevens.files.wordpress.com/2010/02/20100228-144238.png?w=601&#038;h=338" alt="" width="601" height="338" /></p>
<p>One sheet to ping/resolve a list:</p>
<p><img class="alignnone size-full wp-image-2031" title="20100228-144254" src="http://didierstevens.files.wordpress.com/2010/02/20100228-144254.png?w=601&#038;h=338" alt="" width="601" height="338" /></p>
<p>One sheet to list the IP addresses of the current machine:</p>
<p><img class="alignnone size-full wp-image-2033" title="20100228-144315" src="http://didierstevens.files.wordpress.com/2010/02/20100228-144315.png?w=601&#038;h=338" alt="" width="601" height="338" /></p>
<p>And last, a sheet with settings:</p>
<p><img class="alignnone size-full wp-image-2032" title="20100228-144332" src="http://didierstevens.files.wordpress.com/2010/02/20100228-144332.png?w=601&#038;h=338" alt="" width="601" height="338" /></p>
<p>Download <a href="http://didierstevens.com/files/software/NetworkMashup_V0_0_2.zip">here</a>.</p>
<hr /><a href="http://blog.didierstevens.com/2007/11/01/announcing-quickposts/">Quickpost info</a></p>
<hr />
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/didierstevens.wordpress.com/2029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/didierstevens.wordpress.com/2029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/didierstevens.wordpress.com/2029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/didierstevens.wordpress.com/2029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/didierstevens.wordpress.com/2029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/didierstevens.wordpress.com/2029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/didierstevens.wordpress.com/2029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/didierstevens.wordpress.com/2029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/didierstevens.wordpress.com/2029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/didierstevens.wordpress.com/2029/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=2029&subd=didierstevens&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.didierstevens.com/2010/03/01/quickpost-networkmashup-xls/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">didierstevens</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2010/02/20100228-144238.png" medium="image">
			<media:title type="html">20100228-144238</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2010/02/20100228-144254.png" medium="image">
			<media:title type="html">20100228-144254</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2010/02/20100228-144315.png" medium="image">
			<media:title type="html">20100228-144315</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2010/02/20100228-144332.png" medium="image">
			<media:title type="html">20100228-144332</media:title>
		</media:content>
	</item>
		<item>
		<title>Quickpost: Quasi-Tautologies &amp; SQL-Injection</title>
		<link>http://blog.didierstevens.com/2010/02/02/quickpost-quasi-tautologies-sql-injection/</link>
		<comments>http://blog.didierstevens.com/2010/02/02/quickpost-quasi-tautologies-sql-injection/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 09:54:27 +0000</pubDate>
		<dc:creator>Didier Stevens</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Quickpost]]></category>

		<guid isPermaLink="false">http://blog.didierstevens.com/?p=1966</guid>
		<description><![CDATA[Last OWASP/ISSA Belgian chapter meeting was the location of an interesting discussion. For a full report of the meeting, read Xavier&#8217;s excellent blogpost.
Many SQL-injection techniques rely on tautologies: adding an expression that is always true to the where-clause of a select statement. Like OR 1=1. 1=1 is a tautology, it&#8217;s an expression that always yields [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1966&subd=didierstevens&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Last <a href="http://www.owasp.org/index.php/Belgium#tab=Chapter_Meetings">OWASP/ISSA Belgian chapter meeting</a> was the location of an interesting discussion. For a full report of the meeting, read <a href="http://blog.rootshell.be/2010/02/01/owasp-issa-belgium-chapter-meeting/">Xavier&#8217;s excellent blogpost</a>.</p>
<p>Many <a href="http://en.wikipedia.org/wiki/SQL_injection">SQL-injection techniques</a> rely on <a href="http://en.wikipedia.org/wiki/Tautology_%28logic%29">tautologies</a>: adding an expression that is always true to the where-clause of a select statement. Like <strong>OR 1=1</strong>. <strong>1=1</strong> is a tautology, it&#8217;s an expression that always yields true.</p>
<p>So if <strong>SELECT * FROM USERS WHERE USERNAME = &#8216;ADMIN&#8217; and PASSWORD = &#8216;UNKNOWN&#8217;</strong> doesn&#8217;t select any rows because the password is not correct, injecting <strong>&#8216; OR 1=1 &#8211;</strong> gives SQL statement <strong>SELECT * FROM USERS WHERE USERNAME = &#8216;ADMIN&#8217; and PASSWORD = &#8221; OR 1=1 &#8211;&#8217;</strong> which will return all rows, because the where-clause is always true (<strong>OR 1=1</strong>).</p>
<p>There are several security applications (WAFs, SQL firewalls, &#8230;) designed to monitor the stream of SQL statements and reject statements with tautologies, i.e. the result of a SQL-injection. Some are very simple and just try to match pattern 1=1. Bypassing them is easy: 1&gt;0 is also a tautology. Others are more sophisticated and try to find constant expressions in the where-clause. Constant expressions are expressions with operators, functions and constants, but without variables. If a constant expression is detected that always evaluates to true, the firewall assumes it&#8217;s the result of a SQL-injection and blocks the query.</p>
<p>This is all classic SQL-injection, but now comes the interesting part.</p>
<p>What if I use an expression that is not a tautology in it&#8217;s mathematical sense, but is almost one&#8230; Say I use expression <strong>RAND() &gt; 0.01</strong> ? The <a href="http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand">RAND</a> function is a random number generator and returns a floating point value in the range [0.0, 1.0[. Expression <strong>RAND() &gt; 0.01</strong> is not a tautology, it&#8217;s not always true, but it is true about 99% percent of the time. I call this a quasi-tautology.</p>
<p>A firewall looking for tautologies will not detect this, because it is not a tautology. But when you use it in a SQL-injection, you stand a 99% chance of being succesful (provided the application is vulnerable to SQL-injection)!</p>
<p>There are other functions than RAND to create quasi-tautologies. An expression comparing the seconds of the current system time with 59 is also a quasi-tautology.</p>
<p>The <a href="http://www.greensql.net/">GreenSQL firewall</a> will detect SQL statements with quasi-tautologies, not because it looks for them, but because it builds a whitelist in training mode.</p>
<hr /><a href="http://blog.didierstevens.com/2007/11/01/announcing-quickposts/">Quickpost info</a></p>
<hr />
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/didierstevens.wordpress.com/1966/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/didierstevens.wordpress.com/1966/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/didierstevens.wordpress.com/1966/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/didierstevens.wordpress.com/1966/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/didierstevens.wordpress.com/1966/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/didierstevens.wordpress.com/1966/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/didierstevens.wordpress.com/1966/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/didierstevens.wordpress.com/1966/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/didierstevens.wordpress.com/1966/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/didierstevens.wordpress.com/1966/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1966&subd=didierstevens&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.didierstevens.com/2010/02/02/quickpost-quasi-tautologies-sql-injection/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">didierstevens</media:title>
		</media:content>
	</item>
		<item>
		<title>Quickpost: Shellcode to Load a DLL From Memory</title>
		<link>http://blog.didierstevens.com/2010/01/28/quickpost-shellcode-to-load-a-dll-from-memory/</link>
		<comments>http://blog.didierstevens.com/2010/01/28/quickpost-shellcode-to-load-a-dll-from-memory/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 03:08:14 +0000</pubDate>
		<dc:creator>Didier Stevens</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[My Software]]></category>
		<category><![CDATA[Quickpost]]></category>

		<guid isPermaLink="false">http://blog.didierstevens.com/?p=1959</guid>
		<description><![CDATA[I finally took time to develop shellcode to load a DLL, not with LoadLibrary, but directly from memory. Not storing the DLL on disk prevents it from being detected by AV software; not using LoadLibrary bypasses HIPS software that monitors this system call.
My shellcode is based on Joachim&#8217;s code.
In previous posts, I showed how to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1959&subd=didierstevens&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I finally took time to develop shellcode to load a DLL, not with LoadLibrary, but directly from memory. Not storing the DLL on disk prevents it from being detected by AV software; not using LoadLibrary bypasses HIPS software that monitors this system call.</p>
<p>My shellcode is based on <a href="http://www.joachim-bauch.de/tutorials/load_dll_memory.html">Joachim&#8217;s code</a>.</p>
<p>In previous posts, I showed how to <a href="http://blog.didierstevens.com/2008/06/05/bpmtk-how-about-srp-whitelists/">load a DLL</a> <a href="http://blog.didierstevens.com/2008/10/23/excel-exercises-in-style/">or shellcode</a> with VBA in Excel. This is a combination of both techniques: a VBA macro loads and executes shellcode in Excel&#8217;s process space, and the shellcode loads a DLL from memory into Excel&#8217;s process memory.</p>
<p>With the <a href="http://blog.didierstevens.com/2008/06/25/bpmtk-bypassing-srp-with-dll-restrictions/">code of the previous post</a>, the DLL appears in the list of loaded DLLs:</p>
<p><img class="alignnone size-full wp-image-1960" title="20100127-193739" src="http://didierstevens.files.wordpress.com/2010/01/20100127-193739.png?w=616&#038;h=419" alt="" width="616" height="419" /></p>
<p>With this shellcode, it doesn&#8217;t:</p>
<p><img class="alignnone size-full wp-image-1961" title="20100127-192408" src="http://didierstevens.files.wordpress.com/2010/01/20100127-192408.png?w=616&#038;h=419" alt="" width="616" height="419" /></p>
<hr /><a href="http://blog.didierstevens.com/2007/11/01/announcing-quickposts/">Quickpost info</a></p>
<hr />
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/didierstevens.wordpress.com/1959/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/didierstevens.wordpress.com/1959/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/didierstevens.wordpress.com/1959/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/didierstevens.wordpress.com/1959/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/didierstevens.wordpress.com/1959/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/didierstevens.wordpress.com/1959/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/didierstevens.wordpress.com/1959/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/didierstevens.wordpress.com/1959/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/didierstevens.wordpress.com/1959/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/didierstevens.wordpress.com/1959/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1959&subd=didierstevens&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.didierstevens.com/2010/01/28/quickpost-shellcode-to-load-a-dll-from-memory/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">didierstevens</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2010/01/20100127-193739.png" medium="image">
			<media:title type="html">20100127-193739</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2010/01/20100127-192408.png" medium="image">
			<media:title type="html">20100127-192408</media:title>
		</media:content>
	</item>
		<item>
		<title>Quickpost: PDF Header %!PS-Adobe-N.n PDF-M.m</title>
		<link>http://blog.didierstevens.com/2010/01/21/quickpost-pdf-header-ps-adobe-n-n-pdf-m-m/</link>
		<comments>http://blog.didierstevens.com/2010/01/21/quickpost-pdf-header-ps-adobe-n-n-pdf-m-m/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 11:21:03 +0000</pubDate>
		<dc:creator>Didier Stevens</dc:creator>
				<category><![CDATA[My Software]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Quickpost]]></category>

		<guid isPermaLink="false">http://blog.didierstevens.com/?p=1953</guid>
		<description><![CDATA[@Feliam has an interesting PDF library to create PDF files with an unconventional header (the generated document doesn&#8217;t start with %PDF-&#8230;, but %PDF appears somewhere in the first 1024 bytes of the document). As this trick is likely to be taken over by malware authors, I updated PDFiD to support this.
The PDF reference document also [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1953&subd=didierstevens&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/feliam" target="_self">@Feliam</a> has an interesting <a href="http://feliam.wordpress.com/">PDF library</a> to create PDF files with an unconventional header (the generated document doesn&#8217;t start with %PDF-&#8230;, but %PDF appears somewhere in the first 1024 bytes of the document). As this trick is likely to be taken over by malware authors, I updated <a href="http://blog.didierstevens.com/2010/01/13/quickpost-new-versions-of-pdfid-and-pdf-parser/" target="_self">PDFiD</a> to support this.</p>
<p>The PDF reference document also mentions %!PS-Adobe-N.n PDF-M.m as a valid header, however, the PDF documents I and @Feliam generated with this header are not rendered by Adobe Reader (neither Foxit or Sumatra PDF).</p>
<p>I was told Adobe did support this header in older versions. My tests show Adobe Reader version 3, 4, 5 and 6 will render PDF documents with header %!PS-Adobe-N.n PDF-M.m. Versions 7, 8 and 9 will not. Therefor I decided not to include support for this header to PDFiD.</p>
<p>pdf-parser doesn&#8217;t test the header, it analyzes PDF documents regardless of the header.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/didierstevens.wordpress.com/1953/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/didierstevens.wordpress.com/1953/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/didierstevens.wordpress.com/1953/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/didierstevens.wordpress.com/1953/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/didierstevens.wordpress.com/1953/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/didierstevens.wordpress.com/1953/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/didierstevens.wordpress.com/1953/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/didierstevens.wordpress.com/1953/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/didierstevens.wordpress.com/1953/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/didierstevens.wordpress.com/1953/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1953&subd=didierstevens&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.didierstevens.com/2010/01/21/quickpost-pdf-header-ps-adobe-n-n-pdf-m-m/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">didierstevens</media:title>
		</media:content>
	</item>
		<item>
		<title>Quickpost: New Versions of PDFiD and pdf-parser</title>
		<link>http://blog.didierstevens.com/2010/01/13/quickpost-new-versions-of-pdfid-and-pdf-parser/</link>
		<comments>http://blog.didierstevens.com/2010/01/13/quickpost-new-versions-of-pdfid-and-pdf-parser/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 21:54:00 +0000</pubDate>
		<dc:creator>Didier Stevens</dc:creator>
				<category><![CDATA[My Software]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Quickpost]]></category>

		<guid isPermaLink="false">http://blog.didierstevens.com/?p=1940</guid>
		<description><![CDATA[A new version of PDFiD (V0.0.10): to deal with PDF samples trying to evade detection by preceding the header with some random bytes, I use less stringent conditions to identify a PDF file. If PDFiD finds keyword %PDF in the first 1024 bytes of a file, it assumes it&#8217;s a PDF file and starts analyzing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1940&subd=didierstevens&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>A new version of PDFiD (V0.0.10): to deal with PDF samples trying to evade detection by preceding the header with some random bytes, I use less stringent conditions to identify a PDF file. If PDFiD finds keyword %PDF in the first 1024 bytes of a file, it assumes it&#8217;s a PDF file and starts analyzing it.</p>
<p>A new version of pdf-parser (v0.3.7):</p>
<ul>
<li>added support for filters /LZWDecode and /RunLengthDecode</li>
<li>added a &#8211;dump option to extract the unfiltered data of a stream object (useful when the data is not actually compressed, but a payload)</li>
<li>testing the Python version before execution</li>
</ul>
<p>Both can be downloaded on the <a href="http://blog.didierstevens.com/programs/pdf-tools/" target="_self">PDF Tools</a> page.</p>
<hr /><a href="http://blog.didierstevens.com/2007/11/01/announcing-quickposts/">Quickpost info</a></p>
<hr />
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/didierstevens.wordpress.com/1940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/didierstevens.wordpress.com/1940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/didierstevens.wordpress.com/1940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/didierstevens.wordpress.com/1940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/didierstevens.wordpress.com/1940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/didierstevens.wordpress.com/1940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/didierstevens.wordpress.com/1940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/didierstevens.wordpress.com/1940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/didierstevens.wordpress.com/1940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/didierstevens.wordpress.com/1940/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1940&subd=didierstevens&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.didierstevens.com/2010/01/13/quickpost-new-versions-of-pdfid-and-pdf-parser/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">didierstevens</media:title>
		</media:content>
	</item>
		<item>
		<title>Quickpost: Read-Only USB Stick</title>
		<link>http://blog.didierstevens.com/2009/12/20/quickpost-read-only-usb-stick/</link>
		<comments>http://blog.didierstevens.com/2009/12/20/quickpost-read-only-usb-stick/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 20:52:33 +0000</pubDate>
		<dc:creator>Didier Stevens</dc:creator>
				<category><![CDATA[Forensics]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Quickpost]]></category>

		<guid isPermaLink="false">http://blog.didierstevens.com/?p=1878</guid>
		<description><![CDATA[When someone asks me for a read-only USB stick, I recommend to use an SD card with a SD-to-USB adapter, because these are easier to find than USB sticks with write-protection. Most SD cards have a write-protection tab.

But last time I got a surprise: when testing a new SD card reader, I was able to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1878&subd=didierstevens&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>When someone asks me for a read-only USB stick, I recommend to use an <a href="http://en.wikipedia.org/wiki/Secure_Digital" target="_blank">SD card</a> with a SD-to-USB adapter, because these are easier to find than USB sticks with write-protection. Most SD cards have a write-protection tab.</p>
<p><img class="alignnone size-full wp-image-1882" title="20091220-214410" src="http://didierstevens.files.wordpress.com/2009/12/20091220-214410.png?w=500&#038;h=679" alt="" width="500" height="679" /></p>
<p>But last time I got a surprise: when testing a new SD card reader, I was able to write to the write-protected SD card. Turns out that this particular SD card reader doesn&#8217;t support the write-protection tab and always allows the OS to write to the SD card.</p>
<hr /><a href="http://blog.didierstevens.com/2007/11/01/announcing-quickposts/">Quickpost info</a></p>
<hr />
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/didierstevens.wordpress.com/1878/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/didierstevens.wordpress.com/1878/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/didierstevens.wordpress.com/1878/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/didierstevens.wordpress.com/1878/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/didierstevens.wordpress.com/1878/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/didierstevens.wordpress.com/1878/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/didierstevens.wordpress.com/1878/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/didierstevens.wordpress.com/1878/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/didierstevens.wordpress.com/1878/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/didierstevens.wordpress.com/1878/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1878&subd=didierstevens&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.didierstevens.com/2009/12/20/quickpost-read-only-usb-stick/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">didierstevens</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2009/12/20091220-214410.png" medium="image">
			<media:title type="html">20091220-214410</media:title>
		</media:content>
	</item>
		<item>
		<title>Quickpost: New EICARgen Version</title>
		<link>http://blog.didierstevens.com/2009/12/04/quickpost/</link>
		<comments>http://blog.didierstevens.com/2009/12/04/quickpost/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 14:58:09 +0000</pubDate>
		<dc:creator>Didier Stevens</dc:creator>
				<category><![CDATA[My Software]]></category>
		<category><![CDATA[Quickpost]]></category>

		<guid isPermaLink="false">http://blog.didierstevens.com/?p=1869</guid>
		<description><![CDATA[I never expected to release a new version of EICARgen, but I&#8217;m forced to: EICARgen.exe generates just too many false positives.
The new version contains the EICAR string an XOR-encode string (key 0xFF). It has only a couple of detections. Kaspersky and VBA32 shouldn&#8217;t actually detect this. EICAR clearly specifies that the presence of the EICAR [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1869&subd=didierstevens&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I never expected to release a <a href="http://blog.didierstevens.com/programs/eicargen/" target="_self">new version of EICARgen</a>, but I&#8217;m forced to: EICARgen.exe generates just <a href="http://www.virustotal.com/analisis/e1ca8f976720443c520d825e9332be0324729bb74990e3b009a0d2cdbd19a20a-1257744630" target="_blank">too many false positives.</a></p>
<p>The new version contains the EICAR string an XOR-encode string (key 0xFF). It has only a <a href="http://www.virustotal.com/analisis/d00da89f78d16e639a2c7196a75a05a3d0e89b9e262b7d1c1356fa06e2d4ed93-1259611081" target="_blank">couple of detections</a>. Kaspersky and VBA32 shouldn&#8217;t actually detect this. EICAR clearly specifies that the presence of the EICAR test string inside a file (like an executable) shouldn&#8217;t be detected. As to why AVG needs to detect EICAR test file droppers, I have no idea&#8230;</p>
<hr /><a href="http://blog.didierstevens.com/2007/11/01/announcing-quickposts/">Quickpost info</a></p>
<hr />
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/didierstevens.wordpress.com/1869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/didierstevens.wordpress.com/1869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/didierstevens.wordpress.com/1869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/didierstevens.wordpress.com/1869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/didierstevens.wordpress.com/1869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/didierstevens.wordpress.com/1869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/didierstevens.wordpress.com/1869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/didierstevens.wordpress.com/1869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/didierstevens.wordpress.com/1869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/didierstevens.wordpress.com/1869/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1869&subd=didierstevens&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.didierstevens.com/2009/12/04/quickpost/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">didierstevens</media:title>
		</media:content>
	</item>
		<item>
		<title>Quickpost: &#8220;Hiding&#8221; a PDF Document</title>
		<link>http://blog.didierstevens.com/2009/11/09/quickpost-hiding-a-pdf-document/</link>
		<comments>http://blog.didierstevens.com/2009/11/09/quickpost-hiding-a-pdf-document/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 15:00:25 +0000</pubDate>
		<dc:creator>Didier Stevens</dc:creator>
				<category><![CDATA[Entertainment]]></category>
		<category><![CDATA[My Software]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Quickpost]]></category>

		<guid isPermaLink="false">http://blog.didierstevens.com/?p=1829</guid>
		<description><![CDATA[Here&#8217;s some Python code (it uses my mPDF module) to append a new PDF document to an existing PDF document to &#8220;hide&#8221; the original document. Recovering the original is trivial, you open the PDF document with a HEX-editor and delete the appended document (starting after the second %%EOF counting from the end of the file). [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1829&subd=didierstevens&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s some Python code (it uses <a href="http://blog.didierstevens.com/programs/pdf-tools#make-pdf" target="_self">my mPDF module</a>) to append a new PDF document to an existing PDF document to &#8220;hide&#8221; the original document. Recovering the original is trivial, you open the PDF document with a HEX-editor and delete the appended document (starting after the second %%EOF counting from the end of the file). This trick uses <a href="http://blog.didierstevens.com/2008/05/07/solving-a-little-pdf-puzzle/" target="_self">incremental updates</a>.</p>
<p><img class="alignnone size-full wp-image-1832" title="20091107-172245" src="http://didierstevens.files.wordpress.com/2009/11/20091107-172245.png?w=441&#038;h=541" alt="20091107-172245" width="441" height="541" /></p>
<pre class="brush: python;">
#!/usr/bin/python

__description__ = 'make-pdf-hide-original, use it to &quot;hide&quot; the original PDF document'
__author__ = 'Didier Stevens'
__version__ = '0.0.1'
__date__ = '2009/11/07'

&quot;&quot;&quot;
Source code put in public domain by Didier Stevens, no Copyright

https://DidierStevens.com

Use at your own risk

History:
 2009/11/07: start

Todo:

&quot;&quot;&quot;

import mPDF
import time
import zlib
import optparse

def Main():
    oParser = optparse.OptionParser(usage='usage: %prog [options] pdf-file\n' + __description__, version='%prog ' + __version__)
    oParser.add_option('-s', '--line', default='Hello World', help='The line of text to print on the screen (default Hello World')
    (options, args) = oParser.parse_args()

    if len(args) != 1:
        oParser.print_help()
        print ''
        print '  %s' % __description__
        print '  Source code put in the public domain by Didier Stevens, no Copyright'
        print '  Use at your own risk'
        print '  https://DidierStevens.com'

    else:
        pdffile = args[0]
        oPDF = mPDF.cPDF(pdffile)
        oPDF.template1()
        oPDF.stream(5, 0, 'BT /F1 24 Tf 100 700 Td (%s) Tj ET' % options.line)
        oPDF.xrefAndTrailer('1 0 R')

if __name__ == '__main__':
   Main()
</pre>
<hr /><a href="http://blog.didierstevens.com/2007/11/01/announcing-quickposts/">Quickpost info</a></p>
<p>&nbsp;</p>
<hr />
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/didierstevens.wordpress.com/1829/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/didierstevens.wordpress.com/1829/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/didierstevens.wordpress.com/1829/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/didierstevens.wordpress.com/1829/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/didierstevens.wordpress.com/1829/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/didierstevens.wordpress.com/1829/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/didierstevens.wordpress.com/1829/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/didierstevens.wordpress.com/1829/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/didierstevens.wordpress.com/1829/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/didierstevens.wordpress.com/1829/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1829&subd=didierstevens&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.didierstevens.com/2009/11/09/quickpost-hiding-a-pdf-document/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">didierstevens</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2009/11/20091107-172245.png" medium="image">
			<media:title type="html">20091107-172245</media:title>
		</media:content>
	</item>
		<item>
		<title>Quickpost: SAFER and Malicious Documents</title>
		<link>http://blog.didierstevens.com/2009/09/28/quickpot-safer-and-malicious-documents/</link>
		<comments>http://blog.didierstevens.com/2009/09/28/quickpot-safer-and-malicious-documents/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 17:50:58 +0000</pubDate>
		<dc:creator>Didier Stevens</dc:creator>
				<category><![CDATA[My Software]]></category>
		<category><![CDATA[Quickpost]]></category>

		<guid isPermaLink="false">http://blog.didierstevens.com/?p=1769</guid>
		<description><![CDATA[I wasn’t going to mention SAFER to restrict the rights of an application, because Software Restriction Policies can be bypassed. But a Tweet by Edi Strosar made me review my viewpoint. In this particular case, bypassing SRP is a non-issue, because the user is already local admin!
Software Restriction Policies allow you to force specific applications [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1769&subd=didierstevens&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><em>I wasn’t going to mention <a href="http://blogs.msdn.com/michael_howard/archive/2005/01/31/363985.aspx" target="_blank">SAFER</a> to <a href="http://blog.didierstevens.com/2009/09/27/preventing-malicious-documents-from-compromising-windows-machines/" target="_self">restrict the rights of an application</a>, because <a href="http://blog.didierstevens.com/2008/03/06/bpmtk-replacing-gpdisable/" target="_self">Software Restriction Policies can be bypassed</a>. But a <a href="http://twitter.com/EdiStrosar/status/4421644065" target="_blank">Tweet by Edi Strosar</a> made me review my viewpoint. In this particular case, bypassing SRP is a non-issue, because the user is already local admin!</em></p>
<p>Software Restriction Policies allow you to force specific applications to run with a restricted token. As Michael explained it with AD GPOs, I&#8217;ll show it with local policies.</p>
<p>Enable SAFER policies for SRPs by adding DWORD registry key Levels (value 0&#215;31000) to HKLM\SOFTWARE\Policies\Microsoft\Windows\Safer\CodeIdentifiers:</p>
<p><img class="alignnone size-full wp-image-1771" title="20090928-184852" src="http://didierstevens.files.wordpress.com/2009/09/20090928-184852.png?w=737&#038;h=410" alt="20090928-184852" width="737" height="410" /></p>
<p>Start the Local Security Policy administration tool and go to the Software Restriction Policies. You&#8217;ll have to create new policies if this is the first time you configure SRPs.</p>
<p><img class="alignnone size-full wp-image-1770" title="20090928-180154" src="http://didierstevens.files.wordpress.com/2009/09/20090928-180154.png?w=449&#038;h=341" alt="20090928-180154" width="449" height="341" /></p>
<p>Create a new rule in Additional Rules. We&#8217;ll identify the application to restrict by its path and name, so create a Path Rule:</p>
<p><img class="alignnone size-full wp-image-1772" title="20090928-185739" src="http://didierstevens.files.wordpress.com/2009/09/20090928-185739.png?w=334&#038;h=393" alt="20090928-185739" width="334" height="393" /></p>
<p>For the security level, select Basic User:</p>
<p><img class="alignnone size-full wp-image-1773" title="20090928-184938" src="http://didierstevens.files.wordpress.com/2009/09/20090928-184938.png?w=406&#038;h=455" alt="20090928-184938" width="406" height="455" /></p>
<p>If you have no Basic User option, you forgot to update the registry before launching the administration tool:</p>
<p><img class="alignnone size-full wp-image-1774" title="20090928-184657" src="http://didierstevens.files.wordpress.com/2009/09/20090928-184657.png?w=406&#038;h=455" alt="20090928-184657" width="406" height="455" /></p>
<p>Select the application to restrict:</p>
<p><img class="alignnone size-full wp-image-1775" title="20090928-185830" src="http://didierstevens.files.wordpress.com/2009/09/20090928-185830.png?w=406&#038;h=455" alt="20090928-185830" width="406" height="455" /></p>
<p>This rule will force Adobe Reader to run with a restricted token:</p>
<p><img class="alignnone size-full wp-image-1777" title="20090928-180534" src="http://didierstevens.files.wordpress.com/2009/09/20090928-180534.png?w=439&#038;h=515" alt="20090928-180534" width="439" height="515" /></p>
<p>Writing to SYSTEM32 is denied:</p>
<p><img class="alignnone size-full wp-image-1778" title="20090928-180742" src="http://didierstevens.files.wordpress.com/2009/09/20090928-180742.png?w=462&#038;h=164" alt="20090928-180742" width="462" height="164" /></p>
<hr /><a href="http://blog.didierstevens.com/2007/11/01/announcing-quickposts/">Quickpost info</a></p>
<hr />
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/didierstevens.wordpress.com/1769/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/didierstevens.wordpress.com/1769/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/didierstevens.wordpress.com/1769/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/didierstevens.wordpress.com/1769/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/didierstevens.wordpress.com/1769/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/didierstevens.wordpress.com/1769/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/didierstevens.wordpress.com/1769/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/didierstevens.wordpress.com/1769/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/didierstevens.wordpress.com/1769/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/didierstevens.wordpress.com/1769/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1769&subd=didierstevens&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.didierstevens.com/2009/09/28/quickpot-safer-and-malicious-documents/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">didierstevens</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2009/09/20090928-184852.png" medium="image">
			<media:title type="html">20090928-184852</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2009/09/20090928-180154.png" medium="image">
			<media:title type="html">20090928-180154</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2009/09/20090928-185739.png" medium="image">
			<media:title type="html">20090928-185739</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2009/09/20090928-184938.png" medium="image">
			<media:title type="html">20090928-184938</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2009/09/20090928-184657.png" medium="image">
			<media:title type="html">20090928-184657</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2009/09/20090928-185830.png" medium="image">
			<media:title type="html">20090928-185830</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2009/09/20090928-180534.png" medium="image">
			<media:title type="html">20090928-180534</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2009/09/20090928-180742.png" medium="image">
			<media:title type="html">20090928-180742</media:title>
		</media:content>
	</item>
		<item>
		<title>QuickPost: Arduino + Alcohol Gas Sensor + WiShield + LCD</title>
		<link>http://blog.didierstevens.com/2009/09/09/quickpost-arduino-alcohol-gas-sensor-wishield-lcd/</link>
		<comments>http://blog.didierstevens.com/2009/09/09/quickpost-arduino-alcohol-gas-sensor-wishield-lcd/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 20:07:21 +0000</pubDate>
		<dc:creator>Didier Stevens</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Quickpost]]></category>

		<guid isPermaLink="false">http://blog.didierstevens.com/?p=1751</guid>
		<description><![CDATA[This is a little project I&#8217;m working on for Brucon:

This is an Arduino with a WiFi adapter (WiShield), an LCD and a gas sensor (senses gases like ethanol).
What it does: the Arduino reads the sensor (uncalibrated for the moment), displays its value on line 1 of the LCD and also servers it on a web [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1751&subd=didierstevens&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>This is a little project I&#8217;m working on for <a href="http://brucon.org" target="_blank">Brucon</a>:</p>
<p><img class="alignnone size-full wp-image-1750" title="20090909-212457" src="http://didierstevens.files.wordpress.com/2009/09/20090909-212457.png?w=656&#038;h=452" alt="20090909-212457" width="656" height="452" /></p>
<p>This is an Arduino with a WiFi adapter (<a href="http://asynclabs.com/home" target="_blank">WiShield</a>), an <a href="http://en.wikipedia.org/wiki/Liquid_crystal_display" target="_blank">LCD</a> and a <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8880" target="_blank">gas sensor</a> (senses gases like <a href="http://en.wikipedia.org/wiki/Ethanol" target="_blank">ethanol</a>).</p>
<p>What it does: the Arduino reads the sensor (uncalibrated for the moment), displays its value on line 1 of the LCD and also servers it on a web page (with an embedded webserver connecting to the WiFi network via the WiShield).<br />
If the sensor read-out is 900 or more, a LED is turned on.<br />
And I can send a message via the webserver to line 2 of the LCD.</p>
<p>The problem I had to solve: the LCD didn&#8217;t work when the WiShield was operating.</p>
<p>The cause: the WiShield library and the <a href="http://www.arduino.cc/playground/Code/LCD4BitLibrary" target="_blank">LCD library</a> use some common pins.</p>
<p>Solution: change the pin assignment in the LCD library code (LCD4Bit.cpp):</p>
<pre class="brush: cpp;">
// --------- PINS -------------------------------------
//is the RW pin of the LCD under our control?  If we're only ever going to write to the LCD, we can use one less microcontroller pin, and just tie the LCD pin to the necessary signal, high or low.
//this stops us sending signals to the RW pin if it isn't being used.
int USING_RW = false;

//RS, RW and Enable can be set to whatever you like
int RS = 1;
int RW = 11;
int Enable = 0;
//DB should be an unseparated group of pins  - because of lazy coding in pushNibble()
int DB[] = {3, 4, 5, 6};  //wire these to DB4~7 on LCD.

//--------------------------------------------------------
</pre>
<p>And don&#8217;t forget to delete LCD4Bit.o before recompiling the code. The Arduino IDE doesn&#8217;t check dependencies of libraries when compiling.</p>
<p>And yes, once calibrated, you should be able to use this alcohol gas sensor to <a href="http://www.wired.com/epicenter/2008/10/googles-mail-go/" target="_blank">prevent drunk e-mailing</a> <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  But you&#8217;ll need to add a sensor to verify you&#8217;re actually blowing into the alcohol gas sensor. For example a gas pressure sensor.</p>
<hr /><a href="http://blog.didierstevens.com/2007/11/01/announcing-quickposts/">Quickpost info</a></p>
<hr />
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/didierstevens.wordpress.com/1751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/didierstevens.wordpress.com/1751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/didierstevens.wordpress.com/1751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/didierstevens.wordpress.com/1751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/didierstevens.wordpress.com/1751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/didierstevens.wordpress.com/1751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/didierstevens.wordpress.com/1751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/didierstevens.wordpress.com/1751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/didierstevens.wordpress.com/1751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/didierstevens.wordpress.com/1751/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.didierstevens.com&blog=264765&post=1751&subd=didierstevens&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.didierstevens.com/2009/09/09/quickpost-arduino-alcohol-gas-sensor-wishield-lcd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">didierstevens</media:title>
		</media:content>

		<media:content url="http://didierstevens.files.wordpress.com/2009/09/20090909-212457.png" medium="image">
			<media:title type="html">20090909-212457</media:title>
		</media:content>
	</item>
	</channel>
</rss>