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

<channel>
	<title>PredragTasevski.com</title>
	<atom:link href="http://predragtasevski.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://predragtasevski.com</link>
	<description>Sharing is Caring</description>
	<lastBuildDate>Thu, 10 May 2012 17:01:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Helsinki</title>
		<link>http://predragtasevski.com/cybersecurity/helsinki/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=helsinki</link>
		<comments>http://predragtasevski.com/cybersecurity/helsinki/#comments</comments>
		<pubDate>Thu, 10 May 2012 17:01:20 +0000</pubDate>
		<dc:creator>pece</dc:creator>
				<category><![CDATA[Cyber Security]]></category>

		<guid isPermaLink="false">http://predragtasevski.com/cybersecurity/helsinki/</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[[SinglePic not found]
]]></content:encoded>
			<wfw:commentRss>http://predragtasevski.com/cybersecurity/helsinki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clever solution by making site more resilient by optimization</title>
		<link>http://predragtasevski.com/attacks_defense/clever-solution-by-making-site-more-resilient-by-optimization/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clever-solution-by-making-site-more-resilient-by-optimization</link>
		<comments>http://predragtasevski.com/attacks_defense/clever-solution-by-making-site-more-resilient-by-optimization/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 12:50:47 +0000</pubDate>
		<dc:creator>pece</dc:creator>
				<category><![CDATA[Simulation of Attacks and Defense]]></category>
		<category><![CDATA[ab]]></category>
		<category><![CDATA[attacks]]></category>
		<category><![CDATA[clever solution]]></category>
		<category><![CDATA[cyber security]]></category>
		<category><![CDATA[DDoS]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[Jmeter]]></category>
		<category><![CDATA[malicious code]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://predragtasevski.com/?p=379</guid>
		<description><![CDATA[PURPOSE &#38; SCENARIO The objective of this laboratory test, scenario is to make explore alternative &#8220;clever&#8221; solutions (as opposed to making the site more resilient by optimizing it) to protect your site against attacks. Moreover, DDoS1 attacks, malicious code, etc. &#8230; <a href="http://predragtasevski.com/attacks_defense/clever-solution-by-making-site-more-resilient-by-optimization/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1><span style="font-family: Arial, sans-serif;">PURPOSE &amp; SCENARIO</span></h1>
<p>The objective of this laboratory test, scenario is to make explore alternative &#8220;clever&#8221; solutions (as opposed to making the site more resilient by optimizing it) to protect your site against attacks. Moreover, DDoS<a name="sdfootnote1anc" href="#sdfootnote1sym"></a><sup>1</sup> attacks, malicious code, etc.</p>
<p><span id="more-379"></span></p>
<p><span style="color: #000000;"><span style="font-family: Arial, sans-serif;"><span style="font-size: small;"> Therefore, we need to d</span></span></span>evelop countermeasures for the <strong>working</strong> attacks simulated with a standard DoS attack from a single IP address (performed with AB<a name="sdfootnote2anc" href="#sdfootnote2sym"></a><sup>2</sup> or Jmeter). Limitations for this scenarios is highlighted:</p>
<ul>
<li>No additional hardware can be used</li>
<li>The wordpress installation can not be optimized: no caching plugins, no reverse-proxy (varnish, squid etc)</li>
<li>No reactive measures that automatically block incoming traffic: the site must respond to at least some of the requests coming from the attacker at all times</li>
<li>The countermeasures must not have negative effects on &#8220;normal usage pattern&#8221;. Normal usage pattern is defined as:
<ul>
<li>Bursts of 10 connections per IP address in 1 second</li>
<li>Page load times not over 10 seconds</li>
</ul>
</li>
<li>Normal usage must be possible from the same IP address that the attack originated from after a 20 second delay maximum.</li>
</ul>
<p>In addition, we have to make much of the rules for the scenario. Rules as follow: Fresh installation of the latest version of Ubuntu Server and the most recent WordPress as of 20.10.2011. First priority: No normal usage pattern connections can be dropped! Second priority: service speed of normal connections. Defined by number of connections / second (easy to measure). Third priority: How fast after the attack is stopped, the site can be accessed from the attacking IP again.</p>
<p>Each test and measured results will be exposed in to Test section. Whereas, the process of installation of clever solution and attacking scripts will be provided in to Appendixes section.</p>
<p>Finally, the measurement results will be compared with the first state without attack and any security solutions applied. Alternatively, providing measurement results with one solution and attack will help us to identify the most beneficial security solution. Therefore, in Conclusion section comparison results will be highlighted.</p>
<h1><span style="font-family: Arial, sans-serif;">TESTS</span></h1>
<p><span style="font-family: Arial, sans-serif;">Because of requirements of our scenario we need to display the results before security solution is applied and attacker performance. For this purpose we are going to use an AB script to display the response time of the server:</span></p>
<pre>ab -t 10 -n 10 -c 10 http://192.168.56.102/wordpress/</pre>
<p>The above script provides detail information, yet only important is Request per second. Thus, with an fresh installation and without any security solution, it provided with result of 3.95 [#/sec]. With other word, 3.95 number of request per second. After applying different security solution and performing an attack to the server, results will be divers.</p>
<p>In addition, test were done by two different virtual environment machines. One is for testing results and the other one is to perform attack with the following script:</p>
<pre><span style="font-family: Consolas, sans-serif;"><span style="font-size: x-small;">ab -n 100 -c 10 <a href="http://192.168.56.102/wordpress/">http://192.168.56.102/wordpress/</a></span></span></pre>
<p>&nbsp;</p>
<h2><span style="font-family: Arial, sans-serif;">TEST 1</span></h2>
<p>First test is to install libapache2-mod-evasive [libapache2-mod-evasive]. Where, mod_evasive is an evasive maneuvers module for Apache is to provide some protection in the event of an HTTP DoS or DDoS attack or brute force attack. It is also designed to be a detection tool, and can be easily configured to talk to ipchains, firewalls, routers, and etcetera.</p>
<p>The process of installation and configuration refer to the Appendix 1.</p>
<p>After completed the installation and configuration process it is time to test the security solution and to highlight the results. Before performing the attack the results were somehow, lower then, before installing the mod-evasive, 2.06 number request per second. When we start the attack and in same time analysis the server responded with timeout. The conclusion is that mod-evasive it is not enough solution.</p>
<h2><span style="font-family: Arial, sans-serif;">TEST 2</span></h2>
<p align="JUSTIFY">From previous test we can see that the solution was not enough clever for our needs. The server somehow was dead. However, we are going to install now mod_security module for apache, with side of previous test. For more detail information of installation process and configuration refer to Appendix 2 or to the following source [mod_security].</p>
<h1>CONCLUSION</h1>
<p>There are three points that we should consider and to see which proposal was more accurate and it did the job that was required in the scenario.</p>
<p>In conclusion, the above proposals are nice and good example to have an view of how and with what tools we should perform script kiddie techniques. How to shutdown access to a server. On the whole, it show as how to use tools and methods of measuring the bandwidth of network and how to limit the transfer in comfortable way.</p>
<h1>APPENDIXES</h1>
<p>Appendix 1 is connected with the Method 1, which highlighted points are illustration on what information we should check, to clarify that the virtual environment has limitation of the network interface. Where Appendix 2 is for installation process of Ubuntu Server 10.04 LTS and wordpress, mysql installation.</p>
<h2>APPENDIX 1</h2>
<p><span style="font-family: Arial, sans-serif;"><span style="font-size: small;">Installation process:</span></span></p>
<pre><span style="font-family: Consolas, monospace;"><span style="font-size: x-small;">sudo apt-get install libapache2-mod-evasive</span></span></pre>
<p><span style="font-size: small; font-family: Arial, sans-serif;">Configuration process is followed and gather from the following source [Evasive Module], for addition proposal please refer to[Blacklist]:</span></p>
<pre><span style="font-family: Consolas, sans-serif;"><span style="font-size: x-small;">sudo mkdir /var/log/apache2/mod_evasive</span></span></pre>
<pre><span style="font-family: Consolas, sans-serif;"><span style="font-size: x-small;">sudo chown www-data /var/log/apache2/mod_evasive</span></span></pre>
<p><span style="font-family: Arial, sans-serif;"><span style="font-size: small;">Afterwards, create its configuration file with a default content, with the following command:</span></span></p>
<pre><span style="font-family: Consolas, sans-serif;"><span style="font-size: x-small;">sudo nano /etc/apache2/apache2.conf </span></span></pre>
<pre class="brush: php">
&lt;IfModule mod_evasive20.c&gt;
DOSHashTableSize 3097
DOSPageCount 2
DOSSiteCount 50
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 10
DOSLogDir /var/log/apache2/mod_evasive
DOSEmailNotify root@localhost
DOSWhitelist 127.0.0.1
DOSSystemCommand &amp;quot;/sbin/iptables -I INPUT -p tcp --dport 80 -s %s -j DROP
&lt;/IfModule&gt;
</pre>
<p>The above changes to take effect please restart the apache service by:</span></span></code></p>
<pre><code><span style="font-family: Consolas, sans-serif;"><span style="font-size: x-small;">sudo service apache2 restart</span></span></code></pre>
<p><code><span style="font-family: Arial, sans-serif;"><span style="font-size: small;">You can test whether it works using a script included in the deb package:</span></span></code></p>
<pre><code><span style="font-family: Consolas, sans-serif;"><span style="font-size: x-small;">perl /usr/share/doc/libapache2-mod-evasive/examples/test.pl</span></span></code></pre>
<h2>APPENDIX 2</h2>
<p>Installation and configuration of mod_security:</p>
<pre>apt-get install libapache2-modsecurity
/etc/init.d/apache2 force-reload</pre>
<ul>
<li>Installation media: Ubuntu 11.10 32bit iso image;</li>
<li>HW: Virtualbox, 1CPU 32bit, 512MB RAM, 8GB HD (dynamic allocation);</li>
<li>NIC1 NAT;</li>
<li>NIC2 host only (for ssh and http access from host);</li>
<li>Language used in installation process: English and country Estonia;</li>
<li>Keyboard Layout English;</li>
<li>no http proxy</li>
<li>Default applications</li>
<li>sudo apt-get install lamp phpmyadmin</li>
<li>wget -c <a href="http://wordpress.org/latest.tar.gz">http://wordpress.org/latest.tar.gz</a></li>
<li>tar xvjf latest.tar.gz</li>
<li>sudo cp wordpress /var/www/wordpress</li>
<li>sudo nano /var/www/wordpress/wp-config.php <span style="font-family: Arial, sans-serif;"><br />
</span></li>
<li>Change the settings to your needs</li>
</ul>
<h1>Bibliography</h1>
<p>libapache2-mod-evasive: Canonical Ltd., Package: libapache2-mod-evasive (1.10.1-1), 2011, <a href="http://packages.ubuntu.com/hardy/libapache2-mod-evasive" target="_blank">http://packages.ubuntu.com/hardy/libapache2-mod-evasive</a></p>
<p>mod_security: How to Forge, Secure Your Apache With mod_security, 2006, <a href="http://www.howtoforge.com/apache_mod_security" target="_blank">http://www.howtoforge.com/apache_mod_security</a></p>
<p>Evasive Module: Deep Logic, Inc., Apache Evasive Maneuvers Module, 2005, <a href="http://fossies.org/unix/www/apache_httpd_modules/mod_evasive_1.10.1.tar.gz:t/mod_evasive/README  " target="_blank">http://fossies.org/unix/www/apache_httpd_modules/mod_evasive_1.10.1.tar.gz:t/mod_evasive/README</a></p>
<p>Blacklist: Jeff Starr, Eight Ways to Blacklist with Apache’s mod_rewrite, Feb 2009, <a href="http://perishablepress.com/press/2009/02/03/eight-ways-to-blacklist-with-apaches-mod_rewrite/  " target="_blank">http://perishablepress.com/press/2009/02/03/eight-ways-to-blacklist-with-apaches-mod_rewrite/</a></p>
<p>&nbsp;</p>
<div id="sdfootnote1">
<p>1DDoS – Denial-of-service attack</p>
</div>
<div id="sdfootnote2">
<p><a name="sdfootnote2sym" href="#sdfootnote2anc"></a>2AB - <a href="http://httpd.apache.org/docs/2.0/programs/ab.html">http://httpd.apache.org/docs/2.0/programs/ab.html</a></p>
</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://predragtasevski.com/attacks_defense/clever-solution-by-making-site-more-resilient-by-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing SNORT &#8211; IDS rulesets</title>
		<link>http://predragtasevski.com/cybersecurity/snort_ruleset/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=snort_ruleset</link>
		<comments>http://predragtasevski.com/cybersecurity/snort_ruleset/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 11:12:56 +0000</pubDate>
		<dc:creator>pece</dc:creator>
				<category><![CDATA[Attacks And Cracking]]></category>
		<category><![CDATA[Cyber Security]]></category>
		<category><![CDATA[Simulation of Attacks and Defense]]></category>
		<category><![CDATA[cyber security]]></category>
		<category><![CDATA[DDoS]]></category>
		<category><![CDATA[ids]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[Port scan]]></category>
		<category><![CDATA[snort]]></category>
		<category><![CDATA[snort rules]]></category>
		<category><![CDATA[SYN flood]]></category>
		<category><![CDATA[testing ids]]></category>
		<category><![CDATA[vulnerability scanning]]></category>

		<guid isPermaLink="false">http://predragtasevski.com/?p=354</guid>
		<description><![CDATA[SCENARIO The objective of this laboratory test, scenario is to create a solution and instructions for testing an IDS1 systems usefulness for detecting attacks against a wordpress site. In addition, we have to develop/download/find/whatever a SNORT configuration (rulesets, preprocessors, whatever) &#8230; <a href="http://predragtasevski.com/cybersecurity/snort_ruleset/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1>SCENARIO</h1>
<p>The objective of this laboratory test, scenario is to create a solution and instructions for<br />
testing an IDS<sup>1</sup> systems usefulness for detecting attacks against a wordpress site. In<br />
addition, we have to develop/download/find/whatever a SNORT configuration (rulesets,<br />
preprocessors, whatever) that performs better than the default configuration in <a title="Testing IDS" href="http://predragtasevski.com/attacks_defense/testing-ids/" target="_blank">previous<br />
post</a>. By better we mean:</p>
<ul>
<li>Less false positives</li>
<li>Less false negatives</li>
<li>The objectives are contradictory so the rule of thumb is one false negative per 10 false positives eg. solution with 10 false positives and 2 false negatives is better than the solution with 100 false positives and 1 false negatives, but the solution with 10 false positives and 1 false negative is better than the solution with 1 false positive and 2 false negatives.</li>
<li>Attack is defined by a single invocation of all the test scripts in a row</li>
</ul>
<p><span id="more-354"></span>Meanwhile, the new rules have to be able to detect not only the default attacks that<br />
are set to a default snort configuration, yet they have to be able to detect SQL injection,<br />
brute force password, apache killer script, pytbull, etc. Furthermore, in figure 1 we are<br />
illustrating the scenario.</p>
<div id="attachment_355" class="wp-caption aligncenter" style="width: 549px"><img class="size-full wp-image-355" title="Illustration 1: Illustration of Scenario" src="http://predragtasevski.com/wp-content/uploads/snort_rules.png" alt="Illustration 1: Illustration of Scenario" width="539" height="281" /><p class="wp-caption-text">Illustration 1: Illustration of Scenario</p></div>
<p>Therefore, in the proposal section we will present two proposals that have been submitted due to this laboratory test and additionally in result section we will highlighted the identification numbers made by snort set new rules. In section appendixes we will provide you with more details configuration procedures, configuration of VM&#8217;s – Virtual Machines, attacks, etc.<br />
Finally, closing with an conclusion and the results of best set of rules made of the proposals.</p>
<h1>SETUP of SNORT</h1>
<p>To setup snort in a right way, that will work for the second Host only network please following the instruction link provided with a full description and configuration of snort<br />
[SNORT2].</p>
<h1>PROPOSALS</h1>
<p>In total two proposals are presented in next sub-sections.</p>
<h2>PROPOSAL 1</h2>
<p>Add <a href="http://www.tud.ttu.ee/~t061780/attacks/robert.rules" target="_blank">http://www.tud.ttu.ee/~t061780/attacks/robert.rules</a> to your Snort.<br />
On your Snort machine:</p>
<pre class="brush: php">cd /etc/snort/rules
wget http://www.tud.ttu.ee/~t061780/attacks/robert.rules</pre>
<p>Now you have the rules, add them to your snort conf file (default /etc/snort/snort.conf). To do that inser:</p>
<pre class="brush: php">&quot;include $RULE_PATH/robert.rules&quot;</pre>
<p>somewhere with rest of the rules after line 800. Run Snort and test.</p>
<h2>PROPOSAL 2</h2>
<p>Add the following rules: <a href="http://predragtasevski.com/predrag.rules" target="_blank">http://predragtasevski.com/predrag.rules</a><br />
To be able to insert the snort rules in to the snort file please double check where it is located. You can find the location with the following command: find / -name snort.conf<br />
Before you continue please change the IP address to your server address on line number #6, example alert tcp any any -&gt; 192.168.56.X where x is your octet.<br />
Then to add the following rules at the conf file do the following command:</p>
<pre class="brush: php">cat predrag.rules &amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;gt; snort.conf</pre>
<p>Now it is time to start or restart snort. It should work.</p>
<h1>RESULTS</h1>
<p>After executing the above proposal we will highlight the results into the table bellow. Result<br />
are presented from the total amount of reports, registered alerts in the snort. This is done<br />
by help of web interface of Basic Analysis and Security Engine in addition Analysis<br />
Console for Intrusion Databases (ACID) project tool [ACID]. Therefore, the result from the<br />
proposals are highlighted below:</p>
<table style="background-color: #ffffff;" width="400" border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td>Attack performed</td>
<td>Proposal number</td>
<td>Baseline Total number of Alerts</td>
<td>Total number of Alerts</td>
<td>Unique Alerts</td>
<td>Categories</td>
</tr>
<tr>
<td>SQL injection</td>
<td>1</td>
<td bgcolor="#FF0000">0</td>
<td bgcolor="#FF0000">0</td>
<td bgcolor="#FF0000">0</td>
<td>0</td>
</tr>
<tr>
<td>SQL injection</td>
<td>2</td>
<td bgcolor="#FF0000">0</td>
<td bgcolor="#009933">52</td>
<td bgcolor="#009933">1</td>
<td>1</td>
</tr>
<tr>
<td>Pytbull &#8211; evasion</td>
<td>1</td>
<td>N/A</td>
<td bgcolor="#66CC00">128</td>
<td bgcolor="#66CC00">6</td>
<td>3</td>
</tr>
<tr>
<td>SQL injection + nmap</td>
<td>Combine both</td>
<td>N/A</td>
<td bgcolor="#66CC00">36</td>
<td bgcolor="#66CC00">5</td>
<td>3</td>
</tr>
<tr>
<td>Pytbull</td>
<td>Combine both</td>
<td>N/A</td>
<td bgcolor="#00FF00">844</td>
<td bgcolor="#00FF00">7</td>
<td>3</td>
</tr>
</tbody>
</table>
<p>Table 1: Details of total report numbers of alerts made by SNORT and the different proposal rule sets. Details of the attacks conducted in the table are presented in appendixes section.</p>
<p>Additionally, figure 2 is presenting the pine chart of the total number alerts<br />
recognized by Snort.</p>
<div id="attachment_357" class="wp-caption aligncenter" style="width: 557px"><img class="size-full wp-image-357" title="Illustration 2: Total number of Alerts" src="http://predragtasevski.com/wp-content/uploads/snort11.png" alt="Illustration 2: Total number of Alerts" width="547" height="323" /><p class="wp-caption-text">Illustration 2: Total number of Alerts</p></div>
<p>Secondly, figure 3 is representing the pine chart of total number of unique alerts recognized by Snort.</p>
<div id="attachment_358" class="wp-caption aligncenter" style="width: 560px"><img class="size-full wp-image-358" title="Illustration 3: Total number of Unique Alerts" src="http://predragtasevski.com/wp-content/uploads/snort2.png" alt="Illustration 3: Total number of Unique Alerts" width="550" height="323" /><p class="wp-caption-text">Illustration 3: Total number of Unique Alerts</p></div>
<h1>CONCLUSION</h1>
<p>From the above results we came to conclusion that the new applied rules were successful and were able to recognize alerts more then the default rule set of Snort. Meanwhile, only proposal 2 was able to recognized an SQL injections without any additional tweaking. Although proposal 1 was still useful, on the other hand the best solution is when we combine the both rule sets proposals. Then the Snort is able to recognized an significant number of total alerts and additionally for our laboratory report more interesting is unique total number alerts.</p>
<p>Closing, even the default Snort rules configuration is good, yet when you tweak it by<br />
your own needs, you will have much better IDS system for your network. In future it should be recommended always refer to [snort_rules], to gather more available advance Snort rules, made by experts. Where will help you to configure and setup Snort IDS system to detecting attacks against a wordpress site, etc.</p>
<h1>APPENDIXES</h1>
<p>Appendix 1 is the configuration of the attacker virtual machine, in more detail Blacktrack 5<br />
distribution. Secondly, Appendix 2 is the ubuntu wordpress configuration server and<br />
additional is the configuration and setup process and refer links of IDS Snort virtual<br />
machine. Appendix 4, 5 and 6 are providing brief details about the attacks that were<br />
conducted during this laboratory test.</p>
<h2>APPENDIX 1</h2>
<p>● Installation media: Black Track 5 GNOME 32bit iso image;<br />
● HW: Virtualbox, 1CPU 32bit, 512MB RAM, 8GB HD (dynamic allocation);<br />
● NIC1 NAT;<br />
● NIC2 host only (for ssh and http access from host);<br />
● Downloadable link: <a href="http://www.backtrack-linux.org/downloads/" target="_blank">http://www.backtrack-linux.org/downloads/</a></p>
<h2>APPENDIX 2</h2>
<p>● Installation media: Ubuntu 10.04 32bit iso image;<br />
● HW: Virtualbox, 1CPU 32bit, 512MB RAM, 8GB HD (dynamic allocation);<br />
● NIC1 NAT;<br />
● NIC2 host only (for ssh and http access from host);<br />
● Language used in installation process: English and country Estonia;<br />
● Keyboard Layout English;<br />
● Hostname: pece<br />
● Partition methods: Guided, use entire disk<br />
● Username: pece<br />
● no http proxy<br />
● Default applications</p>
<pre>sudo apt-get install lamp phpmyadmin
wget -c http://wordpress.org/latest.tar.gz
tar xvjf latest.tar.gz
sudo cp wordpress /var/www/wordpress
sudo nano /var/www/wordpress/wp-config.php Change the settings to your needs</pre>
<h2>APPENDIX 3</h2>
<p>● Installation media: Ubuntu 10.04 32bit iso image;<br />
● HW: Virtualbox, 1CPU 32bit, 512MB RAM, 8GB HD (dynamic allocation);<br />
● NIC1 NAT;<br />
● NIC2 host only (for ssh and http access from host);<br />
● Language used in installation process: English and country Estonia;<br />
● Keyboard Layout English;<br />
● Hostname: pece<br />
● Partition methods: Guided, use entire disk<br />
● Username: pece<br />
● no http proxy<br />
● Default applications<br />
● Snort configuration and installation refer to [SNORT1] in addition, please refer to<br />
[SNORT2].</p>
<h2>APPENDIX 4</h2>
<p>Here we test typical SQL- injection in URL.<br />
Commands used:</p>
<pre class="brush: php">wget &quot;http://192.168.56.101/?p=1&#039;%20OR%20&#039;1&#039;=&#039;1&quot;
wget &quot;http://192.168.56.101/?p=1&#039;%20AND%201=(SELECT%20COUNT(*)%20FROM
%20tabname);%20—&quot; </pre>
<p>Snort by default does not detect this, where in applying the proposal 2 rules, it did detect.</p>
<h2>APPENDIX 5</h2>
<p>To test Snort and acidbase, perform a portscan of the Snort host.</p>
<pre class="brush: php">sudo nmap -p1-65535 -sV -sS -O 192.168.56.102</pre>
<h2>APPENDIX 6</h2>
<p>To setup pytbull it is a bit of pain, yet if you follow the rules and the documentation it will<br />
work like shark. For documentation please refer to [pytbull_doc].</p>
<h1>Bibliography</h1>
<p>SNORT2: Nick Moore, Snort 2.8.4.1 Ubuntu 9 Installation Guide, June 2009,<br />
<a href="http://www.snort.org/assets/113/Snort_2.8.4.1_Ubuntu.pdf" target="_blank">http://www.snort.org/assets/113/Snort_2.8.4.1_Ubuntu.pdf</a><br />
ACID: Basic Analysis and Security Engine, Welcome to the Basic Analysis and Security Engine (BASE) project , 2008,<a href="http://base.secureideas.net/about.php" target="_blank"> http://base.secureideas.net/about.php</a><br />
snort_rules:  <a href="http://rules.emergingthreats.net/open/snort-2.9.0/rules/" target="_blank">http://rules.emergingthreats.net/open/snort-2.9.0/rules/</a><br />
SNORT1: kat-amsterdam, SnortIDS, December 2010,<br />
<a href="https://help.ubuntu.com/community/SnortIDS" target="_blank">https://help.ubuntu.com/community/SnortIDS</a><br />
pytbull_doc: Sébastien Damaye, Official documentation for pytbull v1.3 -, 2011, <a href="http://pytbull.sourceforge.net/index.php?page=documentation" target="_blank">http://pytbull.sourceforge.net/index.php?page=documentation</a></p>
<p>1 IDS &#8211; Intrusion detection system</p>
]]></content:encoded>
			<wfw:commentRss>http://predragtasevski.com/cybersecurity/snort_ruleset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing IDS</title>
		<link>http://predragtasevski.com/attacks_defense/testing-ids/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=testing-ids</link>
		<comments>http://predragtasevski.com/attacks_defense/testing-ids/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 17:19:59 +0000</pubDate>
		<dc:creator>pece</dc:creator>
				<category><![CDATA[Simulation of Attacks and Defense]]></category>
		<category><![CDATA[cyber security]]></category>
		<category><![CDATA[DDoS]]></category>
		<category><![CDATA[ids]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[openvas]]></category>
		<category><![CDATA[Port scan]]></category>
		<category><![CDATA[snort]]></category>
		<category><![CDATA[SYN flood]]></category>
		<category><![CDATA[testing ids]]></category>
		<category><![CDATA[vulnerability scanning]]></category>

		<guid isPermaLink="false">http://predragtasevski.com/?p=348</guid>
		<description><![CDATA[SCENARIO The objective of this laboratory test, scenario is to create a solution and instructions for testing an IDS^1 systems usefulness for detecting attacks against a wordpress site. In addition, a repeatable process to evaluate vendor claims. Whatever passive IDS &#8230; <a href="http://predragtasevski.com/attacks_defense/testing-ids/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1>SCENARIO</h1>
<p>The objective of this laboratory test, scenario is to create a solution and instructions for<br />
testing an IDS^1 systems usefulness for detecting attacks against a wordpress site. In<br />
addition, a repeatable process to evaluate vendor claims. Whatever passive IDS system<br />
sample delivered as a VM or a dedicated box. Creating the IDS system itself is out of<br />
scope.<span id="more-348"></span><br />
The process must be detailed enough so that somebody else can get the same<br />
results when applying that. The &#8220;other person&#8221; is expected to have IT knowledge sufficient<br />
to install and run a Linux desktop.<br />
Budget requirements: Modest &#8211; 2 machines + a tester (Joe) + networking equipment<br />
to connect the two machines and an IDS together.<br />
The process must test at least the following attacks:</p>
<ul>
<li>Port scan</li>
<li>SYN flood</li>
<li>&#8220;Regular&#8221; DoS overwhelming attack (Ab)</li>
</ul>
<p>Optionally the process may test:</p>
<ul>
<li>slowloris/pyloris</li>
<li>Apache Range header DoS vulnerability <a href="http://httpd.apache.org/security/CVE-011-3192.txt " target="_blank">http://httpd.apache.org/security/CVE-011-3192.txt </a></li>
<li>An attack targeting any other fairly recent (not older than 3-4 years) known vulnerability that could in theory apply to the target system (wordpress server)</li>
</ul>
<p>However the competition rules are:<br />
The highest number of attacks evaluated. Limits: * Each attack must be relevant eg.<br />
if it attacks IIS it&#8217;s NOT relevant. If it attacks Windows RPC it&#8217;s not relevant. If it attacks<br />
some other CMS eg. Drupal it&#8217;s NOT relevant. * Basically equivalent attacks count as one<br />
(different port scanners for example) * You must be able to explain in broad terms what the attack does eg: attacks the vulnerability #X in Apache server If the #attacks is equal.<br />
Lab instaractions:<br />
Install 3 VM-s: Attacker IDS and Target</p>
<ol>
<li>Make sure all VM-s have two network adapters: NAT and Host-Only.</li>
<li>Install Snort and it&#8217;s GUI called &#8220;acidbase&#8221; on IDS <a href="https://help.ubuntu.com/community/SnortIDS" target="_blank">https://help.ubuntu.com/community/SnortIDS</a>.</li>
<li>Install Apache, Mysql and WordPress on Target.</li>
<li>Execute an attack on Attacker towards the IP address on the Host Only network.</li>
<li>Take notice of the results displayed on Acid console.</li>
<li>Reset counters, move on to next attack</li>
</ol>
<p>Additionally, illustration 1 describes the overview of above scenario</p>
<div id="attachment_349" class="wp-caption aligncenter" style="width: 660px"><a href="http://predragtasevski.com/wp-content/uploads/ids1.png"><img class="size-full wp-image-349" title="Illustration 1: Lab 5 Illustration of Scenario" src="http://predragtasevski.com/wp-content/uploads/ids1.png" alt="Illustration 1: Lab 5 Illustration of Scenario" width="650" height="255" /></a><p class="wp-caption-text">Illustration 1: Lab 5 Illustration of Scenario</p></div>
<p>Firstly, setup procedure of snort, secondly available proposals and thirdly illustrating the results and the functionality of proposals. Finally, closing this laboratory report with conclusion. In addition, appendixes is configuration of VM&#8217;s – Virtual Machines.</p>
<h1>SETUP of SNORT</h1>
<p>To setup snort in a right way, that will work for the second Host only network please following the instruction link provided with a full description and configuration of snort [SNORT2].<br />
After completing the setup and configuration to run snort on the second interface<br />
use the following command:</p>
<pre class="brush: php">snort -c /etc/snort/snort/conf -i eth1</pre>
<h1>PROPOSALS</h1>
<p>In total three proposals and each one is highlighted in the next sub-sections.</p>
<h2>PROPOSAL 1</h2>
<p>Full instructions<br />
1. Set up IDS (Snort) and WordPress on the first PC<br />
2. Install Ubuntu server on the second PC . Then install all attacking tools there :</p>
<pre class="brush: php">wget enos.itcollege.ee/~avein/lab4i.sh
sudo sh lab4i.sh</pre>
<p>After that you should have:<br />
[sourcecode]ab.sh &#8211; DoS attack script &#8211; uses ab to generate traffic flood<br />
apachekiller.pl &#8211; Apachekiller attack script More info:</p>
<p>http://www.hackersgarage.com/apache-killer-denial-of-service-flaw-in-apache-</p>
<p>webserver.html[/sourceocode]<br />
README.txt &#8211; extra instructions</p>
<pre>scan.sh - Port scanning script - uses nmap
sloworis.pl - Sloworis attack script More info: \ 

http://ha.ckers.org/slowloris/

synf.sh - syn flood attack script - uses hping3</pre>
<p>3. Start your IDS/wordpress server and the server with attack tools.<br />
4. Run each attack tool ONE AT A TIME (targeting the wordpress/IDS server of<br />
course) . Monitor the logs/notifications on yours IDS system (SNORT) and check<br />
whether wordpress site is still accessible.<br />
Let each attack tool run 2 minutes, then stop the attack by pressing CTRL+C on the<br />
terminal window where the attack tool is running.<br />
The only exeption is port scan- its better to wait until it finishes .<br />
After each attack save the IDS log and wait atlest 5 minutes before trying next<br />
tool (to give server time to recover). Best practice is to manually check if the<br />
server load is at normal (one can use htop for that)</p>
<pre>a) To run DoS attack :
sh ab.sh
Page 6
{target}
eg sh ab.sh 192.168.56.101
b) For port scan:
sh scan.sh
{target IP}
eg sh scan.sh 192.168.56.101
c) For Syn flood (with hping3)
sh
synf.sh {target}
eg synf.sh 192.168.56.101/wordpress
d) For Sloworis attack:
perl slowloris.pl -dns {target}
eg perl sloworis.pl -dns 192.168.56.101/wordpress
e) For Apachekiller attack:
perl apachekiller.pl
{target IP}
eg perl apachekiller.pl 192.168.56.101</pre>
<h2>PROPOSAL 2</h2>
<h3>Intro</h3>
<p>For this scenario we need to run several different attacks and scans to be able to compare the results with different IDS setups and rulesets. We might also want to test it with legitimate traffic to see that we dont get false positives in our alarms. We dont have that much legitimate traffic possibilities with 1 blog on our servers right now, but if we start tweaking the IDS false positives becomes an important metric and we might want to<br />
test normal usage and create traffic to run with tcpreplay for example. My proposal is to test the IDS with pytbull running on BackTrack. Pytbull is IDS testing framework and BackTrack a Linux ditribution.<br />
I will assume that we have WordPress server with running default Snort set up on it and working. No extensive testing has been done with different snort setups so we might have to tune the methods, but basic things should be covered.</p>
<h3>DL and install BackTrack</h3>
<p><a href="http://www.backtrack-linux.org/downloads/" target="_blank">backtrack-linux.org/downloads/</a><br />
Install it rather than running a live version for this scenario. Boot it up in default mode, start GUI and launch installation from desktop. Default login root / toor. Standard setup comes with pytbull and several pieces of software the IDS test-system depends on like nmap, hping3, nikto and others.</p>
<h3>Setup connections</h3>
<p>Connect the machines and install ftp and ssh on server. We need ftp to get snort alert files and ssh to run attacks against.</p>
<pre>apt-get install vsftpd openssh-server</pre>
<h3>Setup pytbull</h3>
<p>You will find pytbull from /pentest/enumeration/ids/pytbull/ or Applications &gt; BackTrack &gt; Information Gathering &gt; Network Analysis &gt; IDS IPS Identification &gt; pytbull when using the GUI. Change the configuration file values to have correct connection information, user credentials and locations of dependencies. Here you also select which test modules out of the 9 available you want to run. ClientSideAttacks needs extra configuration.</p>
<pre>cd /pentest/enumeration/ids/pytbull/
gedit config.cfg
Example conf file: http://www.tud.ttu.ee/~t061780/attacks/config.cfg
Now get custom DoS module to have hping SYN flood and  \
ApacheBench DoS tests covered.
cd modules
mv denialOfService.py denialOfService.py-backup
wget http://www.tud.ttu.ee/~t061780/attacks/denialOfService.py
You may want to refer to Pytbull documentation</pre>
<h3>Run</h3>
<p>/pentest/enumeration/ids/pytbull/pytbull -t &lt;WP/Snort server IP&gt;<br />
If everything works you will find html report file under /reports. If you have problems add -d on run for debugging.</p>
<h3>(optional) Slowloris</h3>
<p>To have slowloris attack test for pytbull we need to get custom slowloris that allows to set how many packets to send because we dont want the tests to run forever. I added argument s that tells the script to stop after we have sent s packets.</p>
<pre>cd /pentest/stressing
wget www.tud.ttu.ee/~t061780/attacks/slowloris.pl
Slowloris attack has been written into DoS module,  \
 you have to uncomment it. Lines 47-52.
gedit /pentest/enumeration/ids/pytbull/modules/denialOfService.py</pre>
<h2>PROPOSAL 3</h2>
<p>For this proposal I will suggest to use open source tool OpenVas for vulnerability scanning, to test our IDS system. It contains many security tools integrated. The security and analysis tools are: Nikto, nmap, ike-scan, snmpwalk, amap, ldapsearch, SLAD (John-the-Ripper, Chkrootkit, LSOF, ClamAV, Tripwire, TIGER, logwatch,<br />
trapwatch, lm-sensors, snort and ovaldi), pnscan, portbunny, strobe, w3af, etc.<br />
Instructions of installation process, for further more information please refer to <a href="http://www.openvas.org/setup-and-start.html" target="_blank">http://www.openvas.org/setup-and-start.html</a></p>
<h3>Step 1: Configure OBS Repository</h3>
<pre>sudo apt-get -y install python-software-properties
sudo add-apt-repository "deb

http://download.opensuse.org/repositories/security:/OpenVAS:\

  /STABLE:/v4/xUbuntu_10.04/ ./"
sudo apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys \
   BED1E87979EAFD54
sudo apt-get update</pre>
<h3>Step 2: Quick-Install OpenVAS</h3>
<pre>sudo apt-get -y install greenbone-security-assistant gsd openvas-cli \
 openvas-manager openvas-scanner
openvas-administrator sqlite3 xsltproc</pre>
<h3>Step 3: Quick-Start OpenVAS</h3>
<p>(copy and paste whole block, during first time you will be asked to set a password for user &#8220;admin&#8221;)</p>
<pre>test -e /var/lib/openvas/CA/cacert.pem || sudo openvas-mkcert -q
sudo openvas-nvt-sync
test -e /var/lib/openvas/users/om || sudo openvas-mkcert-client \
  -n om -i
sudo /etc/init.d/openvas-manager stop
sudo /etc/init.d/openvas-scanner stop
sudo openvassd
sudo openvasmd --migrate
sudo openvasmd --rebuild
sudo killall openvassd
sleep 15
sudo /etc/init.d/openvas-scanner start
sudo /etc/init.d/openvas-manager start
sudo /etc/init.d/openvas-administrator restart
sudo /etc/init.d/greenbone-security-assistant restart
test -e /var/lib/openvas/users/admin || sudo openvasad -c \
 add_user -n admin -r Admin</pre>
<h3>Step 4: Log into OpenVAS as &#8220;admin&#8221;</h3>
<p>Open https://localhost:9392/ or start &#8220;gsd&#8221; on a command line as a regular user (not as root!).<br />
Optional we can use and the Slowloris and Pyloris DoS attacks.<br />
Download link for Slowloris is: <a href="http://ha.ckers.org/slowloris/slowloris.pl" target="_blank">http://ha.ckers.org/slowloris/slowloris.pl</a><br />
The above solution and tool will help us to check and test our IDS system usefulness. It tests the following attacks: Port scan, SYN flood, DoS, etc. The results are presented with nice GUI interface. For more info about the project please refer to <a href="http://www.openvas.org" target="_blank">www.openvas.org</a>.</p>
<h1>RESULTS</h1>
<p>After executing the above proposal we will highlight the results. Nevertheless, only the<br />
Proposal 1 was able to run the test. Others two, Proposal 2 and Proposal 3 were<br />
unsuccessful of installation process and configuration and to run the attacks. Moreover,<br />
the result are presented from the total amount of reports, registered alerts in the snort.<br />
This is done by help of web interface of Basic Analysis and Security Engine in addition<br />
Analysis Console for Intrusion Databases (ACID) project tool [ACID]. Therefore, the result<br />
from the Proposal 1 and from the rest are highlighted below:</p>
<ul>
<li>Proposal 1</li>
</ul>
<ul>
<ul>
<li>DoS – registered alerts: 2;</li>
<li>Port scan : 8;</li>
<li>synf.sh: 1344;</li>
<li>slowloris.pl: 1782;</li>
<li>apachekiller.pl: not working;</li>
</ul>
<li>Proposal 2</li>
<ul>
<li>pytbull: 0, the message was: Error: FTP error, 550 failed to open file.</li>
</ul>
<li>Proposal 3</li>
<ul>
<li>Too complicated to be configured and installed. The instructions and the procedures should be more easy. After few hours of configuring and test, tweaks are is still not working. Yet there are many good tutorials how to configure OpenVAS please refer [OpenVas1] and [OpenVas2].</li>
</ul>
</ul>
<h1>CONCLUSION</h1>
<p>Primarily, setting-up IDS, the Snort, it is not an easy task to complete. On the other hand,<br />
configuring, installing, etc. the testing tools for IDS system is even more complicated.<br />
Therefore, the Proposal 1 has the best solution and installation process of the test tools.<br />
Despite, that it was the only one that worked.<br />
Finally, recommendation for the IDS solutions and in addition to the penetrating<br />
tools to test the usefulness of IDS has to be more simple and stepwise solution. However,<br />
the above scenario and proposals are great tools and solutions for a future reader.</p>
<h1>APPENDIXES</h1>
<p>Appendix 1 is the configuration of the attacker virtual machine, in more detail Blacktrack<br />
distribution. Secondly, Appendix 2 is the ubuntu wordpress configuration server and<br />
additional is the configuration and setup process and refer links of IDS Snort virtual<br />
machine.</p>
<h2>APPENDIX 1</h2>
<p>● Installation media: Black Track 5 GNOME 32bit iso image;<br />
● HW: Virtualbox, 1CPU 32bit, 512MB RAM, 8GB HD (dynamic allocation);<br />
● NIC1 NAT;<br />
● NIC2 host only (for ssh and http access from host);<br />
● Downloadable link: <a href="http://www.backtrack-linux.org/downloads/" target="_blank">http://www.backtrack-linux.org/downloads/</a></p>
<h2>APPENDIX 2</h2>
<p>● Installation media: Ubuntu 10.04 32bit iso image;<br />
● HW: Virtualbox, 1CPU 32bit, 512MB RAM, 8GB HD (dynamic allocation);<br />
● NIC1 NAT;</p>
<p>● NIC2 host only (for ssh and http access from host);<br />
● Language used in installation process: English and country Estonia;<br />
● Keyboard Layout English;<br />
● Hostname: pece<br />
● Partition methods: Guided, use entire disk<br />
● Username: pece<br />
● no http proxy<br />
● Default applications</p>
<pre>sudo apt-get install lamp phpmyadmin
wget -c http://wordpress.org/latest.tar.gz
tar xvjf latest.tar.gz
sudo cp wordpress /var/www/wordpress
sudo nano /var/www/wordpress/wp-config.php</pre>
<p>Change the settings to your needs.</p>
<h2>APPENDIX 3</h2>
<p>● Installation media: Ubuntu 10.04 32bit iso image;<br />
● HW: Virtualbox, 1CPU 32bit, 512MB RAM, 8GB HD (dynamic allocation);<br />
● NIC1 NAT;<br />
● NIC2 host only (for ssh and http access from host);<br />
● Language used in installation process: English and country Estonia;<br />
● Keyboard Layout English;<br />
● Hostname: pece<br />
● Partition methods: Guided, use entire disk<br />
● Username: pece<br />
● no http proxy<br />
● Default applications<br />
● Snort configuration and installation refer to [SNORT1] in addition, please refer to<br />
[SNORT2].</p>
<h1>
Bibliography</h1>
<p>SNORT2: Nick Moore, Snort 2.8.4.1 Ubuntu 9 Installation Guide, June 2009,<br />
<a href="http://www.snort.org/assets/113/Snort_2.8.4.1_Ubuntu.pdf" target="_blank">http://www.snort.org/assets/113/Snort_2.8.4.1_Ubuntu.pdf</a><br />
ACID: Basic Analysis and Security Engine, Welcome to the Basic Analysis and Security Engine (BASE) project , 2008,<a href="http://base.secureideas.net/about.php" target="_blank"> http://base.secureideas.net/about.php</a><br />
OpenVas1: NA, Backtrack 5- OpenVas Tutorial, NA, <a href="http://www.ehacking.net/2011/06/backtrack-5-openvas-tutorial.html" target="_blank">http://www.ehacking.net/2011/06/backtrack-5-openvas-tutorial.html</a><br />
OpenVas2: BackTrack Linux, Getting started with OpenVas, June 2011, <a href="http://www.backtrack-linux.org/wiki/index.php/OpenVas" target="_blank">http://www.backtrack-linux.org/wiki/index.php/OpenVas</a><br />
SNORT1: kat-amsterdam, SnortIDS, December 2010,<br />
<a href="https://help.ubuntu.com/community/SnortIDS" target="_blank">https://help.ubuntu.com/community/SnortIDS</a></p>
<p>1 IDS &#8211; Intrusion detection system</p>
]]></content:encoded>
			<wfw:commentRss>http://predragtasevski.com/attacks_defense/testing-ids/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Security Programing Techniques</title>
		<link>http://predragtasevski.com/cybersecurity/security-programing-techniques/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=security-programing-techniques</link>
		<comments>http://predragtasevski.com/cybersecurity/security-programing-techniques/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 14:27:28 +0000</pubDate>
		<dc:creator>pece</dc:creator>
				<category><![CDATA[Cyber Security]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[cyber security]]></category>
		<category><![CDATA[HQL]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JDBC]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[PHP5]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Ruby on Rail]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[security model]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://predragtasevski.com/?p=342</guid>
		<description><![CDATA[INTRODUCTION The main goal of this post is to introduce the reader with the security programing techniques into deferent program languages and operating system security models. The post is introducing four following topics: Session storage&#8217;s in Ruby on Rail Parameterized &#8230; <a href="http://predragtasevski.com/cybersecurity/security-programing-techniques/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1>INTRODUCTION</h1>
<p>The main goal of this post is to introduce the reader with the security programing techniques into deferent program languages and operating system security models. The post is introducing four following topics:</p>
<ol>
<li>Session storage&#8217;s in Ruby on Rail</li>
<li>Parameterized statements into Java with JDBC, C# with ASP.NET, PHP5, php-mysqli, Perl, Python and Hibernate Query Language (HQL)</li>
<li>Unix permission model, Unix ACL and Windows 7 security<br />
model</li>
<li>Finding all the security vulnerabilities in bash script</li>
</ol>
<p>Each topic will be divided into own section, where at the end of each topic we stated the reference and additional reading material. The source code, scrips and the additional task were given by the lecture. However this will help the readers and people interesting into programing for further work and involvement with the above topics.</p>
<p><span id="more-342"></span></p>
<h1>1. Session storage&#8217;s in Ruby on Rail</h1>
<p>Session in Rails is a hash-like structure which allows you to store data across requests.<br />
Sessions can hold any kind of data object (with some limitations) because they store<br />
data using Data Marshalling.Session in rails it is not a hash. Session creates new<br />
instant of session in every time new user visit the site. Recommendation is to not store<br />
large objects in a session and critical data should not be stored in session.Rails way of<br />
implementing session is:</p>
<p>&nbsp;</p>
<ol>
<li>session_id is a 32 hex character MD5 hash based upon time, random number and constant string. It is stored in cookie at client browser. Rails provides transparent support for session_id.</li>
<li>Session storage discussed below.</li>
</ol>
<p>Ruby on Rails provides with many session storage option:</p>
<p>&nbsp;</p>
<ol>
<li>PStore &#8211; it implements a file based persistence mechanism based on a Hash. User code can store hierarchies of Ruby objects (values) into the data store file by name (keys). An object hierarchy may be just a single object. User code may later read values back from the data store or even update data, as needed. The files that are stored are usually located in the tmp/sessions folder for the Rails app. The main downside of using the PStore is that you will have to do some session-pruning periodically because performance decreases as the number of sessions stored increases.</li>
<li>ActiveRecordStore &#8211; keeps the session id and hash in a database table and saves and retrieves the hash on every request.</li>
<li>CookieStore &#8211; it saves the session hash directly in a cookie on the client-side. The server retrieves the session hash from the cookie and eliminates the need for a session id. Cookie-based sessions are just faster to retrieve and process than hitting the file-system on every request, were it was previously. Cookies are generally limited to 4K in size. While not an issue for most (proper) usage of the session, this could be a legitimate limit for some scenarios. If your application abuses the session, you’ll need to decide on a different session store that are available. The cookie has a SHA512 fingerprint attached and is hashed with a secret stored up on the server and there are, however, derivatives of CookieStore which encrypt the session hash, so the client cannot see it.</li>
<li>DRbStore &#8211; it store uses distributed Ruby to store a user’s session data. The performance is great, but it requires a bit more setup than the other stores.</li>
<li>FileStore &#8211; This store keeps the fragments on the hard disk instead of in memory. It works well if you have a lot of file storage and have outgrown the MemoryStore.</li>
<li>MemoryStore &#8211; keeps your session data in server memory. It keeps the fragments in your application&#8217;s memory, which can potentially take up a lot of memory on your server. It is used by default, but it is hard to manage and scale if your application becomes popular.</li>
</ol>
<p><strong>Note:</strong> Ruby on Rail CookieStore is available only in edge rails. PStore is the default option for stable release, whereas its CookieStore as default for edge rails.</p>
<h2>Reference</h2>
<p>Ruby On Rails Security Guide, From: <a href="http://guides.rubyonrails.org/security.html" target="_blank">http://guides.rubyonrails.org/security.html</a><br />
Sessions and cookies in Ruby on Rails, From: <a href="http://www.quarkruby.com/2007/10/21/ sessions-and-cookies-in-ruby-on-rails#sstorage" target="_blank">http://www.quarkruby.com/2007/10/21/<br />
sessions-and-cookies-in-ruby-on-rails#sstorage</a><br />
What&#8217;s New in Edge Rails: Cookie Based Sessions are the New Default, From: <a href="http:// ryandaigle.com/articles/2007/2/21/what-s-new-in-edge-rails-cookie-based-sessions" target="_blank">http://<br />
ryandaigle.com/articles/2007/2/21/what-s-new-in-edge-rails-cookie-based-sessions</a></p>
<h1>2. Parameterized statements into Java with JDBC, C# with ASP.NET, PHP5, php-mysqli, Perl, Python and Hibernate Query Language (HQL)</h1>
<p>For this task we will take a look at the parameterized statement API-s and we will find out and document how much does each of them protect against the following possible<br />
misuses of SQL statements:</p>
<ul>
<li>String injection (quotes, double quotes)</li>
<li>SQL statement injection (expression syntax etc)</li>
<li>Out of range integers</li>
<li>Blind SQL injection</li>
</ul>
<h2>Java with JDBC</h2>
<pre class="brush: php">

PreparedStatement prep =
conn.prepareStatement(&quot;SELECT * FROM
USERS
WHERE USERNAME=? AND PASSWORD=?&quot;);
prep.setString(1, username);
prep.setString(2, password);
prep.executeQuery();
</pre>
<p>There are no possibilities of string injection because of the filtering the statements. It enables users’ input to be initially filtered instead  of directly embedding it in the SQL statements. In this example is that the each parameter is a scalar, not a table, where the user input is then assigned (bound) to a parameter. It is a good idea if the character range is limited. Another thing that can be done to avoid SQL injection is to convert numeric values to integers before parsing them into the SQL statement. Or using ISNUMERIC to verify that they are integers.</p>
<h2>C# with ASP.NET</h2>
<pre class="brush: php">

using (SqlCommand myCommand =
new SqlCommand(&quot;SELECT * FROM USERS
WHERE
USERNAME=@user AND
PASSWORD=HASHBYTES(’SHA1’, @pwd)&quot;,
myConnection))
{
myCommand.Parameters.AddWithValue(&quot;@user&quot;,
user);
myCommand.Parameters.AddWithValue(&quot;@pwd&quot;,
pass);
myConnection.Open();
SqlDataReader myReader =
myCommand.ExecuteReader();
...
}
</pre>
<p>The placeholder &#8211; @user and the hashbyte value of password @pws &#8211; has become part  if the hardcoded SQL. At runtime, the value provided by the querystring is passed to the database along with the hardcoded SQL, and the database will check the Username and password field as it attempts to bind the parameter value to it. This ensures a level of strong typing. If the parameter value is not the right type for the database field (a string, or numeric that&#8217;s out of range for the field type), the database will be unable to convert it to the right type and will reject it. If the target field datatype is a string (char, nvarchar etc), the parameter value will be &#8220;stringified&#8221; automatically, which includes escaping single quotes. It will not form part of the SQL statement to be executed.</p>
<h2>PHP5</h2>
<pre class="brush: php">

$db = new PDO(’pgsql:dbname=database’);
$stmt = $db-&amp;amp;amp;amp;amp;gt;prepare(&quot;SELECT priv FROM
testUsers WHERE
username=:username AND password=:password&quot;);
$stmt-&amp;amp;amp;amp;amp;gt;bindParam(’:username’, $user);
$stmt-&amp;amp;amp;amp;amp;gt;bindParam(’:password’, $pass);
$stmt-&amp;amp;amp;amp;amp;gt;execute();
</pre>
<p>In this example to protect against SQL injection, it is used an input not directly to be  embedded in SQL statements. Instead, it is used an parameterized statements (preferred), or user input must be carefully escaped or filtered. This example shows and parameterized example/statement in php v. 5 and PDO database to protect from SQL injections and blind SQL injections.</p>
<h2>PHP-MySQLi</h2>
<pre class="brush: php">

$db = new mysqli(&quot;host&quot;, &quot;user&quot;, &quot;pass&quot;,
&quot;database&quot;);
$stmt = $db -&amp;amp;amp;amp;amp;gt; prepare(&quot;SELECT priv FROM
testUsers
WHERE username=? AND password=?&quot;);
$stmt -&amp;amp;amp;amp;amp;gt; bind_param(&quot;ss&quot;, $user, $pass);
$stmt -&amp;amp;amp;amp;amp;gt; execute();
</pre>
<p>Same as above but this time it is used the vendor-specific methods; for instance, using the mysqli extension for MySQL 4.1 and create parameterized statements to protect from the SQL injection.</p>
<h2>Perl</h2>
<pre class="brush: php">

use DBI;
my $db = DBI-
&amp;amp;amp;amp;amp;gt;connect(’DBI:mysql:mydatabase:host’,
’login’, ’password’);
$statment = $db-&amp;amp;amp;amp;amp;gt;prepare(&quot;UPDATE players SET
name = ?,
score = ?, active = ? WHERE jerseyNum = ?&quot;);
$rows_affected = $statment-&amp;amp;amp;amp;amp;gt;execute(&quot;Smith,
Steve&quot;,
42, ’true’, 99);</pre>
<p>Automatically &#8220;sanitize&#8221; input to parameterized SQL statements to avoid the catastrophic  database attacks.</p>
<h2>Python</h2>
<pre class="brush: php">

import sqlite3
db = sqlite3.connect(’:memory:’)
db.execute(’update players set name=:name,
score=:score,
active=:active where jerseyNum=:num’,
{’num’: 100,
’name’: ’John Doe’,
’active’: False,
’score’: -1}
)</pre>
<p>It is parameterized statement with an example of named placeholders. Which insure to avoid the SQL injections and database attacks.</p>
<h2>Hibernate Query Language (HQL)</h2>
<pre class="brush: php">

Query safeHQLQuery = session.createQuery(
&quot;from Inventory where productID=:productid&quot;);
safeHQLQuery.setParameter(&quot;productid&quot;,
userSuppliedParameter);
</pre>
<p>Unsafe example: Query unsafeHQLQuery = session.createQuery(&#8220;from Inventory where<br />
productID=&#8217;&#8221;+userSuppliedParameter+&#8221;&#8216;&#8221;); The example from left it’s used prepared statement approach because all the SQL code stays within the application. This makes your application relatively database independent. However, other options allow you to store all the SQL code in the database itself, which has both security and non-security<br />
advantages and the approach is called Stored Procedure</p>
<h1>3. Unix permission model, Unix ACL and Windows 7 security<br />
model</h1>
<p>In this topic we will describe two security set-ups that can not be expressed with traditional Unix permission model, UNIX ACL and Windows 7 security model.</p>
<h2>Unix permission model</h2>
<ul>
<li>Giving an different permission to different users in the same group</li>
<li>Read and write permission/access to all groups, which gives and access to the ‘private files’, and you can gain access through a root account by an unwanted user, which brings and complete breach of the system</li>
</ul>
<h2>Unix ACL- enabled permission model</h2>
<ul>
<li>If the user has permission over the file, he can read/write and delete it, which brings that it is not possible to give ‘some’ permission to the user.</li>
<li>ACL’s are not very portable and are very hard to maintain. For instance good example is transferring of files with ACL’s between different of Unix systems is an exercise for brave person, even if the both file systems support them. Which brings a difficulty to maintain for existing files for instance backup, restore, copying, etc.</li>
</ul>
<h2>Windows 7 security model</h2>
<ul>
<li>As a standard user you can perform an action that requires administrator privileges by the UAC(User Access Control), which is controlled by the Admin Approval Mode. It can be turn off and on. Every time when you need to gain an access of the administration privileges it will be prompt a dialog box to gain and provide the password for an access. Therefore in the medium settings with any malware could turn it off.</li>
<li>And the settings of the UAC are in medium mode not off, still brings an opportunity to being turn off by the malware.</li>
</ul>
<h1>4. Finding all the security vulnerabilities in bash script</h1>
<p>In this topic we will find all the possible vulnerabilities into the following bash script:</p>
<pre class="brush: php">

#!/bin/sh
# remove files with name pattern matching regexp
if [ x$1 = x ]; then
# if [[ x$1 = x ]]
echo -n &quot;Please enter directory name: &quot;
read dir
else
dir=$1
fi
if [ x$2 = x ]; then
# if [[ x$2 = x ]]
echo -n &quot;Please enter pattern: &quot;
read pattern
else
pattern=$2
fi
find $dir &amp;amp;amp;amp;amp;gt; /tmp/listing
# can use &amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;gt; or print the output first before
cmd=&#039;rm `grep &#039;$pattern&#039; /tmp/listing`&#039; #+the command is execute
echo &quot;Running command $cmd&quot;
eval $cmd //it converts string in command
rm /tmp/listing
exit 0</pre>
<p>We should avoid temporary file, instead we should use pipes [2].<br />
We should avoid eval [2].<br />
Using the double brackets, instead of single one ([[... ]]) it is comment on the script above [1].<br />
$REPLY can be used to read the previous value of the dir and pattern variable [1].<br />
We can use instead of find, while read contracture (loop) [1]. Find &#8211; can be set with a cycle, for or while to check the validation of the file and the directory/path, also comment on the script or using “$pattern” /tmp/listing [1].<br />
No sensitization of the input, the user can put any value and therefore, execute any command to create another command.<br />
As we can see above the script it looks like that it is security vulnerable. If we want to<br />
implement the security in the script we should implement the above changes into the script.</p>
<h2>Reference:</h2>
<p>[1] Mendel Cooper, 30 April 2011. Advanced Bash-Scripting Guide; An in-depth exploration of the art of shell scripting. Retrieved from: <a href="http://tldp.org/LDP/abs/html/index.html" target="_blank">http://tldp.org/LDP/abs/html/index.html</a><br />
[2] Lecture 8 slides Scripting, Meelis Roos. Retrieved from file: 08-scripting.pdf</p>
]]></content:encoded>
			<wfw:commentRss>http://predragtasevski.com/cybersecurity/security-programing-techniques/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Honeypot document</title>
		<link>http://predragtasevski.com/malware/honeypot-document/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=honeypot-document</link>
		<comments>http://predragtasevski.com/malware/honeypot-document/#comments</comments>
		<pubDate>Thu, 16 Feb 2012 08:00:01 +0000</pubDate>
		<dc:creator>pece</dc:creator>
				<category><![CDATA[Malware]]></category>
		<category><![CDATA[honeypot document]]></category>

		<guid isPermaLink="false">http://predragtasevski.com/?p=338</guid>
		<description><![CDATA[INTRODUCTION The main goal of laboratory report is to identify possible leaked/stolen information, documents from our system without recognising that attacker had an access. Thus access of the document will inform us immediately with the information of the burglar. The &#8230; <a href="http://predragtasevski.com/malware/honeypot-document/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1>INTRODUCTION</h1>
<p>The main goal of laboratory report is to identify possible leaked/stolen information,<br />
documents from our system without recognising that attacker had an access. Thus access of the document will inform us immediately with the information of the burglar. The report should highlight the following aspects:</p>
<p>&nbsp;</p>
<ul>
<li>Constructed an document as non malicious code, for instance honey document that will help us to track from where, who, information about the system, etc. is using our document.</li>
<li>Detail description of process, how did we build the document and the idea behind the tracking system.</li>
<li>Description of needed infrastructure that is tracking the document.<span id="more-338"></span></li>
</ul>
<p>The laboratory report is created by a team of 7 members. Where each member had<br />
own task to accomplish.<br />
Moreover, to be more contingent the unknown person has gain access to our<br />
computer/laptop. Thereby he is looking for interesting name of file, folder, etc. that most<br />
likely will have a content of interesting data, information for his purpose. After he<br />
downloaded file/folder from our system the intruder will open this file in his system<br />
assuming that contains very important personal/corporate information. However, by<br />
opening this file/folder, document it will send us immediately leaked information about his<br />
system to our server and additionally an e-mail. This process and procedures that are<br />
behind the honeypot document, or with other words trap set to detect, deflect, or in some<br />
manner counteract attempts at unauthorized use of information systems [1] is described in following sections.<br />
Furthermore, the coding of the honeypot document is done in HTML file with<br />
additional java script queries, where detail information and construction are displayed in<br />
Honeypot section.<br />
Meanwhile in Appendix section we provide the code of the honeypot document and<br />
additional what is the leaked/collected information of the intruder system, with other word,<br />
content illustration of mail and server logs.</p>
<p>Finally the conclusion made of the laboratory report will be concise in summary<br />
section.</p>
<h1>HONEYPOT IDEA</h1>
<p>HTML file We can name the file online banking or etc. cause it is html and it is more<br />
convincing way that the attacker will assume that this is an not only a online banking link<br />
but yet an the stored cookies and other leaked information.<br />
The honeypot file has inline javascript that will collect as much information as it can<br />
from the users browser, make it into a JSON object and create a request to our server<br />
using that information. The request will return an image, so nothing will be broken,<br />
however on our server we decode the information and send ourselves an alert email, that<br />
someone has accessed that document and where the accessing came from. There is also an image embedded that requests it from our server- these requests are logged and we see the IP address of the opener. This is as a backup in case the user doesn’t allow<br />
javascript to execute.<br />
<em><strong>How we lure an attacker into trap</strong></em><br />
To discover the identity of attacker and get information, she/he has to open html file.<br />
Besides setting up honeypot from technical point of view, we have to make document<br />
attractive.<br />
On our system all the documents will be protected by (different) passwords. We can<br />
have same password for files with same extensions (for example, for PDFs or for MS Word documents).<br />
In html file, we store these passwords. The name of html document should be<br />
corresponding (“file passwords” for example). Attacker will need additional time to crack<br />
the passwords, so we are offering easy, quick way to get over additional obstacles.<br />
Actually, in html file passwords should be correct not no make the attacker suspicious.<br />
Attacker may be suspicious why we stored this kind of information in html file, but it<br />
can be explained with the following reasons: a) to open html (with notepad or browser for<br />
example) is quicker than opening .pdf and .doc (by Adobe Reader and MS Word<br />
respectively) b) html has different extension (.html) that PDF or MS Word documents, so it has different icon in GUI. If you put a lot of different files in a folder, html is much easier to find with a glance among PDFs and DOCs.</p>
<p><em><strong>What information we get</strong></em></p>
<p>The honeypot is scripted to give us the following information about the attacker: first of all IP address. Time, when the attacker accessed the honeypot file.<br />
Except that, we also get information about user agent, OS, language and other details<br />
about attacker’s system. For this concrete task that should be enough. The script is configurable to get some additional information too. As our plan is to simply gather information on our infiltrator, it is essential to avoid being malicious with our code. It will not alter target’s system or bypass any restrictions of it. The solution will not announce itself and will be as stealthy as possible.<br />
The information is sent to mail. For the example of sent e-mail, please refer to Appendix 2.</p>
<h1>HONEYPOT INFRASTRUCTURE</h1>
<p>We need a Web server running PHP. The PHP script will collect the JSON data received<br />
from the attacker, format it nicely and send via email to people who will process it. If<br />
JavaScript is not enabled on the attacker’s side we rely on the fact that a picture is<br />
accessed from the honeypot html file. The server has to serve this image and the request<br />
for it of course appears in the web server access logs. This information again is processed by the same PHP script mentioned above and forwarded to analysts. Another alternative way to inform security personnel about this honeypot image being accessed is the Simple Event Corelator (SEC) written by Risto Vaarandi [2]. This software is freely available under GPL license. We could write a rule for SEC that would monitor the web server access log file for the specific image file request and send an email with the IP address from which the image was accessed. The rule that is used for SEC can be found in Appendix 3. The content we are looking for in the log file may look like this:</p>
<pre class="brush: php">192.168.1.34 - - [07/Dec/2011:19:16:07 +0200] &quot;GET /honey.png HTTP/1.1&quot; 200 1932</pre>
<h1>SUMMARY</h1>
<p>Nowadays the most common vector in unauthorized access into the system is followed by stealing important data, either is from personal computer or corporate network. Therefore, solution of implementing a trap for detecting, and deflecting the attacker of collecting valuable information is important. This laboratory report consists solution for future detection, by creating an honeypot document that will help us to collect data from the attacker. The document it self it is not an malicious code, likewise does not corrupt or infect the attacker system. Solution provided above is designed with an simple infrastructure which help us to identify identity of attacker in different operation system.<br />
Moreover, the honeypot document provides us an information of what is the attacker<br />
or user of this document operation system, which browser he is using, what plugins are<br />
installed in the browser and additional the time of accessing the file and attached IP<br />
address. Thereby, by identifying the above information will guide us in further steps. For<br />
instance by identifying his IP address we can find his location, ISP, etc.<br />
However, is this above provided information enough? The answer to the question is<br />
simple, indeed it is, cause we don’t need more. The idea in this laboratory is not to find or<br />
assail the attacker, but it is just to identify, and realize that someone had an unauthorized<br />
access to the system and to distinguish his identity.<br />
Consequently, from the above we can conclude that we rather gather the<br />
information from the attacker then to attack him back.</p>
<h1>APPENDICES</h1>
<p>Appendix 1 is the HTML and Java script code presented and in addition in Appendix 2 we<br />
present the e-mail received after the attacker has open the document. SEC are described<br />
in Appendix 3</p>
<h2>Appendix 1</h2>
<p>HTML + Java script code presented below:</p>
<pre class="brush: php">&amp;lt;!--
To change this template, choose Tools | Templates
and open the template in the editor.
--&amp;gt;
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
var JSON;JSON||(JSON={});
(function(){function k(a){return 10&amp;gt;a?&quot;0&quot;+a:a}function o(a){p.lastIndex=0;return
p.test(a)?&#039;&quot;&#039;+a.replace(p,function(a){var c=r[a];return&quot;string&quot;===typeof c?c:&quot;\\u&quot;+
(&quot;0000&quot;+a.charCodeAt(0).toString(16)).slice(-4)})+&#039;&quot;&#039;:&#039;&quot;&#039;+a+&#039;&quot;&#039;}function m(a,j){var
c,d,h,n,g=e,f,b=j[a];b&amp;amp;&amp;amp;&quot;object&quot;===typeof b&amp;amp;&amp;amp;&quot;function&quot;===typeof
b.toJSON&amp;amp;&amp;amp;(b=b.toJSON(a));&quot;function&quot;===typeof i&amp;amp;&amp;amp;(b=i.call(j,a,b));switch(typeof b)
{case &quot;string&quot;:return o(b);case &quot;number&quot;:return isFinite(b)?&quot;&quot;+b:&quot;null&quot;;case
&quot;boolean&quot;:case &quot;null&quot;:return&quot;&quot;+b;
case &quot;object&quot;:if(!b)return&quot;null&quot;;e+=l;f=[];if(&quot;[object
Array]&quot;===Object.prototype.toString.apply(b))
{n=b.length;for(c=0;c&amp;lt;n;c+=1)f[c]=m(c,b)||&quot;null&quot;;h=0===f.length?&quot;[]&quot;:e?&quot;[\n&quot;+e+f.join(&quot;
,\n&quot;+e)+&quot;\n&quot;+g+&quot;]&quot;:&quot;[&quot;+f.join(&quot;,&quot;)+&quot;]&quot;;e=g;return h}if(i&amp;amp;&amp;amp;&quot;object&quot;===typeof i)
{n=i.length;for(c=0;c&amp;lt;n;c+=1)&quot;string&quot;===typeof i[c]&amp;amp;&amp;amp;(d=i[c],(h=m(d,b))&amp;amp;&amp;amp;f.push(o(d)+
(e?&quot;: &quot;:&quot;:&quot;)+h))}else for(d in
b)Object.prototype.hasOwnProperty.call(b,d)&amp;amp;&amp;amp;(h=m(d,b))&amp;amp;&amp;amp;f.push(o(d)+(e?&quot;: &quot;:&quot;:&quot;)
+h);h=0===f.length?&quot;{}&quot;:e?&quot;{\n&quot;+e+f.join(&quot;,\n&quot;+
e)+&quot;\n&quot;+g+&quot;}&quot;:&quot;{&quot;+f.join(&quot;,&quot;)+&quot;}&quot;;e=g;return h}}if(&quot;function&quot;!==typeof
Date.prototype.toJSON)Date.prototype.toJSON=function(){return isFinite(this.valueOf())?
this.getUTCFullYear()+&quot;-&quot;+k(this.getUTCMonth()+1)+&quot;-&quot;+k(this.getUTCDate())
+&quot;T&quot;+k(this.getUTCHours())+&quot;:&quot;+k(this.getUTCMinutes())+&quot;:&quot;+k(this.getUTCSeconds())
+&quot;Z&quot;:null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=fun
ction(){return this.valueOf()};var q=/
[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufe
ff\ufff0-\uffff]/g,
p=/
[\\\&quot;\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\
u2060-\u206f\ufeff\ufff0-\uffff]/g,e,l,r={&quot;\u0008&quot;:&quot;\\b&quot;,&quot;\t&quot;:&quot;\\t&quot;,&quot;\n&quot;:&quot;\\n&quot;,&quot;\u000c&quot;
:&quot;\\f&quot;,&quot;\r&quot;:&quot;\\r&quot;,&#039;&quot;&#039;:&#039;\\&quot;&#039;,&quot;\\&quot;:&quot;\\\\&quot;},i;if(&quot;function&quot;!==typeof
JSON.stringify)JSON.stringify=function(a,j,c){var d;l=e=&quot;&quot;;if(&quot;number&quot;===typeof
c)for(d=0;d&amp;lt;c;d+=1)l+=&quot; &quot;;else&quot;string&quot;===typeof c&amp;amp;&amp;amp;(l=c);if((i=j)&amp;amp;&amp;amp;&quot;function&quot;!==typeof
j&amp;amp;&amp;amp;(&quot;object&quot;!==typeof j||&quot;number&quot;!==typeof j.length))throw
Error(&quot;JSON.stringify&quot;);return m(&quot;&quot;,
{&quot;&quot;:a})};if(&quot;function&quot;!==typeof JSON.parse)JSON.parse=function(a,e){function c(a,d){var
g,f,b=a[d];if(b&amp;amp;&amp;amp;&quot;object&quot;===typeof b)for(g in
b)Object.prototype.hasOwnProperty.call(b,g)&amp;amp;&amp;amp;(f=c(b,g),void 0!==f?b[g]=f:delete
b[g]);return e.call(a,d,b)}var
d,a=&quot;&quot;+a;q.lastIndex=0;q.test(a)&amp;amp;&amp;amp;(a=a.replace(q,function(a){return&quot;\\u&quot;+
(&quot;0000&quot;+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:
{}\s]*$/.test(a.replace(/\\(?:[&quot;\\\/bfnrt]|u[0-9a-fA-F]
{4})/g,&quot;@&quot;).replace(/&quot;[^&quot;\\\n\r]*&quot;|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
&quot;]&quot;).replace(/(?:^|:|,)(?:\s*\[)+/g,&quot;&quot;)))return d=eval(&quot;(&quot;+a+&quot;)&quot;),&quot;function&quot;===typeof
e?c({&quot;&quot;:d},&quot;&quot;):d;throw new SyntaxError(&quot;JSON.parse&quot;);}})();
&amp;lt;/script&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
var l=window.navigator,q={},a={},r={};delete l.geolocation;for(var i in
l.plugins)a[i]={},a[i].description=l.plugins[i].description,a[i].filename=l.plugins[i].
filename,a[i].name=l.plugins[i].name;delete l.plugins;delete
l.mimeTypes;q.plugins=a;q.nav=l;var h=JSON.stringify(q),s=&quot;?
i=&quot;+encodeURIComponent(h);document.write(&#039;&amp;lt;img
src=&quot;http://78.47.222.185/honey.php&#039;+s+&#039;&quot; /&amp;gt;&#039;);
&amp;lt;/script&amp;gt;
&amp;lt;div&amp;gt;TODO write content&amp;lt;/div&amp;gt;
&amp;lt;img src=&quot;http://78.47.222.185/honey.png&quot; /&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
</pre>
<h2>Appendix 2</h2>
<p>What we receive via email:</p>
<pre class="brush: php">

stdClass Object
(
[plugins] =&amp;gt; stdClass Object
(
[0] =&amp;gt; stdClass Object
(
[description] =&amp;gt; Shockwave Flash 11.1 r102
[filename] =&amp;gt; gcswf32.dll
[name] =&amp;gt; Shockwave Flash
)
[1] =&amp;gt; stdClass Object
(
[description] =&amp;gt; Shockwave Flash 11.1 r102
[filename] =&amp;gt; NPSWF32.dll
[name] =&amp;gt; Shockwave Flash
)
[2] =&amp;gt; stdClass Object
(
[description] =&amp;gt; NPRuntime Script Plug-in Library for Java(TM)
Deploy
[filename] =&amp;gt; npdeployJava1.dll
[name] =&amp;gt; Java Deployment Toolkit 7.0.10.8
)
[3] =&amp;gt; stdClass Object
(
[description] =&amp;gt; 4.0.60831.0
[filename] =&amp;gt; npctrl.dll
[name] =&amp;gt; Silverlight Plug-In
)
[4] =&amp;gt; stdClass Object
(
[description] =&amp;gt;
[filename] =&amp;gt; internal-remoting-viewer
[name] =&amp;gt; Remoting Viewer
)
[5] =&amp;gt; stdClass Object
(
[description] =&amp;gt;
[filename] =&amp;gt; ppGoogleNaClPluginChrome.dll
[name] =&amp;gt; Native Client
)
[6] =&amp;gt; stdClass Object
(
[description] =&amp;gt;
[filename] =&amp;gt; pdf.dll
[name] =&amp;gt; Chrome PDF Viewer
)
[7] =&amp;gt; stdClass Object
(
[description] =&amp;gt; DivX VOD Helper Plug-in
[filename] =&amp;gt; npovshelper.dll
[name] =&amp;gt; DivX VOD Helper Plug-in
)
[8] =&amp;gt; stdClass Object
(
[description] =&amp;gt; DivX Plus Web Player version 2.1.3.529
[filename] =&amp;gt; npdivx32.dll
[name] =&amp;gt; DivX Plus Web Player
)
[9] =&amp;gt; stdClass Object
(
[description] =&amp;gt; Allows digital signing with Estonian ID cards
[filename] =&amp;gt; npesteid-firefox-plugin.dll
[name] =&amp;gt; EstEID Firefox plug-in
)
[10] =&amp;gt; stdClass Object
(
[description] =&amp;gt; Google Update
[filename] =&amp;gt; npGoogleUpdate3.dll
[name] =&amp;gt; Google Update
)
[11] =&amp;gt; stdClass Object
(
[description] =&amp;gt; Provides functionality for installing third-party
plug-ins
[filename] =&amp;gt; default_plugin
[name] =&amp;gt; Default Plug-in
)
[length] =&amp;gt; stdClass Object
(
)
[item] =&amp;gt; stdClass Object
(
[name] =&amp;gt; item
)
[namedItem] =&amp;gt; stdClass Object
(
[name] =&amp;gt; namedItem
)
[refresh] =&amp;gt; stdClass Object
(
[name] =&amp;gt; refresh
)
)
[nav] =&amp;gt; stdClass Object
(
[vendorSub] =&amp;gt;
[product] =&amp;gt; Gecko
[userAgent] =&amp;gt; Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2
(KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2
[language] =&amp;gt; en-US
[productSub] =&amp;gt; 20030107
[appVersion] =&amp;gt; 5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like
Gecko) Chrome/15.0.874.121 Safari/535.2
[onLine] =&amp;gt; 1
[platform] =&amp;gt; Win32
[vendor] =&amp;gt; Google Inc.
[appCodeName] =&amp;gt; Mozilla
[cookieEnabled] =&amp;gt; 1
[appName] =&amp;gt; Netscape
)
)
TIME-1323861098
IP- xxx.xxx.xxx.xxx
</pre>
<h2>Appendix 3</h2>
<p>SEC rule file for web server log monitoring (will work only for IPv4). Alerts the root user via email and suppresses alerts for one hours for the same IP address</p>
<pre class="brush: php">type=SingleWithSuppress
ptype=RegExp
pattern=^((?:[\d]{1,3}\.){3})\.[\d]) .+ GET /honey.png
desc=Honeypot picture file accessed from $1
action=pipe mail ‘%s’ mail root@localhost
window=3600</pre>
<h1>Bibliography</h1>
<p>1: Wikipedia, Honeypot (computing), 4 December 2011,<br />
<a href="http://en.wikipedia.org/wiki/Honeypot_(computing)" target="_blank">http://en.wikipedia.org/wiki/Honeypot_(computing)</a><br />
2: Risto Vaarandi, SEC man page, NA, <a href="http://simple-evcorr.sourceforge.net/man.html" target="_blank">http://simple-evcorr.sourceforge.net/man.html</a></p>
<p>The above post is written by: Predrag Tasevski, Robert Pallas, Kuuno Pärnoja, Mikheil Basilaia, Karl Düüna, Roman Stepanenko and Heliand Dema</p>
]]></content:encoded>
			<wfw:commentRss>http://predragtasevski.com/malware/honeypot-document/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Identify Possible Infection of Malware Into the Wireshark Capture File</title>
		<link>http://predragtasevski.com/malware/malware-wireshark-capture/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=malware-wireshark-capture</link>
		<comments>http://predragtasevski.com/malware/malware-wireshark-capture/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 10:08:37 +0000</pubDate>
		<dc:creator>pece</dc:creator>
				<category><![CDATA[Malware]]></category>
		<category><![CDATA[capture file]]></category>
		<category><![CDATA[cyber security]]></category>
		<category><![CDATA[infection]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://predragtasevski.com/?p=330</guid>
		<description><![CDATA[INTRODUCTION The main goal of laboratory report is to identify possible infection of malware into the wireshark capture file. The report should highlight the following aspects: • Download https://sim.cert.ee/hw/download.pcap • Find malware download in this pcap and extract malware or &#8230; <a href="http://predragtasevski.com/malware/malware-wireshark-capture/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1>INTRODUCTION</h1>
<p>The main goal of laboratory report is to identify possible infection of malware into the<br />
wireshark capture file. The report should highlight the following aspects:<br />
• Download <a href="https://sim.cert.ee/hw/download.pcap" target="_blank">https://sim.cert.ee/hw/download.pcap</a><br />
• Find malware download in this pcap and extract malware or malwares find out<br />
where malware was downloaded from.<br />
• What malware, malwares changes in system.<br />
• C&amp;C Names and address.<br />
• Document the process also where You found hints and how exactly You did it (you<br />
need to show Your thought and communication process &#8211; please write a summary of<br />
it.)<br />
• Write an incident report.<span id="more-330"></span><br />
Moreover, we have to consider the malware analysis report reminders, please refer<br />
to [1] or [2].<br />
Additional, analysis it is stated into the Analysis section, where we explain the<br />
techniques, filter tools, gather knowledge, links, etc. Structure of the laboratory report is<br />
first to present analysis with details information. Malware and infections description are<br />
described.<br />
Finally the conclusion made of all analysis will be concise in summary section.</p>
<h1>ANALYSIS</h1>
<p>To be able to open and use the above file, firstly we have to download the wireshark tool.<br />
Where the main goal and purpose for wireshark application is to analysis a network<br />
protocols from captured file. Therefore please refer to the following link: <a href="http://www.wireshark.org/" target="_blank">http://www.wireshark.org/</a><br />
Useful links for future use, please refer to [3], [4], [5] and [6]. On figure 1 it shows<br />
the Graphic Interface of Wireshark application with running filter: http protocol.</p>
<div id="attachment_331" class="wp-caption aligncenter" style="width: 594px"><img class="size-large wp-image-331" title="Illustration 1: Wireshark application, filter: http protocol" src="http://predragtasevski.com/wp-content/uploads/pic1-1024x553.png" alt="Illustration 1: Wireshark application, filter: http protocol" width="584" height="315" /><p class="wp-caption-text">Illustration 1: Wireshark application, filter: http protocol</p></div>
<p>However, from the figure 1 we can see that there is a lot of traffic generated by the<br />
user. Therefore we have to apply and additional filter rules, which will help and guide for<br />
better and easy analysis. As we go through each generated http protocol traffic we can<br />
conclude that the user generated and has been visiting different source, where can be<br />
potential threat for the organization and personal use with a different malicious code.</p>
<p>To be able to filter only the http protocols on port 80 with a header GET, we should<br />
use the following filter: http.request.method == &#8220;GET&#8221;. Where this filter will narrow down<br />
the results that are presented into the captured file. In spite of the filter above it helps a lot,<br />
yet there is still a lot of traffic generated, consequently we have to utilize an additional filter.</p>
<p>Another extremely useful wireshark option we used, was Analyze → Follow TCP<br />
Stream which shows communication between IP addresses in more readable and useful<br />
way: shows DNS name for the IP and if file was downloaded gives filetype and name.<br />
We discovered that IP address 79.137.237.34 belongs to accord-component.ru. When we<br />
accessed the site with various web browsers, all of them showed that it contained<br />
malware.</p>
<pre class="brush: php">
GET /serial/index.php HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET
CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
Connection: Keep-Alive
Host: accord-component.ru
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 30 Nov 2011 23:07:18
GMTContent-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/5.3.2
Content-Encoding: gzip
</pre>
<p>Another suspicious IP was 86.63.168.101, where from this IP address brought us to<br />
domain name zumlelao.com, but it was un-accessible from browsers. Wireshark showed the User downloaded file 4.exe from zumlelao.com.</p>
<pre class="brush: php">
GET /load.php?file=0
HTTP/1.1Accept: image/jpeg, application/x-ms-application, image/gif,
application/xaml+xml, image/pjpeg, application/x-ms-xbap, */*
Accept-Language: et
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET
CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
Accept-Encoding: gzip, deflate
Host: zumlelao.com
Connection: Keep-AliveHTTP/1.1 200 OK
Date: Wed, 30 Nov 2011 21:55:02
GMTServer: Apache/2
X-Powered-By: PHP/5.2.17
Cache-Control: public
Content-Disposition: attachment; filename=4.exe
Content-Transfer-Encoding: binary
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 10666
Keep-Alive: timeout=1, max=100
Connection: Keep-Alive
Content-Type: application/octet-stream
</pre>
<p>Additionally, we can always use an Find function, which will help as to identify<br />
certain traffic or site. Figure 2 demonstrated the usage of the Find function, accessible<br />
from menu Edit → Find.</p>
<div id="attachment_332" class="wp-caption aligncenter" style="width: 442px"><img class="size-full wp-image-332" title="Illustration 2: Wireshark, Find function" src="http://predragtasevski.com/wp-content/uploads/pic2.png" alt="Illustration 2: Wireshark, Find function" width="432" height="239" /><p class="wp-caption-text">Illustration 2: Wireshark, Find function</p></div>
<p>Other IP addresses that were generated/extracted first the ones with malware<br />
detected:79.137.237.34 -accord-component.ru; 86.63.168.101 zumlelao.com. Other IP&#8217;s<br />
are: 173.194.32.32 (33,34,41,50,51,52,58,59,60,63), 192.168.123.1, 193.184.164.159<br />
(174,176,185), 193.40.252.83, 193.88.71.156, 194.126.108.69 (70), 194.126.124.136,<br />
194.204.14.49, 195.222.15.74, 199.7.48.190, 209.85.173.95, 123.168.24.204 (209,221,225,229,235), 79.137.237.34, 80.252.91.41 (61), 69.171.228.11, 23.32.89.55, 23.32.99.172, 216.34.181.45 (48), 213.168.24.26, 90.190.148.34 (40), 86.63.168.101, 82.98.58.48, 81.19.238.61.</p>
<p>If we run or analysis the above domain names into the google we will automatic<br />
indicated that the zumlelao.com it is an before reported as a malware site and the second<br />
too. Therefore the analysis and the infection of details of malware are highlighted into the<br />
next section.</p>
<h1>INFECTION</h1>
<p>Indeed, the above captured file presents traffic generated by the user, that can be threat<br />
for the organization, home user, etc. As from the previous section demonstrates how to<br />
identify if the generated traffic has infected or has the user visit the malicious code sites.<br />
This section identifies the malicious code and displays their details.<br />
Moreover, the zumlelao.com host it is reported previous as malicious code site. For<br />
this purpose we gather the help from the following link: <a href="http://sopport.clean-mx.de/" target="_blank">http://sopport.clean-mx.de/</a>. Here is<br />
the reported malicious, suspicious code from the above host in the table bellow.</p>
<table border="1">
<tbody>
<tr>
<td><strong>URL</strong></td>
<td><strong>Virus name</strong></td>
<td><strong>IP Initial</strong></td>
<td><strong>Link</strong></td>
</tr>
<tr>
<td>http://zumlelao.com/oad.php?file=grabbers</td>
<td>0/40(0.0%) unknown_htm</td>
<td>86.63.168.101</td>
<td><a href="http://support.clean-mx.de/clean-mx/viruses?id=1108452" target="_blank">http://support.clean-mx.de/clean-mx/viruses?id=1108452</a></td>
</tr>
<tr>
<td>http://zumlelao.com/2.exe</td>
<td>13/40 (32.5%) TR/TDss.77.1</td>
<td>86.63.168.101</td>
<td><a href="http://support.clean-mx.de/clean-mx/viruses?id=1108438" target="_blank">http://support.clean-mx.de/clean-mx/viruses?id=1108438</a></td>
</tr>
<tr>
<td>http://zumlelao.com/load.php?file=0</td>
<td>20/40 (50%) TR/Crypt.XPACK.Gen3</td>
<td>86.63.168.101</td>
<td><a href="http://support.clean-mx.de/clean-mx/viruses?id=1108442" target="_blank">http://support.clean-mx.de/clean-mx/viruses?id=1108442</a></td>
</tr>
</tbody>
</table>
<p>Furthermore, figure 3 is proving the analysis made through the wireshark, were one<br />
of the above links has been access, for more details clink on the above link and points in a figure 3:A and B.</p>
<div id="attachment_333" class="wp-caption aligncenter" style="width: 594px"><img class="size-large wp-image-333" title="Illustration 3: Prove of generating traffic of following malware link: http://zumlelao.com/load.php? file=0 were B and A are proving the links and the IP initiation." src="http://predragtasevski.com/wp-content/uploads/pic3-1024x553.png" alt="Illustration 3: Prove of generating traffic of following malware link: http://zumlelao.com/load.php? file=0 were B and A are proving the links and the IP initiation." width="584" height="315" /><p class="wp-caption-text">Illustration 3: Prove of generating traffic of following malware link: http://zumlelao.com/load.php? file=0 were B and A are proving the links and the IP initiation.</p></div>
<p>Moreover, to get the file itself for analysis, we used Netresec&#8217;s Network Miner 2.1<br />
http://www.netresec.com/?page=NetworkMiner. In Files menu, it shows all packets as files.<br />
We uploaded 4.exe.octet-stream to virustotal.com &#8211; 30 Antivirus software identified as<br />
malware Virustotal link: <a href="http://www.virustotal.com/file-scan/report.html?id=d6ee8736cd2eae8571b193b28b59dff33e9607237f78b0888d69c70f241bb04b- 1323098398" target="_blank">http://www.virustotal.com/file-scan/report.html?id=d6ee8736cd2eae8571b193b28b59dff33e9607237f78b0888d69c70f241bb04b-<br />
1323098398</a><br />
MD5 : 94a7f6430510fe7314c1e746bad79bf4<br />
SHA1 : 69ab04c9c586a8cf07a00665e160a48260a2465e<br />
SHA256: d6ee8736cd2eae8571b193b28b59dff33e9607237f78b0888d69c70f241bb04b<br />
F-Secure identified malware as Trojan.Generic.KD.438472</p>
<p>Trojan.Generic.KD malwares usually are classified as Backdoors. It infects<br />
executable files in the system and its main goal is to make backdoor into the system. It<br />
changes registry. In some cases it can put payload on the infected system, slow it down<br />
and make internet browsing difficult and time consuming. Aim of the malware can be<br />
stealing information or gaining partial/full access of the victim&#8217;s system. On the other hand, Trojan.Generic.KD malwares are difficult to remove from infected computers.<br />
From VirusTotal analysis we can see that various antivirus software can discover<br />
and identify Trojan.Generic.KD.438472. Therefore one can remove malware by<br />
downloading antivirus software provided by F-Secure, Comodo, Microsoft, Sophos,<br />
Symantec, DrWeb, etc. Here is an example from Dr.Web how to delete Trojan.Generic.KD malware <a href="http://www.drwebhk.com/en/virus_removal/694829/Trojan.Generic.KD.53986.html" target="_blank">http://www.drwebhk.com/en/virus_removal/694829/Trojan.Generic.KD.53986.html</a><br />
For our case we downloaded Dr.Web CureIt (free edition for home PCs, which discovered<br />
the malware and removed it) &#8211; <a href="http://www.freedrweb.com/download+cureit/?nc=t&amp;lng=en" target="_blank">http://www.freedrweb.com/download+cureit/?nc=t&amp;lng=en</a>.<br />
Before continuing to disinfect the system, please read and understand the massage<br />
delivered through this forum: <a href="http://forums.majorgeeks.com/showthread.php?t=35407" target="_blank">http://forums.majorgeeks.com/showthread.php?t=35407</a>.</p>
<h1>SUMMARY</h1>
<p>Nowadays malicious codes, infection of the system is one of the highest vector of<br />
production work everyday of the organizations. Therefore, different approaches, advance<br />
analysis, troubleshooting, etc. has to be applicable and stated in every organization.<br />
Leaking of data, information, access of network (internal and external) can be very harmful for organization and even the home usage of computers. Therefore, this laboratory report main aim is to provide the reader to be able to conduct advance analysis of system and their identification of infection within the wireshark network analysis tool.</p>
<p>From the above sections in Analysis and in the Infection we have to follow the steps<br />
and links that will help us for a further work. Meanwhile, the captured generated traffic from the distributed file has indeed indicated that the system it is infected. Were as an prove we demonstrate an screen-shot, figure 3, that one of the infected link has been visited. Likewise, the system of this user is infected. Thus infection identified name is:<br />
TR/Crypt.XPACK.Gen3, where we do supply and the disinfecting stepwise solution with the above link.<br />
Closing, as there are many different ways, tools, process for analysing the malicious<br />
code behaviours in system this laboratory report is supplying the reader with advance and<br />
stepwise solution for identifying the infection of the system within advance network<br />
analysis wireshark application.</p>
<h1>WORKLOAD</h1>
<p>We made analysis on the virtual Windows 7 machine. For virtualization we used<br />
VirtualBox. During analysis each of group member did the same analysis to cross-<br />
reference the results.<br />
We basically used the following tools: Wireshark, Network Miner and <a href="http://virustotal.com" target="_blank">virustotal.com</a>.</p>
<h1>Bibliography</h1>
<p>1: Lenny Zeltser, Reverse-Engineering: Malware Analysis Tools and Techniques Training, 2011, <a href="http://zeltser.com/reverse-malware/" target="_blank">http://zeltser.com/reverse-malware/</a><br />
2: Lenny Zeltser, Malware analysis report reminders, 2011, <a href="http://zeltser.com/reverse- malware/malware-analysis-report-template.mm" target="_blank">http://zeltser.com/reverse-<br />
malware/malware-analysis-report-template.mm</a><br />
3: Kevin, Malware Analysis &amp; Malware Reverse Engineering, NA, <a href="http://technology- flow.com/articles/windows-malware-analysis/" target="_blank">http://technology-<br />
flow.com/articles/windows-malware-analysis/</a><br />
4: Chris Greer, Top 10 Wireshark Filters, April 2010,<br />
<a href="http://www.lovemytool.com/blog/2010/04/top-10-wireshark-filters-by-chris-greer.html" target="_blank">http://www.lovemytool.com/blog/2010/04/top-10-wireshark-filters-by-chris-greer.html</a><br />
5: Russ McRe, Security Analysis with Wireshar, November 2006<br />
6: Chief Banana, Using Wireshark filters for capturing malware, Marh 2011,<br />
<a href="http://securitybananas.com/?p=529" target="_blank">http://securitybananas.com/?p=529<br />
</a></p>
<p>The above post is written by Predrag Tasevski and Mikheil Basilaia</p>
<p>Shorter link: <a href="http://predragtasevski.com/?p=330">http://predragtasevski.com/?p=330</a></p>
]]></content:encoded>
			<wfw:commentRss>http://predragtasevski.com/malware/malware-wireshark-capture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual Machine Malware / Malicious Analysis</title>
		<link>http://predragtasevski.com/cybersecurity/virtual-machine-malware-malicious-analysis/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=virtual-machine-malware-malicious-analysis</link>
		<comments>http://predragtasevski.com/cybersecurity/virtual-machine-malware-malicious-analysis/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 18:54:11 +0000</pubDate>
		<dc:creator>pece</dc:creator>
				<category><![CDATA[Cyber Security]]></category>
		<category><![CDATA[Log Mining]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[malicious analysis]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[malware analysis]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[virtual machine analysis]]></category>

		<guid isPermaLink="false">http://predragtasevski.com/?p=307</guid>
		<description><![CDATA[INTRODUCTION The main goal of laboratory report is to identify possible infection of two Windows 7 virtual machine. Virtual machines presented by the lecture: Win 1 Win 2 The assignment is following: Find out what is infecting the machine win1 &#8230; <a href="http://predragtasevski.com/cybersecurity/virtual-machine-malware-malicious-analysis/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1>INTRODUCTION</h1>
<p>The main goal of laboratory report is to identify possible infection of two Windows 7 virtual<br />
machine. Virtual machines presented by the lecture:</p>
<ul>
<li>Win 1</li>
<li>Win 2</li>
</ul>
<p>The assignment is following:</p>
<p>Find out what is infecting the machine win1</p>
<ul>
<li>Understand which way is the current malware dangerous to &#8220;your organisation&#8221;</li>
<li>If possible, do clean win1</li>
<li>Is win2 clean or it has problems, too?</li>
<li>If needed, do clean win2<span id="more-307"></span></li>
</ul>
<p>Additionally, deliverable questions should be visible:</p>
<ul>
<li>Summary &#8211; Your thoughts about the exercise. Please provide a short summary</li>
<li>Malware that infects machines</li>
<ul>
<li>Md5 hash &#8211; if it possible and if not, please explain, why.</li>
<li>Sha256 has -if it possible and if not, then please explain, why.</li>
<li>A description &#8211; in which way that malware is a threat to &#8220;You organization&#8221;</li>
</ul>
<li>Tools You used to find the infection(s)</li>
<li>Tools You used to clean machine(s)</li>
<li>Where You found hints and how exactly You did it (you need to show Your thought and communication process &#8211; please write a summary of it.)</li>
<li>How would you evaluate your partner.</li>
</ul>
<p>Moreover, we have to consider the malware analysis report reminders, please refer to [1] or [2].</p>
<p>Furthermore, each virtual machine will be analysed with different tools, in case to<br />
gather more information and solution for disinfecting process.<br />
Structure of the laboratory report is first to present each virtual machine with details information in section Virtual Machine&#8217;s, Each visualization is examined. Malware and disinfection process are described. Meanwhile in appendices, we explain what virtual  environment and tools we have used for this written report.<br />
Finally the conclusion made of all analysis will be concise in summary section.</p>
<h1>VIRTUAL MACHINE&#8217;s</h1>
<p>In this section each virtual machines are going to be examine in sub-sections, analysis  and additionally the disinfection solutions, etc. will be presented. The tools that are used for conducting the analysis are presented in the Tools section.</p>
<h2>Win1</h2>
<p>Intense detail information are highlighted bellow and MD5 sum for Win1 virtual box<br />
machine:<br />
OS: Ms Windows 7 Professional<br />
Version: 6.1.7601 Service Pack 1 Build 7601<br />
System type: 32 bit<br />
Computer name: DoeM<br />
Users Names:</p>
<ul>
<li>Jane Doe</li>
<li>Jhon Doe</li>
</ul>
<p>MD5 Sum: 6313cf7303de37ba62aadf5208b6ea78</p>
<h2>Analysis</h2>
<p>The analysis starts firstly from the observations, then with an supporting figures, sample of<br />
identification, are there any dependencies and in closer with summary of the analysis.<br />
From analysis with a different tools we came to conclusion that the above virtual<br />
image it is infected with some malicious code. Were certain tools have provides as an information that there is background accessing to network. However, this analysis it is not enough so therefore we will do more inside investigation to come-out with the hosts or network that the malicious code is trying to access, or an information that is shared.</p>
<p>To be able to identify the behaviour of a network we have used the Wireshark tool.<br />
Bellow are highlighted the steps: Network adapter type: NAT, logged in as: John Doe,<br />
additionally Wireshark run as Administrator. Upon the testing, the only user application<br />
open on WIN1 is Notepad. No additional network activities from log-in user, also no<br />
network activities from user on Host System. Wireshark, it detected suspicious traffic:</p>
<ol>
<li>Classification: BAD TCP (according to Wireshark coloring rules), Destination: 192.168.0.254 / 8.8.4.4 (Googne Public DNS) with Protocol: DNS; Info: Standard query A <em><strong>mamtumbochka766.ru</strong></em> / Standard query A <em><strong>followmego12.ru</strong></em> / Standart query A <em><strong>losokorot7621.ru</strong></em> / standard query A<em><strong> hidemyfass87111.ru</strong></em> /; Reason for classification as BAD TCP: Header checksum incorrect, maybe caused by &#8220;IP checksum offload&#8221;, Message: Bad Cheksum, Severity level: Error</li>
<li> As a response, WIN1 machine got UDP packet (according to Wireshark coloring rules); Protocol: DNS; Info: Standard query response, Sever failure.</li>
<li>Additionally, Wireshark detected another round of BAD TCP packets; Classification: BAD TCP; Destination: 195.226.218.135; Protocol: TCP; Port: 50530; Info: HTTP ACK (before that, WIN1 sent ACK message, got SYN ACK and this packet was an ACK). Where during HTTP session, WIN1 machine received the following linebased text data: <strong>i5eOnJKV57mp5biuqK+0tri0tbW+uK+0qeDr57mp5b29uL6pr7ypurm5vqng6+e 5qeU=</strong>; Then WIN1 received FIN ACK message from server and send ACK and FIN  ACK. Session was finished.</li>
</ol>
<p>The session was repeated once in 3 minutes and received line-based text data, for<br />
all sessions was the same. For illustration please refer to the following link for more details<br />
of pcap life of wireshark: <a href="http://bit.ly/mDdqAQ" target="_blank">http://bit.ly/mDdqAQ</a>.</p>
<p>Additional log files and screen shots are presented bellow during the analysis with<br />
other tools that are listed in the sections of tools.</p>
<div id="attachment_308" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-308 " title="TCPView tool, YGLA.ru access to domain" src="http://predragtasevski.com/wp-content/uploads/TCPView-300x225.png" alt="Illustration 1: TCPView tool, YGLA.ru access to domain" width="300" height="225" /><p class="wp-caption-text">Illustration 1: TCPView tool, YGLA.ru access to domain</p></div>
<p>Furthermore, log illustration of hijackThis tool:</p>
<pre class="brush: php">Logfile of Trend Micro HijackThis v2.0.4
Scan saved at 20:35:44, on 27.11.2011
Platform: Windows 7 SP1 (WinNT 6.00.3505)
MSIE: Internet Explorer v8.00 (8.00.7601.17514)
Boot mode: Normal
Running processes:
C:\Windows\system32\taskhost.exe
C:\Windows\system32\Dwm.exe
C:\Windows\Explorer.EXE
C:\Windows\System32\VBoxTray.exe
C:\Windows\system32\SearchProtocolHost.exe
C:\Windows\system32\taskmgr.exe
C:\Users\Jhon Doe\Desktop\HijackThis.exe
R1 - HKCU\Software\Microsoft\Internet Explorer\Main,Search Page =

http://go.microsoft.com/fwlink/?LinkId=54896

R0 - HKCU\Software\Microsoft\Internet Explorer\Main,Start Page = about:blank
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Default_Page_URL =

http://go.microsoft.com/fwlink/?LinkId=69157

R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Default_Search_URL =

http://go.microsoft.com/fwlink/?LinkId=54896

R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Search Page =

http://go.microsoft.com/fwlink/?LinkId=54896

R0 - HKLM\Software\Microsoft\Internet Explorer\Main,Start Page =

http://go.microsoft.com/fwlink/?LinkId=69157

R0 - HKLM\Software\Microsoft\Internet Explorer\Search,SearchAssistant =
R0 - HKLM\Software\Microsoft\Internet Explorer\Search,CustomizeSearch =</pre>
<pre class="brush: php">R0 - HKCU\Software\Microsoft\Internet Explorer\Toolbar,LinksFolderName =</pre>
<pre class="brush: php">F3 - REG:win.ini: load=C:\Users\JHONDO~1\LOCALS~1\Temp\5b17fff70008a4e8.exe
O4 - HKLM\..\Run: [VBoxTray] C:\Windows\system32\VBoxTray.exe
O23 - Service: FJOSKX - Sysinternals - www.sysinternals.com -
C:\Users\JHONDO~1\AppData\Local\Temp\FJOSKX.exe
O23 - Service: Remote Packet Capture Protocol v.0 (experimental) (rpcapd) - CACE
Technologies, Inc. - C:\Program Files\WinPcap\rpcapd.exe
O23 - Service: SUUKATRPY - Sysinternals - www.sysinternals.com -
C:\Users\JHONDO~1\AppData\Local\Temp\SUUKATRPY.exe
O23 - Service: VirtualBox Guest Additions Service (VBoxService) - Oracle Corporation -
C:\Windows\system32\VBoxService.exe</pre>
<p>Alternatively, we turn to Process Explorer and Process Monitor from Sysinternals. In<br />
spite of comprehensive information and some suspicious activities, these tools were<br />
unable to show direct link to malware. We analyzed some suspicious DLLs and .exe files,<br />
but all of them appeared to be legitimate Windows files. Also ee turned to Security Task<br />
Manager by Neuber Software where it discovered file 061afffa0005f9e5.exe in<br />
C:\Users\JHONDO~1\LOCALS~1\Temp folder. Usually malware runs itself or is hidden in<br />
Temp folder. So weird name and location give us enough reason to think it&#8217;s malware.<br />
Additional information provided by Security Task Manager: Company: Not provided;<br />
Type: Program. Hidden; Starts: when Windows starts and Registry: win.ini.</p>
<p>Meanwhile, for advance analysis we have conduct with clean boot which is<br />
explained into the KB article in the following link:<a href=" http://support.microsoft.com/kb/929135" target="_blank"> http://support.microsoft.com/kb/929135</a>.<br />
Now we run the wireshark analysis network tool, where no more suspicious network traffic<br />
is identified. This means that the malicious code is running from 3rd party applications and<br />
not from Microsoft services or process.</p>
<p>Likelihood, to be able to identify the malicious code, threads in virtual machine, we<br />
recommend to run an online free virus scanning. Thus process is done by ESET free<br />
online tool scanning, refer to the following link:<a href=" http://www.eset.com/us/online-scanner/" target="_blank"> http://www.eset.com/us/online-scanner/</a>.<br />
The aim of this step is to help to identify if the threads have been registered in to the virus<br />
signature database. If so, this will be a useful information and will assist to continue with<br />
analysis.</p>
<pre class="brush: php">Eset Online scanner, found 20 threads:</pre>
<pre class="brush: php">C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RIZWMML\spyeye-
1.2.60\c39bb188f2ac6534e75c6d961b9a78a2 Win32/Spy.SpyEye.BY trojan cleaned
by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RIZWMML\spyeye-</pre>
<pre class="brush: php">1.2.99\92bf8b3eb04be42f6aba05d6b97e8f25 Win32/Spy.SpyEye.BY trojan cleaned
by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RIZWMML\spyeye-
1.3.10\21da6142e3cd3979b7ef122ee638c78f a variant of Win32/Kryptik.MKM trojan
cleaned by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RIZWMML\spyeye-
1.3.25\7822bbf0c8ea3e9a75a19e954a39d6c9 Win32/Spy.SpyEye.CA trojan cleaned
by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RIZWMML\spyeye-
1.3.31\2bed4bbed303c91e2169b2f32db46acb.exe Win32/Spy.SpyEye.CA trojan cleaned
by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RIZWMML\spyeye-
1.3.32\1686b7e48871dd715336c732cfc32c1d Win32/Spy.SpyEye.CA trojan cleaned
by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RIZWMML\spyeye-
1.3.34\b2c3acf99f68c42626cf345b74095d51 a variant of Win32/Spy.SpyEye.CA trojan
cleaned by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$R387J1S IRC/SdBot
trojan cleaned by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$R6TYLIY a variant of
Win32/Kryptik.KUQ trojan cleaned by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$R8Y8LWG Win32/Pepex.E
worm cleaned by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RD4Q6CZ
Win32/AutoRun.IRCBot.FC worm cleaned by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RI87EEE
Win32/AutoRun.KS worm cleaned by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RIJ4S9U a variant of
Win32/Kryptik.KUQ trojan cleaned by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$ROFILPO probably a
variant of Win32/Autorun.MHBFUDT worm cleaned by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RQNEZXA Win32/Pepex.F
worm cleaned by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RU9MNXT IRC/SdBot
trojan cleaned by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RY4NX2I IRC/SdBot
trojan cleaned by deleting - quarantined
C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1000\$RY6CB6A
Win32/AutoRun.KS worm cleaned by deleting - quarantined
C:\Bios.Bin\Bios.Bin.exe a variant of Win32/Injector.FPL trojan cleaned by deleting -
quarantined
C:\Users\Public\Videos\Sample Videos\moos.exeIRC/SdBot trojan cleaned by deleting -
quarantined</pre>
<p>Each virus definition is presented bellow in the following table with the description<br />
link:</p>
<table border="1">
<tbody>
<tr>
<td><strong>Name of threads</strong></td>
<td><strong>Description links</strong></td>
</tr>
<tr>
<td>Win32/Spy.SpyEye.BY</td>
<td><a href="http://www.eset.eu/encyclopaedia/win32-spy-spyeye-btrojan- pincav-shd-backdoor" target="_blank">http://www.eset.eu/encyclopaedia/win32-spy-spyeye-btrojan- pincav-shd-backdoor</a></td>
</tr>
<tr>
<td>Win32/Kryptik.MKM</td>
<td>N/A</td>
</tr>
<tr>
<td>Win32/Spy.SpyEye.CA</td>
<td><a href="http://www.microsoft.com/security/portal/threat/Encyclopedia/ Entry.aspx?Name=Trojan%3AWin32%2FSpyeye" target="_blank">http://www.microsoft.com/security/portal/threat/Encyclopedia/ Entry.aspx?Name=Trojan%3AWin32%2FSpyeye</a></td>
</tr>
<tr>
<td>IRC/SdBot</td>
<td><a href="http://www.symantec.com/security_response/writeup.jsp? docid=2002-051312-3628-99" target="_blank">http://www.symantec.com/security_response/writeup.jsp? docid=2002-051312-3628-99</a></td>
</tr>
<tr>
<td>Win32/Kryptik.KUQ</td>
<td><a href="http://www.virustotal.com/file-scan/report.html? id=1025888a8be72a04cf0b576c65a9b2b13a7abaaa6b90124 e2c14b095f98edef7-1310416729" target="_blank">http://www.virustotal.com/file-scan/report.html? id=1025888a8be72a04cf0b576c65a9b2b13a7abaaa6b90124 e2c14b095f98edef7-1310416729</a></td>
</tr>
<tr>
<td>Win32/Pepex.E</td>
<td><a href="http://www.virustotal.com/file-scan/report.html? id=169ff0849ce6e055584d24cabc18637db9ae127c166f4309 147c457a4f410d9d-1303250955" target="_blank">http://www.virustotal.com/file-scan/report.html? id=169ff0849ce6e055584d24cabc18637db9ae127c166f4309 147c457a4f410d9d-1303250955</a></td>
</tr>
<tr>
<td>Win32/AutoRun.IRCBot.FC</td>
<td><a href="http://www.eset.eu/encyclopaedia/win32-autorun-ircbot-fcnet- worm-mytob-gvm-w32-gen-trojan-qhost-d?lng=en" target="_blank">http://www.eset.eu/encyclopaedia/win32-autorun-ircbot-fcnet- worm-mytob-gvm-w32-gen-trojan-qhost-d?lng=en</a></td>
</tr>
<tr>
<td>Win32/AutoRun.KS</td>
<td> <a href="http://www.eset.eu/encyclopaedia/win32_autorun_ks_sillyfdc _worm_fgj_dnn" target="_blank">http://www.eset.eu/encyclopaedia/win32_autorun_ks_sillyfdc</a><a href="http://www.eset.eu/encyclopaedia/win32_autorun_ks_sillyfdc _worm_fgj_dnn" target="_blank">_worm_fgj_dnn</a></td>
</tr>
<tr>
<td>Win32/Injector.FPL</td>
<td><a href="http://www.virustotal.com/file-scan/report.html? id=51591a4e9aed52a04bbd33c45f7111ae8b3af1051bf39e25 07940243962e7f25-1303564836" target="_blank">http://www.virustotal.com/file-scan/report.html? id=51591a4e9aed52a04bbd33c45f7111ae8b3af1051bf39e25 07940243962e7f25-1303564836</a></td>
</tr>
</tbody>
</table>
<p>From the above table we can come to the conclusive proof that total sum number of<br />
malicious code running in the virtual machine are 20, with an 9 different definitions of<br />
trojan, warms, etc. However, most of them were located in to the Recycle bin folder.<br />
Additionally to the analysing packets with Wireshark showed that Win1 has some malware, which sent and received some information over network without knowledge of the user. Destination IP addresses, names and port numbers were suspicious.</p>
<h2>Disinfection</h2>
<p>Indeed, this virtual machine it is infected. Therefore we have to perform an disinfection<br />
process. However, from the above table of the links it provides an solution and steps that<br />
should be followed for disinfection process. Either with an tool or steps for removing the<br />
malicious code. Also, we can remove the files with some additional tools that are available<br />
for free, for instance Eraser tool. Now that we know the exact location of each infected file<br />
it is much easier and simple to be able to delete, remove the files from our system.<br />
Although we could use the Eset scanner tool that we have performed previously.<br />
Nevertheless, to be sure and more save way is to do the removing process manually.</p>
<p>Therefore, recommendation for deleting the malicious code of all time from virtual<br />
machine is eraser tool. You need to configure task and which folders or files you specify to<br />
be removed. After the task was completed, restart the machine and now the system should be disinfected and additional we recommend to run the Eset online scanner free tool one more time, just in case in a meaner of your organization.</p>
<h2> Win2</h2>
<p>Intense detail information are highlighted bellow and MD5 sum for Win2 virtual box<br />
machine:<br />
OS: Ms Windows 7 Professional<br />
Version: 6.1.7601 Service Pack 1 Build 7601<br />
System type: 32 bit<br />
Computer name: DoeM<br />
Users Names:</p>
<ul>
<li>Jane Doe</li>
<li>Jhon Doe</li>
</ul>
<p>MD5 Sum: 155a5b9e8b842dff4aa5a7b4361113d3</p>
<h2>Analysis</h2>
<p>Despite the fact that Process Monitor, TCPView and other Sysinternals Suite analysis tools did not help us at all (also Wireshark did not detect any suspicious network activities), at this point, additionally registry changes were detected with CaptureBat tool, where the log file will be presented in figure 2. However by running the ESET online free scanner tool, it did detect in total three threads to our virtual machine, logs are presented bellow.</p>
<pre class="brush: php">Eset Online Scanner, found 3 threads:</pre>
<pre class="brush: php">C:\$Recycle.Bin\S-1-5-21-1301155936-2652204530-896827088-1001\$RKV8ZW1.exe
Win32/Duqu.A trojan
C:\Users\Jane\AppData\Local\Temp\0004fbd1.tmpa variant of Win32/Kryptik.VFI trojan
C:\Users\Jane\AppData\Local\Temp\b01dffe3001c4fe2.exe
Win32/TrojanDownloader.Agent.QXN trojan</pre>
<p>Threads are located in to the system directory of Jane user name. Additionally, there<br />
is an other malicious code located into the Recycle bin as we were able to detect into the<br />
previous analysis for Win1 virtual machine. In spite of fact that in previously scenario we<br />
had only a threads located into Recycle Bin, at this virtual environment we have as an local<br />
files. Therefore to be able to identify the above file and there integrity we have to sum the MD5 and SHA256 algorithms. For this action we are using an online tool winMd5Sum.</p>
<table border="1">
<tbody>
<tr>
<td><strong>File name</strong></td>
<td><strong>MD5Sum</strong></td>
<td><strong>SHA256</strong></td>
</tr>
<tr>
<td>C:\Users\Jane\AppData\<br />
Local\Temp\0004fbd1.tmp</td>
<td>aa17de9a17a58840b8\<br />
f3b3bd5412daee</td>
<td>6d242dbfec946dcacc90d624def\<br />
b073cb7d7bcc531c06d566933610fef\<br />
62f986</td>
</tr>
<tr>
<td>C:\Users\Jane\AppData\<br />
Local\Temp\b01dffe3001c4fe2.exe</td>
<td>dc88442c440a5fa5c5fa\<br />
449a2d0ab1e5</td>
<td>d9a874bf8d9f2f2ca803d38abd6\<br />
77ab51e77008b6cfbab37525dd28df7\<br />
1be107</td>
</tr>
</tbody>
</table>
<p>For advance analysis, we will run the MD5Sum into the <a href="http://virustotal.com">virustotal.com</a> search to<br />
identify the threads. Indeed, all of the above have been reported previously as a malware.<br />
Meanwhile, to gather better description of the above malicious codes we will search the<br />
definitions in the Eset database and descriptions provided in the following table.</p>
<table border="1">
<tbody>
<tr>
<td><strong>Thread name</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>Win32/Duqu.A</td>
<td><a title="http://blog.eset.com/2011/10/28/win32duqu-analysisthe- rpc-edition" href="http://blog.eset.com/2011/10/28/win32duqu-analysisthe- rpc-edition" target="_blank">http://blog.eset.com/2011/10/28/win32duqu-analysisthe-rpc-edition</a></td>
</tr>
<tr>
<td>Win32/Kryptik.VFI</td>
<td><a href="http://vil.nai.com/vil/content/v_683077.htm" target="_blank">http://vil.nai.com/vil/content/v_683077.htm</a></td>
</tr>
<tr>
<td>Win32/TrojanDownloader.Agent.QXN</td>
<td><a href="http://www.pcsafedoctor.com/Trojan/remove- Win32.TrojanDownloader.Agent.QNX.html" target="_blank">http://www.pcsafedoctor.com/Trojan/remove-Win32.TrojanDownloader.Agent.QNX.html</a></td>
</tr>
</tbody>
</table>
<div id="attachment_311" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-311" title="Illustration 2: CaptureBAT, win2, registry changes" src="http://predragtasevski.com/wp-content/uploads/capturebat-300x200.png" alt="Illustration 2: CaptureBAT, win2, registry changes" width="300" height="200" /><p class="wp-caption-text">Illustration 2: CaptureBAT, win2, registry changes</p></div>
<p>Figure 2 is just a part of the log files that were able to be capture of the CaptureBAT tool, as we can see form the above that many changes were effected over the registries. Therefore, we need to run either an registry system check or as we know the location of the malicious code, with OllyDbg we can run the files and inspect there behaviour and if they have any additionally affect over the memory dump, etc. presented in figure 3.</p>
<div id="attachment_312" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-312" title="Illustration 3: OllyDbg analysis, memory dump, system dll access, etc." src="http://predragtasevski.com/wp-content/uploads/ollydbg-300x201.png" alt="Illustration 3: OllyDbg analysis, memory dump, system dll access, etc." width="300" height="201" /><p class="wp-caption-text">Illustration 3: OllyDbg analysis, memory dump, system dll access, etc.</p></div>
<p>Nevertheless, because now we have the locations and the threads description it is<br />
next step to disinfected the system, yet it is still a big thread for the organization, etc.</p>
<h2>Disinfection</h2>
<p>As on the previously scenario, we recommend either to use the Eset online free scanner or to use in more convinced way the Eraser tool, for removing the malicious code from the<br />
machine forever. Furthermore, to just make sure that the above malicious code is<br />
removed, disinfected from our system still recommendations is to run the Eset tool for a<br />
second time, for double check the system.<br />
All the above files and threads could be a very harmful for the organization and for<br />
everyday production work. Therefore, advance analysis of the system it is always in hands<br />
to help us to protect our data, internet access, etc. of being leaked.</p>
<h2>Tools</h2>
<p>Tools that help for conducting the results are highlighted in this section. Those are just few<br />
of them that are available for this purpose. Nevertheless, we have use only the listed ones.<br />
Tools and downloadable links:</p>
<ul>
<li>CaptureBAT: <a href="http://www.honeynet.org/node/315" target="_blank">http://www.honeynet.org/node/315</a></li>
<li>Most of the tools that are used for this laboratory report are Sysinternals Suite: <a href="http://technet.microsoft.com/en-us/sysinternals/bb842062" target="_blank">http://technet.microsoft.com/en-us/sysinternals/bb842062</a></li>
<li>Advance report: HijaskThis: <a href="http://free.antivirus.com/hijackthis/" target="_blank">http://free.antivirus.com/hijackthis/</a></li>
<li>Wireshark: <a href="http://www.wireshark.org/" target="_blank">http://www.wireshark.org/</a></li>
<li>ESET Free Online Scanner:<a href=" http://www.eset.com/us/online-scanner/" target="_blank"> http://www.eset.com/us/online-scanner/</a></li>
<li>Eraser: <a href="http://www.heidi.ie/eraser/" target="_blank">http://www.heidi.ie/eraser/</a></li>
<li>Virustotal: <a href="http://www.virustotal.com/" target="_blank">http://www.virustotal.com/</a></li>
<li>Security Task Manager: <a href="http://neuber.com/taskmanager/index.html" target="_blank">http://neuber.com/taskmanager/index.html</a></li>
<li>OllyDbg v1.10: <a href="http://www.ollydbg.de/" target="_blank">http://www.ollydbg.de/</a></li>
<li>WinMD5Sum: <a href="http://www.nullriver.com/products/winmd5sum" target="_blank">http://www.nullriver.com/products/winmd5sum</a></li>
</ul>
<div>However, there are many other tools that can be used. Recent papers, tutorials can help us for further action, please refer to [3] [4] [5] [6].</div>
<div></div>
<div></div>
<h1>SUMMARY</h1>
<div>Nowadays malicious codes, infection of the system is one of the highest vector of production work everyday of the organizations. Therefore, different approaches, advance analysis, troubleshooting, etc. has to be applicable and stated in every organization.</div>
<div>
<p>Leaking of data, information, access of network (internal and external) can be very harmful<br />
for organization and even the home usage of computers. Therefore, this laboratory report<br />
main aim is to provide the reader to be able to conduct advance analysis of system and<br />
their disinfection.</p>
<p>From the two scenarios, virtual machine environments we came to final consistent conclusion that both of them are infected. Yet different threads were able to be found in the systems. However analysis is done by the short time of period. In each scenario in report provides an solutions how and what kind of actions should be considered for future disinfection of the system. Moreover, in next lines we are stating the summary of each infected machine.</p>
<p>Firstly, Win1 was infected with identified 20 threads, with other words in total of 9<br />
different definitions of trojan, malware, warms code. The definition of the threads were<br />
advance, where from the links provided in the table above, is stated that the few of them<br />
were playing very smart. By smart, we mean, that if they have noticed that wireshark,<br />
tcpviewer or other tools were running, the malicious code stops responding, so it was able<br />
to cover his identity, information leaks, etc. In addition, the malicious codes were located in<br />
to the Recycle bin folder, where we were not able to identify there MD5 sum or SHA256. If<br />
we want it to proceed in this step, we had to restore them from the bin folder and then<br />
identify them. Advance we identify the user that has spread the malicious code, user<br />
name: John Doe. Nevertheless, disinfecting process helped us to remove the code from<br />
the system and just in case we have run in second time the Eset online scanner tool.</p>
<p>Secondly, Win2 was indeed infected too. In spite of the scenario one, this was less<br />
infected. The total sum of the threads were 3. Each of them were supply by the<br />
administrator user account: Jane Doe. The location of the malicious code is located into<br />
the temp folders and one in a recycle bin directory. From the definitions links from the<br />
above table we can stated that they have try to attempt over the network to leak<br />
informations, registry changes and additional files are added to the system. However, all of<br />
them were harmful for our environment and therefore and disinfection steps were<br />
necessary. Additionally, the location of the files were accessible therefore we provide an<br />
addition MD5sum and SHA256 for each file, were it help us to identify them in<br />
<a href="http://virustotal.com" target="_blank">virustotal.com</a>.</p>
</div>
<div>
<p>Finally, the both virtual box were infected with different malicious code. Advance<br />
disinfection procedures were necessary to troubleshoot and find the solution to make the<br />
hence system for being able to use it in production. However, the threads were able to<br />
share, leak information and data, in advance were able to change the registry and even<br />
the system files. Therefore, we do recommend advance furthermore actions to be<br />
considered. Meanwhile, the list of the tools that is provided by this report will help the hence users and analysers to be able to identify the threads in a system and to perform an disinfection. Additional the tutorials, stepwise solutions were provided as a reference where can guide for more advance troubleshooting.</p>
<p>Closing, as there are many different ways, tools, process for analysing the malicious<br />
code behaviours in system this laboratory report is supplying the reader with advance and<br />
stepwise solution for identifying the infection of the system. The above procedure can be applied into real time, everyday working machine.</p>
<h1>WORKLOAD</h1>
<p>We analysed both Win1 and Win2 on our computers. Virtualization environment for both<br />
host systems were the same. Each of us analyzed Win1 and Win2. First we analyzed Win1 and then Win2. So the group analyzed each of Virtual Machines (Win1 and Win2) two times.<br />
In such way we cross-referenced the analysis results and got more reliable<br />
information about the system and its infection.</p>
<h1>APPENDIXES</h1>
<p>Appendix 1 is configuration of the virtual environment.</p>
<h2>APPENDIX 1</h2>
<p>Virtual environment: Oracle VirtualBox Version 4.1.2 r73507. Downloadable from the<br />
following link: <a href="https://www.virtualbox.org/wiki/Downloads" target="_blank">https://www.virtualbox.org/wiki/Downloads</a></p>
<h1>Bibliography</h1>
<p>1: Lenny Zeltser, Reverse-Engineering: Malware Analysis Tools and Techniques Training, 2011, <a href="http://zeltser.com/reverse-malware/" target="_blank">http://zeltser.com/reverse-malware/</a></p>
<p>2: Lenny Zeltser, Malware analysis report reminders, 2011, <a href="http://zeltser.com/reversemalware/malware-analysis-report-template.mm" target="_blank">http://zeltser.com/reversemalware/malware-analysis-report-template.mm</a>\</p>
<p>3: Lenny Zeltser, Introduction to malware Analysis, 2010, <a href="http://zeltser.com/reverse-malware/introto-malware-analysis.pdf" target="_blank">http://zeltser.com/reverse-malware/introto-malware-analysis.pdf</a></p>
<p>4: Michael Kassner, 10 ways to detect computer malware, 2009,</p>
<p><a href="http://www.techrepublic.com/blog/10things/10-ways-to-detect-computer-malware/970" target="_blank">http://www.techrepublic.com/blog/10things/10-ways-to-detect-computer-malware/970</a></p>
<p>5: Michael Kassner, 10 more ways to detect computer malware, 2009,<br />
<a href="http://www.techrepublic.com/blog/10things/10-more-ways-to-detect-computer-malware/1069" target="_blank">http://www.techrepublic.com/blog/10things/10-more-ways-to-detect-computer-malware/1069</a></p>
<p>6: Andrew Brandt, Security Tips: Identify Malware Hiding in Windows&#8217; System Folders, 2005,<br />
<a href="http://www.pcworld.com/article/120795-3/security_tips_identify_malware_hiding_in_windows_system_folders.html" target="_blank">http://www.pcworld.com/article/120795-3/security_tips_identify_malware_hiding_in_windows_system_folders.html</a></p>
<p>The above post is written by Predrag Tasevski and Mikheil Basilaia</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://predragtasevski.com/cybersecurity/virtual-machine-malware-malicious-analysis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mobile Malware Analysis</title>
		<link>http://predragtasevski.com/malware/mobile-malware-analysis/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-malware-analysis</link>
		<comments>http://predragtasevski.com/malware/mobile-malware-analysis/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 14:39:43 +0000</pubDate>
		<dc:creator>pece</dc:creator>
				<category><![CDATA[Malware]]></category>
		<category><![CDATA[cell phone]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[mobile malware analysis]]></category>
		<category><![CDATA[network crime]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[phone games]]></category>
		<category><![CDATA[phone malware]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sms]]></category>

		<guid isPermaLink="false">http://predragtasevski.com/?p=300</guid>
		<description><![CDATA[PURPOSE The goal of this post is to identify and analyze mobile malware file: mmc.jar. Thereby please follow the following steps for completing the task: Unpack the file (hint &#8211; using zip on .jar) Examine .class files using tool available here (local copies for Mac, Linux, Win) &#8230; <a href="http://predragtasevski.com/malware/mobile-malware-analysis/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1>PURPOSE</h1>
<p>The goal of this post is to identify and analyze mobile malware file: <a href="https://sim.cert.ee/hw/mmc.jar" target="_blank">mmc.jar</a>. Thereby please follow the following steps for completing the task:</p>
<ul>
<li><span style="color: #000000; font-family: 'Times New Roman';">Unpack the file (hint &#8211; using zip on .jar)</span></li>
<li><span style="color: #000000;"><span style="font-family: 'Times New Roman';">Examine .class files using tool available </span></span><a href="http://java.decompiler.free.fr/?q=jdgui" target="_blank">here</a><span style="color: #000000;"><span style="font-family: 'Times New Roman';"> (local copies for </span></span><a href="https://sim.cert.ee/hw/jd-gui-0.3.3.osx.i686.dmg">Mac</a><span style="color: #000000;"><span style="font-family: 'Times New Roman';">, </span></span><a href="https://sim.cert.ee/hw/jd-gui-0.3.3.linux.i686.tar.gz">Linux</a><span style="color: #000000;"><span style="font-family: 'Times New Roman';">, </span></span><a href="https://sim.cert.ee/hw/jd-gui-0.3.3.windows.zip">Win</a><span style="color: #000000;"><span style="font-family: 'Times New Roman';">)</span></span></li>
<li><span style="color: #000000; font-family: 'Times New Roman';">Find code sending SMSes using &#8216;sms://&#8217; URI</span></li>
<li><span style="color: #000000; font-family: 'Times New Roman';">Calculate short number used in SM.send</span></li>
<li><span style="color: #000000; font-family: 'Times New Roman';">Finally for compiling the code use the developing tool <a href="http://www.eclipse.org/" target="_blank">Eclipse IDE</a>.</span></li>
</ul>
<div><span style="color: #000000;">Firstly, we are going to analysis the Java source code after decompilation. The accent is to find the code that is sending an SMSes using the &#8216;sms://&#8217; URL. After identifying the linking associated classes we have to compile the code to move toward to final results of URLs. For this purpose we are using the developing tool <a href="http://www.eclipse.org/downloads/" target="_blank">Eclipse IDE</a>.</span></div>
<div>Therefore, the results and the sent SMSes URLs are going to be presented into conclusion section. Which will complete the task and will yield the basic analysis of mobile malware file.<span id="more-300"></span></div>
<h1>ANALYSIS</h1>
<p>After running the decompiler tool we are examining and analyzing the Java source code. Whereby on the source code on the class M.class line 343 we have found the following source code:</p>
<pre class="brush: java">if ((i &gt;= 35) &amp;amp;amp;&amp;amp;amp; (SM.isSending != true) &amp;amp;amp;&amp;amp;amp; (i % 6 == 0) &amp;amp;amp;&amp;amp;amp; (f &lt; count_query)) {
  if (SM.GS()) f += 1;
   if (f == 1) {
            RS.L(rs);
            RS.L(&quot;Slide&quot;);
            rs = RS.j(&quot;Slide&quot;);
            game = RS.L(rs, Integer.toString((int)(System.currentTimeMillis() / 1000L)));
            RS.L(rs);
   }if (f &lt; count_query) {
  game = SM.send(&quot;sms://&quot; + ms[1][b], ms[2][b]); // sms://
  if (b == count_query) b = 1; else b += 1;
}</pre>
<div>The above code is associated with the class SM.class. With the following source code:</div>
<div>
<pre class="brush: java">public static int send(String s, String s1)
{
   if (isSending) return 0;
      new SM(s, s1);
   return -1;
}
public SM(String s, String s1) {
 success = false;
 isSending = true;
 this.destination = s;
 this.message = s1;
 try {
      Thread thread = new Thread(this);
      thread.start();
 }
 catch (Exception exception) {
 isSending = false;
}</pre>
<p>The above code is checking if the message and the destination is correct<br />
and if the message is sent. Coloration is more like the first public static method named <em>send</em> with the two string values of <em>s</em> and <em>s1</em>.<br />
All the above extraction was finished by JD-Gui version 0.3.3 and JD-Core version 0.6.0 and using the menu bar for search, with the criteria that will meet our needs.<br />
The bellow are executable results presented, done by eclipse after compiling the code:</p>
<pre class="brush: php">/0SIF|6XI8ULE|YNLD5QDA6WM|YJ90RL/+WPJDAFY2 DC3QJ/+3RKA/5YPA0MD-5QFD
while 7375/88600168904|7202/65510006691|1899/FTEME 1283|8385/88600168904|
1 16
2 33
3 49
4 66
7375 88600168904 //sms://7375
7202 65510006691 //sms://7202
1899 fteme 1283 //sms://1899
8385 88600168904 //sms://8385
decoded
36
7375 88600168904
42
7202 65510006691
48
1899 fteme 1283
54</pre>
<p>From the above presented results after compiling the code we have identify the number of SMSes URLs and in addition the exact URLs.</p>
<h1>CONCLUSION</h1>
<p>We live in a world were nowadays for everyday work, communication, etc. the most essentially tool is our mobile phones, smart phones, etc. We used them for communication, sending SMS, playing games, checking e-mails, social networking, bank transaction, etc. That is why today there are hundreds and rising everyday mobile malware files. We need to make sure what we are installing in our devices, what kind of games, applications, etc. Therefore, this post will help for a people who are interested to learn basic of how to analysis and identify malware files for mobile phones. However, this is only a basic, and a good guide to give you an idea of what kind of tools, applications you should have. This task is done only for a Java source code mobile malware game.</p>
<p>Furthermore, from the above section we have identify the number of SMSes that are sent and to what numbers. The total number of SMSes is 4 and sent to the following URLs:</p>
<p>sms://7375<br />
sms://7202<br />
sms://1899<br />
sms://8385</p>
<p>Finally, mobile malware is rising and it is about to explode, therefore users need education[1]. By delivering basic and advance mobile malware security awareness program we will have less malware attacks and better security policy into everyday mobile, smart phones usage.</p>
<h1>Bibliography</h1>
<p>[1] Chris Martin, Mobile malware is about to explode, users need education, 20 Jan. 2012, <a href="http://www.theinquirer.net/inquirer/opinion/2140338/mobile-malware-explode-users-education">http://www.theinquirer.net/inquirer/opinion/2140338/mobile-malware-explode-users-education</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://predragtasevski.com/malware/mobile-malware-analysis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regular Expression</title>
		<link>http://predragtasevski.com/log-mining/regular-expression/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=regular-expression</link>
		<comments>http://predragtasevski.com/log-mining/regular-expression/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 14:08:33 +0000</pubDate>
		<dc:creator>pece</dc:creator>
				<category><![CDATA[Log Mining]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[log mining]]></category>
		<category><![CDATA[regular expression]]></category>

		<guid isPermaLink="false">http://predragtasevski.com/?p=293</guid>
		<description><![CDATA[This post delivers solution of advance regular expression. In the following lines we describe the goal and the rules of the task, whereby follows with the working solution. Task Write a regular expression for matching the names which follow the following rules: 1) &#8230; <a href="http://predragtasevski.com/log-mining/regular-expression/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This post delivers solution of advance regular expression. In the following lines we describe the goal and the rules of the task, whereby follows with the working solution.</p>
<h1>Task</h1>
<p>Write a regular expression for matching the names which follow the following rules:<br />
1) Each name consists of one or more parts. If there are two or more parts, they are separated either with a single space (&#8221; &#8220;) or dash (&#8220;-&#8221;) character.<br />
2) Each name part must consist of letters only. The name part must begin with an upper-case letter which are followed by one or more lower-case letters. Each name part can  have an optional prefix which begins with an upper-case letter, followed by one or more lower-case letters.<span id="more-293"></span></p>
<h1>Solution</h1>
<p>^([A-Z][a-z]+([A-Z][a-z]+)?(\s|-))*[A-Z][a-z]+([A-Z][a-z]+)?$</p>
<p>For completing the task, we are dividing into several sub-tasks.</p>
<p>Firstly, we had to find expression, which satisfies the first requirement of the task: representing one or more parts, which can be separated either with space (“ “) or dash (“-”). Thereby, we can represent space and dash with the following expression (\s|-).</p>
<p>If the entry is just one legitimate part (without space or dash after), (\s|-) has 0 occurrences. Yet the entry may consist of many legitimate parts divided by spaces or dashes. The expression should be (\s|-)*.</p>
<p>As for the legitimate parts, we have to write expression considering second part of requirements.</p>
<p>Legitimate part should consist of letters only, begin with (only one) uppercase letter and followed by one or more lowercase letters. Legitimate part can have prefix beginning with (only one) uppercase letter, followed by one or more lowercase letters.</p>
<p>Therefore, [A-Z][a-z]+ represents the entry which begins uppercase letter and is followed by one or more lower case letters. In addition, to represent prefix, which occurs either 0 or 1 time, we will have the following expression: ([A-Z][a-z]+)?. Moreover, to represent the whole legitimate entry, we merge the two expressions (it does not matter whether prefix expression comes first) with: A-Z][a-z]+([A-Z][a-z]+)?. Thus with this expression we go back to (\s|-)* where putting [A-Z][a-z]+([A-Z][az]+)? into parentheses with (\s|-) and take * outside of parentheses (as this whole expression) legitimate part with either space or dash should be presented for 0 or more consecutive times.</p>
<p>(([A-Z][a-z]+([A-Z][a-z]+)?(\s|-))*</p>
<p>To be able to exclude entries, which end with “-”, we add expression of legitimate part. and add “^” and “$” respectively at the beginning and the end of expression, to mark the  beginning and an end of the string.</p>
<p>^(([A-Z][a-z]+([A-Z][a-z]+)?(|s|-))*([A-Z][a-z]+([A-Z][a-z]+)?$</p>
<p>Finally, we have the whole expression we have to test it (we have to put the expression in quotation marks).</p>
<p><strong>egrep &#8216;^([A-Z][a-z]+([A-Z][a-z]+)?(\s|-))*[A-Z][a-z]+([A-Z][a-z]+)?$&#8217; &lt;file_name&gt;</strong></p>
<p>The above solution is written by: Predrag Tasevski and Mikheil Basilaia</p>
]]></content:encoded>
			<wfw:commentRss>http://predragtasevski.com/log-mining/regular-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.254 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-10 19:56:49 -->

