<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Insecurety Research</title>
	<atom:link href="http://insecurety.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://insecurety.net</link>
	<description>We are spelling it wrong... You are DOING it wrong!</description>
	<lastBuildDate>Wed, 15 May 2013 21:26:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Active Directory Password Hash Extraction</title>
		<link>http://insecurety.net/?p=884&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=active-directory-password-hash-extraction</link>
		<comments>http://insecurety.net/?p=884#comments</comments>
		<pubDate>Sun, 05 May 2013 11:33:40 +0000</pubDate>
		<dc:creator>dietrich</dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Passwords]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[lm]]></category>
		<category><![CDATA[ntds]]></category>
		<category><![CDATA[ntlm]]></category>
		<category><![CDATA[pwdump]]></category>

		<guid isPermaLink="false">http://insecurety.net/?p=884</guid>
		<description><![CDATA[Just added a tool for offline Active Directory password hash extraction. It has very basic functionality right now but much more is planned. Command line application that runs on Windows only at the moment. ntds_decode -s &#60;FILE&#62; -d &#60;FILE&#62; -m &#8230; <a href="http://insecurety.net/?p=884">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Just added a tool for <strong>offline</strong> Active Directory password hash extraction.<br />
It has very basic functionality right now but much more is planned.</p>
<p>Command line application that runs on Windows only at the moment.<br />
<strong>
<pre>
  ntds_decode -s &lt;FILE&gt; -d &lt;FILE&gt; -m -i

    -s &lt;FILE&gt; : SYSTEM registry hive
    -d &lt;FILE&gt; : Active Directory database
    -m        : Machines (omitted by default)
    -i        : Inactive, Locked or Disabled accounts (omitted by default)</pre>
<p></strong></p>
<p>The SYSTEM registry hive and Active Directory database are from a domain controller.<br />
These files are obviously locked so you need to backup using the Volume Shadow Copy Service.</p>
<p>The output format is similar to pwdump and only runs on Windows at the moment.<br />
LM and NTLM hashes are extracted from active user accounts only.</p>
<p>ntds_decode mounts the SYSTEM file so Administrator access is required on the computer you run it on.</p>
<p>If you&#8217;re an experienced pen tester or Administrator that would like to test this tool, you can grab from <a href="http://www.insecurety.net/downloads/pwdtools/ntds_decode.zip">here</a></p>
<p>It&#8217;s advisable you don&#8217;t use the tool unless you know what you&#8217;re doing.<br />
Source isn&#8217;t provided at the moment because it&#8217;s too early to release.</p>
<p>If you have questions about it, feel free to e-mail the address provided in README.txt</p>
]]></content:encoded>
			<wfw:commentRss>http://insecurety.net/?feed=rss2&#038;p=884</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A tale of two mainframes</title>
		<link>http://insecurety.net/?p=877&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-tale-of-two-mainframes</link>
		<comments>http://insecurety.net/?p=877#comments</comments>
		<pubDate>Mon, 29 Apr 2013 20:31:28 +0000</pubDate>
		<dc:creator>March</dc:creator>
				<category><![CDATA[forensics]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Passwords]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Anikata]]></category>
		<category><![CDATA[arrest]]></category>
		<category><![CDATA[Cambodia]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[legality]]></category>
		<category><![CDATA[mainframes]]></category>
		<category><![CDATA[OPSEC]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[z/OS]]></category>

		<guid isPermaLink="false">http://insecurety.net/?p=877</guid>
		<description><![CDATA[Today, I acquired a copy of a report on anakata&#8217;s alleged hacking of Logica. You, too, can find a copy of it in PDF form here. There&#8217;s a number of interesting things in this report, and I figured I would &#8230; <a href="http://insecurety.net/?p=877">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Today, I acquired a copy of a report on <a title="anakata's" href="http://news.cnet.com/8301-1023_3-57510232-93/pirate-bays-warg-back-in-sweden-busted-on-hacking-charges/">anakata&#8217;s</a> alleged hacking of Logica. You, too, can find a copy of it in PDF form <a title="here" href="http://minfil.se/Mfz0bfb3bc/bilaga_a.pdf">here</a>.<br />
There&#8217;s a number of interesting things in this report, and I figured I would take the time to disassemble them and give a little bit of analysis on each.</p>
<p>The first interesting thing, which starts on the bottom of page 36, is the vast number of IPs from which the attackers came from. Out of curiosity, I did a little investigation on the boxes involved in the attacks, the jumpboxes, if you will.<br />
Now, one of these is pretty interesting.<br />
124.248.187.225 and 27.109.118.33 are located in Cambodia. This implies that, if it WAS anakata, he presumably just compromised wireless routers in his area and used those to launch the attacks, or else was too lazy to protect himself.<br />
93.186.170.54 belongs to a VPS company.<br />
The others, bar one, are all residential ranges. I took a look at them, and nothing particularly struck my fancy about them, however, they did possess dreamboxes and/or some rather esoteric webservers, so my guess would be either default credentials or really, <strong>really</strong> bad code led to their compromises.<br />
Now, what grabs my attention is 202.120.189.223, and here is why:<br />
This was a z/OS mainframe belonging to Tongji University in China, one of the most respected universities in the country (although it is now offline). So, this brings the total number of hacked mainframes up to 3.</p>
<p>I&#8217;m just speculating here, but I would imagine that owing to the difficulty in transferring and working with files from UNIX to z/OS (even with Unix System Services and FTP), that Chinese mainframe probably existed as both storage for the tools used in the Logica hack, and as a development environment. I&#8217;m frankly very curious as to how, exactly, these mainframes were so easily broken into, but I have some suspicions.<br />
RACF, which is one of two competing &#8220;user management systems&#8221; for z/OS (the other being ACF2), has a number of interesting&#8230; quirks, including a limit on password length (8 characters), and the fact that the superuser account shipped by default cannot be completely removed; trying to attempt so may seem successful, but will result in it being quietly restored later. I have a few other theories, including the possibility of credential reuse and easily enumerated accounts (RACF conveniently tells you if a username doesn&#8217;t exist on the system), but unfortunately most of these aren&#8217;t concrete. Additionally, the main methods of egress seem to have been FTP and SSH, with little to no login failures reported, in which case it is worth assuming that the credentials may have been gathered from elsewhere, ie a compromised webserver.<br />
Anyway, as I said, this is just conjecture, and not solid facts.</p>
<p>Another interesting thing that is worth pointing out is the nature of the majority of the backdoor tools. Take a look at the following code:<br />
<code><br />
#include &lt;stdio.h&gt;<br />
#include &lt;unistd.h&gt;<br />
int main(int argc, char *argv[])<br />
{<br />
setuid(0);<br />
setgid(0);<br />
setgroups(0, NULL);<br />
execl("/bin/sh", "sh", NULL);<br />
}<br />
</code><br />
That&#8217;s incredibly, incredibly simple C. I&#8217;m not a C programmer, and even I could write that. But there&#8217;s a wonderful elegance about it. Why waste time with a tremendously technical backdoor tool when the simplest thing, a setuid wrapper for a shell, works just as well?<br />
That said, there are also far more technical and clever tools deployed, including one written in Z/arch HLasm. Dabbling in C, assembly, and other languages seems rather adventurous, so, with the warning that it&#8217;s just speculation, I&#8217;d imagine that this was a group of people familiar with mainframe development, not just one developer.<br />
The other tools, go.rx and kurwa, are interesting, too. Based on the strings shown from them, they&#8217;re probably rexx scripts (rexx is the equivalent of Perl on UNIX). If the giant /* REXX */ didn&#8217;t inform you. What is interesting is that they are apparently exploiting a previously unknown privilege escalation vulnerability, as well as adding yet another language to the list used.<br />
There are also less technical backdoors, for example, changing SSH keys to ensure access later, and altering inetd.conf to accomplish the same thing.</p>
<p>So, now that we&#8217;ve taken a look at this, I&#8217;d like to comment on what seems, to me, to be paradoxical and/or stupid.<br />
There are only two mainframes, yet a fairly bewildering range of techniques was deployed, with tools written in at least three different programming languages. This right here is terrible opsec, and a terrible waste. Adding multiple backdoors is risky, because you can&#8217;t gain MORE access; once you&#8217;ve got a backdoor in place you&#8217;ve got a backdoor, but you&#8217;re leaving more things around that a curious system administrator might stumble upon. As well as that, the more varied the tools and techniques, the more obvious it&#8217;s a large and diverse group. It would have been wiser to agree on a list of public tools and simple code that could have been easily ported to z/OS. It just seems weird that everyone was deploying their own toolkit; if these were made specifically for this attack, that&#8217;s quite an amount of time to spend.</p>
<p>Still, it&#8217;s a fascinating story. Mainframe security doesn&#8217;t get nearly enough coverage, and IBM&#8217;s z/OS has survived through a lack of scrutiny; security through obscurity.</p>
]]></content:encoded>
			<wfw:commentRss>http://insecurety.net/?feed=rss2&#038;p=877</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Memcached Remote Denial of Service PoC</title>
		<link>http://insecurety.net/?p=872&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=memcached-remote-denial-of-service-poc</link>
		<comments>http://insecurety.net/?p=872#comments</comments>
		<pubDate>Mon, 29 Apr 2013 13:49:44 +0000</pubDate>
		<dc:creator>infodox</dc:creator>
				<category><![CDATA[Denial of Service]]></category>
		<category><![CDATA[Exploit]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Idiots]]></category>
		<category><![CDATA[Packet-Fu]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[killthebox]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[remote exploit]]></category>

		<guid isPermaLink="false">http://insecurety.net/?p=872</guid>
		<description><![CDATA[A long time ago, in 2011, a rather serious vulnerability was reported in Memcached. It is now 2013, and the vulnerability still exists in the latest version on the memcached Google Code page. The report is here: https://code.google.com/p/memcached/issues/detail?id=192 Now, as you &#8230; <a href="http://insecurety.net/?p=872">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A long time ago, in 2011, a rather serious vulnerability was reported in Memcached. It is now 2013, and the vulnerability still exists in the latest version on the memcached Google Code page.</p>
<p>The report is here: <a href="https://code.google.com/p/memcached/issues/detail?id=192">https://code.google.com/p/memcached/issues/detail?id=192</a></p>
<p>Now, as you can see, by sending a specially crafted packet, we can cause Memcached to segfault, and essentially die. Memcached is used by a lot of high profile sites to speed up page load times, and killing it would impact a bit on site performance, so I was rather curious as to why this bug had not yet been killed.</p>
<p>As you can see from the report, the vulnerability is trivial to exploit. Just send the magic packet of death and it kills the memcached service. I tried to get remote code execution from it, but had no luck at all. Perhaps one of you might have more luck!</p>
<div id="attachment_873" class="wp-caption aligncenter" style="width: 1376px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/04/2013-04-29-135036_1366x768_scrot.png"><img class="size-full wp-image-873" alt="memcached dead" src="http://insecurety.net/wordpress/wp-content/uploads/2013/04/2013-04-29-135036_1366x768_scrot.png" width="1366" height="768" /></a><p class="wp-caption-text">memcached ded</p></div>
<p>Exploit code available to download here: <a href="http://insecurety.net/wordpress/wp-content/uploads/2013/04/killthebox.py_.txt">killthebox.py</a></p>
<p>As always, responsible use is encouraged. Killing $(big website) memcached might get you in trouble, so don&#8217;t do it.</p>
<p>As for the memcached devs: You have known about this for two bloody years and never fixed it. This is terribly irresponsible of you. Fix it.</p>
]]></content:encoded>
			<wfw:commentRss>http://insecurety.net/?feed=rss2&#038;p=872</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Bitcoin &#8220;Brainwallets&#8221; and why they are a bad idea</title>
		<link>http://insecurety.net/?p=866&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bitcoin-brainwallets-and-why-they-are-a-bad-idea</link>
		<comments>http://insecurety.net/?p=866#comments</comments>
		<pubDate>Tue, 26 Mar 2013 18:01:26 +0000</pubDate>
		<dc:creator>infodox</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Exploit]]></category>
		<category><![CDATA[Idiots]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[bitcoin]]></category>
		<category><![CDATA[bitcoin hijacking]]></category>
		<category><![CDATA[bitcoin theft]]></category>
		<category><![CDATA[blatant theft]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[passphrases]]></category>
		<category><![CDATA[passwords]]></category>
		<category><![CDATA[sha256]]></category>

		<guid isPermaLink="false">http://insecurety.net/?p=866</guid>
		<description><![CDATA[// Decided to publish this after some misgivings about disclosure. After telling Asher about it earlier, it was decided to disclose it to make people aware of the issue. A week or two ago, I stumbled across an article about &#8230; <a href="http://insecurety.net/?p=866">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>// Decided to publish this after some misgivings about disclosure. After telling Asher about it earlier, it was decided to disclose it to make people aware of the issue.</p>
<p>A week or two ago, I stumbled across an article about how these &#8220;Brainwallet&#8221; things were making your bitcoins &#8220;Deniable&#8221;, as no &#8220;wallet&#8221; exists except in your head.</p>
<p>How they work is quite simple: you take a passphrase, and that is to be the super secret key for your &#8220;wallet&#8221;. So long as you remember that passphrase, you can access the wallet.</p>
<p>This passphrase is hashed with SHA256 to form the private key for your wallet, so you can generate your privkey at will. The privkey is turned into a bitcoin address using the standard algorithm.</p>
<p>Now, so long as you know the private key, you own that wallet. So if you know the passphrase, you know the private key. This is essentially basing the private key on insecure (user supplied as opposed to random) data, normally a word or string of words (everyone sucks at passphrases).</p>
<p>Now, how do we go about attacking this. Well, think of it as the same as cracking peoples passwords.</p>
<p>You take a dictionary of likely looking passphrases, and hash &#8216;em with SHA-256 to make a bunch of private keys. You then convert them to wallet-import format using the Base58 encoding that Bitcoin uses, and pass the WIF string to bitcoind to import the wallet. If anyone was using that private key/passphrase, all their bitcoin now belongs to you.</p>
<p>Being a lovely person, I wrote up a proof of concept based on brainwallet.py (a brainwallet generator) that automatically does all this. My code is terrible, but it proves the point I was trying to make. A better written piece of code could import thousands of keys incredibly quickly, exhausting entire blocks of passphrase-keyspace.</p>
<p><a href="http://pastie.org/pastes/7123606/text?key=hkkjdwy70fpl4doquq7nhg">Proof of Concept</a></p>
<p>The brainwallet.py implementation I hacked into the above can be gotten here: <a href="https://github.com/willwharton/pybrainwallet/blob/master/brainwallet.py">Brainwallet.py</a></p>
<p>The terrifying thing about this is, you are not only stealing &#8220;current&#8221; bitcoins, but also future ones. If anyone ever uses any of the passphrases you have &#8220;pwned&#8221;, you own their bitcoins.</p>
<p>So, tell your friends: Brainwallets are dumb.</p>
<p>-infodox</p>
<p>p.s.: we now accept bitcoin if you ever feel like buying us a beer. 1MJ6KnLdXm82UjdDuvgjxDhngLjBMJfamV</p>
<p>NOTE: We do not encourage or approve of stealing peoples money. It is a bad idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://insecurety.net/?feed=rss2&#038;p=866</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Punching through the Fortinet &#8211; Web Filter Evasion</title>
		<link>http://insecurety.net/?p=860&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=punching-through-the-fortinet-web-filter-evasion</link>
		<comments>http://insecurety.net/?p=860#comments</comments>
		<pubDate>Thu, 21 Mar 2013 08:57:30 +0000</pubDate>
		<dc:creator>infodox</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[blacklists]]></category>
		<category><![CDATA[censorship]]></category>
		<category><![CDATA[epic fail]]></category>
		<category><![CDATA[Fortinet]]></category>
		<category><![CDATA[SSH tunnel]]></category>
		<category><![CDATA[tor]]></category>

		<guid isPermaLink="false">http://insecurety.net/?p=860</guid>
		<description><![CDATA[Today, 20th of March 2013, I went into college as per normal, and tried accessing this site to upload a new post (which is now in drafts, I will publish it over the weekend). Anyway, I ran straight into this: &#8230; <a href="http://insecurety.net/?p=860">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Today, 20th of March 2013, I went into college as per normal, and tried accessing this site to upload a new post (which is now in drafts, I will publish it over the weekend). Anyway, I ran straight into this:</p>
<div id="attachment_861" class="wp-caption aligncenter" style="width: 1376px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/03/Screenshot-from-2013-03-20-141609.png"><img class="size-full wp-image-861" alt="censored" src="http://insecurety.net/wordpress/wp-content/uploads/2013/03/Screenshot-from-2013-03-20-141609.png" width="1366" height="768" /></a><p class="wp-caption-text">Me, blocked.</p></div>
<p>I, quite naturally, became quite irate. I had missed my morning cup of coffee due to a delayed bus, and now this. Blocked. Censored. Denied.<br />
I had gotten used to seeing this &#8220;page&#8221; quite often, as my web browsing habits (Security websites) tend to get flagged as &#8220;hacking&#8221; and suchlike. However, seeing my site blatantly blacklisted as a &#8220;malicious website&#8221;, i.e. one which slings malware at its viewers, was a step too bloody far.</p>
<p>After a slight rage-fest on twitter, and several angry emails sent to various responsible persons (all of whom denied any responsibility so far, cowards!) I decided the best course of action would be publishing a guide on getting around these shitty web filters. As it so happens, Fortinet has a bigger gaping hole, than, well, Goatse.<br />
Generally speaking, the best way around any of this crap, is to tunnel right through them. I shall outline the methods I have used with the most success over the last few months of putting up with this nonsense.</p>
<p>TOR &#8211; The Onion Router.<br />
So, the last few posts concentrated on getting you TOR set up, and are linked at the bottom of this post. There is a very valid reason for this, and it is rather simple.</p>
<p>Fortinet &#8220;FortiGard&#8221; has no bloody clue what TOR is, and does not block it. I can surf freely all day long without seeing a single &#8220;blocked&#8221; page, provided I am willing to tolerate severely throttled speeds and &#8220;the lag of TOR&#8221; during the connecting phase.</p>
<p>So, if you are stuck behind a Fortinet, TOR up! It is beneficial to your internet-health anyway! It makes you less traceable!</p>
<p>For TOR installation details, see the following posts:<br />
<a href="http://insecurety.net/?p=847">Installing TOR on Ubuntu</a><br />
<a href="http://insecurety.net/?p=842">Installing TOR on Windows</a><br />
<a href="http://insecurety.net/?p=856">Installing Torbutton</a></p>
<p>Now, if they have blocked TOR, the following tricks will work:</p>
<p>SSH tunnels to port 443.<br />
For a free shell that supports SSH to port 443, go to <a href="http://www.cjb.net/shell.html">CJB.NET Shells</a><br />
If, for some reason, even that fails&#8230; Let me know! I have had some luck with DNS tunnelling also.</p>
<p>So, in conclusion: Fortinet is trivial to bypass, you can do it blindfolded.</p>
]]></content:encoded>
			<wfw:commentRss>http://insecurety.net/?feed=rss2&#038;p=860</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing Torbutton</title>
		<link>http://insecurety.net/?p=856&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-torbutton</link>
		<comments>http://insecurety.net/?p=856#comments</comments>
		<pubDate>Wed, 20 Mar 2013 18:57:26 +0000</pubDate>
		<dc:creator>infodox</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Anonymity]]></category>
		<category><![CDATA[bypass censorship]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[installing torbutton]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[tor]]></category>
		<category><![CDATA[torbutton]]></category>

		<guid isPermaLink="false">http://insecurety.net/?p=856</guid>
		<description><![CDATA[I almost thought a Torbutton install post was pointless, until I realized a lot of people still manage to screw it up. Somehow. I have no idea exactly how&#8230; Anyways, onward! I will assume you have read http://insecurety.net/?p=847 and http://insecurety.net/?p=842 &#8230; <a href="http://insecurety.net/?p=856">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I almost thought a Torbutton install post was pointless, until I realized a lot of people still manage to screw it up.<br />
Somehow. I have no idea exactly how&#8230;<br />
Anyways, onward! I will assume you have read http://insecurety.net/?p=847 and http://insecurety.net/?p=842 and gotten TOR working for you.</p>
<p><strong> The following works on any platform once TOR/Vidalia is installed. TORbutton makes irreversable changes to Firefox, so you should install Firefox specifically for this! </strong></p>
<p>In Firefox navigate to torproject.org/torbutton</p>
<p>Click the install link near bottom of page. The one that reads &#8220;Expert Install&#8221; &#8220;Install from this page&#8221;<br />
Allow it to do voodoo magic.</p>
<div id="attachment_857" class="wp-caption aligncenter" style="width: 810px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/03/YXo6l.png"><img class="size-full wp-image-857" alt="torbutton install" src="http://insecurety.net/wordpress/wp-content/uploads/2013/03/YXo6l.png" width="800" height="600" /></a><p class="wp-caption-text">torbutton install</p></div>
<p>Once Torbutton installs and Firefox restarts, navigate to check.torproject.org</p>
<div id="attachment_858" class="wp-caption aligncenter" style="width: 810px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/03/TzATc.png"><img class="size-full wp-image-858" alt="It Works!" src="http://insecurety.net/wordpress/wp-content/uploads/2013/03/TzATc.png" width="800" height="600" /></a><p class="wp-caption-text">It Works!</p></div>
<p>If you are seeing this, it clearly worked and you are good to go! Now onward we go!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://insecurety.net/?feed=rss2&#038;p=856</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing TOR On Ubuntu Linux</title>
		<link>http://insecurety.net/?p=847&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-tor-on-ubuntu-linux</link>
		<comments>http://insecurety.net/?p=847#comments</comments>
		<pubDate>Wed, 20 Mar 2013 18:51:30 +0000</pubDate>
		<dc:creator>infodox</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Anonymity]]></category>
		<category><![CDATA[anonymity online]]></category>
		<category><![CDATA[bypass censorship]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[installing vidalia]]></category>
		<category><![CDATA[Polipo]]></category>
		<category><![CDATA[TOR install]]></category>
		<category><![CDATA[tor project]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vidalia]]></category>

		<guid isPermaLink="false">http://insecurety.net/?p=847</guid>
		<description><![CDATA[Seeing as Ubuntu is one of the most commonly used Linux distros around, and because I cannot be bothered getting a Fedora .iso, and because these instructions work fine for Debian also, here goes! (yes, in the images I am &#8230; <a href="http://insecurety.net/?p=847">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Seeing as Ubuntu is one of the most commonly used Linux distros around, and because I cannot be bothered getting a Fedora .iso, and because these instructions work fine for Debian also, here goes! (yes, in the images I am using BT5, which is basically Ubuntu)</p>
<p>To get your distribution name, the command &#8220;lsb_release -c&#8221; will tell you. This is important.</p>
<p>First off, add the appropriate repository to your /etc/apt/sources.list file.</p>
<p>Essentially this command:<br />
sudo echo &#8220;deb <a href="http://deb.torproject.org/torproject.org">http://deb.torproject.org/torproject.org</a> &lt;DISTRIBUTION&gt; main&#8221; &gt;&gt; /etc/apt/sources.list</p>
<div id="attachment_848" class="wp-caption aligncenter" style="width: 810px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/03/b55Xk.png"><img class="size-full wp-image-848" alt="Adding TOR repo" src="http://insecurety.net/wordpress/wp-content/uploads/2013/03/b55Xk.png" width="800" height="600" /></a><p class="wp-caption-text">Adding TOR repo</p></div>
<p>Next, we import the tor project GPG keys. I advise being root when doing this.</p>
<p>gpg &#8211;keyserver keys.gnupg.net &#8211;recv 886DDD89<br />
gpg &#8211;export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -</p>
<div id="attachment_849" class="wp-caption aligncenter" style="width: 810px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/03/87X4c.png"><img class="size-full wp-image-849" alt="Adding GPG keys" src="http://insecurety.net/wordpress/wp-content/uploads/2013/03/87X4c.png" width="800" height="600" /></a><p class="wp-caption-text">Adding GPG keys</p></div>
<p>sudo apt-get update to refresh your package lists&#8230;</p>
<div id="attachment_850" class="wp-caption aligncenter" style="width: 810px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/03/5cmnD.png"><img class="size-full wp-image-850" alt="Update Package List" src="http://insecurety.net/wordpress/wp-content/uploads/2013/03/5cmnD.png" width="800" height="600" /></a><p class="wp-caption-text">Update Package List</p></div>
<p>Now we install the torproject keyring.</p>
<p>apt-get install deb.torproject.org-keyring</p>
<div id="attachment_851" class="wp-caption aligncenter" style="width: 810px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/03/X5bpG.png"><img class="size-full wp-image-851" alt="keyring install" src="http://insecurety.net/wordpress/wp-content/uploads/2013/03/X5bpG.png" width="800" height="600" /></a><p class="wp-caption-text">Installing Keyring</p></div>
<p>Install TOR itself and the Vidalia GUI&#8230; It will prompt to add a user to the group so select your username!!!</p>
<p>apt-get install vidalia tor polipo</p>
<div id="attachment_852" class="wp-caption aligncenter" style="width: 810px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/03/Y7KkM.png"><img class="size-full wp-image-852" alt="Installing TOR" src="http://insecurety.net/wordpress/wp-content/uploads/2013/03/Y7KkM.png" width="800" height="600" /></a><p class="wp-caption-text">Installing TOR</p></div>
<p>Now, we check is Vidalia working OK or are we already fscked. By running it.</p>
<div id="attachment_853" class="wp-caption aligncenter" style="width: 810px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/03/YJSbb.png"><img class="size-full wp-image-853" alt="Vidalia Works" src="http://insecurety.net/wordpress/wp-content/uploads/2013/03/YJSbb.png" width="800" height="600" /></a><p class="wp-caption-text">Vidalia Works</p></div>
<p>If it looks like that, you are good to go <img alt="smile" src="http://fee.seomraspraoi.org/img/smilies/smile.png" width="15" height="15" /> Again, as per http://insecurety.net/?p=842 , just set proxy settings in your browser to use 127.0.0.1 and 9050 as the port and you should be good to go!</p>
<p>Next up: Installing TORbutton <img src='http://insecurety.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The observant ones will note the dates on the screenshots are old: I had originally made this guide for some friends who wanted it, and then I decided to publish it openly because, reasons.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://insecurety.net/?feed=rss2&#038;p=847</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TOR Setup &#8211; Windows</title>
		<link>http://insecurety.net/?p=842&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tor-setup-windows</link>
		<comments>http://insecurety.net/?p=842#comments</comments>
		<pubDate>Wed, 20 Mar 2013 18:38:01 +0000</pubDate>
		<dc:creator>infodox</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[anonymous browsing]]></category>
		<category><![CDATA[bypass censorship]]></category>
		<category><![CDATA[installing tor]]></category>
		<category><![CDATA[online privacy]]></category>
		<category><![CDATA[setting up tor]]></category>
		<category><![CDATA[tor]]></category>
		<category><![CDATA[vidalia]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://insecurety.net/?p=842</guid>
		<description><![CDATA[/* This is part one of a multipart posting series that&#8217;s gonna go on all evening before el grande finale of using TOR and suchlike to bypass Fortinet Web Filters and other such bullshit censorship warez. The two TOR install &#8230; <a href="http://insecurety.net/?p=842">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>/*<br />
This is part one of a multipart posting series that&#8217;s gonna go on all evening before el grande finale of using TOR and suchlike to bypass Fortinet Web Filters and other such bullshit censorship warez. The two TOR install posts will go up first, followed by the ranty bypassing one, then some other stuff :3</p>
<p>Please note, these installation guides are for non technical people in a sense, I literally try hold the users hand as much as possible&#8230;<br />
*/</p>
<p>Well, if anyone here is as paranoid as I am, they probably wonder how the hell they can prevent their online activities from being traced back to them. So, in the interest of helping others anonymize their online presence, I have decided to knock up a few simple enough guides on installing and using various pieces of anonymity software, starting with the TOR bundle for Windows.</p>
<p>So. You should navigate yourself to torproject.org, and go to the downloads section.</p>
<div id="attachment_843" class="wp-caption aligncenter" style="width: 1352px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/03/9LsUk.png"><img class="size-full wp-image-843" alt="Downloading TOR" src="http://insecurety.net/wordpress/wp-content/uploads/2013/03/9LsUk.png" width="1342" height="713" /></a><p class="wp-caption-text">Downloading TOR</p></div>
<p>Assuming you installed Firefox ages back (I hope to god ye arent using IE&#8230;) install the Vidalia bundle. Just download it, run the executable file, tick all the boxes (i.e. full install) and fire ahead. It will pop during the install.</p>
<div id="attachment_844" class="wp-caption aligncenter" style="width: 530px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/03/t33wE.png"><img class="size-full wp-image-844" alt="Installing Vidalia Bundle" src="http://insecurety.net/wordpress/wp-content/uploads/2013/03/t33wE.png" width="520" height="408" /></a><p class="wp-caption-text">Installing Vidalia Bundle</p></div>
<p>Finally, let TOR run, and you should see the following after up to two minutes or so:</p>
<div id="attachment_845" class="wp-caption aligncenter" style="width: 375px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/03/SbwYO.png"><img class="size-full wp-image-845" alt="TOR works" src="http://insecurety.net/wordpress/wp-content/uploads/2013/03/SbwYO.png" width="365" height="422" /></a><p class="wp-caption-text">TOR is now running</p></div>
<p>Bingo. That is TOR installed and running, and as you can see, it is VERY simple to use. To make it work with Firefox for anonymized browsing: Edit -&gt; Preferences -&gt; Advanced -&gt; Network -&gt; Settings -&gt; Set proxy as: SOCKS5 (type), and 127.0.0.1 as IP and 9050 as port. I don&#8217;t think I can get much more simple than that.<br />
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://insecurety.net/?feed=rss2&#038;p=842</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Password Algorithms: Windows System Key (SYSKEY)</title>
		<link>http://insecurety.net/?p=768&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=password-algorithms-windows-system-key-syskey</link>
		<comments>http://insecurety.net/?p=768#comments</comments>
		<pubDate>Sat, 16 Mar 2013 03:22:35 +0000</pubDate>
		<dc:creator>dietrich</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[forensics]]></category>
		<category><![CDATA[Passwords]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[lm]]></category>
		<category><![CDATA[lsa]]></category>
		<category><![CDATA[ntds]]></category>
		<category><![CDATA[ntlm]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[pwdump]]></category>
		<category><![CDATA[sam]]></category>
		<category><![CDATA[samdump]]></category>
		<category><![CDATA[syskey]]></category>

		<guid isPermaLink="false">http://insecurety.net/?p=768</guid>
		<description><![CDATA[I stumbled upon some forum posts related to System Key recently and read something about 1 of the authentication modes available to Administrators that made me wonder if true or not. Just to note, there are 3 modes. Generated by &#8230; <a href="http://insecurety.net/?p=768">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I stumbled upon some forum posts related to System Key recently and read something about 1 of the authentication modes available to Administrators that made me wonder if true or not.</p>
<p>Just to note, there are 3 modes.</p>
<p><strong></p>
<ol>
<li>Generated by passphrase</li>
<li>Stored in registry</li>
<li>Stored on removable storage device</li>
</ol>
<p></strong></p>
<p>2 is enabled by default, but you can change this with the syskey.exe utility.</p>
<p>The claim was that if you forgot the passphrase or &#8220;startup password&#8221; there&#8217;s no reliable method of recovery. The &#8220;only way&#8221; to get back into the system is to restore a backup if one is available or disable completely using something like <a href="http://pogostick.net/~pnh/ntpasswd/" title="ntpasswd">ntpasswd</a></p>
<p>In most cases, either way is probably sufficient enough, but there are situations where you would need to know the original passphrase and don&#8217;t have a backup available or perhaps you can&#8217;t even use a backup which could erase some critical information required.</p>
<p>There are a number of ways to recover the passphrase but I&#8217;ll just suggest one for now.<br />
Found this short video which shows someone enabling the startup password</p>
<p><iframe width="584" height="438" src="http://www.youtube.com/embed/4hyEUBFhGi0?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>One of the the comments is &#8220;BOSS﻿ HOW WE HACK SYSKEY!!!&#8221; <img src='http://insecurety.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h2>History of SYSKEY</h2>
<p>SYSKEY was Microsoft&#8217;s response to <a href="http://ftp.samba.org/pub/samba/pwdump/">pwdump</a> and <a href="http://insecure.org/sploits/l0phtcrack.lanman.problems.html">L0phtCrack</a>.<br />
It was provided as an optional security enhancement with Windows NT SP3 and enabled by default since the release of Windows 2000.</p>
<p>The purpose of this feature was to prevent pwdump working without modifications. Open source offline decryption tools didn&#8217;t surface until the release of <a href="http://sourceforge.net/projects/ophcrack/files/samdump2/">samdump2</a> by Nicola Cuomo.</p>
<p>What follows is a short timeline of events related to SYSKEY.</p>
<table border="1" style="background-color:#FFFFFF" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td>March 1997</td>
<td>Samba developer Jeremy Allison publishes pwdump which enables Administrators to dump LM and NTLM hashes stored in the SAM database.</td>
</tr>
<tr>
<td>April 1997</td>
<td>L0pht publishes L0phtcrack which allows Administrators to audit password hashes. It had been in development since the release of pwdump.</td>
</tr>
<tr>
<td>May 1997</td>
<td>Microsoft publishes Service Pack 3 for Windows NT which added SYSKEY as an optional feature to prevent pwdump working properly.</td>
</tr>
<tr>
<td>December 1999</td>
<td>Todd Sabin documents flaw with SYSKEY. Anyone with access to the SAM database can reveal password hashes without the System key.</td>
</tr>
<tr>
<td>April 2000</td>
<td>Todd Sabin releases pwdump2 which dumps password hashes with the obfuscation removed. This also dumps hashes from a domain controller.</td>
</tr>
<tr>
<td>February 2004</td>
<td>Nicola Cuomo documents SYSKEY, Releases Samdump2 which enables offline decryption of password hashes stored in SAM database.</td>
</tr>
</table>
<h2>Password Generation</h2>
<p>When the system boots and auth mode 1 is enabled, windows will display a dialog box waiting for you to enter the password. The following text is displayed on an XP system.</p>
<p><strong>&#8220;This computer is configured to require a password in order to start up. Please enter the Startup Password below.&#8221;</strong></p>
<p>Blank passwords are acceptable so whether you enter something or not, it gets processed with MD5 and authenticated once you hit OK.</p>
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace;color: #000000;background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px;overflow: auto;width: 100%"><code>#define MAX_SYSKEY_PWD 260

void pwd2key(wchar_t pwd[], uint8_t syskey[]) {
  MD5_CTX ctx;
  size_t pwd_len = wcslen(pwd);
  pwd_len = (pwd_len &gt; MAX_SYSKEY_PWD) ? MAX_SYSKEY_PWD : pwd_len;
 
  MD5_Init(&amp;ctx);
  MD5_Update(&amp;ctx, pwd, pwd_len);
  MD5_Final(syskey, &amp;ctx);
}
</code></pre>
<p>Enter the wrong password 3 times and you&#8217;ll receive the following error.</p>
<p><strong>&#8220;System error: Lsass.exe&#8221;<br />
&#8220;When trying to update a password the return status indicates that the value provided as the current password is not correct.&#8221;</strong></p>
<p>This message appears because the LSA database key fails to decrypt but I wanted to know how exactly this password was authenticated.</p>
<p>Between XP and Vista, the LSA database got a major upgrade so you may see something else on post-XP systems.</p>
<p>If you were to attempt recovery through the LSA database, it would not only be much slower, it&#8217;s more complicated and because there&#8217;s a simpler way, I&#8217;m not going to cover it.</p>
<h2>SAM Database</h2>
<p>The SAM database is stored in <strong>%SystemRoot%\System32\config\SAM</strong> which as you probably know contains local user and group information, including encrypted NTLM/LM hashes.</p>
<p>Windows reads the value of <strong>F</strong> under <strong>SAM\Domains\Account</strong> and using the System key, decrypts the Sam key.</p>
<p>The structure of the <strong>F</strong> value isn&#8217;t documented but I&#8217;ve put together what I *think* is close enough to the original based on some <a href="http://msdn.microsoft.com/en-us/library/cc245476.aspx">MSDN documentation</a> and analyzing code in <strong>SAMSRV.DLL</strong> which is where the decryption occurs.</p>
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace;color: #000000;background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px;overflow: auto;width: 100%"><code>#define SYSTEM_KEY_LEN   16
 
#define QWERTY &quot;!@#$%^&amp;*()qwertyUIOPAzxcvbnmQQQQQQQQQQQQ)(*@&amp;%&quot;
#define DIGITS &quot;0123456789012345678901234567890123456789&quot;

#define SAM_KEY_LEN      16
#define SAM_SALT_LEN     16
#define SAM_CHECKSUM_LEN 16

typedef struct _SAM_KEY_DATA {
  uint32_t Revision;
  uint32_t Length;
  uint8_t Salt[SAM_SALT_LEN];
  uint8_t Key[SAM_KEY_LEN];
  uint8_t CheckSum[SAM_CHECKSUM_LEN];
  uint32_t Reserved[2];
} SAM_KEY_DATA, *PSAM_KEY_DATA;

typedef enum _DOMAIN_SERVER_ENABLE_STATE {
  DomainServerEnabled = 1,
  DomainServerDisabled
} DOMAIN_SERVER_ENABLE_STATE, *PDOMAIN_SERVER_ENABLE_STATE;

typedef enum _DOMAIN_SERVER_ROLE {
  DomainServerRoleBackup  = 2,
  DomainServerRolePrimary = 3
} DOMAIN_SERVER_ROLE, *PDOMAIN_SERVER_ROLE;

typedef struct _OLD_LARGE_INTEGER {
  unsigned long LowPart;
  long HighPart;
} OLD_LARGE_INTEGER, *POLD_LARGE_INTEGER;

#pragma pack(4)
typedef struct _DOMAIN_ACCOUNT_F {
  uint32_t Revision;
  uint32_t unknown1;
  
  OLD_LARGE_INTEGER CreationTime;
  OLD_LARGE_INTEGER DomainModifiedCount;
  OLD_LARGE_INTEGER MaxPasswordAge;
  OLD_LARGE_INTEGER MinPasswordAge;
  OLD_LARGE_INTEGER ForceLogoff;
  OLD_LARGE_INTEGER LockoutDuration;
  OLD_LARGE_INTEGER LockoutObservationWindow;
  OLD_LARGE_INTEGER ModifiedCountAtLastPromotion;
  
  uint32_t NextRid;
  uint32_t PasswordProperties;
  uint16_t MinPasswordLength;
  uint16_t PasswordHistoryLength;
  uint16_t LockoutThreshold;
  uint16_t unknown2;
  
  DOMAIN_SERVER_ENABLE_STATE ServerState;
  DOMAIN_SERVER_ROLE ServerRole;
  
  uint8_t UasCompatibilityRequired;
  uint32_t unknown3[2]; 
  
  SAM_KEY_DATA keys[2];
  uint32_t unknown4;
} DOMAIN_ACCOUNT_F, *PDOMAIN_ACCOUNT_F;
#pragma pack()

NTSTATUS DecryptSamKey(PSAM_KEY_DATA key_data, uint8_t syskey[]) {
  MD5_CTX ctx;
  RC4_KEY key;
  uint8_t dgst[MD5_DIGEST_LEN];
  
  // create key with salt and decrypt data
  MD5_Init(&amp;ctx);
  MD5_Update(&amp;ctx, key_data-&gt;Salt, SAM_SALT_LEN);
  MD5_Update(&amp;ctx, QWERTY, strlen(QWERTY) + 1);
  MD5_Update(&amp;ctx, syskey, SYSTEM_KEY_LEN);
  MD5_Update(&amp;ctx, DIGITS, strlen(DIGITS) + 1);
  MD5_Final(dgst, &amp;ctx);
  
  RC4_set_key(&amp;key, MD5_DIGEST_LEN, dgst);
  RC4(&amp;key, SAM_CHECKSUM_LEN + SAM_KEY_LEN, 
      key_data-&gt;Key, key_data-&gt;Key);
  
  // verify decryption was successful by generating checksum
  MD5_Init(&amp;ctx);
  MD5_Update(&amp;ctx, key_data-&gt;Key, SAM_KEY_LEN);
  MD5_Update(&amp;ctx, DIGITS, strlen(DIGITS) + 1);
  MD5_Update(&amp;ctx, key_data-&gt;Key, SAM_KEY_LEN);
  MD5_Update(&amp;ctx, QWERTY, strlen(QWERTY) + 1);
  MD5_Final(dgst, &amp;ctx);
  
  // compare with checksum and return status
  if (memcmp(dgst, key_data-&gt;CheckSum, SAM_CHECKSUM_LEN) == 0) {
    return STATUS_SUCCESS;
  }
  return STATUS_WRONG_PASSWORD;
}
</code></pre>
<p>NOTE: The strings didn&#8217;t format well for the blog but if you plan on using, let me know.</p>
<p>As you can see above, the Sam key is decrypted using System key and then a checksum is generated and compared with that stored in <strong>SAM_KEY_DATA</strong><br />
If they match, authentication succeeded, return <strong>STATUS_SUCCESS</strong> else <strong>STATUS_WRONG_PASSWORD</strong></p>
<p>That&#8217;s pretty much how you can brute force the System Key when auth mode 1 is selected.</p>
<h2>Recovery</h2>
<p>Assuming you can read the <strong>F</strong> value from <strong>SAM</strong> hive, recovery is straight forward enough with the right libraries/code.</p>
<p>Following is just some pseudo code to demonstrate flow of recovery using dictionary attack.</p>
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace;color: #000000;background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px;overflow: auto;width: 100%"><code>    sam = openfile(&quot;offline_system\Windows\config\SAM&quot;);
   data = readreg(sam, &quot;SAM\Domains\Account&quot;, &quot;F&quot;)
 
  words = openfile(&quot;dictionary.txt&quot;)
 
  while (readfile(words, pwd)) {
    pwd2key(pwd, syskey)
    if (DecryptSamKey(data-&gt;keys[0], syskey) == STATUS_SUCCESS) {
      print &quot;Found password: &quot; + pwd
      break;
    }
  }
  closefile(words)
  closefile(sam)
</code></pre>
<p>LSA and NTDS algorithms call a hash function 1000 times during creation<br />
of the encryption/decryption key while SAM algorithm doesn&#8217;t use any.</p>
<p>It&#8217;s not a vulnerability but could be useful to know some day.</p>
]]></content:encoded>
			<wfw:commentRss>http://insecurety.net/?feed=rss2&#038;p=768</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tool Release: phpkit 1.0 Web Backdoor</title>
		<link>http://insecurety.net/?p=757&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tool-release-phpkit-1-0-web-backdoor</link>
		<comments>http://insecurety.net/?p=757#comments</comments>
		<pubDate>Mon, 11 Feb 2013 10:29:19 +0000</pubDate>
		<dc:creator>infodox</dc:creator>
				<category><![CDATA[File Inclusion]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Remote Code Execution]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[maintaining access]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[shell access]]></category>
		<category><![CDATA[trojan]]></category>
		<category><![CDATA[webshell]]></category>

		<guid isPermaLink="false">http://insecurety.net/?p=757</guid>
		<description><![CDATA[This is the (about bloody time too) release of the &#8220;PHPKit&#8221; PHP backdooring tool I was working on in my free time over the past while. While not as advanced as &#8220;proper&#8221; web backdoors such as &#8220;weevely&#8221;, or &#8220;webhandler&#8221;, I &#8230; <a href="http://insecurety.net/?p=757">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This is the (about bloody time too) release of the &#8220;PHPKit&#8221; PHP backdooring tool I was working on in my free time over the past while.</p>
<div id="attachment_760" class="wp-caption aligncenter" style="width: 1376px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/02/2013-02-11-021628_1366x768_scrot.png"><img class="size-full wp-image-760" alt="phpkit" src="http://insecurety.net/wordpress/wp-content/uploads/2013/02/2013-02-11-021628_1366x768_scrot.png" width="1366" height="768" /></a><p class="wp-caption-text">phpkit</p></div>
<p>While not as advanced as &#8220;proper&#8221; web backdoors such as &#8220;weevely&#8221;, or &#8220;webhandler&#8221;, I feel PHPkit is something &#8220;interesting&#8221; to say the least.</p>
<p>Unlike most PHP backdoors, phpkit&#8217;s trojan contains no unusual function calls like &#8220;System&#8221; or &#8220;eval&#8221;. The only things it does are an ini_set and &#8220;include&#8221;. All &#8220;suspicious&#8221; PHP calls are made at runtime in-memory <img src='http://insecurety.net/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
This, I feel, makes it have a far smaller footprint on the target server. All payloads are sent as raw PHP in raw POST requests, where php://input passes them to the &#8220;include&#8221; function. It uses ini_set to attempt to enable allow_url_include if such is disabled, but I am working on a better workaround at the moment than this.<br />
Likely something to do with fopen and suchlike&#8230; Will figure it out for the next version <img src='http://insecurety.net/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I actually got the idea to write this from when I was writing an exploit for the PHP-CGI bug, as shown here: <a href="http://insecurety.net/?p=705">http://insecurety.net/?p=705</a></p>
<p>This tools &#8220;shell&#8221; is somewhat rudimentary, in that it (unlike Weevely), does not store CWD, etc. It simply executes commands, which is what I designed it to do. It does, however, have a rather nice file upload stager, which I was rather happy with.<br />
It is reasonably reliable for an experiment, and certainly is interesting in that the evil code is ran entirely in memory <img src='http://insecurety.net/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Anyways, enough talking about how awesome it is (it really is not that awesome <img src='http://insecurety.net/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  ), time for some demos and useage.</p>
<p>So, obviously you have placed odd.php on the target server somewhere, somehow. What next?</p>
<p>Well, the only mandatory argument is &#8211;url=&#8217;URL&#8217;, where the URL is the URL to the odd.php file (or whatever you called it). By default, the tool will attempt code execution and pop you a shell if possible.<br />
If not possible, it simply exits.</p>
<p>The &#8211;mode operator allows you to choose what mode you want to use. By default, the &#8220;SHELL&#8221; mode is chosen, however &#8220;UPLOAD&#8221; is another option. If you choose &#8220;UPLOAD&#8221;, you must specify a local and remote file.<br />
To specify the local file (File to upload), use &#8211;lfile=&#8221;PATH TO FILE&#8221;<br />
To specify where to write the file, use &#8211;rfile=&#8221;PATH TO PLACE FILE&#8221;</p>
<p>This should upload the file cleanly and rapidly, allowing you to move on with the pwning of things.</p>
<p>Here is a screenshot of it in shell mode</p>
<div id="attachment_758" class="wp-caption aligncenter" style="width: 1376px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/02/2013-02-11-021328_1366x768_scrot.png"><img class="size-full wp-image-758" alt="phpkit shell mode" src="http://insecurety.net/wordpress/wp-content/uploads/2013/02/2013-02-11-021328_1366x768_scrot.png" width="1366" height="768" /></a><p class="wp-caption-text">Shell Mode</p></div>
<p>And here is a screenshot of file uploading.</p>
<div id="attachment_759" class="wp-caption aligncenter" style="width: 1376px"><a href="http://insecurety.net/wordpress/wp-content/uploads/2013/02/2013-02-11-021613_1366x768_scrot.png"><img class="size-full wp-image-759" alt="phpkit upload mode" src="http://insecurety.net/wordpress/wp-content/uploads/2013/02/2013-02-11-021613_1366x768_scrot.png" width="1366" height="768" /></a><p class="wp-caption-text">phpkit upload mode</p></div>
<p>Well, that&#8217;s all for now. As you can see, it is more of an experiment than a real software by any stretch of the imagination, however, if you find it useful let me know <img src='http://insecurety.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You may download it here: <a href="http://insecurety-research.googlecode.com/files/phpkit-1.0.tar.gz">phpkit-1.0.tar.gz</a> <img src='http://insecurety.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://insecurety.net/?feed=rss2&#038;p=757</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
