<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>
<channel>
	<title>G-Loaded Journal &#187; Security</title>
	<atom:link href="http://www.g-loaded.eu/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.g-loaded.eu</link>
	<description>An open-source software and technology related journal</description>
	<lastBuildDate>Mon, 05 Dec 2011 19:55:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
		<item>
		<title>Speed up Apache by including htaccess files into httpd.conf</title>
		<link>http://www.g-loaded.eu/2011/11/28/speed-up-apache-by-including-htaccess-files-into-httpd-conf/</link>
		<comments>http://www.g-loaded.eu/2011/11/28/speed-up-apache-by-including-htaccess-files-into-httpd-conf/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 05:12:59 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=2522</guid>
		<description><![CDATA[It is widely known that, if virtual hosts in Apache (httpd) are configured to permit vhost administrators override specific configuration options at the directory level using htaccess files, the web server consumes valuable time in order to check whether an htaccess file exists in every directory included in the requested path and parse it. On [...]]]></description>
			<content:encoded><![CDATA[<p>It is widely known that, if virtual hosts in Apache (httpd) are configured to permit vhost administrators override specific configuration options at the directory level using htaccess files, the web server consumes valuable time in order to check whether an htaccess file exists in every directory included in the requested <em>path</em> and parse it. On the other hand, many popular web applications utilize htaccess files, especially those residing in the <em>DocumentRoot</em>, in order to implement pretty URLs or HTTP redirections, which is extremely convenient since the virtual host owner does not have to edit httpd&#8217;s configuration directly. So, I had the idea to include the htaccess file of the DocumentRoot directory on the filesystem into the virtual host&#8217;s configuration.<br />
<span id="more-2522"></span><br />
Suppose we have the <code>/home/example.org/public_html/</code> directory on the filesystem, which serves as the document root of our virtualhost. The relevant httpd configuration for that vhost would look like this:</p>
<pre class="codesnp">
&lt;VirtualHost 123.123.123.123:80&gt;
  ServerName example.org:80
  ...
  DocumentRoot /home/example.org/public_html
  &lt;Directory /home/example.org/public_html&gt;
    AllowOverride All
    ...
  &lt;/Directory&gt;
  ...
&lt;/VirtualHost&gt;
</pre>
<p>In order to prevent the htaccess lookups on the filesystem without losing the htaccess functionality &#8211; at least at the DocumentRoot level- I transformed the configuration to the following:</p>
<pre class="codesnp">
&lt;VirtualHost 123.123.123.123:80&gt;
  ServerName example.org:80
  ...
  DocumentRoot /home/example.org/public_html
  &lt;Directory /home/example.org/public_html&gt;
    AllowOverride None
    Include /home/example.org/public_html/.htaccess
    ...
  &lt;/Directory&gt;
  ...
&lt;/VirtualHost&gt;
</pre>
<p>Let&#8217;s see what we have accomplished with this:</p>
<ol>
<li>httpd does not waste any time looking for and parsing htaccess files resulting in faster request processing,</li>
<li>the virtual host administrator can still override the configuration options of the document root manually or through the web interface of the web application.</li>
</ol>
<p>Seems like a win-win situation performance and functionality wise.</p>
<p>But, as usual, there is no win-win situation without a downside. In this case, the above trick weakens the server&#8217;s security. Let&#8217;s see how.</p>
<p>Although the configuration of a directory can be set in both <code>httpd.conf</code> and the directory&#8217;s htaccess file, not all directives can be used in both contexts. htaccess files support a subset of the directives that can be used in the <code>Directory</code> context within <code>httpd.conf</code>. By including the htaccess file in httpd&#8217;s configuration the vhost admin is no longer restricted to that subset of directives.</p>
<p>This means that by implementing the above configuration the virtual host administrator is granted more privileges regarding the configuration of the virtual host. This also means that a potential attacker, that would exploit a vulnerability of the web application, would be granted the same privileges once he got write access to that htaccess file.</p>
<p>So, although this trick may seem like a good idea at first, it is in fact a rather <strong>bad idea</strong> and <em>should never be used in production, unless you trust the virtual host administrator and the web application</em>. I do not intend to use such a configuration and I do not recommend it. There are by far better ways to speed up Apache.</p>
<p>Your comments and suggestions are welcome.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2011/11/28/speed-up-apache-by-including-htaccess-files-into-httpd-conf/">Speed up Apache by including htaccess files into httpd.conf</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2007/02/21/htaccess-cheat-sheet/" rel="bookmark">.htaccess Cheat Sheet</a></li>
<li><a href="http://www.g-loaded.eu/2007/08/10/ssl-enabled-name-based-apache-virtual-hosts-with-mod_gnutls/" rel="bookmark">SSL-enabled Name-based Apache Virtual Hosts with mod_gnutls</a></li>
<li><a href="http://www.g-loaded.eu/2008/05/10/use-mod_deflate-to-compress-web-content-delivered-by-apache/" rel="bookmark">Use mod_deflate to Compress Web Content delivered by Apache</a></li>
<li><a href="http://www.g-loaded.eu/2010/03/28/script-apache-error-report/" rel="bookmark">Script for Apache Error Report</a></li>
<li><a href="http://www.g-loaded.eu/2008/12/18/using-the-mod_dav_svn-svnparentpath-directive-with-multiple-authz-files/" rel="bookmark">Using the mod_dav_svn SVNParentPath directive with multiple authz files</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2011/11/28/speed-up-apache-by-including-htaccess-files-into-httpd-conf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>How to configure mod_gnutls to use the RC4 cipher to mitigate the SSL/TLS vulnerability</title>
		<link>http://www.g-loaded.eu/2011/09/27/mod_gnutls-rc4-cipher-beast/</link>
		<comments>http://www.g-loaded.eu/2011/09/27/mod_gnutls-rc4-cipher-beast/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 20:40:45 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[attack]]></category>
		<category><![CDATA[ciphers]]></category>
		<category><![CDATA[mod_gnutls]]></category>
		<category><![CDATA[mod_ssl]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[vulnerability]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=2471</guid>
		<description><![CDATA[It&#8217;s been a while since the details of an SSL/TLS vulnerability have been released to the public. Since then, security experts have worked on the issue and have released a whitepaper describing how to mitigate the attack, known as BEAST (Browser Exploit Against SSL/TLS). From the security researchers&#8217; article: The problem lies in the way [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since the details of an <em>SSL/TLS vulnerability</em> have been released to the public. Since then, security experts have worked on the issue and have <a href="http://www.phonefactor.com/blog/slaying-beast-mitigating-the-latest-ssltls-vulnerability.php">released</a> a <a href="http://www.phonefactor.com/resources/CipherSuiteMitigationForBeast.pdf" title="Whitepaper on the mitigation of the BEAST attack">whitepaper</a> describing how to mitigate the attack, known as BEAST (Browser Exploit Against SSL/TLS).<br />
<span id="more-2471"></span><br />
From the security researchers&#8217; article:</p>
<blockquote><p>The problem lies in the way that block ciphers are used in SSL/TLS. Block ciphers are generally operated in one of several modes that define how encrypted blocks are manipulated to ensure complete confidentiality. Cipher Block Chaining, or CBC mode, is used in SSL for all block ciphers, including AES and Triple-DES. The BEAST attack relies on a weakness in the way CBC mode is used in SSL and TLS. Non-CBC cipher suites, such as those using the RC4 stream encryption algorithm, are not vulnerable.</p>
<p>There have been several suggested mitigations that can be put into play from the perspective of the client, such as reorganizing the way the data is sent in the encrypted stream. Servers can protect themselves by requiring a non-CBC cipher suite. One such cipher suite is rc4-sha, which is widely supported by clients and servers.</p></blockquote>
<p>Researchers have concluded that the <a href="http://en.wikipedia.org/wiki/RC4" title="Information about the Alleged RC4 cipher">RC4</a> (Alleged RC4) based cipher suites are not vulnerable to the BEAST attack, while <a href="http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher-block_chaining_.28CBC.29" title="Information about the Cipher-block chaining (CBC)">CBC</a> (Cipher Block Chaining mode) based cipher suites are. This involves both the <strong>TLS 1.0</strong> and the <strong>SSL 3.0</strong> protocols. On the contrary, TLS 1.1 and 1.2 have not been found to be vulnerable, but their use is very limited since they haven&#8217;t been adopted by the majority of HTTP clients and servers yet.</p>
<p>So, the use of <strong>RC4</strong> based ciphers is all that is left for the moment. The security experts have released a list of cipher suites that is suitable for use in the configuration of the <a href="http://httpd.apache.org/docs/2.2/mod/mod_ssl.html" title="mod_ssl documentation page">mod_ssl</a> module for <a href="http://httpd.apache.org/" title="Apache's httpd homepage">httpd</a>:</p>
<pre class="console">
SSLHonorCipherOrder on
SSLCipherSuite !aNULL:!eNULL:!EXPORT:!DSS:!DES:RC4-SHA:RC4-MD5:ALL
</pre>
<p>They have also released a one-liner list of ciphers suitable for use in the relevant fields of the <em>Local Group Policy Editor</em> in Windows Server boxes.</p>
<p>However, there is no info about configuring the <a href="http://www.outoforder.cc/projects/apache/mod_gnutls/" title="mod_gnutls homepage">mod_gnutls</a> module for <em>apache</em> to use <strong>RC4</strong> based ciphers, so, as a dedicated user of <em>mod_gnutls</em>, I decided to release this <em>tip</em>. All you have to do is set the preferred ciphers in the <strong>GnuTLSPriorities</strong> directive. In this example we use the TLS 1.0 protocol:</p>
<pre class="console">
GnuTLSPriorities NONE:+VERS-TLS1.0:+ARCFOUR-128:+RSA:+SHA1:+COMP-NULL
</pre>
<p>Visiting a secure web site that has been configured using any of the methods described above and by checking the information of the secure connection to that website, you should see the following message:</p>
<div id="attachment_2478" class="wp-caption aligncenter" style="width: 576px"><img src="http://www.g-loaded.eu/wp-content/uploads/firefox_ssl_tls_rc4_message.png" alt="Firefox message about using RC4 encryption cipher" title="firefox_ssl_tls_rc4_message" width="566" height="109" class="size-full wp-image-2478" /><p class="wp-caption-text">Firefox message about using RC4 encryption cipher</p></div>
<p>This means that everything is working correctly.</p>
<p>As always, comments and suggestions are welcome and appreciated.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2011/09/27/mod_gnutls-rc4-cipher-beast/">How to configure mod_gnutls to use the RC4 cipher to mitigate the SSL/TLS vulnerability</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2009/02/20/critical-vulnerability-in-adobe-reader/" rel="bookmark">Critical vulnerability in Adobe Reader</a></li>
<li><a href="http://www.g-loaded.eu/2007/08/10/ssl-enabled-name-based-apache-virtual-hosts-with-mod_gnutls/" rel="bookmark">SSL-enabled Name-based Apache Virtual Hosts with mod_gnutls</a></li>
<li><a href="http://www.g-loaded.eu/2007/11/14/mod_gnutls-binary-for-apache/" rel="bookmark">mod_gnutls binary for Apache</a></li>
<li><a href="http://www.g-loaded.eu/2008/05/16/using-ssh-for-networking/" rel="bookmark">Using SSH for networking</a></li>
<li><a href="http://www.g-loaded.eu/2006/01/10/how-to-configure-and-use-lirc/" rel="bookmark">How to configure and use LIRC</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2011/09/27/mod_gnutls-rc4-cipher-beast/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>How secure is the TOR network for everyday internet browsing?</title>
		<link>http://www.g-loaded.eu/2011/04/02/how-secure-is-the-tor-network-for-everyday-internet-browsing/</link>
		<comments>http://www.g-loaded.eu/2011/04/02/how-secure-is-the-tor-network-for-everyday-internet-browsing/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 06:47:02 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Proxy]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[TOR]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=2203</guid>
		<description><![CDATA[I recently read that the Free Software Foundation has given the Award for Projects of Social Benefit to the TOR Project. Congratulations! There are indeed some cases that the TOR network can be extremely useful to the societies. On the other hand, the fact that an organization like the FSF gives this award to the [...]]]></description>
			<content:encoded><![CDATA[<p>I recently read that the Free Software Foundation has given the <em>Award for Projects of Social Benefit</em> to the <a href="https://www.torproject.org/">TOR Project</a>. Congratulations! There are indeed some cases that the TOR network can be extremely useful to the societies. On the other hand, the fact that an organization like the <abbr title="Free Software Foundation">FSF</abbr> gives this award to the TOR project combined with statements like &#8220;<em>People like you and your family use Tor to protect themselves, their children, and their dignity while using the Internet</em>&#8220;, that can be found throughout the TOR project website, may lead the typical internet user into thinking that the TOR network, apart from providing anonymity, is also a secure way of communication, which is far from the truth. I don&#8217;t claim to be a network security expert or an authority on the TOR network, but I don&#8217;t think any expertise is required in order to state the obvious.<br />
<span id="more-2203"></span><br />
At this point, it is useful to roughly describe how TOR works. The TOR network consists of TOR clients, relays and exit nodes. A client connects to the network which initiates the creation of a tunnel that starts at the user&#8217;s location and ends, after following a random route through the relays, to a random exit node. The user configures other software like web browsers or instant messengers to connect to the remote service through this tunnel. Once the request exits the tunnel at the exit-node, it goes through the network of the ISP that provides internet access to the TOR exit-node and it finally reaches the remote service. The response from the remote service follows the inverse route to get back to the user&#8217;s software. This way, the user&#8217;s ISP has absolutely no idea what services the user communicates with, since all user traffic goes through the TOR network and the network of a 3rd party ISP.</p>
<p>So, TOR can provide anonymity as far as the user&#8217;s ISP is concerned, but is it a secure way to communicate with remote services? <strong>If no extra encryption is used</strong>, then it is quite obvious that using remote services through the TOR network is <strong>totally insecure</strong>. Here is why.</p>
<p>The <strong>TOR exit-node</strong> is a key point in the communication between the user and the remote service. This is where the user&#8217;s data exits the TOR tunnel and continues its way to the remote service through the 3rd party ISP&#8217;s network. It is also the place where data from the remote service leaves the 3rd party ISP&#8217;s network and enters the TOR tunnel in order to reach the end user. If no encryption is used, it is possible for the exit-node operator to <strong>sniff this network traffic</strong>. This means that it is technically possible for an evil exit-node operator to:</p>
<ul>
<li>know which web pages the user visits</li>
<li>read the messages the user exchanges through unencrypted IM networks</li>
<li>read the emails the user sends</li>
<li>if the user authenticates to any services without encryption, the evil exit-node operator could for example find out his mailbox or FTP account password or the passwords the user uses for authentication to web sites</li>
<li>even if the authentication to a web service has taken place through an encrypted SSL tunnel, if the rest of the communication with this specific web service is not encrypted, the evil operator could grab a copy of the user&#8217;s  session cookie for this service and access it pretending to be him</li>
</ul>
<p>These are some of the nasty things that can happen <strong>when you access remote services through a proxy server which you do not control</strong>.</p>
<p>Is there any guarantee that exit node operators do not sniff network traffic?</p>
<p>Even if the exit-node operators are cool, who can guarantee that the network traffic is not monitored within the <strong>3rd party ISP</strong>&#8216;s network? If the user accesses personalized services without encryption, then, even if the user&#8217;s real IP and thus his real name is not known, various pieces of collected data can be combined together and possibly reveal his real identity. This process is widely known as <em><a href="http://epic.org/privacy/reidentification/">re-identification</a></em>.</p>
<p>Is there any guarantee that the ISP providing internet access to a TOR exit node does not collect and sell information to &#8220;marketers and identity thieves&#8221;?</p>
<p><strong>I consider the TOR project quite important</strong>. But, since typical internet users are urged to use the TOR network in order to browse the internet, <strong>the involved risks have to be explained in detail</strong>.</p>
<p>On the other hand, I&#8217;d like to urge internet users to spend some time to familiarize themselves with the <strong>basics</strong> of the HTTP protocol, the <strong>concepts</strong> of HTTP authentication and cookie based authentication and the importance of encrypted HTTP connections through <strong>SSL</strong> or <strong>TLS</strong> tunnels. Since the internet has become part of your lives, regardless of your profession, you need to be educated about these things, so as to be able to realize when your communication with the various internet services is vulnerable. You don&#8217;t have to be gurus, but rather get an idea of what is going on.</p>
<p>So far, it is quite clear that the only way to stay on the safe side while using anonymizing proxies on which you usually do not have full control, like TOR, is to connect to any remote services <strong>using encrypted connections only</strong>, usually through SSL or TLS tunnels. Personally, I never use anonymizing networks or third party proxies. This is because I never really had the need to hide my real location. Furthermore, I find it pointless as I don&#8217;t believe that such a thing as anonymity is really feasible. If I had to use TOR, I would try to find a way to connect to the remote service over an encrypted connection. In general, whenever I need a secure SOCKS proxy, for example when I have to use a public network to access personalized internet services, which do not offer full SSL access, I use OpenSSH client&#8217;s <strong>-D switch</strong> while logging in to a SSH server which I own and fully control and thus I have all the security I need.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2011/04/02/how-secure-is-the-tor-network-for-everyday-internet-browsing/">How secure is the TOR network for everyday internet browsing?</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2006/11/24/auto-closing-ssh-tunnels/" rel="bookmark">Auto-closing SSH tunnels</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/configure-vnc-server-in-fedora/" rel="bookmark">Set up the VNC Server in Fedora</a></li>
<li><a href="http://www.g-loaded.eu/2005/10/20/ssh-tunnels-headaches/" rel="bookmark">SSH Tunnels Headaches</a></li>
<li><a href="http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/" rel="bookmark">Netcat &#8211; a couple of useful examples</a></li>
<li><a href="http://www.g-loaded.eu/2008/05/16/using-ssh-for-networking/" rel="bookmark">Using SSH for networking</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2011/04/02/how-secure-is-the-tor-network-for-everyday-internet-browsing/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>How to change the expiration date of a GPG key</title>
		<link>http://www.g-loaded.eu/2010/11/01/change-expiration-date-gpg-key/</link>
		<comments>http://www.g-loaded.eu/2010/11/01/change-expiration-date-gpg-key/#comments</comments>
		<pubDate>Mon, 01 Nov 2010 16:54:24 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[GPG]]></category>
		<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[PKI]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=2035</guid>
		<description><![CDATA[This post is a step-by-step tutorial on how to extend the expiration date of your GPG keys or reset it in case the keys have already expired. But, before we go through how to change the date, I&#8217;d like to write a few things about why setting an expiration date on your GPG keys is [...]]]></description>
			<content:encoded><![CDATA[<p>This post is a step-by-step tutorial on how to extend the expiration date of your <a href="http://www.gnupg.org/">GPG</a> keys or reset it in case the keys have already expired. But, before we go through how to change the date, I&#8217;d like to write a few things about why setting an expiration date on your GPG keys is important.<br />
<span id="more-2035"></span></p>
<h4>The importance of the GPG/PGP key expiration date</h4>
<p>Most people set their GPG keys to never expire. There is no problem with that. Unless they lose the private key or it gets stolen or they just forget its passphrase. In such a case, the public key, which has probably been published to several key servers around the world and retrieved by an arbitrary number of other people, is practically useless and, apart from removing it from some of the keyservers, they can do absolutely nothing else about it, unless, of course, they had previously generated a <em>revocation certificate</em> for the public key and they still have access to this certificate. In those not so rare cases that the revocation certificate is not available, the only way to let those who have already grabbed a copy of the public key know that they should not use that key any more is by notifying them directly, which is not always possible since the actual number of the holders of that specific public key is not known.</p>
<p>Setting an <strong>expiration date</strong> on your keys is a very good <strong>security measure</strong>. It lets the holders of the public key know the key&#8217;s end-of-life date. On the other hand, you can always extend the key&#8217;s expiration date and send the updated key to the key servers. When others find out that your public key has expired, the very first thing they do will be to refresh it from a key server, in which case they&#8217;ll retrieve your updated public key. Even if you lose the private key or forget the passphrase or even lose the revocation certificate too, a time will come that the public key will expire, which indicates that it is invalid and should not be trusted any more. This is important.</p>
<h4>Change the expiration date of a GPG key</h4>
<p>In this section I describe how to extend or reset a key&#8217;s expiration date using <strong>gpg</strong> from the command line. There are probably several graphical front-ends out there that might simplify this procedure, but, since graphical frontends are not usually cross-platform, I choose to use the command-line gpg utility. So, here is how we do it.</p>
<p>First of all, you have to know the ID of the key you need to edit:</p>
<pre class="console">
$ gpg --list-keys
pub   1024D/B989893B 2007-03-07 [expired: 2009-12-31]
uid                  George Notaras &lt;gnotaras@example.org&gt;
sub   4096g/320D81EE 2007-03-07 [expired: 2009-12-31]
</pre>
<p>The ID in question is B989893B, so we edit the key with that ID:</p>
<pre class="console">
$ gpg --edit-key B989893B
</pre>
<p>You should have entered the <strong>gpg shell</strong> by now. To see a list of the available commands you can always invoke the <strong>help</strong> command.</p>
<p>First of all, list the keys so you know what you are editing:</p>
<pre class="console">
gpg> list
pub  1024D/B989893B  created: 2007-03-07  expired: 2009-12-31  usage: SCA
                     trust: ultimate       validity: ultimate
sub  4096g/320D81EE  created: 2007-03-07  expired: 2009-12-31  usage: E
[ ultimate] (1). George Notaras &lt;gnotaras@example.org&gt;
</pre>
<p>By default, no subkey (sub) is selected, which means that we work on the primary key (pub). It is possible to select the subkey you will be working on by invoking the <strong>key</strong> command followed by the number (index) of the subkey you wish to select. If no arguments or index &#8217;0&#8242; is passed to the <strong>key</strong> command, any subkey is deselected and you will be working on the primary key.</p>
<pre class="console">
gpg> key 0
pub  1024D/B989893B  created: 2007-03-07  expired: 2009-12-31  usage: SCA
                     trust: ultimate       validity: ultimate
sub  4096g/320D81EE  created: 2007-03-07  expired: 2009-12-31  usage: E
[ ultimate] (1). George Notaras &lt;gnotaras@example.org&gt;
</pre>
<p>Now use the <strong>expire</strong> command to set an expiration time for the primary key.</p>
<pre class="console">
gpg> expire
Changing expiration time for the primary key.
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 2y
Key expires at 10/28/12 03:51:07
Is this correct? (y/N) y
You need a passphrase to unlock the secret key for
user: "George Notaras &lt;gnotaras@example.org&gt;"
1024-bit DSA key, ID XXXXXXXX, created 2007-03-07
pub  1024D/B989893B  created: 2007-03-07  expires: 2012-10-28  usage: SCA
                     trust: ultimate       validity: ultimate
sub  4096g/320D81EE  created: 2007-03-07  expired: 2009-12-31  usage: E
[ ultimate] (1). George Notaras &lt;gnotaras@example.org&gt;
</pre>
<p>The output above indicates that the expiration date of the <strong>primary public key</strong> has been set to 2012-10-28. Note that, the expiration date has also been changed on your <strong>primary private key</strong> of the keypair. You can issue the <strong>toggle</strong> command to verify the private key&#8217;s expiration date. Don&#8217;t worry about that. It is the private <strong>subkeys</strong>, which never expire, that are actually used when you decrypt and sign data. Read more on this in a special note at the end of this section. For now, just issue the <strong>toggle</strong> command once again to return to <em>public key editing mode</em>.</p>
<p>In this example case, there is one public subkey on which we need to set a new expiration date. That&#8217;s <em>key number 1</em>. We select that with the <strong>key</strong> command:</p>
<pre class="console">
gpg> key 1
pub  1024D/B989893B  created: 2007-03-07  expires: 2012-10-28  usage: SCA
                     trust: ultimate       validity: ultimate
sub*  4096g/320D81EE  created: 2007-03-07  expired: 2009-12-31  usage: E
[ ultimate] (1). George Notaras &lt;gnotaras@example.org&gt;
</pre>
<p>Set a new expiration time on that subkey by invoking the <strong>expire</strong> command:</p>
<pre class="console">
gpg> expire
Changing expiration time for a subkey.
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 2y
Key expires at 10/28/12 03:02:43
Is this correct? (y/N) y
You need a passphrase to unlock the secret key for
user: "George Notaras &lt;gnotaras@example.org&gt;"
1024-bit DSA key, ID XXXXXXXX, created 2007-03-07
pub  1024D/B989893B  created: 2007-03-07  expires: 2012-10-28  usage: SCA
                     trust: ultimate       validity: ultimate
sub* 4096g/320D81EE  created: 2007-03-07  expires: 2012-10-28  usage: E
[ ultimate] (1). George Notaras &lt;gnotaras@example.org&gt;
</pre>
<p>Now it seems that everything is set up fine. You have changed the expiration dates of your keys. You can always use the <strong>list</strong> command to list the keys. Use the <strong>toggle</strong> command to toggle between <em>public</em> and <em>private</em> key <em>editing mode</em>.</p>
<p>As a final step you need to <em>save</em> your changes. Invoke the <strong>save</strong> command.</p>
<pre class="console">
gpg> save
</pre>
<p>So, now you can update the public key that is stored on the various keyservers. To achieve this use the following command. In this example, the keyserver at <code>pgp.mit.edu</code> is used.</p>
<pre class="console">
$ gpg --keyserver pgp.mit.edu --send-keys B989893B
gpg: sending key B989893B to hkp server pgp.mit.edu
</pre>
<p>Enjoy.</p>
<h5>Important Note</h5>
<p>If you tried to use the <strong>expire</strong> command in <em>private key editing mode</em>, you would notice that it is not possible to change the expiration date of any subkeys in this mode. Actually, the private subkeys <strong>never expire</strong>. Although, I haven&#8217;t investigated this, common sense indicates that, since private subkeys are used to <em>sign</em> and <em>decrypt</em> data and that they are not meant to be distributed, it wouldn&#8217;t make any sense if they expired.</p>
<p>Theoritically speaking, the owner of an expired private key should still have the ability to <strong>decrypt</strong> data and also be able to <strong>sign</strong> data, even if all public subkeys of the current keypair have expired, since it is always possible to reset the expiration date on the currently expired public keys.</p>
<p>As I mentioned earlier, I haven&#8217;t investigated this, but I think that non-expiring private keys make a lot of sense.</p>
<h4>Final Thoughts</h4>
<p>This article described in detail how to <strong>change the expiration date</strong> of GPG/PGP keys. This should be a standard key maintenance procedure if you set an expiration date on your keys.</p>
<p>Setting an expiration date on your keys is not mandatory as long as you have taken other measures to protect the private key and the public key&#8217;s revocation certificate by backing it up and storing it at another location. But, in general, it is a good habit as explained in this article&#8217;s introduction. I by no means am a GPG/PGP expert. I wrote this guide because I realized that most people do not set an expiration date on their keys because they do not know how to change it and extend the key&#8217;s life or because they have not realized the importance of the expiration date or simply because they do not care. I hope you find this tutorial useful and start setting an expiration date on your keys from now on.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2010/11/01/change-expiration-date-gpg-key/">How to change the expiration date of a GPG key</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2005/11/10/be-your-own-ca/" rel="bookmark">Be your own Certificate Authority (CA)</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/ssh-with-keys/" rel="bookmark">Setup the SSH server to use keys for authentication</a></li>
<li><a href="http://www.g-loaded.eu/2010/04/12/a-change-of-plans-regarding-a-web-based-vcs-manager/" rel="bookmark">A change of plans regarding a web-based VCS manager</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2010/11/01/change-expiration-date-gpg-key/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Using setenforce to switch SELinux mode wisely</title>
		<link>http://www.g-loaded.eu/2009/10/30/selinux-setenforce-mode/</link>
		<comments>http://www.g-loaded.eu/2009/10/30/selinux-setenforce-mode/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 15:05:14 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SELinux]]></category>
		<category><![CDATA[System]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=1401</guid>
		<description><![CDATA[setenforce is a command line utility that is used to switch the mode SELinux is running in from enforcing to permissive and vice versa without requiring a reboot. Lately, I&#8217;ve started experimenting again with SELinux on a live system. The default targeted SELinux policy, as usual, needs some adjustment to work with a custom server [...]]]></description>
			<content:encoded><![CDATA[<p><strong>setenforce</strong> is a command line utility that is used to switch the mode <a href="http://en.wikipedia.org/wiki/Security-Enhanced_Linux">SELinux</a> is running in from <em>enforcing</em> to <em>permissive</em> and vice versa without requiring a reboot. Lately, I&#8217;ve started experimenting again with <strong>SELinux</strong> on a live system. The default targeted SELinux policy, as usual, needs some adjustment to work with a custom server configuration. So, I created some custom policy modules and loaded them onto the live system in order to test if my &#8220;<em>allow</em>&#8221; rules were effective.<br />
<span id="more-1401"></span><br />
In such cases, the system administrator must be wise enough to minimize risk. SELinux is not a forgiving feature. If the custom policy blocks the execution of a software and SELinux is running in enforcing mode, then the software does not run. That&#8217;s what SELinux is about after all.</p>
<p>The <strong>permissive mode</strong> exists mainly for testing. In this mode, the auditing mechanism generates notices (<em>AVC Denials</em>) about the action/event that was blocked, but without actually blocking that action/event. It is just a way to check what would have happened if SELinux had been running in <em>enforcing</em> mode. There are two ways to switch SELinux to permissive mode. One is to configure it through its configuration file (<code>/etc/selinux/config</code> on <abbr title="Enterprise Linux">EL</abbr>) to start in permissive mode on boot and the other is to use the aforementioned utility, <em>setenforce</em>, to switch modes while the system is live.</p>
<p>When performing tests on a live system, I usually take all precautions to minimize the risk of failure and usually, if possible, I am around to monitor the progress of the test. But, this time I had to use the custom SELinux policy for some days to see if it is actually effective or it needs further fine-tuning.</p>
<p><strong>The Mistake</strong>: I used setenforce to set SELinux into permissive mode (<code>/usr/sbin/setenforce 0</code>). setenforce is for <strong>temporary changes</strong> and it is definitely not suitable for testing the policy for a long period of time. This is because if for any reason the system reboots, SELinux will be set back into the mode that is defined into its configuration file. The mode set by <code>setenforce</code> does not survive a reboot. So, if the custom policy happens to be incomplete, it will block the server&#8217;s normal operation after the reboot. And such reboots can happen&#8230;</p>
<p>This is exactly what I experienced yesterday. The datacenter on which my virtual server is hosted had problems with its main power supply. This caused one hour of downtime. But G-Loaded&#8217;s outage was a lot greater, because my custom SELinux policy was incomplete. SELinux was started in enforcing mode, so my faulty policy blocked my www service.</p>
<p>This should be a lesson to anyone who performs tests on live systems. The Right Thing&trade; was simple: boot the server into permissive mode and do as many tests as desired. I can blame the datacenter for the one-hour downtime, but for the 7-hour unavailability of <a href="http://www.g-loaded.eu">G-Loaded</a> I am the only one to blame.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/10/30/selinux-setenforce-mode/">Using setenforce to switch SELinux mode wisely</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2006/12/20/selinux-audit-reports-script/" rel="bookmark">SELinux audit reports script</a></li>
<li><a href="http://www.g-loaded.eu/2008/11/26/using-a-switch-to-prevent-system-shutdownrebootsuspend/" rel="bookmark">Using a switch to prevent system shutdown/reboot/suspend</a></li>
<li><a href="http://www.g-loaded.eu/2007/02/09/server-upgraded-to-fedora-6/" rel="bookmark">Server upgraded to Fedora 6</a></li>
<li><a href="http://www.g-loaded.eu/2008/06/18/use-the-alternatives-system-to-switch-to-a-custom-firefox-release/" rel="bookmark">Use the Alternatives System to switch to a custom Firefox release</a></li>
<li><a href="http://www.g-loaded.eu/2006/09/25/how-to-integrate-seaudit-report-in-logwatch/" rel="bookmark">How to integrate seaudit-report in logwatch</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/10/30/selinux-setenforce-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Be cautious with Notepad++</title>
		<link>http://www.g-loaded.eu/2009/10/17/be-cautious-with-notepad/</link>
		<comments>http://www.g-loaded.eu/2009/10/17/be-cautious-with-notepad/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 23:15:07 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Editors]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=1319</guid>
		<description><![CDATA[I use Microsoft Windows 7 RC on my main desktop computer since June 2009. Since there was no Windows ports of my favorite editors in Linux (gedit on Fedora/CentOS), I decided to use Notepad++, an open-source source code editor and Notepad replacement, which is released as free-software. Soon I realized that this application was too [...]]]></description>
			<content:encoded><![CDATA[<p>I use <strong>Microsoft Windows 7 RC</strong> on my main desktop computer since June 2009. Since there was no Windows ports of my favorite editors in Linux (<a href="http://projects.gnome.org/gedit/">gedit</a> on <strong>Fedora</strong>/<strong>CentOS</strong>), I decided to use <a href="http://notepad-plus.sourceforge.net">Notepad++</a>, an open-source source code editor and Notepad replacement, which is released as free-software. Soon I realized that this application was too far from being robust as I experienced random freezes quite often. I continued to use the application hoping that any issues would be resolved in the near future.<br />
<span id="more-1319"></span><br />
I recall that there was a time, when I <strong>lost</strong> all of my <strong>open</strong> and <strong>unsaved</strong> documents due to an application freeze. After checking their bug trackers and help forums on <strong>SourceForge</strong> for a solution to the problem, I found out that the cause of the issues was one of the <strong>plugins</strong>, but noone was really sure which one of them. The suggested solution was to try to reproduce the issue, by enabling the plugins in turns. At that time, I did not have the necessary free time to experiment with the editor, so I had disabled the whole plugin system, just to be sure that my data would be safe. And my data has indeed been safe since that day.</p>
<p>Two days ago, I decided to upgrade the program to the latest version and, during installation and without giving it much thought, I installed the application&#8217;s plugin system and a plugin called &#8220;<em>Document Monitor</em>&#8221; or something like that. This morning my system experienced another <em>Notepad++</em> freeze, but this time a <em>Virtual Machine</em>, which run under <a href="http://virtualbox.org">VirtualBox</a>, froze too. There was heavy disk I/O at that time. The virtual system was meant to be an RPM Build Server, so I re-deployed it just to be sure that everything was all right without risking any data loss during the freeze.</p>
<p>After that, I disabled Notepad++&#8217;s plugin system entirely and do not intend to use any of the plugins ever again. I continue to use the core editor, but I am also looking for alternatives. So far, <a href="http://www.pspad.com/">PSpad</a> (freeware) and <a href="http://www.carthagosoft.net/twistpad/">TwistPad</a> (commercial editor at a very reasonable price) are among the candidates. I mainly use a text editor for plain text and HTML documents, Python, PHP and BASH scripts. Any other suggestions are welcome and appreciated.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/10/17/be-cautious-with-notepad/">Be cautious with Notepad++</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2011/09/09/mozilla-thunderbird-speed-up/" rel="bookmark">Mozilla Thunderbird speed up</a></li>
<li><a href="http://www.g-loaded.eu/2007/10/18/dictionary-lookups-anywhere/" rel="bookmark">Dictionary Lookups Anywhere</a></li>
<li><a href="http://www.g-loaded.eu/2007/10/19/zim-a-desktop-wiki/" rel="bookmark">Zim &#8211; a Desktop Wiki</a></li>
<li><a href="http://www.g-loaded.eu/2011/04/02/the-read-it-later-extension/" rel="bookmark">The Read-It-Later extension</a></li>
<li><a href="http://www.g-loaded.eu/2006/01/05/break-out-of-frames-wordpress-plugin/" rel="bookmark">Break-Out-Of-Frames WordPress Plugin</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/10/17/be-cautious-with-notepad/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Free Personal Email Certificates Program discontinued by Thawte</title>
		<link>http://www.g-loaded.eu/2009/10/12/free-personal-email-certificates-program-discontinued-by-thawte/</link>
		<comments>http://www.g-loaded.eu/2009/10/12/free-personal-email-certificates-program-discontinued-by-thawte/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 16:07:34 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Services]]></category>
		<category><![CDATA[Certificates]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=1298</guid>
		<description><![CDATA[I&#8217;ve been using Thawte&#8216;s free personal email digital certificates for some years now. Unfortunately, Thawte discontinues the Personal E-mail Certificate and Web of Trust services. All issued certificates will be revoked on November 16th 2009 and the particular services will no longer be available after that date. Read more information about this matter here. All [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <strong>Thawte</strong>&#8216;s free personal email digital certificates for some years now. Unfortunately, Thawte discontinues the <strong>Personal E-mail Certificate</strong> and <strong>Web of Trust</strong> services. All issued certificates will be <strong>revoked</strong> on November 16th 2009 and the particular services will no longer be available after that date.<br />
<span id="more-1298"></span><br />
Read more information about this matter <a href="https://siteseal.thawte.com/support/index.html?page=content&#038;id=SO12658" rel="nofollow">here</a>.</p>
<p> All current certificate owners will be offered a <em>free one-year digital certificate</em> for email encryption/signing by <strong>Verisign</strong>. Renewals of those certificates will cost $19.95 per email address (at the time of writing), while using Thwate&#8217;s program you could just pay an initial fee in order to verify your identity and then get your name to appear on all your digital certificates that had been issued by that service for your email addresses.</p>
<p>Although I believe that taking back what you have given is usually either a sign of greed and irresponsibility or proof of bad planning, I do understand Thawte&#8217;s given reasons for such a decision:</p>
<blockquote><p>[...] for the ever-expanding standards and technology requirements will outpace our ability to maintain these services at the high level of quality we require [...]</p></blockquote>
<p>When it comes to <em>secure authentication</em> or <em>digital identification</em>, <strong>quality is not negotiable</strong>. On the other hand, what is questionable is the high price of the certificate renewals, which do not involve any kind of paperwork and could also require no human intervention at all, provided that the initial verification of the certificate owner&#8217;s identity and the renewal procedure itself are being done correctly.</p>
<p>I am quite certain that there are other Certificate Authorities that offer free email certificates or email certificate programs at reasonable prices, but I didn&#8217;t have the time to check. Perhaps, a reader who has done some research on this could contribute some info.</p>
<p>I&#8217;ll be posting about this topic again soon. Stay tuned!</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/10/12/free-personal-email-certificates-program-discontinued-by-thawte/">Free Personal Email Certificates Program discontinued by Thawte</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2007/11/22/root-certificate-programs-the-root-of-all-trust/" rel="bookmark">Root Certificate Programs &#8211; The root of all trust</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/be-your-own-ca/" rel="bookmark">Be your own Certificate Authority (CA)</a></li>
<li><a href="http://www.g-loaded.eu/2007/06/23/high-traffic-on-the-email-server/" rel="bookmark">High traffic on the email server</a></li>
<li><a href="http://www.g-loaded.eu/2007/12/07/email-notifications-from-a-linux-system/" rel="bookmark">Email Notifications from a Linux System</a></li>
<li><a href="http://www.g-loaded.eu/2009/09/21/project-codetrax-discontinued/" rel="bookmark">Project CodeTRAX discontinued</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/10/12/free-personal-email-certificates-program-discontinued-by-thawte/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Reclaiming the forums from bots</title>
		<link>http://www.g-loaded.eu/2009/10/06/reclaiming-the-forums-from-bots/</link>
		<comments>http://www.g-loaded.eu/2009/10/06/reclaiming-the-forums-from-bots/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 11:37:50 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Snippet]]></category>
		<category><![CDATA[SQL]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=1251</guid>
		<description><![CDATA[It&#8217;s been a long time since the last time I had done any cleaning in the G-Loaded Forums. I use the forums for further discussion about the published content, since the comments are disabled after a period of time. During the last months the place had been left at the hands of bots. But this [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a long time since the last time I had done any cleaning in the G-Loaded Forums. I use the forums for further discussion about the published content, since the comments are disabled after a period of time. During the last months the place had been left at the hands of bots. But this is no more. Below you will find information about all the actions I took in order to cleanup the user accounts created by bots and prevent further automatic user registrations.<br />
<span id="more-1251"></span><br />
The software I use is <a href="http://bbpress.org">bbPress</a>. In order to protect the forums from automatic user registrations, I installed the <a href="http://www.gospelrhys.co.uk/plugins/bbpress-plugins/recaptcha-bbpress-plugin">recaptcha plugin</a>. This requires registration at <a href="http://recaptcha.net/">recaptcha.net</a> and the creation of a private/puplic key pair, but the procedure is straightforward, so I won&#8217;t go into the details.</p>
<p>Second, but equally important, is the deletion of user accounts created automatically by bots. The characteristic of those accounts is that they have never posted any posts. All the advertising information existed in the user profile fields. After inspecting the database structure for a while, I deleted all the users with zero number of posts from the <em>bb_users</em> table using the following MySQL query:</p>
<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DELETE</span> <span style="color: #993333; font-weight: bold;">FROM</span> bb_users <span style="color: #993333; font-weight: bold;">WHERE</span> id <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #993333; font-weight: bold;">SELECT</span> id <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#40;</span>
    <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">DISTINCT</span><span style="color: #66cc66;">&#40;</span>u<span style="color: #66cc66;">.</span>id<span style="color: #66cc66;">&#41;</span>
    <span style="color: #993333; font-weight: bold;">FROM</span> bb_users <span style="color: #993333; font-weight: bold;">AS</span> u <span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> bb_posts <span style="color: #993333; font-weight: bold;">AS</span> p <span style="color: #993333; font-weight: bold;">ON</span> p<span style="color: #66cc66;">.</span>poster_id<span style="color: #66cc66;">=</span>u<span style="color: #66cc66;">.</span>id <span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> bb_usermeta <span style="color: #993333; font-weight: bold;">AS</span> m <span style="color: #993333; font-weight: bold;">ON</span> m<span style="color: #66cc66;">.</span>user_id<span style="color: #66cc66;">=</span>u<span style="color: #66cc66;">.</span>id
    <span style="color: #993333; font-weight: bold;">WHERE</span> m<span style="color: #66cc66;">.</span>meta_value <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">&quot;%<span style="color: #000099; font-weight: bold;">\&quot;</span>member<span style="color: #000099; font-weight: bold;">\&quot;</span>%&quot;</span> <span style="color: #993333; font-weight: bold;">AND</span> p<span style="color: #66cc66;">.</span>post_time <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NULL</span>
  <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> bb_non_posters
<span style="color: #66cc66;">&#41;</span>;</pre></div></div>
<p>Then I deleted all the user metadata for non-existent users from the <em>bb_usermeta</em> table using the following query:</p>
<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DELETE</span> <span style="color: #993333; font-weight: bold;">FROM</span> bb_usermeta <span style="color: #993333; font-weight: bold;">WHERE</span> umeta_id <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #993333; font-weight: bold;">SELECT</span> umeta_id <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#40;</span>
    <span style="color: #993333; font-weight: bold;">SELECT</span> m<span style="color: #66cc66;">.</span>umeta_id
    <span style="color: #993333; font-weight: bold;">FROM</span> bb_usermeta <span style="color: #993333; font-weight: bold;">AS</span> m <span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> bb_users <span style="color: #993333; font-weight: bold;">AS</span> u <span style="color: #993333; font-weight: bold;">ON</span> u<span style="color: #66cc66;">.</span>id<span style="color: #66cc66;">=</span>m<span style="color: #66cc66;">.</span>user_id
    <span style="color: #993333; font-weight: bold;">WHERE</span> u<span style="color: #66cc66;">.</span>id <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NULL</span>
  <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> bb_unlinked_meta
<span style="color: #66cc66;">&#41;</span>;</pre></div></div>
<p>The above will eventually delete all user accounts and their meta data when no posts have been published by those users. That means that even legitimate users with no posts will be deleted, but such users are very rare. If your account has been deleted, please make a new one.</p>
<p>Normally, further clean up of the tags tables should be performed, but since those users hadn&#8217;t posted anything, it is very unlikely that they had created any tags, so I think the above are just enough.</p>
<p>Using the above queries I got rid of thousands of user accounts created by bots. Make sure you have backed up your database before attempting any manipulation of the data.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/10/06/reclaiming-the-forums-from-bots/">Reclaiming the forums from bots</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2010/04/07/permanently-delete-posts-topics-bbpress/" rel="bookmark">Permanently remove deleted posts and topics in bbPress</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/06/manage-users-from-the-command-line/" rel="bookmark">User management from the command line</a></li>
<li><a href="http://www.g-loaded.eu/2007/02/12/lock-out-a-user-after-n-failed-login-attempts/" rel="bookmark">Lock out a user after N failed login attempts</a></li>
<li><a href="http://www.g-loaded.eu/2006/05/05/modifying-your-name-in-the-wordpress-comments/" rel="bookmark">Modifying Your Name In The WordPress Comments</a></li>
<li><a href="http://www.g-loaded.eu/2006/11/01/bot-allow-content-and-cc-configurator-plugin-updates/" rel="bookmark">Bot-Allow-Content and CC-Configurator plugin updates</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/10/06/reclaiming-the-forums-from-bots/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>A stolen bike</title>
		<link>http://www.g-loaded.eu/2009/03/28/a-stolen-bike/</link>
		<comments>http://www.g-loaded.eu/2009/03/28/a-stolen-bike/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 14:09:56 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Cycling]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=962</guid>
		<description><![CDATA[Two weeks ago, my MTB got stolen. It was a cheap bike and, after 700Km during the last 5 months without any servicing, it was in a really bad shape. I used a cheap lock to &#8220;protect&#8221; it. I relied on the bike&#8217;s bad condition and assumed that noone would want to steal it. So, [...]]]></description>
			<content:encoded><![CDATA[<p>Two weeks ago, my <a href="http://en.wikipedia.org/wiki/Mountain_bike" title="Mountain Bike">MTB</a> got stolen. It was a cheap bike and, after 700Km during the last 5 months without any servicing, it was in a really bad shape. I used a cheap lock to &#8220;protect&#8221; it. I relied on the bike&#8217;s bad condition and assumed that noone would want to steal it. So, it was a piece of cake for someone to pick it up one night. This article goes into some of the details of that experience and outlines the minimum countermeasures you can take against bike theft.<br />
<span id="more-962"></span><br />
If I don&#8217;t take into account the last 12 years, I&#8217;ve always had a bike as a child or teenager. Noone had ever stolen one from me before. This is why I took the current situation very hard.</p>
<p>I use the bike to move around in the city, go to the university, library, gym, etc. During the last five months, it had become a necessity. But there is one really big problem. It is impossible to keep it indoors. I have to leave it outside, in the wild.</p>
<p>Now, I have bought a new MTB. I really wouldn&#8217;t like it to be stolen again. That would make me extremely pissed off. During the last two weeks, I&#8217;ve read various articles about bicycle theft, about ways to properly protect a bike, et cetera. I even went out late one night, as if I was about to steal a bike, just trying to see things through a thief&#8217;s eyes and realize what the weaknesses of leaving a bike outdoors are.</p>
<p>I won&#8217;t be writing about any things you do not know already. A determined soul or a sophisticated thief will always get what he wants. There is nothing you can do about it. But, the good news is that sophisticated thieves are not really interested in bike theft, unless we are talking about a very expensive bike. On the other hand, a very expensive bike is very unlikely to be left outdoors at night. Sophisticated thieves are of course a problem, but not the real problem. The real problem in such cases is opportunist thieves. Usually, such thieves do not know whether the bike they have stolen is an expensive or a cheap one, whether it is in good condition or not, and they usually sell it for almost nothing afterwards. They are usually victims themselves. Junkies or people in great need for some money who would steal anything that is an easy target.</p>
<p>Below you will find a very small checklist with the things one should take into account in order to protect a bike which is left outside. These of course represent my own thoughts after evaluating all the things I&#8217;ve read and seen. If you can contribute to the list, be my guest. I will really appreciate it.</p>
<ul>
<li><strong>Buy a real lock</strong>. Most of the locks I&#8217;ve seen in bike shops are not locks upon which you can rely for more than a few minutes. From what I&#8217;ve read, it is very easy even for opportunist thieves to bypass or destroy them and get your bike. I would say that 40-50 EUR should be the absolute minimum you should spend on a lock. Don&#8217;t waste your money on 10-15 EUR locks. Invest. Go to a motorcycle shop and buy the best lock you can afford. If you cannot afford a decent lock, buy a cheaper bike. It is (collectively) cheaper to upgrade your bike&#8217;s parts at a later time than to upgrade a lock. Opportunist thieves aim for easy targets. If they realize that the strength of the lock is beyond their abilities, they will not bother with your bike and go for an easier target. Of course, you should <strong>learn how to properly lock your bike</strong>. Even if you use the best of the locks, but attach the bike to a fixed object which is not reliable, then a thief would destroy the fixed object and get your bike. All locks can be opened. But some locks are a lot harder to be opened. Get a good lock and lock your bike wisely. It is the least you can do to protect it. I now use a lock from <a href="http://www.abus.de/">ABUS</a>.</li>
<li><strong>A thief needs privacy</strong>. Do not give it to him. Locking up the bike in a shady corner may be an advantage for the thief as he will be able to work on the lock being unnoticed for a longer period of time. Make him feel uncomfortable with the spot at which you have locked your bike. Make him feel unsafe. A regular opportunist thief will not bother to steal the bike if he does not feel secure enough.</li>
</ul>
<p>Of course, this list is not complete. There are many other things you can do to further protect the bike, but most of them really depend on the location and any other <strong>special conditions</strong> of the area you live in. Bike theft is a problem of all big cities. I will be glad to read your thoughts on what else should be done in order to protect a bike which is left outdoors at night.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/03/28/a-stolen-bike/">A stolen bike</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
  <p>No related articles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/03/28/a-stolen-bike/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Critical vulnerability in Adobe Reader</title>
		<link>http://www.g-loaded.eu/2009/02/20/critical-vulnerability-in-adobe-reader/</link>
		<comments>http://www.g-loaded.eu/2009/02/20/critical-vulnerability-in-adobe-reader/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 12:39:48 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Advisory]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=923</guid>
		<description><![CDATA[Users of Adobe Reader should be aware of a newly discovered critical vulnerability in the Reader which could potentially allow a third party to execute arbitrary code, according to this security advisory by Adobe. The vulnerability affects several versions of Adobe Reader (and Acrobat). Adobe states that updates addressing the issue will be available by [...]]]></description>
			<content:encoded><![CDATA[<p>Users of <strong>Adobe Reader</strong> should be aware of a newly discovered <strong>critical vulnerability</strong> in the Reader which could potentially allow a third party to execute arbitrary code, according to this <a href="http://www.adobe.com/support/security/advisories/apsa09-01.html">security advisory</a> by Adobe. The vulnerability affects several versions of Adobe Reader (and Acrobat). Adobe states that updates addressing the issue will be available by March 11th (!!) for version 9. Updates for earlier versions of the affected software will follow. The advisory also indicates that exploits might already exist, so, take note and have a critical eye on what you download and open in the Reader.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/02/20/critical-vulnerability-in-adobe-reader/">Critical vulnerability in Adobe Reader</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2007/10/19/adobe-reader-8-for-linux/" rel="bookmark">Adobe Reader 8 for Linux</a></li>
<li><a href="http://www.g-loaded.eu/2008/05/03/evince-instead-of-adobe-reader-in-linux/" rel="bookmark">Evince instead of Adobe Reader in Linux</a></li>
<li><a href="http://www.g-loaded.eu/2007/02/24/creative-commons-v30-licenses-launched/" rel="bookmark">Creative Commons v3.0 Licenses Launched</a></li>
<li><a href="http://www.g-loaded.eu/2011/09/27/mod_gnutls-rc4-cipher-beast/" rel="bookmark">How to configure mod_gnutls to use the RC4 cipher to mitigate the SSL/TLS vulnerability</a></li>
<li><a href="http://www.g-loaded.eu/2007/07/29/best-practices-of-software-licensing/" rel="bookmark">Best Practices of Software Licensing</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/02/20/critical-vulnerability-in-adobe-reader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
	</channel>
</rss>

