<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace Site Server v5.11.81 (http://www.squarespace.com/) on Wed, 30 May 2012 21:14:36 GMT--><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><title>Executive Instruments Blog</title><subtitle>Blog</subtitle><id>http://executiveinstruments.com/blog/</id><link rel="alternate" type="application/xhtml+xml" href="http://executiveinstruments.com/blog/"/><link rel="self" type="application/atom+xml" href="http://executiveinstruments.com/blog/atom.xml"/><updated>2011-09-21T23:52:02Z</updated><generator uri="http://www.squarespace.com/" version="Squarespace Site Server v5.11.81 (http://www.squarespace.com/)">Squarespace</generator><entry><title>Creating the OpenSAMM Roadmap Document</title><id>http://executiveinstruments.com/blog/2011/9/21/creating-the-opensamm-roadmap-document.html</id><link rel="alternate" type="text/html" href="http://executiveinstruments.com/blog/2011/9/21/creating-the-opensamm-roadmap-document.html"/><author><name>Zack Payton</name></author><published>2011-09-21T20:27:43Z</published><updated>2011-09-21T20:27:43Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Lately, we've been doing some work with <a href="http://www.opensamm.org/">OpenSAMM</a>&nbsp;to help our clients improve security in their SDLC. &nbsp;This framework is very simple and supplies a method for creating a roadmap to drive your efforts to secure your software development projects. &nbsp;The formal charts used in the official OpenSAMM are apparently generated by Adobe Illustrator which I don't have. &nbsp;I'm a proponent of stimulating graphics, particularly in artifacts that will be dissemenated across diverse groups of skillsets. &nbsp;Since the roadmap document is something that will be used to communicate with executive management the intentions and timeframe to implement OpenSAMM, I wanted to make sure it was visually appealing. &nbsp;Rather than an Excel chart I wanted to get as close to the real thing as possible.</p>
<p>While searching the Internet I stumbled upon a 3 part blog series that detailed an effort to create a method that used XML and Scalable Vector Graphics (SVG) to create a nice-looking roadmap artifact very similar to the graphs shown in the <a href="http://www.opensamm.org/downloads/SAMM-1.0.pdf">official OpenSAMM document</a>. &nbsp;These blog entries go into informative detail about the story of how the author created the format but don't have a definitive set of steps in one easily accessible place.</p>
<p>This blog entry is intended to be summary version of the steps needed to quickly create a roadmap document. &nbsp;For those of you that are curious about the underlying technical details please see the aforementioned blog entries hyperlinked below:</p>
<ol>
<li><a href="http://www.opensamm.org/2010/09/roadmap-chart-generation-part-1-of-3/">Part 1</a></li>
<li><a href="http://www.opensamm.org/2010/09/roadmap-chart-generation-part-2-of-3/">Part 2</a></li>
<li><a href="http://www.opensamm.org/2010/09/roadmap-chart-generation-part-3-of-3/">Part 3</a></li>
</ol>
<p>For those that just want to cut to the chase follow the steps outlined below:</p>
<ol>
<li>First download the archive files <a href="http://www.opensamm.org/wp-content/uploads/2010/09/20100927-samm-roadmap-chart-generation-part-2.zip">here</a> and&nbsp;<a href="http://www.opensamm.org/wp-content/uploads/2010/09/20100928-samm-roadmap-chart-generation-part-3.zip">here</a>&nbsp;and extract the zip archives and place all files in the same directory</li>
<li>Using your favorite text editor (preferrably one with XML syntax highlighting), edit roadmap-ex1.xml to match the goals you have set for each security practice. &nbsp;The file format is very straight forward.</li>
<li>Use a tool like <a href="http://xalan.apache.org/">Apache Xalan</a>&nbsp;to create the SVG file. &nbsp;If you are using xalan the command syntax I used to generate the .svg output file was as follows:</li>
</ol>
<blockquote>
<p><em>xalan -o roadmap.svg roadmap-ex1.xml SAMM-1.0-roadmap-0.6-en_US.xsl &nbsp;</em></p>
</blockquote>
<p style="padding-left: 30px;"><strong>Note:</strong>&nbsp;xalan syntax may vary slightly between versions. &nbsp;See the documentation associated with your xalan installation if this syntax does not work for you.</p>
<p>You're done. &nbsp;Your roadmap.svg file can be opened in most browsers and you should have your roadmap document as roadmap.svg openable in most browsers. &nbsp;Please note that you will need to include the file SAMM-1.0-roadmap-0.4.css whenever distributing the .svg file so that it will properly render in a browser.</p>
<p>I would like to thank Pravir Chandra for creating OpenSAMM, Colin Watson and Brenda Larcom for their great work on the XML, XSLT, and SVG files, and lastly the <a href="https://www.owasp.org/index.php/Main_Page">OWASP</a>&nbsp;community at large for doing an outstanding job of making it easier to secure web applications.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content></entry><entry><title>Locating Dangerous Functions with IDA Pro</title><id>http://executiveinstruments.com/blog/2011/3/25/locating-dangerous-functions-with-ida-pro.html</id><link rel="alternate" type="text/html" href="http://executiveinstruments.com/blog/2011/3/25/locating-dangerous-functions-with-ida-pro.html"/><author><name>Zack Payton</name></author><published>2011-03-25T22:32:03Z</published><updated>2011-03-25T22:32:03Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>During a black box COTS application assessment, we wanted to identify dangerous functions that could possibly be abused to gain code execution.  <a href="http://www.dwheeler.com/flawfinder/">Flawfinder</a>, an elementary source code focused tool designed for exactly this purpose was a good starting point.  Embedded in the source code are a good list of functions that are considered dangerous.</p>
<p>Four problems with flawfinder:</p>
<ol>
<li>It only works on the source code.  No COTS products for me.</li>
<li>Signatures are embedded in the code. Not easily reusable.</li>
<li>Not supported (last update 2007).  I've submitted a patch to Dan Wheeler (the flawfinder author) before and never heard back.</li>
<li>Not exhaustive.  I think Michael Howard did a great job changing the Microsoft SDL to prohibit certain functions from being used for software development. &nbsp;Flawfinder doesn't include many of these functions.</li>
</ol>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I decided to attempt a little experiment and port some of the flawfinder functionality to IDA Pro.  In the end, I moved the flawfinder database to raw XML and added the functions that Michael Howard <a href="http://msdn.microsoft.com/en-us/library/bb288454.aspx">banned</a> from the Microsoft SDL.  My XML file describing dangerous functions is available <a href="http://executiveinstruments.squarespace.com/storage/files/dangerous_functions.xml">here</a>.</p>
<blockquote>
<p>SHA256: 6695bb84bd1e9536c930b3599426cca04bfc02b31d66d9a61ca00ac7f0e1a686</p>
<p>MD5: c6b712a94962dd583974fa34ba19e23f</p>
</blockquote>
<p>&nbsp;</p>
<p>Please let me know if you would like to submit any additional functions and I will add them to the file.  In the future I will probably modify flawfinder to use this xml database as well.</p>
<p>I also created a little python script using IDA python that iterates over function names and finds any references to known dangerous functions.  We are using these references as input for <a href="http://code.google.com/p/mynav/">mynav</a> in order to calculate execution pathes that may lead to exploitable situations which in turn helps us to tune our fuzzers.  My dangerous_functions.py script for achieving this is available <a href="http://executiveinstruments.squarespace.com/storage/files/dangerous_functions.py">here</a>.</p>
<blockquote>
<p>SHA256: bac5d21a7861b4387c0600ed5e825029e10560ab2fad33984ffa935342101f5f</p>
<p>MD5: be6c18777e755662a5fcccdb697dbd93</p>
</blockquote>
<p>In order to use it, you may have to modify the 'dangerous_functions_file' on line 7 of the aforementioned dangerous_functions.py script in order to accurately point to your location of dangerous_functions.xml.  Then load up the binary in which you want to locate dangerous functions in IDA Pro and run the following ida python command</p>
<blockquote>
<p>execfile(r"C:\path\to\dangerous_functions.py")</p>
</blockquote>
<p>Please note that this script is just an experiment (Read: primitive) and makes no attempt to actually verify if the functions are being used safely or not. &nbsp;Additionally, please note that this script was developed and tested using IDA Pro 6.0 and IDApython version 1.4.3.</p>
<p>&nbsp;</p>
<p>I would like to thank Dan Clemens of <a href="http://www.packetninjas.net/">Packet Ninjas</a> for inspiration and of course the <a href="http://www.hex-rays.com/">hex-rays</a> team for such a great tool.  I would also like to thank <a href="http://www.dwheeler.com/">Dan Wheeler</a> for writing flawfinder and Michael Howard for doing such a great job improving the Microsoft SDL and releasing the information for general consumption.  Don't hesitate to drop us a line to offer constructive criticism or offer improvements/suggestions.</p>
<p>Please note Halvar provides a similar project though I have not yet thoroughly reviewed the source:</p>
<p><a href="http://sourceforge.net/projects/bugscam/">http://sourceforge.net/projects/bugscam/</a></p>
<p>Also, this project looks interesting as well:</p>
<p><a href="http://sourceforge.net/projects/ida-pro-code/">http://sourceforge.net/projects/ida-pro-code/</a></p>]]></content></entry><entry><title>RE-Google and IDA 6.0</title><id>http://executiveinstruments.com/blog/2011/3/18/re-google-and-ida-60.html</id><link rel="alternate" type="text/html" href="http://executiveinstruments.com/blog/2011/3/18/re-google-and-ida-60.html"/><author><name>Zack Payton</name></author><published>2011-03-18T19:38:04Z</published><updated>2011-03-18T19:38:04Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>During the course of doing a black box security audit on a COTS application, we noticed that RE-Google had been broken. &nbsp;A lot of changes have been happening in the IDA Python API over the last several revisions causing a lot of breakage of our old and familiar tools. &nbsp;I found someone who had made it work on IDA 5.7 at this link <a href="http://code.google.com/p/idapython/issues/detail?id=61">here</a>. But even using the script linked there, we were still getting this weird error:</p>
<!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 11.0px 'Lucida Grande'; color: #141414} -->
<blockquote>
<p class="p1">Traceback (most recent call last):</p>
<p class="p1">&nbsp; File "&lt;string&gt;", line 1, in &lt;module&gt;</p>
<p class="p1">&nbsp; File "D:\share\regoogle\regoogle.py", line 721, in &lt;module&gt;</p>
<p class="p1">&nbsp; &nbsp; re_google(SEARCH_ALL_FUNCTIONS)</p>
<p class="p1">&nbsp; File "D:\share\regoogle\regoogle.py", line 347, in re_google</p>
<p class="p1">&nbsp; &nbsp; if query4function(func):</p>
<p class="p1">&nbsp; File "D:\share\regoogle\regoogle.py", line 293, in query4function</p>
<p class="p1">&nbsp; &nbsp; res = search4files( l )</p>
<p class="p1">&nbsp; File "D:\share\regoogle\regoogle.py", line 206, in search4files</p>
<p class="p1">&nbsp; &nbsp; results = client.GetSnippetsFeed( query )</p>
<p class="p1">&nbsp; File "D:\Python26\lib\site-packages\gdata\codesearch\service.py", line 84, in GetSnippetsFeed</p>
<p class="p1">&nbsp; &nbsp; feed = self.Query(query.ToUri())</p>
<p class="p1">&nbsp; File "D:\Python26\lib\site-packages\gdata\codesearch\service.py", line 71, in Query</p>
<p class="p1">&nbsp; &nbsp; return self.Get(uri, converter=converter)</p>
<p class="p1">&nbsp; File "D:\Python26\lib\site-packages\gdata\service.py", line 1074, in Get</p>
<p class="p1">&nbsp; &nbsp; return converter(result_body)</p>
<p class="p1">&nbsp; File "D:\Python26\lib\site-packages\gdata\codesearch\__init__.py", line 136, in CodesearchFeedFromString</p>
<p class="p1">&nbsp; &nbsp; return atom.CreateClassFromXMLString(CodesearchFeed, xml_string)</p>
<p class="p1">&nbsp; File "D:\Python26\lib\site-packages\atom\__init__.py", line 93, in optional_warn_function</p>
<p class="p1">&nbsp; &nbsp; return f(*args, **kwargs)</p>
<p class="p1">&nbsp; File "D:\Python26\lib\site-packages\atom\__init__.py", line 128, in CreateClassFromXMLString</p>
<p class="p1">&nbsp; &nbsp; return _CreateClassFromElementTree(target_class, tree)</p>
<p class="p1">&nbsp; File "D:\Python26\lib\site-packages\atom\__init__.py", line 164, in _CreateClassFromElementTree</p>
<p class="p1">&nbsp; &nbsp; target._HarvestElementTree(tree)</p>
<p class="p1">&nbsp; File "D:\Python26\lib\site-packages\atom\__init__.py", line 186, in _HarvestElementTree</p>
<p class="p1">&nbsp; &nbsp; self._ConvertElementTreeToMember(child)</p>
<p class="p1">&nbsp; File "D:\Python26\lib\site-packages\atom\__init__.py", line 295, in _ConvertElementTreeToMember</p>
<p class="p1">&nbsp; &nbsp; _CreateClassFromElementTree(member_class, child_tree))</p>
<p class="p1">&nbsp; File "D:\Python26\lib\site-packages\atom\__init__.py", line 164, in _CreateClassFromElementTree</p>
<p class="p1">&nbsp; &nbsp; target._HarvestElementTree(tree)</p>
<p class="p1">&nbsp; File "D:\Python26\lib\site-packages\atom\__init__.py", line 194, in _HarvestElementTree</p>
<p class="p1">&nbsp; &nbsp; self.text = tree.text.encode(MEMBER_STRING_ENCODING)</p>
<p class="p1">&nbsp; File "D:\Python26\Lib\encodings\utf_8.py", line 18, in decode</p>
<p class="p1">&nbsp; &nbsp; return codecs.utf_8_decode(input, errors, True)</p>
<p class="p1">AttributeError: 'NoneType' object has no attribute 'utf_8_decode'</p>
</blockquote>
<p>&nbsp;</p>
<p>I was able to fix this error by modifying \Python26\Lib\encodings\utf_8.py and the decode() function.</p>
<p>I essentially changed it to the following:</p>
<!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 11.0px 'Lucida Grande'; color: #141414} -->
<blockquote>
<p class="p1">def decode(input, errors='strict'):</p>
<p class="p1">&nbsp; &nbsp; import codecs</p>
<p class="p1">&nbsp; &nbsp; return codecs.utf_8_decode(input, errors, True)</p>
</blockquote>
<p class="p1">Adding the line 'import codecs' appears to fix any RE-Google issues and make it work with IDA Pro 6.0. &nbsp;Not sure why this problem exists. &nbsp;I tried to do some basic checking in gdata to ensure usage of the API was correct. &nbsp;Everything looked right. &nbsp;I even tried to use gdata 2.0.4 which the RE-Google author stated in the README file he used for development: same error.</p>
<p class="p1">&nbsp;</p>
<p class="p1">Anyhow, you may download my version of RE-Google&nbsp;<a href="http://executiveinstruments.squarespace.com/storage/files/REGoogle60.py">here</a>&nbsp;which has been tested and confirmed to work with IDA Pro 6.0.</p>
<blockquote>
<p class="p1">Sha256: 9a01eb0743964b9aed9aa77a20ce3b69f6871309a5e4d5fa1a01bb9c22f9ac34</p>
<p class="p1">MD5: bfb59c1f5d846f49a9afc4e13f76721a&nbsp;</p>
</blockquote>
<p class="p1">&nbsp;</p>
<p class="p1">I'd like to offer my thanks to Felix Leder for writing RE-Google, Elias Bachaalany for porting RE-Google to IDA 5.7, and of course hex rays for writing IDA Pro in the first place.</p>]]></content></entry></feed>
