<?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>WEBarnes.ca (William Barnes) &#187; security</title>
	<atom:link href="http://www.webarnes.ca/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webarnes.ca</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 13 Dec 2011 19:31:16 +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>Toggle Gnome screensaver lock on USB key insertion</title>
		<link>http://www.webarnes.ca/2011/09/toggle-gnome-screensaver-lock-on-usb-key-insertion/</link>
		<comments>http://www.webarnes.ca/2011/09/toggle-gnome-screensaver-lock-on-usb-key-insertion/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 13:39:23 +0000</pubDate>
		<dc:creator>William Barnes</dc:creator>
				<category><![CDATA[Computers & Internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.webarnes.ca/?p=1172</guid>
		<description><![CDATA[While I like my computer to lock itself automatically when I leave, it gets annoying when it does it every time I get up for a few minutes. I decided that it would be nice if I could toggle the screen lock only when I&#8217;m out of the apartment. I decided that the trigger should [...]]]></description>
			<content:encoded><![CDATA[<p>While I like my computer to lock itself automatically when I leave, it gets annoying when it does it every time I get up for a few minutes. I decided that it would be nice if I could toggle the screen lock only when I&#8217;m out of the apartment. I decided that the trigger should be the USB key I have on my keychain. It&#8217;s always with me. If it&#8217;s plugged in to the computer, then I&#8217;m likely home.<del> I apologize for the (lack of) formatting of the code, I will be fixing that when I get my computer back up and running.</del></p>
<p>Ubuntu uses an event-based system called <a href="http://en.wikipedia.org/udev">udev</a> that, among other things, can run a script when a USB device is plugged in or unplugged. Local (ie: user-created) udev rules are stored in <code>/etc/udev/rules.d/</code>. Before you can create a rule, you need to know a little about the device that is going to trigger it. Open a terminal and type:</p>
<p><code>udevadm monitor --udev --environment</code></p>
<p>Connect your USB device. It doesn&#8217;t have to be a USB key, it could be a phone, for example. A bunch of text will come up. Look for &#8220;ID_SERIAL&#8221; and &#8220;ID_VENDOR_ID&#8221;. Write down the values of those. You can use other variables if they suit your device better, just change the rules file accordingly.</p>
<p>Create a file called &#8220;/etc/udev/rules.d/85-screen-lock-toggle.rules&#8221;. Put the following in it, replacing VALUE with the proper value:</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">File: /etc/udev/rules.d/85-screen-lock-toggle.rules</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.webarnes.ca/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.webarnes.ca/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.webarnes.ca/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.webarnes.ca/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="re2">ACTION</span>==<span class="st0">&quot;remove&quot;</span>, ENV<span class="br0">&#123;</span>ID_SERIAL<span class="br0">&#125;</span>==<span class="st0">&quot;VALUE&quot;</span>, ENV<span class="br0">&#123;</span>ID_VENDOR_ID<span class="br0">&#125;</span>==<span class="st0">&quot;VALUE&quot;</span>, RUN+=<span class="st0">&quot;/usr/local/bin/gnome-lock-enable&quot;</span></div></li><li class="li1"><div class="de1"><span class="re2">ACTION</span>==<span class="st0">&quot;add&quot;</span>, ENV<span class="br0">&#123;</span>ID_SERIAL<span class="br0">&#125;</span>==<span class="st0">&quot;VALUE&quot;</span>, ENV<span class="br0">&#123;</span>ID_VENDOR_ID<span class="br0">&#125;</span>==<span class="st0">&quot;VALUE&quot;</span>, RUN+=<span class="st0">&quot;/usr/local/bin/gnome-lock-disable&quot;</span></div></li></ol></pre></div></div>
<p>Next create the scripts to actually disable and enable locking:</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">File: /usr/local/bin/gnome-lock-enable</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.webarnes.ca/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.webarnes.ca/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.webarnes.ca/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.webarnes.ca/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="co0">#!/bin/bash</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="re2">user</span>=<span class="sy0">`</span><span class="kw2">ps</span> aux <span class="sy0">|</span> <span class="kw2">grep</span> gnome-screensaver <span class="sy0">|</span> <span class="kw2">head</span> <span class="re5">-n</span> 1 <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st_h">'{print $1}'</span><span class="sy0">`</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li2"><div class="de2"><span class="kw1">if</span> <span class="br0">&#91;</span> <span class="re5">-n</span> <span class="re1">$user</span> <span class="br0">&#93;</span>; <span class="kw1">then</span></div></li><li class="li1"><div class="de1">	<span class="re2">GNOME_SCREENSAVER_PROC</span>=<span class="sy0">`</span><span class="kw2">ps</span> xa <span class="sy0">|</span> <span class="kw2">grep</span> gnome-screensaver <span class="sy0">|</span> <span class="kw2">head</span> <span class="re5">-n</span> 1 <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st_h">'{print $1}'</span><span class="sy0">`</span></div></li><li class="li1"><div class="de1">	<span class="kw3">export</span> <span class="sy0">`</span><span class="kw2">grep</span> <span class="re5">-z</span> DBUS_SESSION_BUS_ADDRESS <span class="sy0">/</span>proc<span class="sy0">/</span><span class="re1">$GNOME_SCREENSAVER_PROC</span><span class="sy0">/</span>environ<span class="sy0">`</span></div></li><li class="li1"><div class="de1">	<span class="kw2">su</span> <span class="re1">$user</span> <span class="re5">-c</span> <span class="st0">&quot;gconftool-2 --set &quot;</span><span class="sy0">/</span>apps<span class="sy0">/</span>gnome-screensaver<span class="sy0">/</span>lock_enabled<span class="st0">&quot; --type bool 1&quot;</span></div></li><li class="li1"><div class="de1"><span class="kw1">fi</span></div></li></ol></pre></div></div>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">File: /usr/local/bin/gnome-lock-disable</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.webarnes.ca/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.webarnes.ca/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.webarnes.ca/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.webarnes.ca/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="co0">#!/bin/bash</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="re2">user</span>=<span class="sy0">`</span><span class="kw2">ps</span> aux <span class="sy0">|</span> <span class="kw2">grep</span> gnome-screensaver <span class="sy0">|</span> <span class="kw2">head</span> <span class="re5">-n</span> 1 <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st_h">'{print $1}'</span><span class="sy0">`</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li2"><div class="de2"><span class="kw1">if</span> <span class="br0">&#91;</span> <span class="re5">-n</span> <span class="re1">$user</span> <span class="br0">&#93;</span>; <span class="kw1">then</span></div></li><li class="li1"><div class="de1">	<span class="re2">GNOME_SCREENSAVER_PROC</span>=<span class="sy0">`</span><span class="kw2">ps</span> xa <span class="sy0">|</span> <span class="kw2">grep</span> gnome-screensaver <span class="sy0">|</span> <span class="kw2">head</span> <span class="re5">-n</span> 1 <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st_h">'{print $1}'</span><span class="sy0">`</span></div></li><li class="li1"><div class="de1">	<span class="kw3">export</span> <span class="sy0">`</span><span class="kw2">grep</span> <span class="re5">-z</span> DBUS_SESSION_BUS_ADDRESS <span class="sy0">/</span>proc<span class="sy0">/</span><span class="re1">$GNOME_SCREENSAVER_PROC</span><span class="sy0">/</span>environ<span class="sy0">`</span></div></li><li class="li1"><div class="de1">	<span class="kw2">su</span> <span class="re1">$user</span> <span class="re5">-c</span> <span class="st0">&quot;gconftool-2 --set &quot;</span><span class="sy0">/</span>apps<span class="sy0">/</span>gnome-screensaver<span class="sy0">/</span>lock_enabled<span class="st0">&quot; --type bool 0&quot;</span></div></li><li class="li1"><div class="de1"><span class="kw1">fi</span></div></li></ol></pre></div></div>
<p>Make the scripts executable:</p>
<p><code>sudo chmod a+x /usr/local/bin/gnome-lock-enable /usr/local/bin/gnome-lock-disable</code></p>
<p>Restart udev:</p>
<p><code>sudo restart udev</code></p>
<p>Enjoy the convenience.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webarnes.ca/2011/09/toggle-gnome-screensaver-lock-on-usb-key-insertion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encryption in your pocket</title>
		<link>http://www.webarnes.ca/2009/02/encryption-in-your-pocket/</link>
		<comments>http://www.webarnes.ca/2009/02/encryption-in-your-pocket/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 01:21:48 +0000</pubDate>
		<dc:creator>William Barnes</dc:creator>
				<category><![CDATA[Computers & Internet]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[pgp]]></category>
		<category><![CDATA[s/mime]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[security now]]></category>
		<category><![CDATA[signing]]></category>
		<category><![CDATA[yubikey]]></category>

		<guid isPermaLink="false">http://www.webarnes.ca/?p=156</guid>
		<description><![CDATA[There was a recent discussion on Security Now about how nice it would be to have a Yubikey-like device that uses public key encryption to sign a provided string of text and thereby provide strong authentication without the need to share a secret key. Steve stated two problems: hardware limitations and driver problems. I don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>There was a recent discussion on Security Now about how nice it would be to have a Yubikey-like device that uses public key encryption to sign a provided string of text and thereby provide strong authentication without the need to share a secret key. Steve stated two problems: hardware limitations and driver problems. I don&#8217;t have a solution to the first problem, it&#8217;s up to somebody else to come up with a cheap <span class="caps">USB </span>device that can do public key encryption, but I think I have an idea for the second.</p>
<p>The cool thing about the Yubikey is that it shows up as a keyboard. It will work on any computer without the need to install drivers. But the keyboard driver is limited in its ability to receive data from the computer. There is, however, another widely available driver that does support two-way transfer: the Mass Storage Device.</p>
<p>Let&#8217;s say a company designs a <span class="caps">USB </span>flash drive that shows up on the computer with a number of folders: &#8216;sign&#8217;, &#8216;encrypt&#8217;, &#8216;output&#8217;, for example. Copy a file into the &#8216;sign&#8217; folder, press a button on the drive, and a signed copy is placed in the &#8216;output&#8217; folder. Now you have the ability to sign, encrypt, decrypt data on any computer. Encryption would require it to somehow manage public keys. Perhaps you could copy a file and a number (1+) of public keys to the &#8216;encrypt&#8217; folder.</p>
<p>To use it as an authentication token:</p>
<ol>
<li>A website provides you with a random string: &#8220;12345&#8243;</li>
<li>Copy it to a text file in the &#8216;sign&#8217; folder
<ul>
<li>To avoid replay attacks the <span class="caps">URL </span>should be appended or something</li>
</ul>
</li>
<li>Press the button</li>
<li>Copy the contents of the signed result into a textarea (or upload it)</li>
</ol>
<p>Of course, this could all be done automatically by an extension or the browser itself.</p>
<p>The important feature of this is it could be implemented now. It would not require the propagation of a new generic driver. The <span class="caps">USB</span> Mass Storage driver is available all the way back to Windows 98, default since <span class="caps">XP, </span>default since <span class="caps">OS9, </span>available in Linux since 2001. It is nearly as omnipresent as the keyboard driver. It also doesn&#8217;t make any assumptions about the algorithm used. There could exist <span class="caps">PGP,</span> S/MIME, symmetric key versions.</p>
<p>This is just a general sketch. I recognize some security concerns (malicious software could piggyback on the signing process to generate signed files). A more secure one might allow only one file to be written to the drive at a time, requiring user interaction to unlock it each time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webarnes.ca/2009/02/encryption-in-your-pocket/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DNS Spoofing</title>
		<link>http://www.webarnes.ca/2008/08/dns-spoofing/</link>
		<comments>http://www.webarnes.ca/2008/08/dns-spoofing/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 00:29:36 +0000</pubDate>
		<dc:creator>William Barnes</dc:creator>
				<category><![CDATA[Computers & Internet]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.webarnes.ca/?p=33</guid>
		<description><![CDATA[I have been thinking about the big deal in security at the moment: DNS spoofing. Everybody, it seems, is all caught up in trying to figure out how to add more bits. They want to make DNS replies harder to spoof. It seems to me that they are missing the problem. The problem is the [...]]]></description>
			<content:encoded><![CDATA[<p>I have been thinking about the big deal in security at the moment: <span class="caps">DNS </span>spoofing. Everybody, it seems, is all caught up in trying to figure out how to add more bits. They want to make <span class="caps">DNS </span>replies harder to spoof.</p>
<p>It seems to me that they are missing the problem. The problem is the way <span class="caps">DNS </span>servers handle in-bailiwick additional records. If I request an <acronym title="Non-eXisting Domain">NXDOMAIN</acronym> from an <span class="caps">ISP,</span> I can be reasonable assured that a request will be made by the <span class="caps">ISP </span>to Google&#8217;s nameservers (which are probably already cached). I can then spam the <span class="caps">ISP DNS </span>server with fake replies hoping I stumble on the right combination of port and transaction <span class="caps">ID.</span> My replies will include a record for my <span class="caps">NXDOMAIN </span>and also an additional record giving new IP address for Google&#8217;s nameservers. From then on, the <span class="caps">ISP </span>will turn to my provided IP rather than Google. Eventually I can provide it with fake records for www.google.com and other useful subdomains.</p>
<p>My question: why should the <span class="caps">ISP </span>overwrite the information it has already cached? Additional records should be ignored unless they are needed for the current query (as in the case of glue).</p>
<p>I know this doesn&#8217;t prevent <span class="caps">DNS </span>spoofing, but it does significantly lower the value of the attack. You may be able to plant a record for as7230hf.google.com, but you won&#8217;t be able to overwrite their nameservers.</p>
<p>Maybe I&#8217;m missing something. Maybe there really is a critical reason to allow a nameserver to tell you that it isn&#8217;t where it is. But I don&#8217;t think so.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webarnes.ca/2008/08/dns-spoofing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

