<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace V5 Site Server v5.13.594-SNAPSHOT-1 (http://www.squarespace.com) on Wed, 09 Sep 2026 22:37:53 GMT--><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>News</title><link>http://www.tekdefense.com/news/</link><description></description><lastBuildDate>Wed, 05 Oct 2016 15:12:28 +0000</lastBuildDate><copyright></copyright><language>en-US</language><generator>Squarespace V5 Site Server v5.13.594-SNAPSHOT-1 (http://www.squarespace.com)</generator><item><title>Network Challenge - 001 - Solution</title><category>Network</category><category>Network Security</category><category>News</category><category>Ppcap</category><category>ccontest</category><category>network analsyis</category><dc:creator>Admin</dc:creator><pubDate>Mon, 03 Oct 2016 12:09:06 +0000</pubDate><link>http://www.tekdefense.com/news/2016/10/3/network-challenge-001-solution.html</link><guid isPermaLink="false">830757:9759328:35783767</guid><description><![CDATA[<p>I Wanted to send a big thanks out to everyone who sent solutions in for the <a href="http://www.tekdefense.com/news/2016/10/3/network-challenge-001-solution.html">Network challenge</a>. While there were many responses, two (2) stood out amongst the rest. I don't plan on doing prizes for all of these contests, but I was so impressed by these responses, that I wanted to do something special on this ocassion. The winners of this first challenge are:</p>

<ul>
<li>First Place: @dfir_it ($150 amazon Gift Card) Solution is below</li>
<li>Second Place: @CYINT_DUDE ($50 Amazon Gift Card)  <a href="http://www.cyintanalysis.com/tekdefense-pcap-challenge-write-up/">Solution</a></li>
</ul>

<p>The first place solution is so well written, that I figured it was worth posting in it's entirety here (with permission from the author of course). See below for the solution, and keep any eye on dfir.it where the author intends to post more details on how he arrived at the answers you see below.</p>

<h2>@dfir_it Winning Contest Submission:</h2>

<script src="https://gist.github.com/1aN0rmus/f59de12be167536f013461debef5a474.js"></script>
]]></description><wfw:commentRss>http://www.tekdefense.com/news/rss-comments-entry-35783767.xml</wfw:commentRss></item><item><title>Network Challenge - 001 - Linux</title><category>Network</category><category>Network Security</category><category>News</category><category>Ppcap</category><category>Snort</category><category>contest</category><category>network analsyis</category><dc:creator>Admin</dc:creator><pubDate>Fri, 16 Sep 2016 13:04:34 +0000</pubDate><link>http://www.tekdefense.com/news/2016/9/16/network-challenge-001-linux.html</link><guid isPermaLink="false">830757:9759328:35773548</guid><description><![CDATA[<p>One of my favorite sites is&nbsp;"<a href="http://www.malware-traffic-analysis.net/">Malware Traffic Analysis</a>" where the author routinely posts network challenges. In the spirit of contributing to this effort of providing material for analysts to sharpen their skills, I developed a challenge focused around a popular scenario I often come across in research and other analysis efforts. As a heads up, any malware you may come across in the analysis of this PCAP is in fact real malware. Please take care in how you analyze.&nbsp;</p>
<p>When reviewing this PCAP and writing your response please keep in mind what you would really want in an investigation. The questions I ask at the end of this article are intentionally vague, as I didn't want to give too much away with the questions. What I am hoping to see in responses is that the analysts are able to adequately tell a story of what likely occurred, identify network and host indicators that can help further scope this incident, and write detection rules in the detection languages of their choice to find future instances of this activity.&nbsp;</p>
<p><a href="https://www.tekdefense.com/downloads/pcaps/NetChallenge_Linux.zip">PCAP DOWNLOAD</a></p>
<p><strong>The due date for submissions is September 25, 2016. Enjoy!</strong></p>
<h3>Scenario:</h3>
<p>Client provides a <a href="https://www.tekdefense.com/downloads/pcaps/NetChallenge_Linux.zip">PCAP</a> involving all traffic they have from a victim Linux server.&nbsp; A snort signature alerted for files downloaded from an HFS server. The client does not have any other context to provide. Other than the following is the Snort Signature that was alerted on:</p>
<blockquote>
<p>alert tcp any any -&gt; any any (msg:"HFS [File Download]";flow:to_client,established; content:"HFS 2.";distance:0; content:"HFS_SID="; classtype:suspicious; sid:999999; rev:1;)</p>
</blockquote>
<h3>Objective:</h3>
<ol>
<li>Determine what likely occurred based on the evidence from the PCAP.</li>
<li>Identify any network and/or host artifacts that could be used to scope this incident further.</li>
<li>If applicable, write detection signatures (snort/suricata/yara) to increase coverage for this type of activity.&nbsp;</li>
</ol>
<h3>Submissions:</h3>
<p>Feel free to submit your responses directly to NetChallenge[at]tekdefense.com or comment on this blog post with a link to your own article with a response. I'll review responses, and perhaps give out a few prizes to those with great writeups.</p>]]></description><wfw:commentRss>http://www.tekdefense.com/news/rss-comments-entry-35773548.xml</wfw:commentRss></item><item><title>Automater Update .21</title><category>Automater</category><category>News</category><category>python</category><dc:creator>Admin</dc:creator><pubDate>Fri, 20 Nov 2015 13:30:20 +0000</pubDate><link>http://www.tekdefense.com/news/2015/11/20/automater-update-21.html</link><guid isPermaLink="false">830757:9759328:35539559</guid><description><![CDATA[<h3>Keeping Automater up to date:</h3>
<div><strong>Download the latest version:&nbsp;<a href="https://github.com/1aN0rmus/TekDefense-Automater">https://github.com/1aN0rmus/TekDefense-Automater</a></strong></div>
<div>One of the more outstanding modifications added to version .21 of Automater is that users no longer need to worry about keeping on top of the GitHub site to ensure all of the python modules are the latest version. With a small addition of a &ndash;Vv in the command line arguments, Automater will check if the local python modules match the modules on the TekDefense Automater GitHub site. The &ndash;V (--vercheck) argument is actually the argument that tells Automater to check the modules, and the small &ndash;v (--verbose) is required to make Automater report the outcome. If the files don&rsquo;t match, Automater will send a notification to stdout to alert the user to which module has been modified, so up to date modules can be pulled if the user wants. The &ndash;v (--verbose) option can be used to turn on or off any information sent to stdout to either silence or allow Automater to talk to stdout.</div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 700px;" src="http://www.tekdefense.com/storage/post-images/VersionCheck.png?__SQUARESPACE_CACHEVERSION=1448027059787" alt="" /></span></span></div>
<div id="_mcePaste"></div>
<div id="_mcePaste">Arguably an even better option added is yet another &ldquo;version&rdquo; check of sorts. The sites.xml file is still required locally so that Automater can get instructions on what sites to check and what regexs to report upon. However, a new tekdefense.xml file is also checked for and utilized if it is found locally. The significance of this is that with a &ndash;r (--refreshxml) switch included in the command line argument call, Automater will check the TekDefense Automater GitHub site and pull the tekdefense.xml file for use. If the &ndash;r switch is utilized, and the local tekdefense.xml file is found to be different on the local machine, the modified (updated) file on GitHub will be pulled and utilized. This ensures that you have the ability to do your own calls with the sites.xml file, while ALSO maintaining constant calls to sites and checks utilized by the TekDefense crew. Together this gives the Automater use the best coverage with no modifications required or manual processes followed.</div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 700px;" src="http://www.tekdefense.com/storage/post-images/XMLCheck.png?__SQUARESPACE_CACHEVERSION=1448027635474" alt="" /></span></span></div>
<div id="_mcePaste"></div>
<h3>New Requirements and what they mean:</h3>
<div id="_mcePaste"></div>
<div id="_mcePaste">The new Automater has several updates. Out of the blocks, the requests module (version 2.7 or above) is now required to run Automater. For instructions on getting the requests module if you don't already have view <a href="http://docs.python-requests.org/en/latest/user/install/">http://docs.python-requests.org/en/latest/user/install/</a>. This gives us better control of returning HTML and sets us up for further upgrades in the near future when we begin using JSON APIs and data collecting capabilities &ndash; more on this as things progress. Using requests, the default timeout of get calls to web sites has now been set to 5 seconds. This allows Automater to move on after 5 seconds of waiting for a response from a web site. However, if a web site does respond and provide some input, but the site is slow in its response time, the get request will not timeout. This timeout is only for those sites that just don&rsquo;t respond. Further refinements on this subject will continue in future upgrades. There are several bug fixes and other modifications and we will soon thread Automater to provide better response times. For instance the delay feature was fixed.</div>
<div></div>
<div>
<blockquote>
<div>.\Automater.py -h</div>
<div>usage: Automater.py [-h] [-o OUTPUT] [-b] [-f CEF] [-w WEB] [-c CSV]</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [-d DELAY] [-s SOURCE] [--proxy PROXY] [-a USERAGENT] [-V]</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [-r] [-v]</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; target</div>
<div></div>
<div>IP, URL, and Hash Passive Analysis tool</div>
<div></div>
<div>positional arguments:</div>
<div>&nbsp; target &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;List one IP Address (CIDR or dash notation accepted),</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; URL or Hash to query or pass the filename of a file</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; containing IP Address info, URL or Hash to query each</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; separated by a newline.</div>
<div></div>
<div>optional arguments:</div>
<div>&nbsp; -h, --help &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;show this help message and exit</div>
<div>&nbsp; -o OUTPUT, --output OUTPUT</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; This option will output the results to a file.</div>
<div>&nbsp; -b, --bot &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; This option will output minimized results for a bot.</div>
<div>&nbsp; -f CEF, --cef CEF &nbsp; &nbsp; This option will output the results to a CEF formatted</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; file.</div>
<div>&nbsp; -w WEB, --web WEB &nbsp; &nbsp; This option will output the results to an HTML file.</div>
<div>&nbsp; -c CSV, --csv CSV &nbsp; &nbsp; This option will output the results to a CSV file.</div>
<div>&nbsp; -d DELAY, --delay DELAY</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; This will change the delay to the inputted seconds.</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Default is 2.</div>
<div>&nbsp; -s SOURCE, --source SOURCE</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; This option will only run the target against a</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; specific source engine to pull associated domains.</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Options are defined in the name attribute of the site</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; element in the XML configuration file. This can be a</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; list of names separated by a semicolon.</div>
<div>&nbsp; --proxy PROXY &nbsp; &nbsp; &nbsp; &nbsp; This option will set a proxy to use (eg.</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy.example.com:8080)</div>
<div>&nbsp; -a USERAGENT, --useragent USERAGENT</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; This option allows the user to set the user-agent seen</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; by web servers being utilized. By default, the user-</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; agent is set to Automater/version</div>
<div>&nbsp; -V, --vercheck &nbsp; &nbsp; &nbsp; &nbsp;This option checks and reports versioning for</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Automater. Checks each python module in the Automater</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scope. Default, (no -V) is False</div>
<div>&nbsp; -r, --refreshxml &nbsp; &nbsp; &nbsp;This option refreshes the tekdefense.xml file from the</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; remote GitHub site. Default (no -r) is False.</div>
<div>&nbsp; -v, --verbose &nbsp; &nbsp; &nbsp; &nbsp; This option prints messages to the screen. Default (no</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -v) is False.</div>
</blockquote>
</div>
<div></div>
<div id="_mcePaste"></div>
<div id="_mcePaste">Specific sites (already in the sites.xml or tekdefense.xml file) can be called in case the user only wants responses from specific sites. While previous versions of Automater allowed this function for one site using the &ndash;s (--source) switch, the new version allows multiple sites to be utilized by separating the required sites with a semicolon. So in the past, if the user had a sites.xml file with the totalhash_ip entry, the user could call Automater with &ndash;s totalhash_ip and only receive information about totalhash. However, if the user now wants more than totalhash output, but not all information in the sites.xml or tekdefense.xml file(s), he could enter something like Automater &ndash;s totalhash_ip;robtex to get totalhash and robtex information. Any site within the sites.xml or tekdefense.xml ca be joined in this way using the semicolon separator between sites.</div>
<div id="_mcePaste"></div>
<div id="_mcePaste"></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 700px;" src="http://www.tekdefense.com/storage/post-images/Source.png?__SQUARESPACE_CACHEVERSION=1448029671579" alt="" /></span></span></div>
<div></div>
<div></div>
<p>&nbsp;</p>
<p>Lastly, there is now a bot output mode for those who want friendlier output for bots. For instance here is the output using Automater with -b in a skype bot.</p>
<p>&nbsp;</p>
<p><span class="full-image-block ssNonEditable"><span><img src="http://www.tekdefense.com/storage/post-images/bot.png?__SQUARESPACE_CACHEVERSION=1448030004325" alt="" /></span></span></p>]]></description><wfw:commentRss>http://www.tekdefense.com/news/rss-comments-entry-35539559.xml</wfw:commentRss></item><item><title>BSidesNola 2015 Presentation on Honeypots</title><category>Dionaea</category><category>ELK</category><category>Kippo</category><category>News</category><category>SSHPsychos</category><category>honeypot</category><dc:creator>Admin</dc:creator><pubDate>Mon, 01 Jun 2015 22:57:50 +0000</pubDate><link>http://www.tekdefense.com/news/2015/6/1/bsidesnola-2015-presentation-on-honeypots.html</link><guid isPermaLink="false">830757:9759328:35361644</guid><description><![CDATA[<p>Wow, it has been a long time since I have posted. I plan to rectify my posting frequency problems, starting now. Last weekend <a href="https://twitter.com/p4r4n0y1ng">@p4r4n0y1ng</a>&nbsp;and I (<a href="https://twitter.com/TekDefense">@TekDefense</a>) gave a presentation on Honeypots called "<span id="docs-internal-guid-721fc97f-b160-a9a6-b573-84c9093649b1">Catch More Honeys when you are fly" at <a href="http://www.securitybsides.com/w/page/91550808/BSidesNOLA%202015">BSidesNola</a>. See the slides below:</span></p>
<p style="text-align: center;"><span><span><iframe src="https://docs.google.com/presentation/d/1wCAqgJK_fnsIQ7BG9rNDufPadXdzH43ncDLEvHgoxco/embed?start=false&loop=false&delayms=15000" frameborder="0" width="480" height="299" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe></span></span></p>
<p style="text-align: left;"><span><span>I will be publishing a more detailed article on SSHPsychos soon!</span></span></p>]]></description><wfw:commentRss>http://www.tekdefense.com/news/rss-comments-entry-35361644.xml</wfw:commentRss></item><item><title>Over a year with Kippo</title><category>Kippo</category><category>News</category><category>Pipal</category><category>honeypot</category><category>python</category><category>ssh</category><dc:creator>Admin</dc:creator><pubDate>Mon, 21 Jul 2014 00:31:14 +0000</pubDate><link>http://www.tekdefense.com/news/2014/7/20/over-a-year-with-kippo.html</link><guid isPermaLink="false">830757:9759328:34929569</guid><description><![CDATA[<p><strong>UPDATE: </strong>After posting <a href="https://twitter.com/ikoniaris">@ikoniaris</a> of <a href="http://www.tekdefense.com/news/2012/12/27/honeydrive-review.html">Honeydrive</a> and <a href="http://bruteforce.gr/">Bruteforce</a> fame recommended running <a href="https://github.com/ikoniaris/kippo-scripts">these</a>. <a href="https://gist.github.com/1aN0rmus/9821aecd8b9dc521817d">Here are the results</a> of kippo-stats.pl created by Tomasz Miklas and&nbsp;Miguel jacq.</p>
<p>As many of you know from previous posts, I am a big fan of <a href="http://www.tekdefense.com/news/tag/kippo">honeypots</a>, particularly <a href="https://github.com/desaster/kippo">Kippo</a>. My main Kippo instance sitting in AWS has been online for over a year now. Let's take a look at what we have captured and learned over this past year. If you want to validate any of these statistics I have made the raw logs available for <a href="http://www.tekdefense.com/downloads/logs/">download</a>.</p>
<h3>General Stats:</h3>
<p>Unique values (<a href="https://gist.github.com/1aN0rmus/d56a5e53af841a1a5d2f">135526 connections</a>):</p>
<p><a href="https://docs.google.com/spreadsheets/d/1DW2QhYib0Yt0vpwzJzcCoZu4kepgNShSabxcc8c0ABg/edit?usp=sharing">*csv with geo location</a></p>
<p><span class="full-image-block ssNonEditable"><span><img style="width: 650px;" src="http://www.tekdefense.com/storage/KippoGeoIPMap.JPG?__SQUARESPACE_CACHEVERSION=1405967233041" alt="" /></span></span></p>
<p>*Map Generated with <a href="https://github.com/JC-SoCal/GIPC">JCSOCAL's GIPC</a></p>
<p><span style="white-space: pre;"> </span><strong>Top 11 Countries</strong></p>
<p><span style="white-space: pre;"> </span>China:<span style="white-space: pre;"> </span>699</p>
<p><span style="white-space: pre;"> </span>United States:<span style="white-space: pre;"> </span>654</p>
<p><span style="white-space: pre;"> </span>Brazil:<span style="white-space: pre;"> </span>76</p>
<p><span style="white-space: pre;"> </span>Russian Federation:<span style="white-space: pre;"> </span>69</p>
<p><span style="white-space: pre;"> </span>Germany:<span style="white-space: pre;"> </span>65</p>
<p><span style="white-space: pre;"> </span>Korea, Republic of:<span style="white-space: pre;"> </span>57</p>
<p><span style="white-space: pre;"> </span>Romania:<span style="white-space: pre;"> </span>56</p>
<p><span style="white-space: pre;"> </span>Egypt:<span style="white-space: pre;"> </span>52</p>
<p><span style="white-space: pre;"> </span>Japan:<span style="white-space: pre;"> </span>50</p>
<p><span style="white-space: pre;"> </span>India:<span style="white-space: pre;"> </span>41</p>
<p><span style="white-space: pre;"> </span>Indonesia:<span style="white-space: pre;"> </span>41</p>
<p><strong>Unique Usernames:</strong> 8600 (<a href="https://gist.github.com/1aN0rmus/b7c70706b4b2eaa0070c">Username list</a>)</p>
<p><span class="full-image-block ssNonEditable"><span><img src="http://www.tekdefense.com/storage/top10_usernames_aws.png?__SQUARESPACE_CACHEVERSION=1405967286231" alt="" /></span></span></p>
<p>&nbsp;<strong>Unique Passwords:</strong> 75780 (<a href="http://www.tekdefense.com/downloads/wordlists/">wordlist</a>)</p>
<p><span class="full-image-block ssNonEditable"><span><img src="http://www.tekdefense.com/storage/top10_passwords_aws.png?__SQUARESPACE_CACHEVERSION=1405967332283" alt="" /></span></span></p>
<p><span class="full-image-block ssNonEditable"><span><img src="http://www.tekdefense.com/storage/post-images/top10_combinations_pie_aws.png?__SQUARESPACE_CACHEVERSION=1405967364631" alt="" /></span></span></p>
<p><strong>Unique Sources:</strong> 1985 (l<a href="https://gist.github.com/1aN0rmus/8f8a3b9677bd44d04178">ist of IPs</a>)</p>
<div></div>
<h3>Passwords:</h3>
<p>One of my favorite uses of kippo data is to generate wordlists from login attempts. I wrote a <a href="https://github.com/1aN0rmus/TekDefense/blob/master/Kippo2Wordlist">quick script</a> to parse the kippo logs and pull out all passwords and unique them into a wordlist. Feel free to <a href="https://github.com/1aN0rmus/TekDefense/blob/master/Kippo2Wordlist">grab</a>. Additionally I made the <a href="http://www.tekdefense.com/downloads/wordlists/">wordlists available for download</a>.</p>
<p>Using <a href="http://digi.ninja/projects/pipal.php">Pipal</a> I performed <a href="https://gist.github.com/1aN0rmus/30bb4be52bba03649091">analysis</a> of all the login attempts over this year:</p>
<p><script src="https://gist.github.com/1aN0rmus/30bb4be52bba03649091.js"></script></p>
<p>Two items of note here are that over 60% of password attempts were 1-8 characters. 40% of attempts were for lowercase alpha characters only. The most used password was 123456. This is the default pass for Kippo.</p>
<p>If a user attempts to create an account or change the root password in a Kippo session those passwords are captured and added to the allowed credentials list. The following credentials were created:</p>
<blockquote>
<div id="_mcePaste">root:0:albertinoalbert123</div>
<div id="_mcePaste">root:0:fgashyeq77dhshfa</div>
<div id="_mcePaste">root:0:florian12eu</div>
<div id="_mcePaste">root:0:hgd177q891999wwwwwe1.dON</div>
<div id="_mcePaste">root:0:iphone5</div>
<div id="_mcePaste">root:0:kokot</div>
<div id="_mcePaste">root:0:nope</div>
<div id="_mcePaste">root:0:picvina</div>
<div id="_mcePaste">root:0:scorpi123</div>
<div id="_mcePaste">root:0:test</div>
<div id="_mcePaste">root:0:xiaozhe</div>
<div id="_mcePaste">root:0:12345</div>
<div id="_mcePaste">root:0:bnn318da9031kdamfaihheq1fa</div>
<div id="_mcePaste">root:0:ls</div>
<div id="_mcePaste">root:0:neonhostt1</div>
<div id="_mcePaste">root:0:wget123</div>
</blockquote>
<h3>Downloads:</h3>
<div></div>
<div>When an attacker attempts to download a tool via wget, within Kippo we allow that file to be downloaded, although they cannot interact with it. With this we are able to get a copy of whatever is being downloaded. In most cases these are IRC bots, but not all. I have made them all available for <a href="http://www.tekdefense.com/downloads/linux-malware-and-exploits/">download</a>.</div>
<div></div>
<div>Here is a listing of all the files:</div>
<div><strong>*Duplicates and obviously legitimate files have been removed from the list.</strong></div>
<div>
<blockquote>
<div>20131030113401_http___198_2_192_204_22_disknyp</div>
<div>20131103183232_http___61_132_227_111_8080_meimei</div>
<div>20131104045744_http___198_2_192_204_22_disknyp</div>
<div>20131114214017_http___www_unrealircd_com_downloads_Unreal3_2_8_1_tar_gz</div>
<div>20131116130541_http___198_2_192_204_22_disknyp</div>
<div>20131129165151_http___dl_dropboxusercontent_com_s_1bxj9ak8m1octmk_ktx_c</div>
<div>20131129165438_http___dl_dropboxusercontent_com_s_66gpt66lvut4gdu_ktx</div>
<div>20131202040921_http___198_2_192_204_22_disknyp</div>
<div>20131207123419_http___packetstorm_wowhacker_com_DoS_juno_c</div>
<div>20131216143108_http___www_psybnc_at_download_beta_psyBNC_2_3_2_7_tar_gz</div>
<div>20131216143208_http___X_hackersoft_org_scanner_gosh_jpg</div>
<div>20131216143226_http___download_microsoft_com_download_win2000platform_SP_SP3_NT5_EN_US_W2Ksp3_exe</div>
<div>20131217163423_http___ha_ckers_org_slowloris_slowloris_pl</div>
<div>20131217163456_http___www_lemarinel_net_perl</div>
<div>20131222084315_http___maxhub_com_auto_bill_pipe_bot</div>
<div>20140103142644_http___ftp_gnu_org_gnu_autoconf_autoconf_2_69_tar_gz</div>
<div>20140109170001_http___sourceforge_net_projects_cpuminer_files_pooler_cpuminer_2_3_2_linux_x86_tar_gz</div>
<div>20140120152204_http___111_39_43_54_5555_dos32</div>
<div>20140122202342_http___layer1_cpanel_net_latest</div>
<div>20140122202549_http___linux_duke_edu_projects_yum_download_2_0_yum_2_0_7_tar_gz</div>
<div>20140122202751_http___www_ehcp_net_ehcp_latest_tgz</div>
<div>20140201131804_http___www_suplementar_com_br_images_stories_goon_pooler_cpuminer_2_3_2_tar_gz</div>
<div>20140201152307_http___nemo_rdsor_ro_darwin_jpg</div>
<div>20140208081358_http___www_youtube_com_watch_v_6hVQs5ll064</div>
<div>20140208184835_http___sharplase_ru_x_txt</div>
<div>20140215141909_http___tenet_dl_sourceforge_net_project_cpuminer_pooler_cpuminer_2_3_2_tar_gz</div>
<div>20140215142830_http___sourceforge_net_projects_cpuminer_files_pooler_cpuminer_2_3_2_tar_gz</div>
<div>20140219072721_http___www_psybnc_at_download_beta_psyBNC_2_3_2_7_tar_gz</div>
<div>20140328031725_http___dl_dropboxusercontent_com_u_133538399_multi_py</div>
<div>20140409053322_http___www_c99php_com_shell_c99_rar</div>
<div>20140409053728_http___github_com_downloads_orbweb_PHP_SHELL_WSO_wso2_5_1_php</div>
<div>20140413130110_http___www_iphobos_com_hb_unixcod_rar</div>
<div>20140416194008_http___linux_help_bugs3_com_Camel_mail_txt</div>
<div>20140419143734_http___www_activestate_com_activeperl_downloads_thank_you_dl_http___downloads_activestate_com_ActivePerl_releases_5_18_2_1802_ActivePerl_5_18_2_1802_x86_64_linux_glibc_2_5_298023_tar_gz</div>
<div>20140419144043_http___ha_ckers_org_slowloris_slowloris_pl</div>
<div>20140420104056_http___downloads_metasploit_com_data_releases_archive_metasploit_4_9_2_linux_x64_installer_run</div>
<div>20140420104325_http___nmap_org_dist_nmap_6_46_1_i386_rpm</div>
<div>20140505073503_http___116_255_239_180_888_007</div>
<div>20140505093229_http___119_148_161_25_805_sd32</div>
<div>20140505111511_http___112_117_223_10_280_1</div>
<div>20140515091557_http___112_117_223_10_280__bash_6_phpmysql</div>
<div>20140519193800_http___www_unrealircd_com_downloads_Unreal3_2_8_1_tar_gz</div>
<div>20140523120411_http___lemonjuice_tk_netcat_sh</div>
<div>20140610174516_http___59_63_183_193_280__etc_Test8888</div>
<div>20140614200901_http___kismetismy_name_ktx</div>
<div>20140625032113_http___ftp_mirrorservice_org_sites_ftp_wiretapped_net_pub_security_packet_construction_netcat_gnu_netcat_netcat_0_7_1_tar_gz</div>
<div>20140720005010_http___www_bl4ck_viper_persiangig_com_p8_localroots_2_6_x_cw7_3</div>
</blockquote>
</div>
<div>To see the full source for some of the scripts downloaded by the attackers you can go to this <a href="https://github.com/1aN0rmus/KippoAttackerDownloads">Github Repo</a>. A <a href="https://github.com/1aN0rmus/KippoAttackerDownloads/blob/master/20131129165151_http___dl_dropboxusercontent_com_s_1bxj9ak8m1octmk_ktx_c">couple</a> of <a href="https://github.com/1aN0rmus/KippoAttackerDownloads/blob/master/20131207123419_http___packetstorm_wowhacker_com_DoS_juno_c">my</a><a href="https://github.com/1aN0rmus/KippoAttackerDownloads/blob/master/20131217163423_http___ha_ckers_org_slowloris_slowloris_pl"> favorite</a>&nbsp;<a href="https://github.com/1aN0rmus/KippoAttackerDownloads/blob/master/20140523120411_http___lemonjuice_tk_netcat_sh">ones</a>.</div>
<div></div>
<h3>TTY Replay Sessions:</h3>
<div>My absolute favorite feature of Kippo is the ability to replay interactive sessions of attacker activity. Watching these replays gives us an idea of what attackers do once inside a session. For instance almost every session begins with a "w" which shows logged in users and uptime, and then a "uname -a" to show them system details. I made a <a href="https://www.youtube.com/user/TekDefense">Youtube</a> series called <a href="https://www.youtube.com/playlist?list=PLZnUx1UY9ZU8dK4g-J_YVoo6rZwmF7iQN">The Kippo Kronicles</a> a while back to showcase some of these sessions. While I don't have the time necessary to continue putting up videos for each session I have put the output of each session up at this <a href="https://github.com/1aN0rmus/KippoTTY">Github Repo</a>.</div>
<div></div>
<div>Here is a fun example:</div>
<blockquote>
<div>AWSWeb:~# adduser</div>
<div>adduser: Only one or two names allowed.</div>
<div>AWSWeb:~# useradd</div>
<div>adduser: Only one or two names allowed.</div>
<div>AWSWeb:~# ls</div>
<div>AWSWeb:~# pwd</div>
<div>root</div>
<div>AWSWeb:~# cd /[1D[1P[1D[1P[1D[1P[1D[1Pcat /etc/passwd</div>
<div>root:x:0:0:root:/root:/bin/bash</div>
<div>daemon:x:1:1:daemon:/usr/sbin:/bin/sh</div>
<div>bin:x:2:2:bin:/bin:/bin/sh</div>
<div>sys:x:3:3:sys:/dev:/bin/sh</div>
<div>sync:x:4:65534:sync:/bin:/bin/sync</div>
<div>games:x:5:60:games:/usr/games:/bin/sh</div>
<div>man:x:6:12:man:/var/cache/man:/bin/sh</div>
<div>lp:x:7:7:lp:/var/spool/lpd:/bin/sh</div>
<div>mail:x:8:8:mail:/var/mail:/bin/sh</div>
<div>news:x:9:9:news:/var/spool/news:/bin/sh</div>
<div>uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh</div>
<div>proxy:x:13:13:proxy:/bin:/bin/sh</div>
<div>www-data:x:33:33:www-data:/var/www:/bin/sh</div>
<div>backup:x:34:34:backup:/var/backups:/bin/sh</div>
<div>list:x:38:38:Mailing List Manager:/var/list:/bin/sh</div>
<div>irc:x:39:39:ircd:/var/run/ircd:/bin/sh</div>
<div>gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh</div>
<div>nobody:x:65534:65534:nobody:/nonexistent:/bin/sh</div>
<div>libuuid:x:100:101::/var/lib/libuuid:/bin/sh</div>
<div>richard:x:1000:1000:richard,,,:/home/richard:/bin/bash</div>
<div>sshd:x:101:65534::/var/run/sshd:/usr/sbin/nologin</div>
<div>AWSWeb:~# user</div>
<div>bash: user: command not found</div>
<div>AWSWeb:~# adduser obz</div>
<div>Adding user `obz' ...</div>
<div>Adding new group `obz' (1001) ...</div>
<div>Adding new user `obz' (1001) with group `obz' ...</div>
<div>Creating home directory `/home/obz' ...</div>
<div>Copying files from `/etc/skel' ...</div>
<div>Password:&nbsp;</div>
<div>Password again:&nbsp;</div>
<div></div>
<div>Changing the user information for obz</div>
<div>Enter the new value, or press ENTER for the default</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Username []:&nbsp;</div>
<div>Must enter a value!</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Username []: obz</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Full Name []: l[1D[1Padmin obz</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Room Number []: 1</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Work Phone []: 1234567890</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Home Phone []:&nbsp;</div>
<div>Must enter a value!</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Home Phone []: 0</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Mobile Phone []: 0</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Country []: cn</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; City []: xang</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Language []: mand</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Favorite movie []: 1</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Other []: 1</div>
<div>Is the information correct? [Y/n] y</div>
<div>ERROR: Some of the information you entered is invalid</div>
<div>Deleting user `obz' ...</div>
<div>Deleting group `obz' (1001) ...</div>
<div>Deleting home directory `/home/obz' ...</div>
<div>Try again? [Y/n] y</div>
<div></div>
<div>Changing the user information for obz</div>
<div>Enter the new value, or press ENTER for the default</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Username []: obx</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Full Name []: obx toor</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Room Number []: 1</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Work Phone []: 1[1D[1P9089543121</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Home Phone []: 9089342135</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Mobile Phone []: 9089439012</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Country []: cn</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; City []: xang</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Language []: man[1D[1P[1D[1P[1D[1Penglish</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Favorite movie []: one</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Other []: two[1D[1P[1D[1P[1D[1Pfour</div>
<div>Is the information correct? [Y/n] y</div>
<div>ERROR: Some of the information you entered is invalid</div>
<div>Deleting user `obz' ...</div>
<div>Deleting group `obz' (1001) ...</div>
<div>Deleting home directory `/home/obz' ...</div>
<div>Try again? [Y/n] n</div>
<div>AWSWeb:~# cat adduser obz user cat /etc/passwd</div>
<div>root:x:0:0:root:/root:/bin/bash</div>
<div>daemon:x:1:1:daemon:/usr/sbin:/bin/sh</div>
<div>bin:x:2:2:bin:/bin:/bin/sh</div>
<div>sys:x:3:3:sys:/dev:/bin/sh</div>
<div>sync:x:4:65534:sync:/bin:/bin/sync</div>
<div>games:x:5:60:games:/usr/games:/bin/sh</div>
<div>man:x:6:12:man:/var/cache/man:/bin/sh</div>
<div>lp:x:7:7:lp:/var/spool/lpd:/bin/sh</div>
<div>mail:x:8:8:mail:/var/mail:/bin/sh</div>
<div>news:x:9:9:news:/var/spool/news:/bin/sh</div>
<div>uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh</div>
<div>proxy:x:13:13:proxy:/bin:/bin/sh</div>
<div>www-data:x:33:33:www-data:/var/www:/bin/sh</div>
<div>backup:x:34:34:backup:/var/backups:/bin/sh</div>
<div>list:x:38:38:Mailing List Manager:/var/list:/bin/sh</div>
<div>irc:x:39:39:ircd:/var/run/ircd:/bin/sh</div>
<div>gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh</div>
<div>nobody:x:65534:65534:nobody:/nonexistent:/bin/sh</div>
<div>libuuid:x:100:101::/var/lib/libuuid:/bin/sh</div>
<div>richard:x:1000:1000:richard,,,:/home/richard:/bin/bash</div>
<div>sshd:x:101:65534::/var/run/sshd:/usr/sbin/nologin</div>
<div>AWSWeb:~# cat /etc/shadow</div>
<div>cat: /etc/shadow: No such file or directory</div>
<div>AWSWeb:~# /etc/init.d\[1D[1P[1D[1PD/ssh start</div>
<div>bash: /etc/init.D/ssh: command not found</div>
<div>AWSWeb:~# [K/etc/init.D/ssh start[1D[1D[1D[1D[1D[1D[1D[1D[1D[1D[1D[1Pd</div>
<div>bash: /etc/init.d/ssh: command not found</div>
<div>AWSWeb:~#&nbsp;</div>
<div>AWSWeb:~#&nbsp;</div>
<div>AWSWeb:~#&nbsp;</div>
<div>AWSWeb:~#&nbsp;</div>
<div>AWSWeb:~#&nbsp;</div>
<div>AWSWeb:~#&nbsp;</div>
<div>AWSWeb:~#&nbsp;</div>
<div>AWSWeb:~#&nbsp;</div>
<div>AWSWeb:~#&nbsp;</div>
<div>AWSWeb:~# exit</div>
<div>cConnection to server closed.</div>
<div>localhost:~# exit</div>
<div>Connection to server closed.</div>
<div>localhost:~# bye</div>
<div>bash: bye: command not found</div>
<div>localhost:~# exit</div>
<div>Connection to server closed.</div>
<div>localhost:~# admin</div>
<div>bash: admin: command not found</div>
<div>localhost:~# su</div>
<div>localhost:~# ls -l</div>
<div>drwxr-xr-x 1 root root 4096 2013-02-03 17:11 .</div>
<div>drwxr-xr-x 1 root root 4096 2013-02-03 17:11 ..</div>
<div>drwxr-xr-x 1 root root 4096 2009-11-06 11:16 .debtags</div>
<div>-rw------- 1 root root 5515 2009-11-20 09:08 .viminfo</div>
<div>drwx------ 1 root root 4096 2009-11-06 11:13 .aptitude</div>
<div>-rw-r--r-- 1 root root &nbsp;140 2009-11-06 11:09 .profile</div>
<div>-rw-r--r-- 1 root root &nbsp;412 2009-11-06 11:09 .bashrc</div>
<div>localhost:~# pwd</div>
<div>/root</div>
<div>localhost:~# cd /</div>
<div>localhost:/# ls -l</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2013-02-03 17:11 .</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2013-02-03 17:11 ..</div>
<div>drwxr-xr-x 1 root root &nbsp; &nbsp; 0 2009-11-20 08:19 sys</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-08 15:42 bin</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:08 mnt</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:08 media</div>
<div>lrwxrwxrwx 1 root root &nbsp; &nbsp;25 2009-11-06 11:16 vmlinuz -&gt; /boot/vmlinuz-2.6.26-2-686</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:09 opt</div>
<div>lrwxrwxrwx 1 root root &nbsp; &nbsp;11 2009-11-06 11:08 cdrom -&gt; /media/cdrom0</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:08 selinux</div>
<div>drwxrwxrwx 1 root root &nbsp;4096 2009-11-20 08:19 tmp</div>
<div>dr-xr-xr-x 1 root root &nbsp; &nbsp; 0 2009-11-20 08:19 proc</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-08 15:41 sbin</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-20 08:20 etc</div>
<div>drwxr-xr-x 1 root root &nbsp;3200 2009-11-20 08:20 dev</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:09 srv</div>
<div>lrwxrwxrwx 1 root root &nbsp; &nbsp;28 2009-11-06 11:16 initrd.img -&gt; /boot/initrd.img-2.6.26-2-686</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-08 15:46 lib</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:22 home</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:09 var</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-08 15:46 usr</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-08 15:39 boot</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-20 09:08 root</div>
<div>drwx------ 1 root root 16384 2009-11-06 11:08 lost+found</div>
<div>localhost:/# cd /home</div>
<div>localhost:/home# ls -l</div>
<div>ldrwxr-xr-x 1 root root 4096 2013-02-03 17:11 .</div>
<div>drwxr-xr-x 1 root root 4096 2013-02-03 17:11 ..</div>
<div>drwxr-xr-x 1 1000 1000 4096 2009-11-06 11:22 richard</div>
<div>localhost:/home# exit</div>
<div>Connection to server closed.</div>
<div>localhost:~#&nbsp;</div>
<div>localhost:~#&nbsp;</div>
<div>localhost:~#&nbsp;</div>
<div>localhost:~#&nbsp;</div>
<div>localhost:~#&nbsp;</div>
<div>localhost:~#&nbsp;</div>
<div>localhost:~# ssh -D root@http://60.250.65.112/ 1337</div>
<div>The authenticity of host '60.250.65.112 (60.250.65.112)' can't be established.</div>
<div>RSA key fingerprint is 9d:30:97:8a:9e:48:0d:de:04:8d:76:3a:7b:4b:30:f8.</div>
<div>Are you sure you want to continue connecting (yes/no)? yes</div>
<div>Warning: Permanently added '60.250.65.112' (RSA) to the list of known hosts.</div>
<div>root@60.250.65.112's password:&nbsp;</div>
<div>Linux localhost 2.6.26-2-686 #1 SMP Wed Nov 4 20:45:37 UTC 2009 i686</div>
<div>Last login: Sat Feb &nbsp;2 07:07:11 2013 from 192.168.9.4</div>
<div>localhost:~# uname -a</div>
<div>Linux localhost 2.6.24-2-generic #1 SMP Thu Dec 20 17:36:12 GMT 2007 i686 GNU/Linux</div>
<div>localhost:~# pwd</div>
<div>/root</div>
<div>localhost:~# cd /</div>
<div>localhost:/# ls -l</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2013-02-03 17:19 .</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2013-02-03 17:19 ..</div>
<div>drwxr-xr-x 1 root root &nbsp; &nbsp; 0 2009-11-20 08:19 sys</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-08 15:42 bin</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:08 mnt</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:08 media</div>
<div>lrwxrwxrwx 1 root root &nbsp; &nbsp;25 2009-11-06 11:16 vmlinuz -&gt; /boot/vmlinuz-2.6.26-2-686</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:09 opt</div>
<div>lrwxrwxrwx 1 root root &nbsp; &nbsp;11 2009-11-06 11:08 cdrom -&gt; /media/cdrom0</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:08 selinux</div>
<div>drwxrwxrwx 1 root root &nbsp;4096 2009-11-20 08:19 tmp</div>
<div>dr-xr-xr-x 1 root root &nbsp; &nbsp; 0 2009-11-20 08:19 proc</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-08 15:41 sbin</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-20 08:20 etc</div>
<div>drwxr-xr-x 1 root root &nbsp;3200 2009-11-20 08:20 dev</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:09 srv</div>
<div>lrwxrwxrwx 1 root root &nbsp; &nbsp;28 2009-11-06 11:16 initrd.img -&gt; /boot/initrd.img-2.6.26-2-686</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-08 15:46 lib</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:22 home</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-06 11:09 var</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-08 15:46 usr</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-08 15:39 boot</div>
<div>drwxr-xr-x 1 root root &nbsp;4096 2009-11-20 09:08 root</div>
<div>drwx------ 1 root root 16384 2009-11-06 11:08 lost+found</div>
<div>localhost:/# cd /root</div>
<div>localhost:~# ls -l</div>
<div>ldrwxr-xr-x 1 root root 4096 2013-02-03 17:19 .</div>
<div>drwxr-xr-x 1 root root 4096 2013-02-03 17:19 ..</div>
<div>drwxr-xr-x 1 root root 4096 2009-11-06 11:16 .debtags</div>
<div>-rw------- 1 root root 5515 2009-11-20 09:08 .viminfo</div>
<div>drwx------ 1 root root 4096 2009-11-06 11:13 .aptitude</div>
<div>-rw-r--r-- 1 root root &nbsp;140 2009-11-06 11:09 .profile</div>
<div>-rw-r--r-- 1 root root &nbsp;412 2009-11-06 11:09 .bashrc</div>
<div>localhost:~# cd /ho[1D[1P[1D[1P[1D[1P[1D[1P[1D[1P[1D[1Pcd /home/</div>
<div>localhost:/home# ls -l</div>
<div>drwxr-xr-x 1 root root 4096 2013-02-03 17:20 .</div>
<div>drwxr-xr-x 1 root root 4096 2013-02-03 17:20 ..</div>
<div>drwxr-xr-x 1 1000 1000 4096 2009-11-06 11:22 richard</div>
<div>localhost:/home# exit</div>
<div>Connection to server closed.</div>
<div>localhost:~# exit</div>
<div>Connection to server closed.</div>
<div>localhost:~#&nbsp;</div>
</blockquote>
<div></div>
<div></div>
<h3>&nbsp;Conclusion:</h3>
<p>After a year with Kippo, I have learned a lot about what these basic attackers do when connecting to seemingly open ssh hosts. There is plenty more to learn though. I have some plans on building out a larger honeypot infrastructure, and automating some of the data collection and parsing. Additionally I would like to spend more time analyzing the sessions and malware for further trends. I'll keep you all posted!</p>
<p>*Big thanks to <a href="http://bruteforce.gr/">Bruteforce Labs</a> for their tools and expertise in honeypots.</p>]]></description><wfw:commentRss>http://www.tekdefense.com/news/rss-comments-entry-34929569.xml</wfw:commentRss></item><item><title>Automater version 2.1 released - Proxy capabilities and a little user-agent modification</title><category>Automater</category><category>Github</category><category>News</category><category>OSINT</category><category>python</category><dc:creator>Admin</dc:creator><pubDate>Wed, 18 Jun 2014 14:55:59 +0000</pubDate><link>http://www.tekdefense.com/news/2014/6/18/automater-version-21-released-proxy-capabilities-and-a-littl.html</link><guid isPermaLink="false">830757:9759328:34878396</guid><description><![CDATA[<p>It has been a little while since some of our posts on Automater and its capabilities. However, we haven't stopped moving forward on the concept and are proud to announce that Automater has been included in the latest release of<span id="docs-internal-guid-05a2d446-af7b-e52d-86bd-018f24149cc7" style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline;"> <a href="http://blog.zeltser.com/post/86508269224/remnux-v5-release-for-malware-analysts">REMnux</a> </span><span id="docs-internal-guid-05a2d446-af7b-e52d-86bd-018f24149cc7">&nbsp;</span>and also made the cut for<span id="docs-internal-guid-05a2d446-af7b-e52d-86bd-018f24149cc7" style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline;"> <a href="http://www.toolswatch.org/2014/06/new-tool-automater-v2-0-information-gathering-tool-released/">ToolsWatch</a>. </span>Of course, you should get your copy from our<span id="docs-internal-guid-05a2d446-af7b-e52d-86bd-018f24149cc7" style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline;"> <a href="https://github.com/1aN0rmus/TekDefense-Automater">GitHub repo</a></span> since we'll be updating GitHub just prior to getting the updates to other repositories. Okay, enough back-patting and proverbial "glad handing", we are excited to let everyone know that Automater has a new user-agent output that is configurable by the user and now fully supports proxy-based requests and submissions! Thanks go out to<span id="docs-internal-guid-05a2d446-af7b-e52d-86bd-018f24149cc7" style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline;"> <a href="https://github.com/nullprobe">nullprobe</a> </span>for taking interest in the code and pushing us forward on getting the proxy capability completed. Although we didn't use the exact submission he provided, we definitely used some code and ideas he provided. Thanks again nullprobe!</p>
<h3>The New Stuff</h3>
<p>Okay, for a quick review of some of the old posts if you're new to Automater, or need to refresh yourself with the product, please go<span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline;"> <a href="http://www.tekdefense.com/news/2013/12/4/finally-the-new-automater-release-is-out.html">here</a>, <a href="http://www.tekdefense.com/news/2013/12/10/the-extensibility-of-automater.html">here</a>, </span>and<span style="font-size: 15px; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline;"> <a href="http://www.tekdefense.com/news/2013/12/11/automater-output-format-and-modifications.html">here</a></span> to read about Automater its capabilities and extensibility as well as output format etc... As you probably know, Automater is an extensible OSINT tool that has quite a few capabilities. To get straight to the point, Automater can now be run with new command-line tags to enable proxy functionality and to change the user-agent submitted in the header of the web requests made from the tool.</p>
<h3>User-Agent Changes</h3>
<p>Prior to this upgrade, the Automater sent a default user-agent string based on the browser settings on the device hosting the application. While this is probably fine, it just......well.....wasn't good enough for us. By default, the Automater now sends the user-agent string of 'Automater/2.1' with requests and posts (if post submissions are required). However, you now have the ability to change that user-agent string to one of your liking by using the command-line parameter or -a or --agent followed by the string you'd like to use. A new Automater execution line using this new option would look something like:</p>
<blockquote>python Automater.py 1.1.1.1 -a MyUserAgent/1.0</blockquote>
<p>or some such thing that you'd like to send as a user-agent string in the header.</p>
<h3>Proxy Capabilities</h3>
<p>A significant modification in this version was the inclusion of a capability to utilize a network proxy system. To enable this functionality, all that is needed is the command line argument --proxy followed by the address and the port the proxy device is listening on during Automater execution. For instance, if my network proxy is at IP address 10.1.1.1 and is listening on port 8080 I would execute the Automater by typing:</p>
<blockquote>python Automater.py 1.1.1.1 --proxy 10.1.1.1:8080</blockquote>
<p>of course, your system will utilize standard DNS resolution practices if you only know the name of your network proxy and resolve the IP address automatically. So, if the proxy is known as proxy.company.com listening on port 8080, you would type:</p>
<blockquote>python Automater.py 1.1.1.1 --proxy proxy.company.com:8080</blockquote>
<p id="docs-internal-guid-05a2d446-af8b-d0f2-ef1e-dfc3ec981115" dir="ltr">it's as simple as that!</p>
<h3>Further Movement</h3>
<p dir="ltr">We are still working on other submissions and requests, so please keep them coming as we will continue to upgrade as we get requests as well as when we find more efficient ways to do things. We appreciate the support and would love to answer any questions you may have, so give us a yell if you need anything.</p>
<p dir="ltr">p4r4n0y1ng and 1aN0rmus.....OUT!</p>]]></description><wfw:commentRss>http://www.tekdefense.com/news/rss-comments-entry-34878396.xml</wfw:commentRss></item><item><title>Memory Forensics presentation from BSidesNola</title><category>Forensics</category><category>Memory</category><category>News</category><category>Volatility</category><category>analysis</category><dc:creator>Admin</dc:creator><pubDate>Fri, 30 May 2014 00:56:03 +0000</pubDate><link>http://www.tekdefense.com/news/2014/5/29/memory-forensics-presentation-from-bsidesnola.html</link><guid isPermaLink="false">830757:9759328:34844967</guid><description><![CDATA[<p>As some of you may already know, a couple weeks back <a href="https://twitter.com/hiddenillusion">@HiddenIllusion</a> and I gave a talk on Memory Forenics titled "Mo' Memory No' Problems" at <a href="http://www.securitybsides.com/w/page/71231585/BsidesNola2014">BSidesNola</a>. While the talk wasn't recorded we did want to put the slides out for the folks who were not able to attend. I hope you all enjoy.</p>
<p>*Be sure to visit <a href="http://hiddenillusion.blogspot.com/">HiddenIllusion's blog</a>. Also for the analysis walk through at the end of the deck, we used a memory dump of 1337 hacker activity generated by Tony Lee of <a href="http://securitysynapse.com/">SecuritySynapse</a>.</p>
<p><script async class="speakerdeck-embed" data-id="3d9ae360c99501316e3a2eda2b59ba96" data-ratio="1.33333333333333" src="http://www.tekdefense.com//speakerdeck.com/assets/embed.js"></script></p>]]></description><wfw:commentRss>http://www.tekdefense.com/news/rss-comments-entry-34844967.xml</wfw:commentRss></item><item><title>Categorizing Maltrieve Output</title><category>Maltrieve</category><category>Malware</category><category>Programming</category><category>Scripting</category><category>TekTip</category><category>tektip</category><dc:creator>Admin</dc:creator><pubDate>Wed, 29 Jan 2014 05:59:07 +0000</pubDate><link>http://www.tekdefense.com/news/2014/1/29/categorizing-maltrieve-output.html</link><guid isPermaLink="false">830757:9759328:34597495</guid><description><![CDATA[<p>UPDATE: <a href="https://twitter.com/kylemaxwell">@kylemaxwell</a> has accepted the pull of this script into the main maltrieve repo!</p>
<p>*Note: For starters, we need to say thanks as usual to <em>technoskald</em> and point you in the right direction to the <a name="Maltrieve_Code" href="https://github.com/technoskald/maltrieve">Maltrieve Code</a> on GitHub.</p>
<!-- H3 { margin-bottom: 0.08in; }H3.cjk { font-family: "WenQuanYi Micro Hei"; }H3.ctl { font-family: "Lohit Hindi"; }P { margin-bottom: 0.08in; }A:link {  } -->
<h3 class="western">Overview</h3>
<p>We have posted <a href="http://www.tekdefense.com/news/2013/2/22/tektip-ep23-mastiff-with-a-splash-of-maltrieve.html">Maltrieve articles</a> a couple times in the past, but the capabilities of this application continue to amaze us so we thought we'd add to our past contributions. During our initial build of a malware collection box (malware zoo creation) we utilized a standard concept of running Maltrieve throughout the day using a cron job. As most simple things do, this became rather complex based on the fact that the Maltrieve delivery is not categorized in any method, so finding what you're looking for is.....shall we say.....difficult at best. This article discusses a categorization method to help you organize your malware zoo so that it is manageable.</p>
<p>If you would prefer this article in video format, it is provided as well:</p>
<p style="text-align: center;"><iframe width="640" height="360" src="http://www.tekdefense.com//www.youtube.com/embed/uwe32d-nF7U?rel=0" frameborder="0" allowfullscreen></iframe></p>
<!-- H3 { margin-bottom: 0.08in; }H3.cjk { font-family: "WenQuanYi Micro Hei"; }H3.ctl { font-family: "Lohit Hindi"; }P { margin-bottom: 0.08in; }A:link {  } -->
<h3 class="western">Getting started</h3>
<p>The box containing the malware repository is a standard Precise Pangolin Ubuntu Distro (12.04 LTS), so no big tricks or hooks here. Maltrieve is installed in a standard format, but a 1TB drive is being utilized to store the malware retrieved. The box has 3TB worth of space for later use, but for now we'll deal with just the 1TB drive. The malware repository is mounted at /media/malware/maltrievepulls. All scripts utilized (to include the Maltrieve python scripts) are located at /opt/maltrieve. Again, nothing flashy in any of this, so it should be easy for you to get your box setup quick if you'd like.</p>
<!-- H3 { margin-bottom: 0.08in; }H3.cjk { font-family: "WenQuanYi Micro Hei"; }H3.ctl { font-family: "Lohit Hindi"; }P { margin-bottom: 0.08in; }A:link {  } -->
<h3 class="western">Running Maltrieve Consistently</h3>
<p>To begin the build of the malware repository, we wanted to run the maltrieve scripts hourly so that the directory would fill with new and interesting malware consistently and quickly. This screamed &ldquo;crontab&rdquo;, so we fired up a terminal and ran <strong>sudo crontab -l</strong> and then <strong>sudo crontab -e</strong> so that we could edit the crontab. Our initial entry was as follows:</p>
<blockquote><!-- P { margin-bottom: 0.08in; }A:link {  } --></blockquote>
<blockquote>
<p>hourly python /opt/maltrieve/maltrieve.py -d /media/malware/maltrievepulls</p>
<p>@hourly echo "maltrieve run at: $(date) $(time)" &gt;&gt; /home/username/Documents/maltrievelog.log</p>
</blockquote>
<!-- H3 { margin-bottom: 0.08in; }H3.cjk { font-family: "WenQuanYi Micro Hei"; }H3.ctl { font-family: "Lohit Hindi"; }P { margin-bottom: 0.08in; }A:link {  } -->
<p>This simply tells the system to run the maltrieve.py python script on an hourly basis and send the results to the /media/malware/maltrievepulls directory for safe storage. The second entry basically adds a little stamp in a file in my home directory so I can ensure the cron job is running every hour &ndash; you can obviously NOT include this statement if you don't see fit. In any case, we quickly noticed that the Maltrieve app was doing its job and we went about our business allowing the box to do what we asked. We quickly were swimming in malware and were ready to start analyzing to our hearts delight when we ran into the problem!</p>
<h3 class="western">The Problem</h3>
<p>Maltrieve does exactly what it's told and it does it well &ndash; find malware from specific sites and put it in a directory of your liking. And it finds LOTS OF MALWARE if you keep running it as we did in hopes of having a massive store. However, the files are given a hashed name that has very little use to the human eye, and they are just plopped merrily into the directory you choose when you run the malware.py python script. It became quite tedious to run the <em>file </em><span style="font-style: normal;">command on files that just &ldquo;looked&rdquo; interesting based on a hashed filename that gave little meaning to what it might be in terms of formatting, or even payload. A quick look could allow you to do some judging by filesize, but basic command line sorting, grepping, awking, and loads of other tools were needed to try and fix the problem. These methods were simply tedious and after we began to have hundreds of GBs of malware, it became downright no fun any more. The picture below will show you a glimpse of the problem.</span></p>
<p><span style="font-style: normal;"><span class="full-image-block ssNonEditable"><span><img style="width: 650px;" src="http://www.tekdefense.com/storage/post-images/theproblem.png?__SQUARESPACE_CACHEVERSION=1390975622467" alt="" /></span></span></span></p>
<!-- P { margin-bottom: 0.08in; }A:link {  } -->
<p>Hardly the beacon of light for finding what you're looking for from your malware repository.</p>
<p>Running the <em>file</em><span style="font-style: normal;"> command on a few of these things starts showing some potential though because what you get from doing this looks like:</span></p>
<!-- P { margin-bottom: 0.08in; }A:link {  } -->
<blockquote>
<p><span style="font-style: normal;">file 818fc882dab3e682d83aabf3cb8b453b</span></p>
<p><span style="font-style: normal;">818fc882dab3e682d83aabf3cb8b453b: PE32 executable (GUI) Intel 80386, for MS Windows </span></p>
<p>&nbsp;</p>
<p><span style="font-style: normal;">file fd8fd6d345cb630d7f1b6926ce7d28b3 </span></p>
<p><span style="font-style: normal;">fd8fd6d345cb630d7f1b6926ce7d28b3: Zip archive data, at least v1.0 to extract</span></p>
</blockquote>
<!-- H3 { margin-bottom: 0.08in; }H3.cjk { font-family: "WenQuanYi Micro Hei"; }H3.ctl { font-family: "Lohit Hindi"; }P { margin-bottom: 0.08in; }A:link {  } -->
<p><span style="font-style: normal;">So here we find that we have 2 pieces of malware, one is a Portable Executable for a Windows box and the other is a Zip archive. This is a very nice start, but was just 2 needles in a large and growing haystack, and the manual effort was laborious and downright daunting.</span></p>
<h3 class="western">Bash to the Rescue</h3>
<p>As coders love to do, our answer was to take the awesome product Maltrieve and throw some more code at it. My initial thought was to extend the python script, but since I pulled this from a GitHub repository I didn't want to modify the code and then have to &ldquo;re-modify&rdquo; it later if things were ever changed or upgraded. My answer was to create a small Bash Shell script and run it to help categorize our malware repository. The requirements we set upon ourselves were to categorize the code into multiple directories based on the first word output from the <em>file</em><span style="font-style: normal;"> command and then further categorize that by separating the code by size. We decided that 0-50KB files would be considered &ldquo;small&rdquo;, 51KB-1MB would be considered &ldquo;medium&rdquo;, 1.xMB-6MB would be considered &ldquo;large&rdquo;, and anything larger would be considered &ldquo;xlarge&rdquo;. It's a rather brutish method but it's something and it seems to work nicely. So in the end, we would want to see a directory tree that looked something like this:</span></p>
<p><span style="font-style: normal;">--PE32</span></p>
<p><span style="font-style: normal;">----small</span></p>
<p><span style="font-style: normal;">----medium</span></p>
<p><span style="font-style: normal;">----large</span></p>
<p><span style="font-style: normal;">----xlarge</span></p>
<p><span style="font-style: normal;">--Zip</span></p>
<p><span style="font-style: normal;">----small</span></p>
<p><span style="font-style: normal;">----medium</span></p>
<p><span style="font-style: normal;">----large</span></p>
<p><span style="font-style: normal;">----xlarge</span></p>
<p><span style="font-style: normal;">and so on and so on.</span></p>
<!-- P { margin-bottom: 0.08in; }A:link {  } -->
<p><span style="font-style: normal;">Since we set up our maltrieve pulls to run hourly we decided to run the bash script - which we so obviously named </span><span style="font-style: normal;"><strong>maltrievecategorizer.sh &ndash;</strong></span><span style="font-style: normal;"><span style="font-weight: normal;"> to run on every half hour, which allows maltrieve to finish and then categorizes the latest findings. To make this happen, we cracked open crontab again with </span></span><span style="font-style: normal;"><strong>sudo crontab -e </strong></span><span style="font-style: normal;"><span style="font-weight: normal;">and added the following to the end of the file:</span></span></p>
<!-- P { margin-bottom: 0.08in; }A:link {  } -->
<blockquote>
<p><span style="font-style: normal;"><span style="font-weight: normal;">30 * * * * bash /opt/maltrieve/maltrievecategorizer.sh </span></span></p>
</blockquote>
<!-- H3 { margin-bottom: 0.08in; }H3.cjk { font-family: "WenQuanYi Micro Hei"; }H3.ctl { font-family: "Lohit Hindi"; }P { margin-bottom: 0.08in; }A:link {  } -->
<p><span style="font-style: normal;">which just says to run our bash script on the half hour of every day of the year, plain and simple.</span></p>
<h3 class="western">The Bash Script</h3>
<p><span style="font-style: normal;">The </span><span style="font-style: normal;"><span style="font-weight: normal;">maltrievecategorizer.sh bash script can be seen below. An explanation follows the script.</span></span></p>
<!-- P { margin-bottom: 0.08in; }A:link {  } -->
<blockquote>
<p style="margin-bottom: 0in;">#!/bin/sh</p>
<p style="margin-bottom: 0in;">&nbsp;</p>
<p style="margin-bottom: 0in;">smallstr="/small"</p>
<p style="margin-bottom: 0in;">mediumstr="/medium"</p>
<p style="margin-bottom: 0in;">largestr="/large"</p>
<p style="margin-bottom: 0in;">xlargestr="/xlarge"</p>
<p style="margin-bottom: 0in;">smallfile=50001</p>
<p style="margin-bottom: 0in;">mediumfile=1000001</p>
<p style="margin-bottom: 0in;">largefile=6000001</p>
<p style="margin-bottom: 0in;">root_dir="/media/malware/maltrievepulls/"</p>
<p style="margin-bottom: 0in;">all_files="$root_dir*"</p>
<p style="margin-bottom: 0in;">for file in $all_files</p>
<p style="margin-bottom: 0in;">do</p>
<p style="margin-bottom: 0in;">&nbsp; if [ -f $file ]; then</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp; outstring=($(eval file $file))</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp; stringsubone="${outstring[1]}"</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp; case $stringsubone in</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "a") stringsubone="PerlScript";;</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "very") stringsubone="VeryShortFile";;</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "empty") rm $file</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; continue;;</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *);;</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp; esac</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp; if [ ! -d $root_dir$stringsubone ]; then</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir -p "$root_dir$stringsubone"</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir -p "$root_dir$stringsubone$smallstr"</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir -p "$root_dir$stringsubone$mediumstr"</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir -p "$root_dir$stringsubone$largestr"</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkdir -p "$root_dir$stringsubone$xlargestr"</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp; fi</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp; filesize=$(stat -c %s $file)</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp; if [[ "$filesize" -le "$smallfile" ]]; then</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mv $file "$root_dir$stringsubone$smallstr/"</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp; elif [[ "$filesize" -le "$mediumfile" ]]; then</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mv $file "$root_dir$stringsubone$mediumstr/"</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp; elif [[ "$filesize" -le "$largefile" ]]; then</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mv $file "$root_dir$stringsubone$largestr/"</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp; else</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mv $file "$root_dir$stringsubone$xlargestr/"</p>
<p style="margin-bottom: 0in;">&nbsp;&nbsp;&nbsp; fi</p>
<p style="margin-bottom: 0in;">&nbsp; fi</p>
<p style="margin-bottom: 0in;">done</p>
</blockquote>
<!-- H3 { margin-bottom: 0.08in; }H3.cjk { font-family: "WenQuanYi Micro Hei"; }H3.ctl { font-family: "Lohit Hindi"; }P { margin-bottom: 0.08in; }A:link {  } -->
<p style="margin-bottom: 0in;">The first several lines simply create string literals for &ldquo;small&rdquo;, &ldquo;medium&rdquo;, &ldquo;large&rdquo;, and &ldquo;xlarge&rdquo; so we can use them later in the script, and then we create three variables &ldquo;smallfile&rdquo;, &rdquo;mediumfile&rdquo;, and &rdquo;largefile&rdquo; so we can compare file sizes later in the script. So far so good! The lines containing:</p>
<blockquote>
<p style="margin-bottom: 0in;">root_dir="/media/malware/maltrievepulls/"</p>
<p style="margin-bottom: 0in;">all_files="$root_dir*"</p>
<p style="margin-bottom: 0in;">for file in $all_files</p>
<p style="margin-bottom: 0in;">do</p>
<p style="margin-bottom: 0in;">if [ -f $file ]; then</p>
</blockquote>
<p style="margin-bottom: 0in;">do nothing more than set our root directory where our maltrieve root is and then run a loop against every file in that directory.</p>
<blockquote>
<p>outstring=($(eval file $file))</p>
</blockquote>
<p style="margin-bottom: 0in;">Creates a variable called outstring that is an array of words representing the output of the <em>file </em><span style="font-style: normal;">command. So using the </span><em>file </em><span style="font-style: normal;">command output from above, the outstring array would have 818fc882dab3e682d83aabf3cb8b453b: PE32 executable (GUI) Intel 80386, for MS Windows  in it. Each array element would be separated by the space in the statement, so outstring[0] would store:  818fc882dab3e682d83aabf3cb8b453b: and outstring[1] would store: PE32 and outstring[2] would store: executable and so on and so on. We are only interested in outstring[1] to make our categorization a possibility.</span></p>
<p style="margin-bottom: 0in;">&nbsp;</p>
<p style="margin-bottom: 0in;"><span style="font-style: normal;">Our next line in the script</span></p>
<blockquote>
<p><span style="font-style: normal;">stringsubone="${outstring[1]}" </span></p>
</blockquote>
<p style="margin-bottom: 0in;">&nbsp;</p>
<p><span style="font-style: normal;">creates a variable named stringsubone that contains just the string held in outstring[1] so using the example above, stringsubone would now hold PE32.</span></p>
<p style="margin-bottom: 0in;"><span style="font-style: normal;">The case statement you see next</span></p>
<blockquote>
<p style="margin-bottom: 0in;">case $stringsubone in</p>
<p style="margin-bottom: 0in;">"a") stringsubone="PerlScript";;</p>
<p style="margin-bottom: 0in;">"very") stringsubone="VeryShortFile";;</p>
<p style="margin-bottom: 0in;">"empty") rm $file</p>
<p style="margin-bottom: 0in;">continue;;</p>
<p style="margin-bottom: 0in;">*);;</p>
<p style="margin-bottom: 0in;"><span style="font-style: normal;">esac </span></p>
</blockquote>
<p><span style="font-style: normal;">fixes a couple problems with the </span><em>file </em><span style="font-style: normal;">command's output. In the case of a piece of malware that is a Perl Script, the output that the </span><em>file </em><span style="font-style: normal;">command provides is: </span><span style="font-style: normal;"><strong>a /usr/bin/perl\015 script. </strong></span><span style="font-style: normal;"><span style="font-weight: normal;">This may be helpful for a human, but it makes our stringsubone variable hold the letter &ldquo;a&rdquo; in it, which means we would be creating a directory later for categorization called &ldquo;a&rdquo; which is LESS THAN USEFUL. The same problem happens with something called Short Files where the output from the </span></span><em><span style="font-weight: normal;">file </span></em><span style="font-style: normal;"><span style="font-weight: normal;">command is: </span></span><span style="font-style: normal;"><strong>very short file (no magic)</strong></span><span style="font-style: normal;"><span style="font-weight: normal;"> which means our  stringsubone variable would hold the word &ldquo;very&rdquo; which isn't a great name for a directory either. The case statement takes care of these 2 and allows for a better naming method for these directories. It also allows for the removal of empty files which are found as well.</span></span></p>
<p style="margin-bottom: 0in;"><span style="font-style: normal;"><span style="font-weight: normal;">The next lines</span></span></p>
<blockquote>
<p style="margin-bottom: 0in;">if [ ! -d $root_dir$stringsubone ]; then</p>
<p style="margin-bottom: 0in;">mkdir -p "$root_dir$stringsubone"</p>
<p style="margin-bottom: 0in;">mkdir -p "$root_dir$stringsubone$smallstr"</p>
<p style="margin-bottom: 0in;">mkdir -p "$root_dir$stringsubone$mediumstr"</p>
<p style="margin-bottom: 0in;">mkdir -p "$root_dir$stringsubone$largestr"</p>
<p style="margin-bottom: 0in;">mkdir -p "$root_dir$stringsubone$xlargestr"</p>
<p style="margin-bottom: 0in;"><span style="font-style: normal;"><span style="font-weight: normal;">fi </span></span></p>
</blockquote>
<p><span style="font-style: normal;"><span style="font-weight: normal;">simply tell the script to look in the directory and if a directory that has the same name as stringsubone does not exist then create it. Then create the directory small, medium, large, and xlarge within that directory for further categorization. Using the PE32 example from above, basically this says &ldquo;if there's no PE32 directory in this root directory, create one and create the sub-directories small, medium, large, and xlarge within that directory. If the PE32 directory already exists then do nothing&rdquo;.</span></span></p>
<p style="margin-bottom: 0in;"><span style="font-style: normal;"><span style="font-weight: normal;">The remaining lines look difficult but are simple:</span></span></p>
<blockquote>
<p style="margin-bottom: 0in;">filesize=$(stat -c %s $file)</p>
<p style="margin-bottom: 0in;">if [[ "$filesize" -le "$smallfile" ]]; then</p>
<p style="margin-bottom: 0in;">mv $file "$root_dir$stringsubone$smallstr/"</p>
<p style="margin-bottom: 0in;">elif [[ "$filesize" -le "$mediumfile" ]]; then</p>
<p style="margin-bottom: 0in;">mv $file "$root_dir$stringsubone$mediumstr/"</p>
<p style="margin-bottom: 0in;">elif [[ "$filesize" -le "$largefile" ]]; then</p>
<p style="margin-bottom: 0in;">mv $file "$root_dir$stringsubone$largestr/"</p>
<p style="margin-bottom: 0in;">else</p>
<p style="margin-bottom: 0in;">mv $file "$root_dir$stringsubone$xlargestr/"</p>
<p style="margin-bottom: 0in;">fi</p>
<p style="margin-bottom: 0in;"><span style="font-style: normal;"><span style="font-weight: normal;">fi </span></span></p>
</blockquote>
<p style="margin-bottom: 0in;"><span style="font-style: normal;"><span style="font-weight: normal;">first we create a variable called filesize and then using the </span></span><em><span style="font-weight: normal;">stat</span></em><span style="font-style: normal;"><span style="font-weight: normal;"> command, we store the file size in that variable. Then we find out if the file fits in our category of small, medium, large, or xlarge using if and elif comparison statements. Whichever comparison statement turns out to be correct is where the file is then successfully moved.</span></span></p>
<p style="margin-bottom: 0in;">&nbsp;</p>
<p style="margin-bottom: 0in;"><span style="font-style: normal;"><span style="font-weight: normal;">The results of this solution are in the picture below.</span></span></p>
<p style="margin-bottom: 0in;">&nbsp;</p>
<p><span class="full-image-block ssNonEditable"><span><img style="width: 650px;" src="http://www.tekdefense.com/storage/post-images/thecategorizeddirs.png?__SQUARESPACE_CACHEVERSION=1390976462053" alt="" /></span></span></p>
<h3 class="western">Conclusion</h3>
<p style="margin-bottom: 0in;"><span style="font-style: normal;"><span style="font-weight: normal;">As you can plainly see, we now have the ability to quickly look for specific files in an easier fashion. If I am looking for a piece of malware that I know to be in HTML format that was over 50KB, but less than 1MB, I can easily roam to HTML-&gt;medium and a one-liner file command with some grepping and find what I am looking for. I'm certain there are other methods to go about this process and probably WAY better methods of categorizing this directory, so if you have some ideas please shoot them our way and we'll give them a try and see if we can help the community. </span></span></p>
<p style="margin-bottom: 0in;">&nbsp;</p>]]></description><wfw:commentRss>http://www.tekdefense.com/news/rss-comments-entry-34597495.xml</wfw:commentRss></item><item><title>Analyzing DarkComet in Memory</title><category>DarkComet</category><category>Malware analysis</category><category>Memory</category><category>News</category><category>Volatility</category><dc:creator>Admin</dc:creator><pubDate>Mon, 23 Dec 2013 21:14:33 +0000</pubDate><link>http://www.tekdefense.com/news/2013/12/23/analyzing-darkcomet-in-memory.html</link><guid isPermaLink="false">830757:9759328:34524323</guid><description><![CDATA[<p>*Note: This article turned out much longer than I originally anticipated. For those who are looking actionable data from this report but don&rsquo;t want to suffer through the entire article, there are Yara rules at the end!</p>
<h3>Overview</h3>
<p>In a recent case I came across DarkComet and had the opportunity to test out my new <a href="http://www.tekdefense.com/news/2013/12/3/review-malware-and-memory-forensics-with-volatility.html">Volatility skills</a>. Over the course of this article I will be using a memory dump from a Windows7 VM that I installed the following sample on:</p>
<p><a href="https://www.virustotal.com/en/file/6d34ded00c0da9887ba752872093f59c649de72a1f629a32014f5ed8be509363/analysis/">f6351da84168d40fae8da0c156fbab0f</a> &ndash; Downloaded from VirusTotal</p>
<p>If you would like to follow along feel free to <a href="https://drive.google.com/file/d/0B-pKvSR-QbsHdDRzeG8xNVNnbEU/edit?usp=sharing">Download a practice memdump</a>. Keep in mind that the memdump available for download is from the same piece of malware but from a different machine then I used in the rest of the article, so PIDs won't match up. That should make the memdump a little more fun for you. In the case I was working, all I had was a memory sample and an alert from a network appliance stating that DarkComet communications came from the suspected host. My goal in the investigation was to determine if the host was actually infected, is the infection DarkComet, what was the malware doing, was there any exfiltration, and was this infection used to pivot elsewhere in the network.</p>
<h3>Getting started</h3>
<p>There are a few different approaches an analyst can take. Some will go research heavy and try to learn what they can about DarkComet before looking at the dump, while others like to dive right in. Me, I live dangerously sometimes, so I dove in without doing much research. I actually like a hybrid approach though. Just like when I get a PCAP I like to get a feel for a memory dump before doing too much research, mainly because I don&rsquo;t want to subject myself to confirmation bias.</p>
<h3>Process analysis</h3>
<p>Like always I start off with an <a href="https://code.google.com/p/volatility/wiki/CommandReference#imageinfo">imageinfo</a> to get an idea of what profile I should use, but also to understand the timezone of the image. Then I move onto <a href="https://code.google.com/p/volatility/wiki/CommandReference#psxview">psxview</a>. Running psxview, Volatility will check for processes within the memory dump in various ways. This helps us find suspicious processes even if they try to circumvent analysis via one or multiple standard methods. Using the &ndash;A flag with psxview applies rules to help us understand what legitimate processes should show as &ldquo;False&rdquo; by replacing &ldquo;False&rdquo; with &ldquo;Okay&rdquo;.</p>
<p><span class="full-image-block ssNonEditable">&nbsp;</span></p>
<p style="text-align: center;"><img style="width: 650px;" src="http://www.tekdefense.com/storage/post-images/mp1.png?__SQUARESPACE_CACHEVERSION=1387834030022" alt="" /></p>
<p>In this case, we didn&rsquo;t really have to do much analysis to figure out what our bad process probably is. The attackers made it somewhat easy on us by using a common misspelling runddl32.exe. In scenarios where the malware isn&rsquo;t so obvious we may be looking at loaded dlls, launch times, parents, occurrences, hooks, and paths to find bad processes. So let&rsquo;s do a dlllist on this guy to find out where it resides.</p>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><img style="width: 650px;" src="http://www.tekdefense.com/storage/post-images/mp2.png?__SQUARESPACE_CACHEVERSION=1387834181643" alt="" /></span></p>
<p>Ahh, no surprise here, as we typically see %APPDATA% paths leveraged by attackers. That gives us something to work from.</p>
<p><strong>*MSDCSC is a common path utilized by DarkComet. Most likely a default path in the builder.</strong></p>
<h3>File extraction</h3>
<p>Knowing the path we can check if the file is potentially still resident in memory with <a href="https://code.google.com/p/volatility/wiki/CommandReference#filescan">filescan</a>. In this case it was, so I used dumpfiles to extract it out. In cases where that doesn&rsquo;t work <a href="https://code.google.com/p/volatility/wiki/CommandReference#procexedump">procexedump</a> may be better suited.</p>
<p style="text-align: center;"><img style="text-align: center; width: 650px;" src="http://www.tekdefense.com/storage/post-images/mp3.png?__SQUARESPACE_CACHEVERSION=1387834521378" alt="" /></p>
<p>With it extracted we can then do general analysis on it like one of my favorite commands ever: &ldquo;strings&rdquo;. I will skip that for this article though as I want to focus more on what is in memory rather than in the file extracted from memory.</p>
<h3>Network communications</h3>
<p>Now around this time in the actual case I began to take a closer look at the network connections. Unfortunately though, I did not simulate those connections in this memory dump to be able to show you, so we will skip that as well. Keep in mind you would be looking for what external addresses are involved, what ports, and of course when the network connections occurred. I usually feed the network indicators to <a href="http://www.tekdefense.com/automater/">Automater </a>for OSINT analysis. Additionally, the connections may be a good place to start getting an idea if lateral movement may be occurring. Looking for connections over 445 or 3389 may indicate pivoting, especially when it is two workstations that are involved.</p>
<h3>More process analysis</h3>
<p>Getting back to the processes, I thought it would be good idea to do a <a href="https://code.google.com/p/volatility/wiki/CommandReference#pslist">pslist</a> so I could understand what the parent pid was. The parent was no longer around, so I don&rsquo;t know what did the initial launch, but I do see other processes launched by that same parent. Also, drawing more attention to the process we see notepad.exe launching under runddl32.exe. Usually when I see notepad.exe I will run the notepad plugin in volatility which will show the text of a notepad session. In this case that did not return any results. Using <a href="https://code.google.com/p/volatility/wiki/CommandReference#malfind">malfind</a> on the notepad process we see that it is probably not doing any notepad like activity anyways.</p>
<p style="text-align: center;"><img style="text-align: center; width: 650px;" src="http://www.tekdefense.com/storage/post-images/mp4.png?__SQUARESPACE_CACHEVERSION=1387834780075" alt="" /></p>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><img style="width: 650px;" src="http://www.tekdefense.com/storage/post-images/mp5.png?__SQUARESPACE_CACHEVERSION=1387834930073" alt="" /></span></p>
<h3>Find the Mutants!</h3>
<p>At this point there is no question that runddl32.exe is not a normal process. So let&rsquo;s try to identify other indicators. A great place to start if you know the bad process is to look at handles to see what files, mutants, and registry keys may be of interest. To start off with the Mutants aka Mutex objects, there are some pretty apparent indicators.</p>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><img style="width: 650px;" src="http://www.tekdefense.com/storage/post-images/mp6.png?__SQUARESPACE_CACHEVERSION=1387835014700" alt="" /></span></p>
<p>DarkComet has a default mutex of &ldquo;DC_MUTEX-&lt;7 alphanumeric characters&gt;&rdquo;. For those who don&rsquo;t understand what a mutex is, there are plenty of good articles you can read up on, but for the purpose of this discussion think of it as a way a program can let the OS know it is there so it doesn&rsquo;t get launched again while it is already running.</p>
<p>I looked at a lot of DarkComet samples while trying to test the Yara rules that you will see at the bottom. In that testing here are the unique Mutex objects I saw:</p>
<div id="_mcePaste" style="font-size: 80%;">DC_MUTEX-8H6JNU1,&nbsp;DC_MUTEX-HCLS4W4,&nbsp;DCPERSFWBP,&nbsp;DC_MUTEX-6YKRNWA,&nbsp;DCPERSFWBP,&nbsp;DC_MUTEX-9CB5GV6,&nbsp;DC_MUTEX-PT4LZLZ,&nbsp;DC_MUTEX-KHNEW06,&nbsp;DC_MUTEX-9CB5GV6,&nbsp;DC_MUTEX-T27B7E9,&nbsp;DC_MUTEX-T4AJFQ9,&nbsp;DC_MUTEX-GQ3M3G4,&nbsp;DC_MUTEX-FLJQNAW,&nbsp;DC_MUTEX-2QUGF5V,&nbsp;BZIRD0K04Q,&nbsp;DC_MUTEX-8Q459BS,&nbsp;DC_MUTEX-WRG2B6H,&nbsp;DC_MUTEX-TMJMXQD,&nbsp;DC_MUTEX-90Q9J91,&nbsp;DC_MUTEX-8H6JNU1,&nbsp;DC_MUTEX-ZEG6XKR,&nbsp;_x_X_UPDATE_X_x_,&nbsp;_x_X_PASSWORDLIST_X_x_,&nbsp;_x_X_BLOCKMOUSE_X_x_,&nbsp;***MUTEX***,&nbsp;***MUTEX***_PERSIST, MUTEX***_SAIR,&nbsp;DC_MUTEX-U9WXEAQ,&nbsp;DC_MUTEX-E44KJ8W,&nbsp;DC_MUTEX-RT7ED81</div>
<p>&nbsp;</p>
<p><strong>*There are a couple in here that I am not positive were actually DarkComet as I used AV signatures to grab the sample set. As we all know AV can sometimes be misleading.</strong></p>
<h3>DarkComet config</h3>
<p>We have already learned a lot about this malware, but there are still plenty of other things to know. For instance, did it implement a persistence mechanism, what capabilities does it have, how did it get on the system, and so on. To begin to answer those questions I like to dump out the memory of a process and then run strings against it to start to paint a picture. I ran the following command to generate a <a href="https://code.google.com/p/volatility/wiki/CommandReference#memdump">memdump </a>of the process (runddl32.exe) itself.</p>
<blockquote>
<p>python ~/Desktop/volatility/volatility_train/vol.py -f ~/interview/WIN-MKFGQA8PLLR-20131219-151611.raw --profile=Win7SP1x86 memdump -p 1972 -D.</p>
</blockquote>
<p>Now with that I ran strings. Keep in mind that when running strings in Linux you need to use the &ndash;a options and you have to run separately for ASCII and UNICODE, which will look something like this:</p>
<blockquote>
<p>strings -a 1972.dmp #ASCII</p>
<p>strings -a &ndash;e l 1972.dmp #UNICODE</p>
</blockquote>
<p><strong>*There are of course other methods that can be leveraged here to combine these commands</strong></p>
<p>After spending a ton of time looking through these strings, I began to pick out some very obvious data. My favorite of which is the DarkComet configuration:</p>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><img style="width: 650px;" src="http://www.tekdefense.com/storage/post-images/mp7.png?__SQUARESPACE_CACHEVERSION=1387835171969" alt="" /></span></p>
<p>As you can imagine, once I found the DarkComet configuration in memory the case changed a lot for me. To really understand it though I had to do a bit of research to understand what each of these options meant.</p>
<p>Most of the data on these commands came from two places, searching through the posts on hackforums[.]net and and article from Context Information Security (<a href="http://contextis.com/research/blog/malware-analysis-dark-comet-rat/">http://contextis.com/research/blog/malware-analysis-dark-comet-rat/</a>)</p>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><img src="http://www.tekdefense.com/storage/post-images/mp8.png?__SQUARESPACE_CACHEVERSION=1387835220097" alt="" /></span></p>
<p>Some of them are obvious like NETDATA, PERSINT, KEYNAME, etc. Others are not so obvious though, like OFFLINEK which became a very important part of my case. So let&rsquo;s explain some of these here:</p>
<blockquote>
<p>MUTEX={DC_MUTEX-KHNEW06} # This is the Mutant/mutex value that is used</p>
<p>SID={Guest16} # Campaign name</p>
<p>FWB={0} # Firewall bypass (Windows Firewall)</p>
<p>NETDATA={test213.no-ip.info:1604} # C2 *Most seem to be 1604 so that is probably the default</p>
<p>GENCODE={F6FE8i2BxCpu} # Not quite sure on this one, perhaps part of building the encryption?</p>
<p>KEYNAME={MicroUpdate} # Registry key name</p>
<p>EDTDATE={16/04/2007} # Used for time stamp manipulation</p>
<p>PERSINST={1} # Persistence</p>
<p>MELT={0} # Delete the original executable or not</p>
<p>CHANGEDATE={1} # Use the EDTDATE to modify the $SI timestamps</p>
<p>DIRATTRIB={6} # Modify the attributes of a directory, such as make it hidden</p>
<p>FILEATTRIB={6} # Modify the attributes of a file, such as make it hidden</p>
<p>OFFLINEK={1} # Offline keylogging</p>
</blockquote>
<p>So as you can tell, I didn&rsquo;t find out what each option does, but enough to get by for now. If I was really interested in knowing each possible option and what it means, I would take the time to get the latest version of the builder and try out each option to determine what the config changed too. Now this sample's configuration differs slightly from the sample I had for the case, but the general strokes are the same.</p>
<h3>Keylogger</h3>
<p>The OFFLINEK option had me confused for a bit. So to explain it a bit better, when OFFLINEK is enabled &ldquo;{1}&rdquo; the malware will continue to log keystroke to a local file that can then be picked up by the attacker as they want. When disabled, the attacker only has access to keystrokes when the attacker has a live session open with the victim. Looking through the strings memdump in my case quickly showed artifacts that were indicative of a keylogger such as &ldquo;[&lt;-]&rdquo; and the titles of open windows like outlook emails. Strings also showed a path that seemed somewhat suspicious as well.</p>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><img src="http://www.tekdefense.com/storage/post-images/mp9.png?__SQUARESPACE_CACHEVERSION=1387835363267" alt="" /></span></p>
<p>In my actual case I did a filescan to see if there was a file object open for the file in the dclogs directory. There was, so I used dumpfiles to extract it. With the file in hand it was easy to see all the keystrokes that were logged in that file.</p>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><img style="width: 650px;" src="http://www.tekdefense.com/storage/post-images/mp10.png?__SQUARESPACE_CACHEVERSION=1387835421331" alt="" /></span></p>
<p>DarkComet logs keystrokes in a different file for each day. In all the testing and client work I have done, it seems that only the key log file for the day of the acquisition can be extracted as a full file from memory. The log for keystrokes by default are stored in a file named &ldquo;dclogs\&lt;Date&gt;.dc&rdquo;. This can be useful in finding the initial infection date, as the log files will have entries in the MFT (We&rsquo;ll talk more on the timeline later). Within the log, the keystrokes and open windows are logged as seen below.</p>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><img style="width: 650px;" src="http://www.tekdefense.com/storage/post-images/mp11.png?__SQUARESPACE_CACHEVERSION=1387835509620" alt="" /></span></p>
<h3>DarkComet commands</h3>
<p>While looking through the strings in the memdump of the runddl32.exe process I also came across some commands that appear to be functions for DarkComet. This hints at some of the functionality. None of this is surprising though, as we have seen plenty or RATs that all have similar functionality.</p>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><img src="http://www.tekdefense.com/storage/post-images/mp12.png?__SQUARESPACE_CACHEVERSION=1387835574546" alt="" /></span></p>
<h3>Persistence</h3>
<p>At this point in the investigation I had about answered everything I had wanted to in my actual investigation. I did not find any evidence that would suggest lateral movement occurred, but I did see plenty of evidence that suggest exfiltration did. My guess is that the exfiltration data was the keylogger logs, but I was not able to prove with the memory image alone. I did not run the <a href="http://jamaaldev.blogspot.com/2013/07/ethscan-volatility-memory-forensics.html">ethscan </a>plugin on this occasion, but that may have been able to pull a pcap of suspect traffic. The only remaining items I really wanted to answer were where the persistence key is stored and when did the infection take place.</p>
<p>Let&rsquo;s check out the persistence first. We know what the key name is based on the configuration artifacts we pulled (MicroUpdate). We also know via research that there are only a few methods available to DarkComet via the builder for persistence. The standard Run key is used most commonly so it is probably the default. Thanks to the printkey plugin this should be a breeze.</p>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><img style="width: 650px;" src="http://www.tekdefense.com/storage/post-images/mp13.png?__SQUARESPACE_CACHEVERSION=1387835722090" alt="" /></span></p>
<p>There we have it, a standard RUN key in the HKCU for the user that was logged on at the time of infection. With persistence understood, time to check out timeline related data.</p>
<h3>Timeline</h3>
<p>In the Volatility Class <a href="https://twitter.com/gleeda">@gleeda</a> goes over making a &ldquo;<a href="http://computer-forensics.sans.org/blog/2011/12/07/digital-forensic-sifting-super-timeline-analysis-and-creation">Super Timeline</a>&rdquo; using time data in the memory. This is done not just with the timeliner plugin, but also by extracting out the registry and a few other techniques. In my actual case that was what I did, but for this demonstration the MFT plugin alone will suffice. Keep in mind that running timeline data can take a while, so what I like to do is run your general plugins like psxview, pstree, pslist, dlllist, netscan, handles, etc and output them to separate files, so you can cat and grep your way through them for analysis while the timeline is building.</p>
<blockquote>
<p>python ~/Desktop/volatility/volatility_train/vol.py -f ~/interview/WIN-MKFGQA8PLLR-20131219-151611.raw --profile=Win7SP1x86 mftparser --output=body --output-file=mft.csv</p>
<p>mactime -b mft.csv -d -z UTC-5 &gt; mft2.csv</p>
</blockquote>
<p>When analyzing the timeline data, I start with what I already know and pivot from that data. In this case, I know about two directories and some files that are directly involved with this malware. So I will start by grepping that material and looking around the same time frames for other suspicious data.</p>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><img style="width: 650px;" src="http://www.tekdefense.com/storage/post-images/mp14.png?__SQUARESPACE_CACHEVERSION=1387835928062" alt="" /></span></p>
<p>In this demonstration, svchosts.exe in the local temp directory stood out. Now that you have another file of interest you can do a lot of the same things we have already shown to extract it out and learn more about it. In a real case I am looking for what activity occurred right before, so I can understand what may have been the infection point. For instance if I saw a lot of browsing, than it may be a good idea to check out internet history, if I saw a prefetch file entry for java maybe I would look around for an idx file that could show me more. Additionally I am looking for other items that may indicate what the attacker has done once on the box. Here we see that there are key logs being stored, but in more advanced cases where an attacker manages to get a shell, we may see evidence of the tools the attacker was using. <a href="https://twitter.com/jackcr">@jackcr</a> had a <a href="http://blog.handlerdiaries.com/?p=205">recent post</a> on this that goes into further details on that topic.</p>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><img style="width: 650px;" src="http://www.tekdefense.com/storage/post-images/mp15.png?__SQUARESPACE_CACHEVERSION=1387836046061" alt="" /></span></p>
<h3>Wrap it up with Yara</h3>
<p>I could really go into more details on other parts of this analysis but as this is already a very long article I should probably wrap it up. Part of the reason for writing this post is so that if others came across a DarkComet memory sample they could get to the data quicker than I did. To help along with this, the following Yara rules may prove useful:</p>
<blockquote>
<p>rule DarkComet_Config_Artifacts_Memory</p>
<p>{&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; meta:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Description = "Looks for configuration artifacts from DarkComet. Works with memory dump and unpacked samples."</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filetype = "MemoryDump"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Author = "Ian Ahl @TekDefese"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date = "12-19-2013"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; strings:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s0 = "GENCODE={" ascii</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s1 = "MELT={" ascii</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s2 = "COMBOPATH={" ascii</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s3 = "NETDATA={" ascii</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s4 = "PERSINST={" ascii</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; condition:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2 of them</p>
<p>}</p>
<p>&nbsp;</p>
<p>rule DarkComet_Default_Mutex_Memory</p>
<p>{&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; meta:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Description = "Looks for default DarkComet mutexs"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filetype = "MemoryDump"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Author = "Ian Ahl @TekDefese"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date = "12-20-2013"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; strings:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s = "DC_MUTEX-" ascii nocase</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; condition:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; any of them</p>
<p>}</p>
<p>&nbsp;</p>
<p>rule DarkComet_Keylogs_Memory</p>
<p>{&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; meta:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Description = "Looks for key log artifacts"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filetype = "MemoryDump"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Author = "Ian Ahl @TekDefese"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date = "12-20-2013"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; strings:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s0 = "[&lt;-]"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s1 = ":: Clipboard Change :"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s2 = "[LEFT]"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s4 = "[RIGHT]"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s5 = "[UP]"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s6 = "[DOWN]"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s7 = "[DEL]"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $s8 = /::.{1,100}\(\d{1,2}:\d{1,2}:\d{1,2}\s\w{2}\)/ &nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; condition:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; any of them</p>
<p>}</p>
</blockquote>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><img style="width: 650px;" src="http://www.tekdefense.com/storage/post-images/mp16.png?__SQUARESPACE_CACHEVERSION=1387836202137" alt="" /></span></p>]]></description><wfw:commentRss>http://www.tekdefense.com/news/rss-comments-entry-34524323.xml</wfw:commentRss></item><item><title>Automater Output Format and Modifications</title><category>Automater</category><category>DFIR</category><category>News</category><category>OSINT</category><category>Output</category><category>python</category><dc:creator>Admin</dc:creator><pubDate>Wed, 11 Dec 2013 05:44:53 +0000</pubDate><link>http://www.tekdefense.com/news/2013/12/11/automater-output-format-and-modifications.html</link><guid isPermaLink="false">830757:9759328:34498613</guid><description><![CDATA[<p>Our recent post on the <a href="http://www.tekdefense.com/news/2013/12/10/the-extensibility-of-automater.html">extensibility of Automater</a> called for a few more posts discussing other options that the program has available. Particularly, we want to show off some different output options that Automater provides and discuss the sites.xml modifications that provide different output formatting. Please read the extensibility article to get caught up with sites.xml modifications if you are not aware of the options provided with that configuration file.</p>
<p>Automater offers a few possibilities for printouts outside of the standard output (screen-based output) that most users are aware of. By running:</p>
<blockquote>
<p>python Automater.py 1.1.1.1 &ndash;o output.txt</p>
</blockquote>
<p>We tell Automater to run against target 1.1.1.1 and to create a text file named output.txt within the current directory. You can see here, that after Automater does its work and lays out the standard report information to the screen, it also tells you that it has created the text file that you have requested.</p>
<p><img style="width: 600px;" src="http://www.tekdefense.com/storage/post-images/outputtxtgenerated.jpg" alt="" /></p>
<p>Once opened, it is quite obvious that this is the standard output format that you see on your screen now saved to a text file format for storage and further use later.</p>
<p><span class="full-image-block ssNonEditable"><span><img style="width: 600px;" src="http://www.tekdefense.com/storage/post-images/textoutput.jpg?__SQUARESPACE_CACHEVERSION=1386741758490" alt="" /></span></span></p>
<p>While this text format is useful, we thought it would be better to provide the capability to provide a csv format as well as something that would render in a browser. To retrieve a csv formatted report, you would use the &ndash;c command line switch and to retrieve an html formatted report, you would use the &ndash;w command line switch. These options can all be run together, so if we ran the command:</p>
<blockquote>
<p>python Automater.py 1.1.1.1 &ndash;o output.txt &ndash;c output.csv &ndash;w output.html</p>
</blockquote>
<p>We would receive 3 different reports other than the standard screen reporting &ndash; 1 standard text file, 1 comma-seperated text file, and 1 html&nbsp;formatted file. Each of the reports are different and can be utilized based on your requirements.</p>
<p>Since we&rsquo;ve already seen the text file, I wanted to show you the layout of the HTML and comma-separated outputs. Below you can see them, and I think you&rsquo;ll find each of these quite useful for your research endevours.</p>
<p><span class="full-image-block ssNonEditable"><span><img style="width: 600px;" src="http://www.tekdefense.com/storage/csvoutput.jpg?__SQUARESPACE_CACHEVERSION=1386741891571" alt="" /></span></span></p>
<p><span class="full-image-block ssNonEditable"><span><img style="width: 600px;" src="http://www.tekdefense.com/storage/post-images/htmloutput.jpg?__SQUARESPACE_CACHEVERSION=1386741917762" alt="" /></span></span></p>
<p>You will notice that I&rsquo;ve called out a specific &ldquo;column&rdquo; in each of the files that is marked with the header &ldquo;Source&rdquo; in each. This is where the modification of the sites.xml file comes into play. Again, if you need to take a look at how to use sites.xml file for adding other sites and modifying output functionality, please see this <a href="http://www.tekdefense.com/news/2013/12/10/the-extensibility-of-automater.html">article</a>. But for now, let&rsquo;s take a look at what we can do with changing the html and comma-separated report format functionality by changing one simple entry in the sites.xml file. Below, you can see a good look at the robtex.com site element information within the config file. It is obviously here that we want to modify this scenario, since both of our outputs have RobTex DNS written out in the Source &ldquo;column.&rdquo; Looking at the sites.xml file we can easily see that this entry must be defined within the &lt;sitefriendlyname&gt; XML element.</p>
<p><span class="full-image-block ssNonEditable"><span><img style="width: 600px;" src="http://www.tekdefense.com/storage/post-images/sitesxmlsitefriendlynamecallout.jpg?__SQUARESPACE_CACHEVERSION=1386742035623" alt="" /></span></span></p>
<p>Let&rsquo;s change our sites.xml file to show how modifying the &lt;sitefriendlyname&gt; XML element can change our report ouput. We will change the &lt;entry&gt; element within the &lt;sitefriendlyname&gt; element to say &ldquo;Changed Here&rdquo; as seen below:</p>
<p><span class="full-image-block ssNonEditable"><span><img style="width: 600px;" src="http://www.tekdefense.com/storage/post-images/sitesxmlchangedhere.jpg?__SQUARESPACE_CACHEVERSION=1386742098304" alt="" /></span></span></p>
<p>Now we will run Automater again with the same command line as before:</p>
<blockquote>
<p>python Automater.py 1.1.1.1 &ndash;o output.txt &ndash;c output.csv &ndash;w output.html</p>
</blockquote>
<p>And we&rsquo;ll take a look again at our output.csv and output.html files. Notice that the Source &ldquo;column&rdquo; information has been changed to represent what you want to see based on the sites.xml configuration file.</p>
<p><span class="full-image-block ssNonEditable"><span><img style="width: 600px;" src="http://www.tekdefense.com/storage/post-images/changedherecsv.jpg?__SQUARESPACE_CACHEVERSION=1386742198873" alt="" /></span></span></p>
<p><span class="full-image-block ssNonEditable"><span><img style="width: 600px;" src="http://www.tekdefense.com/storage/post-images/changedherehtml.jpg?__SQUARESPACE_CACHEVERSION=1386742220945" alt="" /></span></span></p>
<p>As you&rsquo;ll see when you inspect the sites.xml format, you can change these &lt;entry&gt; elements within the &lt;sitefriendlyname&gt; elements for each regular expression that you are looking for on those sites that have multiple entries. This allows you to change the Source output string in the file based on specific findings. For instance, if you look at the default sites.xml file that we provide you at <a href="https://github.com/1aN0rmus/TekDefense-Automater">GitHub</a> you will find that our VirusTotal sites have multiple entries for the Source string to be reported. This allows you full autonomy in reporting information PER FINDING (regex) so that your results are easily read and understood by you and your team.</p>]]></description><wfw:commentRss>http://www.tekdefense.com/news/rss-comments-entry-34498613.xml</wfw:commentRss></item></channel></rss>