<?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>ejohansson.se &#187; security</title>
	<atom:link href="http://ejohansson.se/categories/computers/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://ejohansson.se</link>
	<description>Random bits about Linux, programming, computers and occasionally other stuff.</description>
	<lastBuildDate>Sun, 18 Apr 2010 20:23:14 +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>Wii and Netgear&#160;WNR834B</title>
		<link>http://ejohansson.se/archives/2008/12/20/wii-and-netgear-wnr834b/</link>
		<comments>http://ejohansson.se/archives/2008/12/20/wii-and-netgear-wnr834b/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 17:44:23 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[network]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wii]]></category>

		<guid isPermaLink="false">http://ejohansson.se/?p=276</guid>
		<description><![CDATA[I recently had a lot of problems connecting my Nintendo Wii wireless to my girlfriend&#8217;s Netgear router (WNR834B). The router was configured to use WPA-PSK [TKIP] + WPA2-PSK [AES] with a fairly long pass phrase (ASCII characters). It worked very well with my iBook (Mac OS X) and worked most of the time with my [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had a lot of problems connecting my Nintendo Wii wireless to my girlfriend&#8217;s Netgear router (WNR834B). The router was configured to use WPA-PSK [TKIP] + WPA2-PSK [AES] with a fairly long pass phrase (ASCII characters). It worked very well with my iBook (Mac OS X) and worked most of the time with my girlfriend&#8217;s laptop (Windows Vista). But it seemed like Windows used the WPA variant instead of WPA2. It just didn&#8217;t connect when forcing it to use WPA2. And the Wii would only connect if we turned encryption off. Not acceptable!</p>
<p>We tried many things to get the Wii to connect, without any success. In a last attempt we tried changing the pass phrase to a 64 characters long hexadecimal pass phrase. That did the trick. Both the Wii and both laptops now connect without any problem. So if you are having problems connecting your Wii to the wireless network, try changing the pass phrase to consist of hexadecimal characters (0-9, A-F) only. For WPA/WPA2 it must be exactly 64 characters long.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2008/12/20/wii-and-netgear-wnr834b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DNS&#160;vulnerability</title>
		<link>http://ejohansson.se/archives/2008/09/09/dns-vulnerability/</link>
		<comments>http://ejohansson.se/archives/2008/09/09/dns-vulnerability/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 18:07:20 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://ejohansson.se/?p=273</guid>
		<description><![CDATA[A very interesting read about the serious vulnerability in DNS discovered by Dan Kaminsky earlier this year: An Illustrated Guide to the Kaminsky DNS Vulnerability. Recommend read if you are interested in security. Should be possible to understand even for people without prior knowledge of DNS.
]]></description>
			<content:encoded><![CDATA[<p>A very interesting read about the serious vulnerability in DNS discovered by Dan Kaminsky earlier this year: <a href="http://www.unixwiz.net/techtips/iguide-kaminsky-dns-vuln.html">An Illustrated Guide to the Kaminsky DNS Vulnerability</a>. Recommend read if you are interested in security. Should be possible to understand even for people without prior knowledge of DNS.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2008/09/09/dns-vulnerability/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Web&#160;security</title>
		<link>http://ejohansson.se/archives/2008/06/16/web-security/</link>
		<comments>http://ejohansson.se/archives/2008/06/16/web-security/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 17:13:40 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://ejohansson.se/archives/2008/06/16/web-security/</guid>
		<description><![CDATA[LWN has an interesting article on web security. Linked from that article is another interesting blog entry: Hardened stateless session cookies by the guy that discovered the latest WordPress vulnerabilities.
Back to catching up on LWN issues&#8230;
]]></description>
			<content:encoded><![CDATA[<p>LWN has an <a href="http://lwn.net/Articles/283383/">interesting article</a> on web security. Linked from that article is another interesting blog entry: <a href="http://www.lightbluetouchpaper.org/2008/05/16/hardened-stateless-session-cookies/">Hardened stateless session cookies</a> by the guy that discovered the latest WordPress vulnerabilities.</p>
<p>Back to catching up on LWN issues&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2008/06/16/web-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELinux and mail() in&#160;PHP</title>
		<link>http://ejohansson.se/archives/2008/02/22/selinux-and-mail-in-php/</link>
		<comments>http://ejohansson.se/archives/2008/02/22/selinux-and-mail-in-php/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 21:37:13 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://ejohansson.se/archives/2008/02/22/selinux-and-mail-in-php/</guid>
		<description><![CDATA[Since I upgraded my server and activated SELinux I haven&#8217;t gotten any emails from wordpress when people post comments on this blog (that&#8217;s why it has taken my so long time to approve comments). Today I decided it was time to look into the problem.
It turned out that the problem was related to the following [...]]]></description>
			<content:encoded><![CDATA[<p>Since I upgraded my server and activated SELinux I haven&#8217;t gotten any emails from wordpress when people post comments on this blog (that&#8217;s why it has taken my so long time to approve comments). Today I decided it was time to look into the problem.</p>
<p>It turned out that the problem was related to the following message that I&#8217;ve been seeing in my log:</p>
<pre>
avc:  denied  { execute_no_trans } for  pid=972 comm="apache2"
name="bash" dev=hda1 ino=26110
scontext=user_u:system_r:httpd_t:s0
tcontext=system_u:object_r:shell_exec_t:s0 tclass=file
</pre>
<p>The mail() function in PHP (which is what wordpress uses to send the notification mail) is implemented using popen(3). When you call mail(), PHP executes popen(&#8220;sendmail &#8230;&#8221;, &#8220;w&#8221;). This ends up with a call to &#8220;sh -c sendmail &#8230;&#8221;, which explains the log message.</p>
<p>The solution was allow execute_no_trans for httpd:</p>
<pre>
allow httpd_t shell_exec_t:file execute_no_trans;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2008/02/22/selinux-and-mail-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SELinux, Subversion and&#160;mod_svn</title>
		<link>http://ejohansson.se/archives/2007/11/04/selinux-subversion-and-mod_svn/</link>
		<comments>http://ejohansson.se/archives/2007/11/04/selinux-subversion-and-mod_svn/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 01:22:48 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://ejohansson.se/archives/2007/11/04/selinux-subversion-and-mod_svn/</guid>
		<description><![CDATA[After upgrading my server (from Debian Sarge to Debian Etch) I decided to enabled SELinux. After reading some documentation (besides Debian&#8217;s basic setup documentation I can recommend Fedora&#8217;s SELinux wiki and especially this presentation) I got the basic setup working. Getting Subversion to fully work required a few extra steps. For your convenience and my [...]]]></description>
			<content:encoded><![CDATA[<p>After upgrading my server (from Debian Sarge to Debian Etch) I decided to enabled SELinux. After reading some documentation (besides <a href="http://wiki.debian.org/SELinux">Debian&#8217;s basic setup documentation</a> I can recommend <a href="http://fedoraproject.org/wiki/SELinux">Fedora&#8217;s SELinux wiki</a> and especially <a href="http://people.redhat.com/dwalsh/SELinux/Presentations/ManageRHEL5.pdf">this presentation</a>) I got the basic setup working. Getting Subversion to fully work required a few extra steps. For your convenience and my memory I&#8217;ve listed them below.</p>
<p>1. Turn on httpd_builtin_scripting and httpd_enable_cgi. Turning on httpd_builtin_scripting gives httpd_t (i.e. apache) permission to read and write files marked httpd_sys_script_rw_t. This is needed for commits to work. Turning on httpd_enable_cgi gives httpd_t permission to execute scripts (marked httpd_sys_script_exec_t), something which is needed for hooks to work.</p>
<pre>
# setsebool -P httpd_builtin_scripting=1
# setsebool -P httpd_enable_cgi=1
</pre>
<p>2. Set the proper security context on the files in the repository. Assuming that all repositories are located under /home/svn, the following commands will do the job. Also make sure that the user apache is running as (e.g. www-data) has read access to the repository and write access to the directories dav and db (<a href="http://svn.ejohansson.se/repos/src/misc/bash/svn_perms">this is the script I use for that</a>).</p>
<pre>
# semanage fcontext -a -t httpd_sys_content_t '/home/svn(/.*)?'
# semanage fcontext -a -t httpd_sys_script_rw_t '/home/svn/[^/]+/(dav|db)(/.*)?'
# semanage fcontext -a -t httpd_sys_script_exec_t '/home/svn/[^/]+/hooks(/.*)?'
# restorecon -Rv /home/svn
</pre>
<p>3. Make sure selinux-policy-refpolicy-dev is installed.</p>
<p>4. Create the directory mysvn. In that directory, create the file mysvn.te with the following contents:</p>
<pre>
policy_module(mysvn,0.0.1)

require {
        type httpd_t;
        type shell_exec_t;
        type httpd_sys_script_t;
        type var_run_t;
};

# If hooks are shell scripts, apache must be able to run a shell. The
# hooks will run in httpd_sys_script_t.
allow httpd_t shell_exec_t:file rx_file_perms;

# For some reason the scripts searches /var/run
allow httpd_sys_script_t var_run_t:dir search;
</pre>
<p>5. Then run:</p>
<pre>
# make -f /usr/share/selinux/refpolicy-targeted/include/Makefile
# semodule -i mysvn.pp
</pre>
<p>The mysvn policy module is needed because hooks are normally shell scripts. For apache to be able to run them it must be able to run a shell. Once the scripts have started, they run in the httpd_sys_script_t domain.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2007/11/04/selinux-subversion-and-mod_svn/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>X.Org local privilege&#160;escalation</title>
		<link>http://ejohansson.se/archives/2006/03/20/xorg-local-privilege-escalation/</link>
		<comments>http://ejohansson.se/archives/2006/03/20/xorg-local-privilege-escalation/#comments</comments>
		<pubDate>Mon, 20 Mar 2006 17:08:53 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://ejohansson.se/archives/2006/03/20/xorg-local-privilege-escalation/</guid>
		<description><![CDATA[A X.Org security advisory was just announced. There is a bug in X.Org server 6.9/7.0 that allows  unprivileged users to execute arbitrary code with root privileges. Apparently the bug was found when examining the results from the analysis that Coverity has been performing on a lot of open source projects (LWN article).
What&#8217;s interesting about [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_133" class="wp-caption alignright" style="width: 73px"><a href="http://www.x.org/"><img class="size-full wp-image-133" title="X.Org" src="http://files.ejohansson.se/wp-content/uploads/2008/08/xorg.png" alt="X.Org" width="63" height="51" /></a><p class="wp-caption-text">X.Org</p></div>
<p>A <a href="http://lists.freedesktop.org/archives/xorg/2006-March/013992.html">X.Org security advisory</a> was just announced. There is a bug in X.Org server 6.9/7.0 that allows  unprivileged users to execute arbitrary code with root privileges. Apparently the bug was found when examining the results from the <a href="http://scan.coverity.com/">analysis</a> that Coverity has been performing on a lot of open source projects (<a href="http://lwn.net/Articles/174769/">LWN article</a>).</p>
<p>What&#8217;s interesting about this bug is that it illustrates how easy it is to make a tiny misstake in C that passes the compiler, doesn&#8217;t crash the program at runtime (the code is perfectly legal) but opens up the system for security attacks. They had a tiny typo in the code that checked the effective uid. Instead of checking the return value</p>
<pre>if (geteuid() != 0) {...}</pre>
<p>they missed the parenthesis which made the expression check if the function&#8217;s address was non-zero. Which it always is.</p>
<pre>if (geteuid != 0) {...}</pre>
<p><a href="http://xorg.freedesktop.org/releases/X11R7.0/patches/">Download the patch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2006/03/20/xorg-local-privilege-escalation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>No more MD5&#160;hash!</title>
		<link>http://ejohansson.se/archives/2006/03/10/no-more-md5-hash/</link>
		<comments>http://ejohansson.se/archives/2006/03/10/no-more-md5-hash/#comments</comments>
		<pubDate>Fri, 10 Mar 2006 22:20:59 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://ejohansson.se/archives/2006/03/10/no-more-md5-hash/</guid>
		<description><![CDATA[Found an interesting article today: Attacking Hash Functions by Poisoned Messages.
The authors have created two postscript files that, when viewed in a postscript viewer seem to differ, but when passed through a MD5 function produces the same hash. This have the consequent that when a non-suspecting individual electronically signs the &#8220;good&#8221; document A (by signing [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.wooyd.org/?p=32">Found</a> an interesting article today: <a href="http://www.cits.rub.de/MD5Collisions/">Attacking Hash Functions by Poisoned Messages</a>.</p>
<p>The authors have created two postscript files that, when viewed in a postscript viewer seem to differ, but when passed through a MD5 function produces the same hash. This have the consequent that when a non-suspecting individual electronically signs the &#8220;good&#8221; document A (by signing the MD5 hash of the document), his signature is also valid for the &#8220;evil&#8221; document B.</p>
<p>To accomplish this they are using the fact that postscript is really a full blown programming language and that, if MD5(X1) is equal to MD5(X2), then MD5(X1 || X) is equal to MD5(X2 || X). (|| means concatenation.) [1]</p>
<p>This is how they&#8217;ve done it&#8230;</p>
<p><span id="more-54"></span></p>
<p>The first document, document A, looks like this.</p>
<pre>
%!PS-Adobe-1.0
%%BoundingBox: 0 0 612 792
(S)(S)eq{
[postscript for document A]
}{
[postscript for document B]
}ifelse
showpage
</pre>
<p>And the second, document B, like this.</p>
<pre>
%!PS-Adobe-1.0
%%BoundingBox: 0 0 612 792
(T)(S)eq{
[postscript for document A]
}{
[postscript for document B]
}ifelse
showpage
</pre>
<p>Both S and T are binary blobs of 128 bytes. Expressed in pseudo C, the two documents can be written like this.</p>
<pre>
if (X == S)
	display(A);
else
	display(B);
</pre>
<p>X equals S in document A, and T in document B. So each document contains postscript for both documents, and it&#8217;s the first 192 bytes that decides which text to show in respective document.</p>
<p>Then, what they have done is finding S and T so that the MD5 hash for</p>
<pre>
%!PS-Adobe-1.0
%%BoundingBox: 0 0 612 792
(S
</pre>
<p>equals the MD5 hash for</p>
<pre>
%!PS-Adobe-1.0
%%BoundingBox: 0 0 612 792
(T
</pre>
<p>Which apparently took only a couple of hours on a stock PC.</p>
<p>Then they are able to create two, seemingly different documents with the same MD5 hash.</p>
<p>If you&#8217;re eager to try this yourself, T and S can be extracted from the order.ps file.</p>
<pre>
# head --bytes=192 order.ps | tail --bytes=128 &gt; T
# head --bytes=322 order.ps | tail --bytes=128 &gt; S
</pre>
<p>Hopefully this will make you think twice before signing any postscript document. Or any binary files for that matter. If you follow that advice, the impact of this shouldn&#8217;t be that big. But, just too be safe, stop using MD5 as your &#8220;hash function of choice&#8221;.</p>
<p>[1] &#8211; <a href="http://www.cits.rub.de/imperia/md/content/magnus/rump_ec05.pdf">Hash Functions and the Blind Passenger Attack</a><br />
[2] &#8211; Observe that the line endings in the example postscript files are CRLF, not LF.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2006/03/10/no-more-md5-hash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WEP cracking and WiFi&#160;security</title>
		<link>http://ejohansson.se/archives/2006/02/17/wep-cracking-and-wifi-security/</link>
		<comments>http://ejohansson.se/archives/2006/02/17/wep-cracking-and-wifi-security/#comments</comments>
		<pubDate>Fri, 17 Feb 2006 20:25:18 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://ejohansson.se/archives/2006/02/17/wep-cracking-and-wifi-security/</guid>
		<description><![CDATA[Anyone interested in network security in general and WiFi security in particular will find the recent thread about WEP cracking on the bcm43xx-dev list interesting. I&#8217;ve always know that cracking WEP is easy, but not that easy.
I can also recommend Cedric Blancher&#8217;s recent SecureCon talk (linked from the mail) as it&#8217;s fairly interesting. Also linked [...]]]></description>
			<content:encoded><![CDATA[<p>Anyone interested in network security in general and WiFi security in particular will find the recent thread about <a href="https://lists.berlios.de/pipermail/bcm43xx-dev/2006-February/001295.html">WEP cracking</a> on the bcm43xx-dev list interesting. I&#8217;ve always know that cracking WEP is easy, but not that easy.</p>
<p>I can also recommend Cedric Blancher&#8217;s <a href="http://sid.rstack.org/pres/0602_Securecon_WirelessInjection.pdf">recent SecureCon talk</a> (linked from the mail) as it&#8217;s fairly interesting. Also linked from the mail is <a href="http://sid.rstack.org/index.php/Wifitap_EN">Wifitap</a> which is</p>
<blockquote><p>
a proof of concept for communication over WiFi networks using traffic injection.
</p></blockquote>
<p>You should especially check out the video <a href="http://sid.rstack.org/videos/aircrack/whax-aircrack-wep.html">cracking WEP in 10 easy steps</a> linked to from the Wifitap site. When you&#8217;ve done that, reconfigure your access point to use WPA instead. Then read the <a href="https://lists.berlios.de/pipermail/bcm43xx-dev/2006-February/001298.html">end of the thread</a> discussing how to crack WPA and return to your AP&#8217;s configuration and set a better password.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2006/02/17/wep-cracking-and-wifi-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
