<?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>ewald.tienkamp.nl &#187; Security</title>
	<atom:link href="http://ewald.tienkamp.nl/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://ewald.tienkamp.nl</link>
	<description>Gentoo Linux and whatever else I think needs to be shot into cyberspace.</description>
	<lastBuildDate>Sat, 04 Sep 2010 08:39:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Hardened Gentoo, PaX and OpenOffice.org</title>
		<link>http://ewald.tienkamp.nl/2010/09/04/hardened-gentoo-pax-and-openoffice-org/</link>
		<comments>http://ewald.tienkamp.nl/2010/09/04/hardened-gentoo-pax-and-openoffice-org/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 08:38:46 +0000</pubDate>
		<dc:creator>Ewald</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[grsecurity]]></category>
		<category><![CDATA[Hardened Gentoo]]></category>
		<category><![CDATA[OpenOffice.org]]></category>
		<category><![CDATA[PaX]]></category>
		<category><![CDATA[paxctl]]></category>

		<guid isPermaLink="false">http://ewald.tienkamp.nl/?p=176</guid>
		<description><![CDATA[Just a short blog post: after merging OpenOffice.org on a Hardened Gentoo machine today, I was unable to boot OpenOffice.org Writer (or any of the other OOo programs). While the solution isn&#8217;t all that pretty, it is rather simple. The problem has to do with OpenOffice.org throwing out the following error when trying to boot [...]]]></description>
			<content:encoded><![CDATA[<p>Just a short blog post: after merging OpenOffice.org on a Hardened Gentoo machine today, I was unable to boot OpenOffice.org Writer (or any of the other OOo programs). While the solution isn&#8217;t all that pretty, it is rather simple.</p>
<p>The problem has to do with <a href="http://www.openoffice.org/">OpenOffice.org</a> throwing out the following error when trying to boot in <a href="http://www.gentoo.org/proj/en/hardened/">Hardened Gentoo</a>:</p>
<blockquote><p>terminate called after throwing an instance of &#8216;std::bad_alloc&#8217;<br />
  what():  std::bad_alloc</p></blockquote>
<p>Turns out this has to do with the way <a href="http://forums.grsecurity.net/viewtopic.php?t=1817#p7235">OpenOffice.org tries to work against the mprotect restrictions</a>. You can lift those restrictions by using paxctl (emerge -av paxctl) in the following way:</p>
<p><code># check for current PaX settings:<br />
paxctl -v /usr/lib/openoffice/program/soffice.bin<br />
# disable mprotect:<br />
paxctl -m /usr/lib/openoffice/program/soffice.bin</code></p>
<p>Now OOo should finally launch. This enables you to write a polite letter to the OOo team asking them to allow us to run OOo <em>with</em> mprotect. <img src='http://ewald.tienkamp.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ewald.tienkamp.nl/2010/09/04/hardened-gentoo-pax-and-openoffice-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Signing PGP/GnuPG keys using caff and sSMTP</title>
		<link>http://ewald.tienkamp.nl/2010/02/10/signing-pgpgnupg-keys-using-caff-and-ssmtp/</link>
		<comments>http://ewald.tienkamp.nl/2010/02/10/signing-pgpgnupg-keys-using-caff-and-ssmtp/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 23:41:40 +0000</pubDate>
		<dc:creator>Ewald</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[caff]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[FOSDEM]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[GnuPG]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[keysigning]]></category>
		<category><![CDATA[PGP]]></category>
		<category><![CDATA[SHA256]]></category>
		<category><![CDATA[signing-party]]></category>
		<category><![CDATA[sSMTP]]></category>
		<category><![CDATA[TLS]]></category>

		<guid isPermaLink="false">http://ewald.tienkamp.nl/?p=115</guid>
		<description><![CDATA[After attending the keysigning party at FOSDEM 2010, I came home with a large list of PGP/GnuPG keys I needed to sign. At the conference, there was a brief mention of using caff to make this task easier and soon enough, the first emails sent using caff came rolling in. Problem was&#8230; I had no [...]]]></description>
			<content:encoded><![CDATA[<p>After attending the <a href="http://fosdem.org/2010/keysigning">keysigning party</a> at <a href="http://fosdem.org/2010/">FOSDEM 2010</a>, I came home with a large list of PGP/GnuPG keys I needed to sign. At the conference, there was a brief mention of using <a href="http://pgp-tools.alioth.debian.org/">caff</a> to make this task easier and soon enough, the first emails sent using caff came rolling in. Problem was&#8230; I had no experience whatsoever using caff, and the documentation was rather brief. I did manage to figure it all out though.<br />
<span id="more-115"></span><br />
For this small guide/list of tips, I am assuming you have gpg working and are familiar with your mail settings.</p>
<p>First problem was not that hard to figure out: caff is not called caff in most packagemanagers. So, as I use Gentoo, I typed<br />
<code>emerge -av signing-party</code><br />
and was on my way.</p>
<p>Caff stores it&#8217;s configuration in a user specific file called ~/.caffrc which can just be kept default to be honest. All you need to do is enter your full name, your email address, your keyid (see the config itself for instructions) and optionally customize the message to be sent. The real trick comes when editing some customizations for gpg.</p>
<p>For example, I wanted to define a default signing level. As you may or may not know, PGP keysigning can be fine-tuned by <a href="http://cryptnet.net/mirrors/rfcs/rfc4880.txt">defining your level of confidence in establishing the key owner&#8217;s identity</a>. All in all, as there was some checking of ID&#8217;s and confirming those, but doing this outside and using only one ID of variable quality, I felt level 2 would be the most appropriate (I&#8217;ll write a personal key signing policy in the near future). After some searching around I discovered that it was indeed not the right place to set this in caffrc, as the gpg-sign-args option was not meant to be used like that. To set this default I would normally have to add this preference to ~/.gnupg/gpg.conf, however, caff uses it&#8217;s own gnupg homedir, so nano -w ~/.caff/gnupghome/gpg.conf and add the following:<br />
<code>default-cert-level 2</code><br />
(and any other customizations you feel that are needed, such as &#8220;charset utf-8&#8243;, and did you <a href="http://www.debian-administration.org/users/dkg/weblog/48">switch to SHA256</a> already btw?)</p>
<p>You may, however, use gpg-sign-args to avoid having to manually save the changes after signing each key, if you like. Insert the following in ~/.caffrc:<br />
<code>$CONFIG{'gpg-sign-args'} = 'save';</code></p>
<p>After this, the signing of specific keys with caff should work just fine. But there&#8217;s still the issue of being able to actually send out those keys by email to the owner. For that purpose we can use the very basic sSMTP, which is most likely already present on your system. If not, and when using Gentoo Linux:<br />
<code>emerge -av ssmtp</code></p>
<p>sSMTP comes with two config-files, which both need to be edited to work with my provider&#8217;s TLS enabled mailserver (<a href="http://www.destr0yr.com/article.php/Gmail_and_sSMTP">just like Google&#8217;s Gmail for that matter</a>). I&#8217;ll provide you with both the files (stripped of comments) the way I have them functioning properly:</p>
<p>/etc/ssmtp/ssmtp.conf<br />
<code>root=postmaster<br />
mailhub=mail.provider.tld:587<br />
AuthUser=username<br />
AuthPass=password<br />
rewriteDomain=<br />
hostname=email@domain.tld<br />
FromLineOverride=YES<br />
UseSTARTTLS=YES</code></p>
<p>/etc/ssmtp/revaliases<br />
<code>root:email@domain.tld:mail.provider.tld:587<br />
defaultuser:email@domain.tld:mail.provider.tld:587</code></p>
<p>Finally, this enabled me to send out the signed keys using caff. The current version of caff does <a href="http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg741135.html">add an invalid Sender header</a> consisting of username@hostname unfortunately, though this has reportedly been solved recently. I solved it myself by inserting the Sender line which was added in <a href="http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg741135.html">the patch mentioned above</a>. Feel free to propose other enhancements in the comments.</p>
<p><strong>Update, 16 February 2010:</strong> <a href="http://ewald.tienkamp.info/keysigningpolicy.php">I now have a personal keysigning policy</a>! For automatically adding the policy URL to signatures, I use the following option in gpg.conf:<br />
<code>set-policy-url http://url/to/policy</code></p>
]]></content:encoded>
			<wfw:commentRss>http://ewald.tienkamp.nl/2010/02/10/signing-pgpgnupg-keys-using-caff-and-ssmtp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mounting a remote file system over ssh using sshfs and non-standard settings</title>
		<link>http://ewald.tienkamp.nl/2010/01/19/mounting-a-remote-file-system-over-ssh-using-sshfs-and-non-standard-settings/</link>
		<comments>http://ewald.tienkamp.nl/2010/01/19/mounting-a-remote-file-system-over-ssh-using-sshfs-and-non-standard-settings/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 22:25:55 +0000</pubDate>
		<dc:creator>Ewald</dc:creator>
				<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[/etc/fstab]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[IdentityFile]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[non-standard]]></category>
		<category><![CDATA[passwordless login]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[remote filesystem mounting]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshfs]]></category>
		<category><![CDATA[uncommon]]></category>

		<guid isPermaLink="false">http://ewald.tienkamp.nl/?p=93</guid>
		<description><![CDATA[As usual I had the desire to have a non-common set-up, which was presumably more secure or at the very least more fun to get working. In this case, after rebuilding my server, I wanted to recreate the sshfs setup I had going on in the past, but this time while using a separate IdentityFile, [...]]]></description>
			<content:encoded><![CDATA[<p>As usual I had the desire to have a non-common set-up, which was presumably more secure or at the very least more fun to get working. In this case, after rebuilding my server, I wanted to recreate the sshfs setup I had going on in the past, but this time while using a separate IdentityFile, non-common portnumber and incorporated in my /etc/fstab file. Somehow I forgot how I managed to get that working in the past, so for my own sake and the sake of others seeking help with this, I wrote down the steps I took to get this working, below.<br />
<span id="more-93"></span><br />
First of all, make sure you have sshd working on the machine that physically contains the disks you want to mount remotely. For this tutorial I&#8217;ll call that machine <em>REMOTE</em>. In sshd_config on <em>REMOTE</em> you will want to set (for the setup used in this post) a different port to listen on and enable passwordless login or as it should be referred to: logging in with keys. Then, return here.</p>
<p>Fine, now, on your local machine (<em>LOCAL</em>), generate an IdentityFile to be used for mounting the remote filesystem. I suggest that, while root, you execute the following:<br />
<code>ssh-keygen -f /root/.ssh/<em>YOURKEYFILE</em></code><br />
Assure that permissions are set accordingly:<br />
<code>chmod -R 700 /root/.ssh</code><br />
Now, get the /root/.ssh/<em>YOURKEYFILE</em><strong>.pub</strong> file. Yes, the one ending in .pub, not your secret one. Now, on the machine <em>REMOTE</em>, I suggest you add a new user, to be used solely for mounting with sshfs. Give it a catchy name like <em>REMOTEUSER</em>:<br />
<code>useradd -m <em>REMOTEUSER</em><br />
password <em>REMOTEUSER</em> #do not leave this blank!</code><br />
Now make sure that the contents of <em>YOURKEYFILE</em><strong>.pub</strong> get appended or added to /home/REMOTEUSER/.ssh/authorized_keys (which is of course on REMOTE, not on LOCAL). I don&#8217;t know (or care) how, use scp, use another machine, use an USB stick, you&#8217;ll figure it out.</p>
<p>After all this, you should be able to log into <em>REMOTEUSER</em> from <em>LOCAL</em> by executing the following as root:<br />
<code>ssh -i /root/.ssh/<em>YOURKEYFILE</em> -p <em>REMOTEPORTNUMBER</em> <em>REMOTEUSER</em>@<em>REMOTE</em></code><br />
If this does not work, check logfiles or use debugmodes.</p>
<p>From here it&#8217;s not that much work to get to mounting disks or folders which are physically on <em>REMOTE</em> to <em>LOCAL</em>. First, make sure you have sshfs installed. In Gentoo you can simply emerge:<br />
<code>emerge -av sshfs-fuse</code><br />
Do this.</p>
<p>Now, make sure you know your <em>LOCALMOUNTPOINT</em> (and ensure the empty folder exists by using mkdir) on <em>LOCAL</em> and know which <em>REMOTEMOUNTPOINT</em> you want to mount (located on <em>REMOTE</em>). Try mounting it by executing the following as root:<br />
<code>sshfs <em>REMOTEUSER</em>@<em>REMOTE</em>:<em>REMOTEMOUNTPOINT</em> <em>LOCALMOUNTPOINT</em> -p<em>REMOTEPORTNUMBER</em> -o uid=<em>LOCALUSERID</em> -o gid=<em>DESIREDGROUPID</em> -o idmap=user -o IdentityFile=/root/.ssh/<em>YOURKEYFILE</em> -o allow_other</code><br />
Please pay close attention to which value is entered where, and, if in doubt, read man sshfs. The values for <em>LOCALUSERID</em> and <em>DESIREDGROUPID</em> determine with what ownership the <em>REMOTEMOUNTPOINT</em> is mounted on <em>LOCAL</em>. The numbers entered represent uid and gid numbers residing on <em>LOCAL</em>.</p>
<p>If this works as expected, it is a simple matter of reformatting the above command, so /etc/fstab is able to automatically mount your <em>REMOTEMOUNTPOINT</em> at (<em>LOCAL</em>)boot. Or so I thought. Turns out it was slightly more complicated, but after some trial and error and some more searching the web I came up with the following working line for fstab:<br />
<code>sshfs#<em>REMOTEUSER</em>@<em>REMOTE</em>:<em>REMOTEMOUNTPOINT</em>   <em>LOCALMOUNTPOINT</em>   fuse   port=<em>REMOTEPORTNUMBER</em>,uid=<em>LOCALUSERID</em>,gid=<em>DESIREDGROUPID</em>,idmap=user,IdentityFile=/root/.ssh/<em>YOURKEYFILE</em>,allow_other   0 0</code><br />
That should do the trick! You can test this by ensuring you have not mounted your <em>REMOTEMOUNTPOINT</em> on <em>LOCAL</em> at this moment (try fusermount -u <em>LOCALMOUNTPOINT</em>) and then simply entering:<br />
<code>mount <em>LOCALMOUNTPOINT</em> #Yes, the one you just entered in /etc/fstab</code><br />
That&#8217;s it! Any comments or questions can be directed to the comments below and I will attempt to adjust the above as needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://ewald.tienkamp.nl/2010/01/19/mounting-a-remote-file-system-over-ssh-using-sshfs-and-non-standard-settings/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scanning for Conficker using Nmap under Gentoo Linux</title>
		<link>http://ewald.tienkamp.nl/2009/05/18/scanning-for-conficker-using-nmap-under-gentoo-linux/</link>
		<comments>http://ewald.tienkamp.nl/2009/05/18/scanning-for-conficker-using-nmap-under-gentoo-linux/#comments</comments>
		<pubDate>Mon, 18 May 2009 20:53:08 +0000</pubDate>
		<dc:creator>Ewald</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[Conficker]]></category>
		<category><![CDATA[emerge]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[package.use]]></category>
		<category><![CDATA[portage]]></category>
		<category><![CDATA[USE flags]]></category>

		<guid isPermaLink="false">http://ewald.tienkamp.nl/?p=8</guid>
		<description><![CDATA[Well, that was what I wanted. I know, Conficker was hot months ago. But hey, I&#8217;m not often around Windows machines and I thought that while I was, I might just as well scan my parents&#8217;s network. So there I was with my little netbook, most recent Nmap (nmap-4.85_beta8) loaded, ready to go. A quick [...]]]></description>
			<content:encoded><![CDATA[<p>Well, that was what I wanted. I know, Conficker was hot months ago. But hey, I&#8217;m not often around Windows machines and I thought that while I was, I might just as well scan my parents&#8217;s network.<br />
<span id="more-8"></span><br />
So there I was with my little netbook, most recent Nmap (nmap-4.85_beta8) loaded, ready to go. A quick Google search taught me the right command.</p>
<p>But it failed.</p>
<p><code>nmap: unrecognized option '--script'<br />
[snip: followed by regular nmap --help output]</code></p>
<p>Eh?</p>
<p>As my thinking was suspended, I went for Google to find me the culprit responsible for this error. No results. What? Ah, well, this is just why I wanted my own blog: to enhance Google with yet unknown knowledge (or knowledge previously only available in obscure languages). Now only to find the solution&#8230;</p>
<p>Turns out it was actually rather simple: compile <a href="http://www.gentoo-portage.com/net-analyzer/nmap/USE#ptabs" title="Gentoo-Portage.com - nmap USE flags">Nmap with the lua USE flag</a>. Yes, that&#8217;s all.</p>
<p><i>OPEN PACKAGE.USE</i><br />
<code>nano /etc/portage/package.use</code><br />
<i>AND INSERT</i><br />
<code>net-analyzer/nmap lua</code><br />
<i>OR ON A TERMINAL ENTER</i><br />
<code>echo "net-analyzer/nmap lua" >> /etc/portage/package.use</code></p>
<p>After this you&#8217;re good to go.</p>
<p>While I&#8217;m at it, let&#8217;s leave you with the recommended scan options at the moment of writing:</p>
<p><code>#Source: <a href="http://nmap.org/changelog.html" title="Nmap changelog">Nmap changelog</a><br />
  o Recommended command for a fast Conficker scan (combine into 1 line):<br />
    nmap -p139,445 --script p2p-conficker,smb-os-discovery,smb-check-vulns<br />
    --script-args checkconficker=1,safe=1 -T4 [target networks]<br />
  o Recommended command for a more comprehensive (but slower) scan:<br />
    nmap --script p2p-conficker,smb-os-discovery,smb-check-vulns -p-<br />
    --script-args checkall=1,safe=1 -T4 [target networks]<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://ewald.tienkamp.nl/2009/05/18/scanning-for-conficker-using-nmap-under-gentoo-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

