<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Darren Martyn on Medium]]></title>
        <description><![CDATA[Stories by Darren Martyn on Medium]]></description>
        <link>https://medium.com/@infodox?source=rss-d259981f34f1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5_tVeSEeJ1btybmH.png</url>
            <title>Stories by Darren Martyn on Medium</title>
            <link>https://medium.com/@infodox?source=rss-d259981f34f1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 02:37:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@infodox/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Pwning Hacker Toys: RCE in “Totally-Not-A-Virus”.]]></title>
            <link>https://medium.com/@infodox/pwning-hacker-toys-rce-in-totally-not-a-virus-1a45d9a99ee?source=rss-d259981f34f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a45d9a99ee</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Darren Martyn]]></dc:creator>
            <pubDate>Wed, 29 Nov 2017 10:28:10 GMT</pubDate>
            <atom:updated>2017-11-29T10:28:10.918Z</atom:updated>
            <content:encoded><![CDATA[<p>So further along the magic adventure of finding RCE holes in skid toys, I found another hole in another shitty piece of malware.</p><p><a href="https://github.com/EinBaum/Totally-Not-A-Virus/">Totally-Not-A-Virus</a> is a keylogger/screenshot thing/remote-command running magic bundle of laughs that features the following:</p><ul><li>Uses Tor for C&amp;C!</li><li>Key logging &amp; screenshots</li><li>Copies itself into autostart locations</li><li>Remote command execution</li><li>Remote error log</li><li>File Manager</li><li>Great web interface with user overview and command console</li><li><strong>Remote Code Execution in the admin panel.</strong></li></ul><p>So we want to look at “p.php”, which seemingly is where the trojan beacons home to… And within seconds, we find an RCE…</p><p>So here is the affected source code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/343a08a5e06d81ef64f6822c4acc4d51/href">https://medium.com/media/343a08a5e06d81ef64f6822c4acc4d51/href</a></iframe><p>Basically, the “mac” POST variable gets used to create a filename (file_data). We control this, so we set it to “urmum.php” in our exploit, but any value will do. This will create a file named “data/urmum.php”.</p><p>Whatever is in the “d” parameter, is data that will be written to this file. So in here goes our usual eval webshell.</p><p>The predictable ensues and we get a shell on the target in 1 request. Hiding behind Tor isn’t so useful if we get a shell on your secret hidden C&amp;C server mate…</p><p>As usual, we have a working exploit available here…</p><p><a href="https://github.com/XiphosResearch/exploits/blob/master/TotallyNotARCE/totallynotarce.py">XiphosResearch/exploits</a></p><p>You may notice its super similar to the last bug…</p><p>And also as usual, we have a screenshot showing successful exploitation of a test setup…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*2VLeBHA4WehKRAXJMVJ7BQ.png" /><figcaption>owned and exposed.</figcaption></figure><p>Anyway, more of the same to come. Go forth and expunge some skids or something, I guess. Or don’t.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a45d9a99ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pwning Hacker Toys: RCE in “HydraPHP”.]]></title>
            <link>https://medium.com/@infodox/pwning-hacker-toys-rce-in-hydraphp-f439f6af4dc6?source=rss-d259981f34f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f439f6af4dc6</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[exploit]]></category>
            <dc:creator><![CDATA[Darren Martyn]]></dc:creator>
            <pubDate>Tue, 28 Nov 2017 15:41:15 GMT</pubDate>
            <atom:updated>2017-11-28T15:41:15.225Z</atom:updated>
            <content:encoded><![CDATA[<p>So I was looking at this amusing RAT named <a href="https://github.com/abazad/PHPRat">HydraPHP</a> on Github, figuring it probably would have some bugs in the C&amp;C. Its written in some godawful Visual Basic shite, and uses a PHP script to shuffle commands/data to and from the “Controller tool” and the implant.</p><p>Anyway, within a few minutes, we found ourselves a spicy remote code execution vulnerability that gives us a shell on the server hosting the PHP script used for C&amp;C. I’ll outline the bug below and provide an exploit you can go and use.</p><p>So, the vuln we found is a “Write whatever the fuck you want into a file whose name/extension you control” bug, so basically, a shell upload. If you send a request to the C&amp;C script with the right parameters and a hardcoded password, you can basically force it to create a file and dump the stuff you submitted into the file.</p><p>The parameters required are the following: “pw”, “cmd”, “os”, “hwid”, “country”, and “username”. The only ones we care about are the “cmd” and “hwid” commands. The “pw” needs to be set to “TaylorHak” (hardcoded auth…), and others can be filled with junk.</p><p>The “hwid” parameter ends up being used as a filename, into which we can shove some stuff. So, we set this to “rekt.php”.</p><p>The “cmd” parameter gets split (using a comma as a delimiter) into 3 fields. To write content into the “hwid” file, we need to set the first field to “Admin”, the second to “WriteCMD”, and the third to our PHP backdoor.</p><p>So we end up with the following exploit (click link to go to exploit source…).</p><p><a href="https://github.com/XiphosResearch/exploits/blob/master/hydrapwn/hydrapwn.py">XiphosResearch/exploits</a></p><p>And here is the mandatory screenshot showing the magic in action ;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*t7_IVQZfOB02rBEQGpvUgQ.png" /><figcaption>get rekt scrubs</figcaption></figure><p>So yeah. Turns out that finding bugs in shitty RAT’s C&amp;C panels is like shooting fish in a barrel. Skids can’t code, etc.</p><p>More of these to come…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f439f6af4dc6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pwning Hacker Toys: Persistent XSS in QuickShell.]]></title>
            <link>https://medium.com/@infodox/pwning-hacker-toys-persistent-xss-in-quickshell-b696a73bd60e?source=rss-d259981f34f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b696a73bd60e</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[exploit]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[xs]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Darren Martyn]]></dc:creator>
            <pubDate>Mon, 27 Nov 2017 14:09:55 GMT</pubDate>
            <atom:updated>2017-11-27T14:09:55.614Z</atom:updated>
            <content:encoded><![CDATA[<p>So this is a fun, but short, one. I was playing about with the C&amp;C server (written in PHP…) for a little remote admin tool called <a href="https://github.com/portwatcher/QuickShell">QuickShell</a>, when I realized that it seemed like pwning it would be pretty easy — after all, it is PHP.</p><p>Looking at how bots beacon home, they basically send a GET request to “/connect.php” with the parameters “name” and “ip”. These fields are freetext, and get reflected out into the admin panel when viewing the list of bots and suchlike.</p><p>Anyway, after setting it up, which was a bit of a chore, I decided to try something mildly amusing. What happens if we put a script tag in the “name” field, prefixed with “/&gt;… And then view the “Bots” list.</p><p>So away we go with a little bit of curl… Server sends back “0” indicating the INSERT query to the database was successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXtzRzUqzll3mX9-0aA6PQ.png" /><figcaption>yeah, this screencap shows nothing of interest except “we fired off a request using curl”</figcaption></figure><p>So we then go to the admin panel, log in, and click “view bots”. Our XSS pops.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G7bvC57X7Zv0e4T4HAvU4Q.png" /><figcaption>and away it pops.</figcaption></figure><p>Now, this isn’t exactly RCE, however, with some cleverness you can almost certainly inject a nice script that takes over the bots… Or just pwns the botmaster ;)</p><p>Now, we also found a second persistent XSS bug. When bots beacon home and send the botmaster command output, it gets shoved into a file named “output.txt”.</p><p>Whatever you send the “/cmd.php” page in a POST requests “output” variable, gets written to this file.</p><p>When the botmaster reads this file, it gets read with ‘readfile(“output.txt”);. So if you were to inject in a script tag… The predictable happens. If only they were using include() instead… Ah well.</p><p>Anyway, I figure I’ll keep on looking for amusing bugs in “hacker” and “red team” tools/toys. Seems there is an abundance of them to be found.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b696a73bd60e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pwning Red Team Toys: CrunchRAT RCE]]></title>
            <link>https://medium.com/@infodox/pwning-red-team-toys-crunchrat-rce-ce83e1d09ae9?source=rss-d259981f34f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce83e1d09ae9</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Darren Martyn]]></dc:creator>
            <pubDate>Fri, 24 Nov 2017 15:10:19 GMT</pubDate>
            <atom:updated>2017-11-24T15:10:19.733Z</atom:updated>
            <content:encoded><![CDATA[<p>Breaking red team toys is a fun game. Usually its the red team who are ruining everyone else’s day, so, why not give them a little something back?</p><p>Anyways, I was scrolling through the Githubs when I came across this <a href="https://github.com/t3ntman/CrunchRAT">CrunchRAT</a> thing by <a href="https://twitter.com/t3ntman">t3ntman</a>. Looked interesting. A neat little implant for use on red team engagements. It uses PHP/MySQL for the C&amp;C panel, and the implant itself is in C#.</p><p>So, I decided to take a look at the PHP code first. It uses PDO, which is great, prevents all the nasty SQL injections. It also specifies in the readme file the following…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*RPirkvHhow1T9_rWRVAWeA.png" /><figcaption>seems like good advice.</figcaption></figure><p>Obviously, it would be a Pretty Bad Idea to allow random crap to be uploaded to your webroot. I had a funny feeling though, so I decided to take a look at “update.php” in the specific bit for accepting uploads from implanted hosts…</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e0fe537c7fa0416184e7bb27e6bc4d30/href">https://medium.com/media/e0fe537c7fa0416184e7bb27e6bc4d30/href</a></iframe><p>Ok. So we know the following:</p><ul><li>$downloadsPath is not gonna be in the webroot, assuming you didn’t massively fuck things up.</li><li>We control $hostname variable and the name/extension/content of the uploaded file.</li><li>We can hit this with no auth whatsoever, we just have to vaguely look like an implant beaconing home.</li></ul><p>Now, for the more astute in the audience, you probably see where this is all going…</p><p>If we can find somewhere to write to in the webroot, we can use directory traversal in the $hostname parameter to traverse out of the nice, safe, <strong>NOT IN WEBROOT </strong>directory untrusted implant uploads get shoved into, and drop a nice webshell into the webroot. Lovely.</p><p>So, it just so happens that the setup script provided creates a “/var/www/html/uploads” directory writable by the apache user — so trusted users can upload files to drop onto the implanted hosts.</p><p>Yeah. You know what happens next…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G6z4TpKhN_2l-9lrtYWkJQ.png" /></figure><p>You can acquire the exploit <a href="https://github.com/XiphosResearch/exploits/tree/master/CrunchRATPoison">in the usual place</a>.</p><p>Anyway, what did we learn from this? Well, we learned a few things…</p><ol><li>“Safe” upload directories… Aren’t.</li><li>Red team folks write tools that are fun to audit.</li><li>Its really worthwhile examining other security folks code from a security angle.</li></ol><p>TL;DR: Audit thy own toolings.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce83e1d09ae9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PureVPN: A bundle of WTF.]]></title>
            <link>https://medium.com/@infodox/purevpn-a-bundle-of-wtf-a1e832c78a8e?source=rss-d259981f34f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1e832c78a8e</guid>
            <category><![CDATA[vpn]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Darren Martyn]]></dc:creator>
            <pubDate>Tue, 14 Nov 2017 00:00:34 GMT</pubDate>
            <atom:updated>2017-11-14T00:00:34.638Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Note: this was originally going on my gh-pages site, but I seem to have broken the theme there, so figured I’d try put it on Medium Dot Com. It lay in drafts for a bit and I kinda found other shit to do and never finished working on this so figure it’s time to hit publish.</em></p><p>So I decided I’d take a look at PureVPN quickly today, because they are a VPN provider <a href="https://torrentfreak.com/purevpn-logs-helped-fbi-net-alleged-cyberstalker-171009/">who claim no logs, but snitch on their users to the feds with magic logs…</a> And frankly, it was a Thursday and I am bored.</p><p>Sure, they snitched on a dude who was probably a shit human being (no one likes stalkers, to be fair) and all, but really, if you are a VPN provider and you lie about having a “No Logs” policy… You are going to get whats coming.</p><p>So after I jumped through the hoops of setting up an account there, I decided to look at the “client software” they offer. There are clients for Windows, OSX, etc, along with a DD-WRT applet. Because generally embedded things are fun, I figured I’d look at the “applet” first. I also took a quick look at the Windows client, and got lost in a maze of “what the fuck?”…</p><p><strong>Part the First: Looking (briefly) at the DD-WRT part.</strong></p><p>So when we go to download some nice router gubbins to make ourselves a SUPER SECURE VPN ROUTER, we see the following…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*VYP3KexG51Yw57eMm_-pdA.png" /><figcaption>oh god no.</figcaption></figure><p>Oh boy. So what is this downloading? Well, its a shell script, that does some crap and downloads more shit.</p><pre>PUREVPN_APPLET_URL=&#39;http://158.69.194.117&#39;<br>...<br>PUREVPN_BRANCH=&#39;main&#39;<br>ARCH=$(uname -m)<br>if [ -e /www/tomato.js ]; then FIRMWARE=&quot;tomato&quot;<br>else FIRMWARE=&quot;ddwrt&quot;<br>fi<br>...<br>PUREVPN_VERSION_URL=&quot;$PUREVPN_APPLET_URL/cgi-bin/applet-cgi.py?action=version&amp;arch=$ARCH&amp;firmware=$FIRMWARE&amp;branch=$PUREVPN_BRANCH&quot;<br>PUREVPN_INSTALL_URL=&quot;$PUREVPN_APPLET_URL/cgi-bin/applet-cgi.py?action=download&amp;arch=$ARCH&amp;firmware=$FIRMWARE&amp;branch=$PUREVPN_BRANCH&quot;<br>PUREVPN_HWCHECK_URL=&quot;$PUREVPN_APPLET_URL/cgi-bin/applet-cgi.py?action=hwcheck&amp;arch=$ARCH&amp;firmware=$FIRMWARE&amp;branch=$PUREVPN_BRANCH&quot;<br>...<br>BOOTSTRAP_ENTRY=&quot;<br>while ! [ -f $PUREVPN_TMP/.lock ] ; do<br>    mkdir -p $PUREVPN_ROOT/..;<br>    wget \&quot;$PUREVPN_INSTALL_URL\&quot; -q -O - | gunzip -c | tar -x -C $PUREVPN_ROOT/..;<br>    $PUREVPN_ROOT/www/scripts/purevpn_startup.sh;<br>    sleep 5;<br>done</pre><p>So basically, it downloads more crap over plaintext HTTP from this webserver somewhere and installs it on your router. But what does it install?</p><pre>purevpn$ ls www/<br>cgi-bin                             iframeResizer.min.js  logo.png    mypage2.sh  purevpn_ddwrt.css  purevpn.js  stylesRouter.css<br>iframeResizer.contentWindow.min.js  lang.js               mypage1.sh  mypage3.sh  purevpn_ddwrt.js   scripts     template.html<br>purevpn$</pre><p>Basically a bunch of shell scripts to add web page functionality (that all run as root, just because), that call out to something in cgi-bin…</p><p>In “cgi-bin” there exists a nice ARM binary that… Well, we ran out of time. Its written in C++, has a bunch of janky shit in it, and I just wasn’t in the mood to reverse it over the weekend after all.</p><p>TL;DR of Router Version:<br>- Installer is “Run this shell script from the internet over a plaintext connection”.<br>- Downloads and executes more shit over the internet and installs shit over the internet that way, via plaintext.<br>- No code signing or checking whatsoever on the shit it does download.<br>- Funky ARM binary that smells funny.</p><p><strong>Part the Second: Windows WTF Wonderland.</strong></p><p>So I chucked their Windows installer onto a Windows 7 VM I use for testing shite software. First thing I noticed while installing it was that it dropped an absolute shitload of files, and took forever to install.</p><p>Given it basically relies on OpenVPN, I decided to check out what version they ship. Its 2017, and they are shipping an OpenVPN that was built in 2015, version 2.3.8, built with OpenSSL 1.0.1p. Look these up in the CVE databases at your own pleasure for a good giggle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*KSdJlgbTWRxgUVT13pPZFw.png" /><figcaption>alrighty then.</figcaption></figure><p>They create some services, so I figured I’d be a bit lazy and find an easy win here. So I checked with “<a href="https://github.com/PowerShellMafia/PowerSploit/tree/master/Privesc">PowerSploit’s PowerUp</a>” by doing “Invoke-AllChecks”, and well, we came out with some results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*5oqmI3DBcBhL4Uc7bWvVDw.png" /><figcaption>ezmode.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*bILv5PX9Lvt79HgG756p3g.png" /><figcaption>2ez4me</figcaption></figure><p>TL;DR: Use any of the following to get privesc on a box with the PureVPN client.</p><pre>Invoke-ServiceAbuse -Name &#39;OpenVPNService&#39;<br>Invoke-ServiceAbuse -Name &#39;sevpnclient&#39;<br>Install-ServiceBinary -name &#39;sevpnclient&#39;</pre><p>I figured at this point, I’d just move on. BUT WAIT. THERE IS MORE!</p><p>So I had a quick look at the files it drops in “C:\Program Files (x86)\PureVPN” and spotted “Injector32.exe” and “Injector64.exe”. What the fuck are these? Well, one way to find out… We chuck them into IDA and have a quick gander. Then I realised it was written in .NET, so I broke open dnSpy, which does a better job of handling .NET than IDA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*87MgQdPBuu939WgBAFPXJA.png" /><figcaption>what the everliving fuck.</figcaption></figure><p>What the fuck its got a DLL injector that injects something called “Split.dll” (or “Split_64.dll”) into something. I took a brief look at it, and basically, what happens is the following.</p><p>1. It takes 1 argument, which is a process to launch.<br>2. It launches this process, suspends it, opens its process memory, chucks in the “Split.dll”, creates a remote thread for it, and then continues execution.<br>3. Exits. DLL is now injected.</p><p>Effectively, if you put your “Split.dll” (for x86), or “Split_64.dll” in the same directory as “Injector$ARCH.exe” and run the injector program with a path to something to inject into, you win the game and have a DLL injected somewhere. I tested this by copying the injector to “C:\work\”, putting a meterpreter DLL as “Split.dll” into there, and running it with the path to notepad.exe as the only argument. It worked. I got a meterpreter. Sadly, the DLL injectors aren’t codesigned…</p><p>So what have we learned? PureVPN ships some awesome shit we can use for malware reasons!</p><p>I didn’t bother looking any further after this. I want to spend some time reversing the DLL it injects, but somehow I ended up having some actual work to do instead. I also want to know why its injecting crap into things…</p><p>Anyway, in conclusion: The PureVPN client software for Windows and routers is shady as fuck. On Windows, the installer unpacks to about 80mb of crap — all to run OpenVPN.</p><p>I’d usually say “just use the VPN config files manually instead of their shonky client”, but all things considered, so much smells bad here that I just recommend not using their service at all.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1e832c78a8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>