<?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> &#187; Joiner</title>
	<atom:link href="http://www.megapanzer.com/tag/joiner/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.megapanzer.com</link>
	<description></description>
	<lastBuildDate>Fri, 23 Dec 2011 13:02:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>The lifecycle of a trojan horse</title>
		<link>http://www.megapanzer.com/2009/03/17/the_lifecycle_of_a_trojan_horse/</link>
		<comments>http://www.megapanzer.com/2009/03/17/the_lifecycle_of_a_trojan_horse/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 15:11:58 +0000</pubDate>
		<dc:creator>carrumba</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Binder]]></category>
		<category><![CDATA[Dropper]]></category>
		<category><![CDATA[Joiner]]></category>
		<category><![CDATA[Lifecycle]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[trojan]]></category>

		<guid isPermaLink="false">http://www.megapanzer.com/?p=665</guid>
		<description><![CDATA[Summarizing the lifecycle of a trojan horse as &#8220;configuration, infection, action, deletion&#8221; would be too brief and you would miss a lot of important and valuable information that makes you understand how they are constructed, how the internal structure looks like and how to breathe life into them. I want to give you the whole, [...]]]></description>
			<content:encoded><![CDATA[<glossarycode><glossarycode><glossarycode><glossarycode><glossarycode><p>Summarizing the lifecycle of a <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1214" title="Glossary: Trojan horse" target="_blank">trojan horse</a> as &ldquo;configuration, infection, action, deletion&rdquo; would be too brief and you would miss a lot of important and valuable information that makes you understand how they are  constructed, how the internal structure looks like and how to breathe life into them. I want to give you the whole, big picture of  the <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1214" title="Glossary: Trojan horse" target="_blank">trojan horse</a> lifecycle, beginning from the stage of configuration over to its deletion and all the steps in between.<br>
<span id="more-665"></span></p>
<p><strong><a name="trojan_configuration_and_generation">Trojan horse configuration and generation</a></strong></p>
<p>What a <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1214" title="Glossary: Trojan horse" target="_blank">trojan horse</a> needs  first are its configuration settings. The information it knows what to do once it is executed on the target system.  At this point we have to know the <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1214" title="Glossary: Trojan horse" target="_blank">trojan horse</a> is divided into two different parts: the <em>client </em>and the <em>server</em>. The <em>server is</em> the part that is installed on the victims systems, the <em>client is</em> the controlling component on at the attackers side.</p>
<pre>          [SERVER]
             |
    [SERVER] |  [SERVER]
        \    |    /
         \   |   /
          \  |  /
     [ATTACKER CLIENT]-----[SERVER]</pre>
<p>The names <em>server </em>and <em>client </em>in this context are a little confusing because  normally a <em>client </em>is the one that connects to a <em>server</em> and sends commands to it. This is the way the setup was in use some years ago. The attackers on the client machines connected to the servers on  the infected victim machines. But nowadays it works exactly the opposite. The infected victim  systems establish a <em><a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Reverse connection" target="_blank">reverse connection</a></em> to the controlling master system. The reason why it works today like this lies in the history; <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: SIN" target="_blank">since</a> the Internet access providers and the hardware vendors began selling  only NAT routers with integrated <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewall</a> functionality and the computers were equipped with desktop <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewalls</a>. From then on it was impossible to an attacker to connect to their <em>servers</em> on the victim systems. A new technique was needed and so the malware developers decided to let the infected systems establish a <em><a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Reverse connection" target="_blank">reverse connection</a></em> to their controlling system. But instead of changing the notation of client and server that way it makes sense again (in networking terminology a <em>client</em> normally connects to the <em>server</em>) they kept it as it was and changed the notation how the connection is established, namely in reverse, a<em> <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Reverse connection" target="_blank">reverse connection</a></em>.</p>
<p><strong>1.</strong> Normally, integrated into the <em>client, </em>you find a tool with which an attacker builds and configures a new trojan packet. Settings like the clients hostname to which the server has to connect back, the servers ID to recognize it after it was installed on the system, whether to install it on the target system at all  or execute it only  and let it disappear after the reboot,  how to start it automatically after a reboot (via registry,  as a service etc.) amongst other things. So first the configuration GUI on the <em>client </em> takes a raw, unconfigured <em>damage routine</em> and customizes it according the attackers settings.</p>
<div id="attachment_493" class="wp-caption alignnone" style="width: 310px"><a href="http://www.megapanzer.com/wp-content/uploads/megapanzer_victim3.png" target="_blank"><img class="size-medium wp-image-493" title="GUI to configure a new trojan package." src="http://www.megapanzer.com/wp-content/megapanzer_victim3-300x182.png" alt="GUI to define configuration settings for a new trojan packet." width="300" height="182"></a><p class="wp-caption-text">GUI to configure a new trojan package.</p></div>
<p><strong>2.</strong> The second component that is configured by the configuration GUI is the <em>dropper</em>.  The <em>dropper is</em> the part in a trojanized packet that installs the <em>damage routine</em> on the target system. It saves it in a safe place on the targets file system, it ignites it and also makes sure it gets started automatically after a system reboot.</p>
<p><strong>3.</strong> The last step the configuration GUI performs is to <em>join/</em><em>bind </em>the  previously configured <em>damage routine</em>, the <em>dropper</em> and the last piece I didn&rsquo;t mention so far: the <em>entertainer file</em> which the victim is expecting to see when double clicking the trojanized file.</p>
<p><a title="Structure of a dropper." href="http://www.megapanzer.com/wp-content/uploads/dropper_medium.png"><img class="size-full wp-image-774 alignnone" title="dropper_medium" src="http://www.megapanzer.com/wp-content/dropper_medium.png" alt="Structure of a dropper."></a></p>
<p><strong><br>
</strong></p>
<p><strong>Propagate and drop the malware</strong></p>
<p>Once the <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1214" title="Glossary: Trojan horse" target="_blank">trojan horse</a> is configured and all the components are merged and glued together to one package the next step is to propagate it.  It depends on the creativity of an attacker how to release the package into the wild and how to convince the big mass of victim(s) to execute it. Some common ways are &hellip;</p>
<ul>
<li>Sending it via email and pretending to be a familiar person</li>
<li>Sending a victim an email with  a link to a homepage containing malicious content that installs the trojan automatically</li>
<li>Spread it in file sharing networks to install it on random victims computer</li>
</ul>
<p>This are only some few examples to show which ways exist at all but I will go into the details later in an other article/chapter dedicated especially to this subject.</p>
<p><strong>Executing the dropper<br>
</strong></p>
<p><strong>1.</strong> After the package reaches the victims machine and was executed the dropper component becomes active first. The dropper extracts the damage routine and the entertainer to the victims harddrive.</p>
<p><strong>2. </strong>After extracting them it has to decide what happens with the <em>damage routine</em>, i.e. where to put it exactly. Has it to be copied to a specific directory and do we have to execute it? For example, we don&rsquo;t have to execute a simple hosts file (with our new bogus host name entries) that contains only text data. A password recovery routine instead we have to execute.</p>
<p><strong>3.</strong> The dropper has to decide whether it is necessary to start the <em>damage routine </em>automatically after a reboot. If the dropper was configured to do so there are several ways to do it as for example using the <em>Windows ini files</em>, the <em>system registry</em> etc. I don&rsquo;t go deeper into this subject here because it would be to much information and has to be covered in a separate chapter/article.</p>
<p><strong>4. </strong>If everything is installed and configured according the attackers wishes  the last thing the dropper has to do before deleting itself is to start the <em>entertainer file</em>. This is necessary so everything behaves as expected and the victim doesn&rsquo;t become suspicious.</p>
<p><strong>Executing the damage routine</strong></p>
<p>After the dropper has finished the installation it is up to the <em>damage routine</em> to do its job. Silently, in the background, without attracting the victims attention, collecting sensitive information as account information, documents, emails, the browser history file,  modifying system settings, etc. But also here I don&rsquo;t go into the details what the <em>damage routine</em> does exactly and how it does it. I will cover this subject later in an other chapter/article.</p>
<p><strong>Removing the malware</strong></p>
<p>At the end of any lifecycle there is normally the death of the object. There are two ways the life of a <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1214" title="Glossary: Trojan horse" target="_blank">trojan horse</a> will finish :</p>
<p><strong>1.</strong> The <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1214" title="Glossary: Trojan horse" target="_blank">trojan horse</a> has finished its work and removes all the files it generated over time it was running on a target system, cleans the system log file entries and just making sure no traces are left after removal. At the very end it deletes itself from the system. The <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1214" title="Glossary: Trojan horse" target="_blank">trojan horse</a> commits suicide.</p>
<p><strong>2.</strong> The <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1214" title="Glossary: Trojan horse" target="_blank">trojan horse</a> was not able to avoid detection on a target system and a copy of the <em>damage routine</em> was sent to a AV (Anti <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=3302" title="Glossary: Virus" target="_blank">Virus</a>) company to analyze its behaviour and subsequently create a fingerprint. The fingerprint pattern is sent to the AV company customers and the <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1214" title="Glossary: Trojan horse" target="_blank">trojan horse</a> will finally be detected, stopped and removed from the system. The <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1214" title="Glossary: Trojan horse" target="_blank">trojan horse</a> gets murdered.</p></glossarycode></glossarycode></glossarycode></glossarycode></glossarycode>
]]></content:encoded>
			<wfw:commentRss>http://www.megapanzer.com/2009/03/17/the_lifecycle_of_a_trojan_horse/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

