<?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>Chesty&#039;s Blog &#187; OSIA</title>
	<atom:link href="http://chesterton.id.au/blog/category/osia/feed/" rel="self" type="application/rss+xml" />
	<link>http://chesterton.id.au/blog</link>
	<description>Press Belly Button to Begin</description>
	<lastBuildDate>Sat, 02 Apr 2011 01:24:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>mod_security False Positives</title>
		<link>http://chesterton.id.au/blog/2011/03/21/mod_security-false-positives/</link>
		<comments>http://chesterton.id.au/blog/2011/03/21/mod_security-false-positives/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 22:53:50 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_security]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=159</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2011/03/21/mod_security-false-positives/">mod_security False Positives</a></p>
mod_security False Positives I&#8217;ll go through a false positive example I found on my blog. False positives are inevitable, so it&#8217;s not a bad idea to run mod_security for a few weeks on detect only. Here&#8217;s the url that was raising the alarm. The trigger was in the url. http://chesterton.id.au/blog/2007/11/20/blue-tongue-harmonica-talk-cd/ Here&#8217;s what modsec_audit.log looked like [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2011/03/21/mod_security-false-positives/">mod_security False Positives</a></p>
<p>I&#8217;ll go through a false positive example I found on my blog. False positives are inevitable, so it&#8217;s not a bad idea to run mod_security for a few weeks on detect only.</p>
<p>Here&#8217;s the url that was raising the alarm. The trigger was in the url.</p>
<p><a href="http://chesterton.id.au/blog/2007/11/20/blue-tongue-harmonica-talk-cd/">http://chesterton.id.au/blog/2007/11/20/blue-tongue-harmonica-talk-cd/</a></p>
<p>Here&#8217;s what modsec_audit.log looked like<br />
<code><br />
--f8a03521-A--<br />
[21/Mar/2011:07:54:47 +1100] TYZpl0LcAZkAAHCLBPIAAAAA ::ffff:124.169.31.22 34169 127.0.0.1 81<br />
--f8a03521-B--<br />
GET /blog/2007/11/20/blue-tongue-harmonica-talk-cd/ HTTP/1.0<br />
Host: chesterton.id.au<br />
X-Real-IP: ::ffff:124.169.31.22<br />
X-Forwarded-For: ::ffff:124.169.31.22<br />
Connection: close<br />
Cache-Control: no-cache<br />
Pragma: no-cache<br />
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.26 (KHTML, like Gecko) Ubuntu/10.10 Chromium/12.0.709.0 Chrome/12.0.709.0 Safari/534.26<br />
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<br />
Accept-Encoding: gzip,deflate,sdch<br />
Accept-Language: en-US,en;q=0.8<br />
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3</p>
<p>--f8a03521-F--<br />
HTTP/1.1 403 Forbidden<br />
Content-Length: 370<br />
Connection: close<br />
Content-Type: text/html; charset=iso-8859-1</p>
<p>--f8a03521-H--<br />
Message: Access denied with code 403 (phase 2). Pattern match "\bcd\b\W*?[\/]" at REQUEST_FILENAME. [file "/etc/apache2/modsecurity_crs/base_rules/modsecurity_crs_40_generic_attacks.conf"] [line "396"] [id "958821"] [rev "2.1.2"] [msg "System Command Injection"] [data "cd/"] [severity "CRITICAL"] [tag "WEB_ATTACK/COMMAND_INJECTION"] [tag "WASCTC/WASC-31"] [tag "OWASP_TOP_10/A1"] [tag "PCI/6.5.2"]<br />
Action: Intercepted (phase 2)<br />
Stopwatch: 1300654487217847 3874 (2435 3436 -)<br />
Producer: ModSecurity for Apache/2.5.13 (http://www.modsecurity.org/); core ruleset/2.1.2.<br />
Server: Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.7 with Suhosin-Patch</p>
<p>--f8a03521-Z--<br />
</code></p>
<p>Section B &#8211;f8a03521-B&#8211; contains the request headers, and you can see the GET is /blog/2007/11/20/blue-tongue-harmonica-talk-cd/.</p>
<p>Section H is the audit log, why it was blocked in this case.<br />
[msg "System Command Injection"] [data "cd/"] so it didn&#8217;t like cd/, I&#8217;m not sure that cd/ (without a space between the cd and the directory) would do much on a unix system, but perhaps it does on windows, where apache also runs. </p>
<p>It also tells you the pattern that matched, the file where the rule is located and the rule id.<br />
Pattern match &#8220;\bcd\b\W*?[\/]&#8221; at REQUEST_FILENAME. [file "/etc/apache2/modsecurity_crs/base_rules/modsecurity_crs_40_generic_attacks.conf"] [line "396"] [id "958821"]</p>
<p>What we can do, is when REQUEST_FILENAME = /blog/2007/11/20/blue-tongue-harmonica-talk-cd/ remove rule id 958821.<br />
<code><br />
SecRule REQUEST_FILENAME "^/blog/2007/11/20/blue-tongue-harmonica-talk-cd/(index.php)?$" "nolog,pass,ctl:RuleRemoveById=958821"<br />
</code></p>
<p>Add this rule to your local rules, the reason we don&#8217;t modify the base_rules is they get overwritten when there&#8217;s an update to the rules.</p>
<p>&#8220;pass&#8221; above means if the rule matches, keep processing other rules, so it will still catch xss for example:</p>
<p><a href="http://chesterton.id.au/blog/2007/11/20/blue-tongue-harmonica-talk-cd/?a=%3Cscript%3Ealert(1)%3C/script%3E" rel="nofollow">http://chesterton.id.au/blog/2007/11/20/blue-tongue-harmonica-talk-cd/?a=%3Cscript%3Ealert(1)%3C/script%3E</a></p>
<p>I&#8217;d like to come back to this later and lock it down a little.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2011/03/21/mod_security-false-positives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mod_security SecAuditLog</title>
		<link>http://chesterton.id.au/blog/2011/03/19/mod_security-secauditlog/</link>
		<comments>http://chesterton.id.au/blog/2011/03/19/mod_security-secauditlog/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 22:49:00 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_security]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=156</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2011/03/19/mod_security-secauditlog/">mod_security SecAuditLog</a></p>
mod_security SecAuditLog In my previous post I didn&#8217;t mention how to turn on the audit log, so without explanation, you put the following in your config. SecAuditEngine RelevantOnly SecAuditLogType serial SecAuditLogParts ABCFHZ We already set SecAuditLog to /var/log/modsecurity/SecAuditLog/modsec_audit.log in the previous post, which has to be writable by the web server user, www-data for ubuntu/debian. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2011/03/19/mod_security-secauditlog/">mod_security SecAuditLog</a></p>
<p>In my previous <a href="http://chesterton.id.au/blog/2011/03/17/mod_security/">post</a> I didn&#8217;t mention how to turn on the audit log, so without explanation, you put the following in your config.</p>
<p><code><br />
SecAuditEngine RelevantOnly<br />
SecAuditLogType serial<br />
SecAuditLogParts ABCFHZ<br />
</code></p>
<p>We already set SecAuditLog to /var/log/modsecurity/SecAuditLog/modsec_audit.log in the previous post, which has to be writable by the web server user, www-data for ubuntu/debian. So after a reload, you should start seeing entries when mod_security denies a request.</p>
<p>I&#8217;m going to modify SecAuditLogType setting in a future post so we can enable the console.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2011/03/19/mod_security-secauditlog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mod_security</title>
		<link>http://chesterton.id.au/blog/2011/03/17/mod_security/</link>
		<comments>http://chesterton.id.au/blog/2011/03/17/mod_security/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 06:05:58 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_security]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=139</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2011/03/17/mod_security/">mod_security</a></p>
mod_security Some time ago, I changed my setup from nginx + spawn-fcgi to nginx + apache so I could play with mod_security. Well, one of my clients got pwned by some sql injection vulnerability, so I finally got to put it in practice. In a nut shell, mod_security is an apache module that scans http(s) [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2011/03/17/mod_security/">mod_security</a></p>
<p>Some time ago, I changed my setup from nginx + spawn-fcgi to nginx + apache so I could play with mod_security. Well, one of my clients got pwned by some sql injection vulnerability, so I finally got to put it in practice. </p>
<p>In a nut shell, mod_security is an apache module that scans http(s) traffic for suspicious strings. It can catch suspicious strings entering apache or leaving apache. It&#8217;s a firewall for http(s), it blocks bad traffic, and lets good traffic pass through.</p>
<p>mod_security is one of those applications that doesn&#8217;t fit the package model well. I guess it comes in two parts, the apache module and the rules. Packages don&#8217;t seem to even attempt to manage the rules, you download them separately and they come with a util to update them. Then you have your local rules that add to, disable, or override the upstream rules to fit your environment.</p>
<p>In ubuntu, the mod_security package is a little outdated, it always will be, especially on LTS, and it&#8217;s one of those packages that needs constant updates. The clever and motivated security researchers eventually find weakness in mod_security which are addressed in updates. So you either use the packages, and hope fixes are backported in a timely manner, which hasn&#8217;t appeared to of happened in ubuntu, or you install by source.</p>
<p>Installing by source increases your workload and moves the burden of keeping it up to date to yourself. But it&#8217;s a pretty straightforward process, and if you have only one or two machines to admin, it&#8217;s no issue.</p>
<p>It&#8217;s basically a matter of downloading the source, checking the signature, running apt-get build-dep libapache-mod-security, untaring, ./configure; make;make test;make install, then enable the module in apache. It&#8217;s pretty well covered in the docs and blogs found in google.</p>
<p>That takes care of the module, but it does nothing without the rules. I downloaded the core rules from <a href="http://www.owasp.org/index.php/Main_Page">OWASP</a>. There some documentation in the package, but there&#8217;s a few gotchas, so I&#8217;ll try and document step by step the process I went through.</p>
<ol>
<li>unpack the rules in your home directory</li>
<li>sudo mkdir /etc/apache2/modsecurity_crs/</li>
<li>cd modsecurity-crs_2.1.2<br />
sudo cp -a *_rules *.example  /etc/apache2/modsecurity_crs/</li>
<li>cd /etc/apache2/modsecurity_crs/<br />
 sudo mv modsecurity_crs_10_config.conf{.example,}</li>
<li>You have to edit modesecurity_crs_10_config.conf and uncomment a few lines, I think the main one being SecRuleEngine.</li>
<li>I created two files in /etc/apache2/mods-available<br />
0modsecurity.conf<br />
<code>&lt;IfModule security2_module><br />
   Include modsecurity_crs/*.conf<br />
   Include modsecurity_crs/base_rules/*.conf<br />
&lt;/IfModule></code><br />
0modsecurity.load<br />
<code>LoadFile /usr/lib/libxml2.so<br />
LoadFile /usr/lib/liblua5.1.so<br />
LoadModule security2_module /usr/lib/apache2/modules/mod_security2.so</code></li>
<li>sudo a2enmod 0modsecurity</li>
<li>create a file called /etc/apache2/modsecurity_crs/modsecurity_localconfig.conf with the following<br />
<code>SecUploadDir /var/log/modsecurity/SecUploadDir<br />
SecAuditLog /var/log/modsecurity/SecAuditLog/modsec_audit.log<br />
SecAuditLogStorageDir /var/log/modsecurity/SecAuditLogStorageDir<br />
SecDebugLog /var/log/modsecurity/SecDebugLog/modsec_debug.log<br />
SecDataDir /var/log/modsecurity/SecDataDir<br />
SecTmpDir /var/log/modsecurity/SecTmpDir<br />
</code></li>
<li>Make all the directories in /var/log/modsecurity, which have to be owned by www-data<br />
<code>sudo mkdir -p /var/log/modsecurity/{SecUploadDir,SecAuditLog,SecAuditLogStorageDir,SecDebugLog,SecDataDir,SecTmpDir}<br />
sudo chown -R www-data: /var/log/modsecurity</code>
</li>
</ol>
<p>That will do for now, I think. To modify the rules I feel it&#8217;s best to slow down and buy a book for learning, I&#8217;m not sure docs and blogs are the best way to learn this, but it&#8217;s up to your learning style. I keep updated by following @ModSecurity on twitter.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2011/03/17/mod_security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping Track of Videos</title>
		<link>http://chesterton.id.au/blog/2010/12/17/keeping-track-of-videos/</link>
		<comments>http://chesterton.id.au/blog/2010/12/17/keeping-track-of-videos/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 17:38:08 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=132</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/12/17/keeping-track-of-videos/">Keeping Track of Videos</a></p>
Keeping Track of Videos When watching a TV series on the laptop, I often lose track of what episode I&#8217;m up to, especially after a reboot, so I use nautilus emblems to keep track for me. The idea is when I double click a video file, instead of it launching a video player, I configure [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/12/17/keeping-track-of-videos/">Keeping Track of Videos</a></p>
<p>When watching a TV series on the laptop, I often lose track of what episode I&#8217;m up to, especially after a reboot, so I use nautilus emblems to keep track for me.</p>
<p>The idea is when I double click a video file, instead of it launching a video player, I configure it to launch a script, which adds the emblem to the file and then launches the video.</p>
<p>The script is pretty complicated<br />
<code><br />
#!/bin/sh<br />
gvfs-set-attribute -t stringv "$1" metadata::emblems generic &#038;&#038;<br />
vlc "$1"<br />
</code><br />
OK, I lied, it&#8217;s pretty simple, gvfs-set-attribute which can be found in the gvfs-bin package sets the emblem then vlc (or totem, or whatever gets your freak on) launches.</p>
<p>So you put the script somewhere sane, like /usr/local/bin/markvideo and click a<br />
video file you want to the script to work on, and then select properties -> open with, and put your script in, it will work with all video files of that extension from then on.</p>
<p>Only one minor pain, you need to refresh nautilus after double clicking a file to see the emblem. I did a similar thing on snow leopard using automator and it didn&#8217;t need refreshing. But at least the emblem is there if I need to reboot, or whatever, so the next time I open that folder (or refresh it) I will see it.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2010/12/17/keeping-track-of-videos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back to Ubuntu</title>
		<link>http://chesterton.id.au/blog/2010/12/16/back-to-ubuntu/</link>
		<comments>http://chesterton.id.au/blog/2010/12/16/back-to-ubuntu/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 02:02:32 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=128</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/12/16/back-to-ubuntu/">Back to Ubuntu</a></p>
Back to Ubuntu About five years ago, I bought a macbook pro2,2 as my main connection to the internet. It started out with tiger. It was a struggle to get used to the differences from a gnome desktop. But I got there, and started liking it. I tried ubuntu on it when i first got [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/12/16/back-to-ubuntu/">Back to Ubuntu</a></p>
<p>About five years ago, I bought a macbook pro2,2 as my main connection to the internet. It started out with tiger. It was a struggle to get used to the differences from a gnome desktop. But I got there, and started liking it. I tried ubuntu on it when i first got it, and didn&#8217;t like the single mouse button, so went back to tiger.</p>
<p>Then came leopard and snow leopard, all good. But started pining for my open source interface. Eventually, after years of pining, I got sick of how slow my macbook had become. It probably just needed a reinstall, but I wanted to go back to ubuntu. All it had become over the years was a browser, a terminal and a video player.</p>
<p>One problem, my cd drive didn&#8217;t work, so usb install was the only way. Well, there was the option of netboot, but the simple instructions I found didn&#8217;t work, so I concentrated on usb which had more documentation. I can&#8217;t put into words how frustrating and hard it was to get ubuntu booting on it, it took a full day of trial and error, reading blogs and howtos, etc.</p>
<p>At one stage it was &#8220;bricked&#8221; (but not totally bricked), I couldn&#8217;t boot anything. It just sat there on a grey screen cycling through different icons. A usb bootable refit rescued me that time.</p>
<p>To cut a long story short, I couldn&#8217;t get ubuntu booting from the usb. So now I have a partition for snow leopard install dvd (I put that on when the cd drive died), a partition of snow leopard for refit, a partition of ubuntu alternative install cd, a partition for ubuntu root and a partition for linux swap.</p>
<p>I tried for most of the time to get ubuntu desktop on there, it wasn&#8217;t happening, eventually tried the alternate cd and got further, although I had to manually force grub to install on the partition outside of the install process. Now it boots, and I&#8217;m extremely happy about it.</p>
<p>I&#8217;m trying to not modify it too much, to stay with the ubuntu defaults, but firefox went for chromium. That and two finger scroll are about the only changes I&#8217;ve made. It&#8217;s good, feels nice, I need to get used to expose corners not being there, and copy and paste being different, but that&#8217;s about it. everything else feels natural.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2010/12/16/back-to-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back To Apache</title>
		<link>http://chesterton.id.au/blog/2010/10/14/back-to-apache/</link>
		<comments>http://chesterton.id.au/blog/2010/10/14/back-to-apache/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 14:13:14 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=123</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/10/14/back-to-apache/">Back To Apache</a></p>
Back To Apache I&#8217;ve reinstalled apache and I&#8217;m in the process of cutting over my sites. Not completely, just for non static files, mainly php. Nginx is infront of apache serving static content and is a reverse proxy to apache which runs on 127.0.0.1:81 The reason? I want to give mod_security a spin. It&#8217;s loaded [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/10/14/back-to-apache/">Back To Apache</a></p>
<p>I&#8217;ve reinstalled apache and I&#8217;m in the process of cutting over my sites. Not completely, just for non static files, mainly php. Nginx is infront of apache serving static content and is a reverse proxy to apache which runs on 127.0.0.1:81</p>
<p>The reason? I want to give mod_security a spin. It&#8217;s loaded now, but it doesn&#8217;t seem to do much atm. Will read up on it in due season ;)</p>
<p>Basically, you google for nginx apache proxy wordpress wp-super-cache and you hit the right sort of pages to set it up. It wasn&#8217;t smooth sailing though, I used <a href="http://tech.nocr.at/tech/how-to-speed-up-wordpress-with-nginx-and-wp-super-cache/">http://tech.nocr.at/tech/how-to-speed-up-wordpress-with-nginx-and-wp-super-cache/</a> which has a flaw.</p>
<p>It contains the lines at the end on the nginx config sample.<br />
<code>	# all other requests go to WordPress<br />
	if (!-e $request_filename) {<br />
	rewrite . /index.php last;<br />
	}</code><br />
and funnily enough, every url opened the front page of my blog. It took me a bit of head scratching before I commented the lines out, enabled mod_rewrite in apache, and toggled a wordpress permalink setting to get .htaccess written.</p>
<p>After I got it working, I read the comments and someone had already discovered the flaw. Plus another page I read is basically the same, except it&#8217;s missing those lines (it wasn&#8217;t as good looking, so I didn&#8217;t use it).</p>
<p>So I&#8217;m pretty happy that I understand the config now, and I&#8217;ll continue to cut over the remaining sites, then turn off php5-cgi. I&#8217;m also happy apache is back, I went a bit anti apache there for a while, but it has its uses, like mod_security for example.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2010/10/14/back-to-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Test Your Server For Vulnerabilities</title>
		<link>http://chesterton.id.au/blog/2010/10/04/how-to-test-your-server-for-vulnerabilities/</link>
		<comments>http://chesterton.id.au/blog/2010/10/04/how-to-test-your-server-for-vulnerabilities/#comments</comments>
		<pubDate>Mon, 04 Oct 2010 02:45:57 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=120</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/10/04/how-to-test-your-server-for-vulnerabilities/">How To Test Your Server For Vulnerabilities</a></p>
How To Test Your Server For Vulnerabilities Sheesh, I write one post on security, mention a security expert in it, and he tries to exploit my server. It&#8217;s not an original idea, but if you want to test your server for vulnerabilities, come out and say you&#8217;re a security expert. Anyway, I finished Cyber War, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/10/04/how-to-test-your-server-for-vulnerabilities/">How To Test Your Server For Vulnerabilities</a></p>
<p>Sheesh, I write one post on security, mention a security expert in it, and he tries to exploit my server. It&#8217;s not an original idea, but if you want to test your server for vulnerabilities, come out and say you&#8217;re a security expert.</p>
<p>Anyway, I finished Cyber War, feeling very satisfied since it&#8217;s been a long time since I had the will to read a book. Twitter&#8217;s 140 character limit has taken a toll.</p>
<p>I think the conclusion the author made was regulation, which will erode privacy, and treaties. Also a new protocol where there are no anonymous users (except for the bad guys, i guess).</p>
<p>The author has no doubt that our critical systems already have backdoors and logic bombs installed, waiting for the day. One thing that struck me is no matter how secure my own network is (which it isn&#8217;t very, no need to test), if someone else is vulnerable, it could affect me and millions of others. </p>
<p>On to the next book. This one is lower level I think.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2010/10/04/how-to-test-your-server-for-vulnerabilities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cyber War</title>
		<link>http://chesterton.id.au/blog/2010/10/02/cyber-war/</link>
		<comments>http://chesterton.id.au/blog/2010/10/02/cyber-war/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 03:13:55 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=116</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/10/02/cyber-war/">Cyber War</a></p>
Cyber War I&#8217;ve recently become more interested in security. I always had an interest in it, locking down linux servers and firewalls, trying to avoid common sql injection and XSS bugs while coding. But I guess that&#8217;s more of a passive interest or approach, I&#8217;m now interested in a more active way, deep packet inspection, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/10/02/cyber-war/">Cyber War</a></p>
<p>I&#8217;ve recently become more interested in security. I always had an interest in it, locking down linux servers and firewalls, trying to avoid common sql injection and XSS bugs while coding. But I guess that&#8217;s more of a passive interest or approach, I&#8217;m now interested in a more active way, deep packet inspection, etc.</p>
<p>In the past, I locked down a server and assumed it would take care of itself, be crack proof, as crack proof as anything connected to the internet can be. I wasn&#8217;t fooling myself, I knew it could still be cracked. </p>
<p>Now I&#8217;m looking at it more from position where I believe the hosts are vulnerable, and I want to examine the traffic coming in and out. Trying to secure the network rather than (or as well as) the hosts. Because, well, some hosts can&#8217;t be secured, there&#8217;s always going to be 0day exploits, old unpatched exploits, and social hacking. Not just trying to stop attacks, but trying to detect owned boxes. Some attacks happen out of band, like from infected usb sticks. Want to sneak some worm onto a target? Do it in plain sight, stand outside their premises and give away usb sticks in a fake promotion, or do it in some conference.</p>
<p>I guess I&#8217;ve got to send props to David Bl (Security Expert) for sparking the interest.</p>
<p>I&#8217;m half way through <a href="http://www.amazon.com/Cyber-War-Threat-National-Security/dp/0061962236">Cyber War</a>, the first book I&#8217;ve read in a very long time. It&#8217;s not a technical manual on security, it&#8217;s more of a look at how vulnerable the USA and other countries are from attacks coming in through the internet.  It talks about political and military tactics and strategy. It&#8217;s more about securing a nation, rather than a network.</p>
<p>It seems the only reason we don&#8217;t see a lot of countries launching attacks on other countries through the internet is the countries who have the ability to attack a potential adversary, also have an interest, be it in trade, or bonds or whatever, in the potential adversary. It&#8217;s not in their best interest to attack at the moment. Things are going to change though. </p>
<p>You don&#8217;t need to be a country to take on someone like the USA, a single person, or a small group with the right know how can do a lot of damage to the military or public infrastructure. Remotely damaging electric generators that take months to replace, crippling banks, whatever. Anything that is connected in someway to the internet is a target. Australia and USA are looking at smart grids, the electric grid is already connected to the internet and it&#8217;s going to get a lot more connected and complicated with the added bonus of more attack vectors.</p>
<p>What can be done by the government to protect its citizens in an attack? Nothing, really. Except for China, who have a big firewall they can use to shut off attacks. Anything a government might do to strengthen its internet defence is going to be an attack on citizens privacy. Who in their right mind would trust a government to do the right thing with all the power they would hold over their citizens, if they had the control they needed to defend themselves and their citizens from internet attacks?</p>
<p>Which brings me to the question of Australia&#8217;s proposed filter. Filter bad, Conroy bad, and all that, but the filter is a firewall between Australian citizens and the internet, it could be used as a defensive measure against attacks. Not necessarily the technology Conroy is proposing, but a suitable firewall could.</p>
<p>But it&#8217;s like the government being able to listen in on every phone call, every conversation. It&#8217;s not going to happen, but something needs to happen. </p>
<p>I dare say the font on the security tag on this blog is going to get large in the tag cloud. These are young thoughts, they may change and I&#8217;ll be talking about security a lot more.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2010/10/02/cyber-war/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Latest FreeSWITCH, PennyTel and Billion 5200N development</title>
		<link>http://chesterton.id.au/blog/2009/11/28/latest-freeswitch-pennytel-and-billion-5200n-development/</link>
		<comments>http://chesterton.id.au/blog/2009/11/28/latest-freeswitch-pennytel-and-billion-5200n-development/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 07:27:56 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[FreeSWITCH]]></category>
		<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[billion]]></category>
		<category><![CDATA[e65]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[voip]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=63</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2009/11/28/latest-freeswitch-pennytel-and-billion-5200n-development/">Latest FreeSWITCH, PennyTel and Billion 5200N development</a></p>
Latest FreeSWITCH, PennyTel and Billion 5200N development For a while now, I had not being using FreeSWITCH for my VoIP, but just logging into PennyTel directly with my Nokia E65. It worked OK, but the voice quality wasn&#8217;t as good as going through FreeSWITCH. A month ago my old ADSL router died, so I bought [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2009/11/28/latest-freeswitch-pennytel-and-billion-5200n-development/">Latest FreeSWITCH, PennyTel and Billion 5200N development</a></p>
<p>For a while now, I had not being using FreeSWITCH for my VoIP, but just logging into PennyTel directly with my Nokia E65. It worked OK, but the voice quality wasn&#8217;t as good as going through FreeSWITCH.</p>
<p>A month ago my old ADSL router died, so I bought a Billion 5200N to replace it. Since then, I&#8217;d been having weird problems with VoIP not working, and the Wifi to LAN bridging stopping dead whenever there was a bit of traffic over it.</p>
<p>It took me a while to sort out all the peculiarities of the Billion.</p>
<p>1. A change of ethernet ports on the router fixed the bridge locking up problem. It took a lot of time and weird theories before I fixed that.<br />
2. When setting up the router from factory defaults, I have to save the wireless interface twice when I change the SSID before it will allow my wireless devices to authenticate.<br />
3. UPnP was interfering with FreeSWITCH, and probably my Nokia. Turning that off on the router fixed FreeSWITCH.<br />
4. Selecting some settings on the router made the routers wireless interface disappear, and the only way to get it back was a factory reset.</p>
<p>So, FreeSWITCH is a breeze to set up for PennyTel now. It takes editing two files.<br />
conf/vars.xml and conf/dialplan/default/000pennytel.xml.</p>
<p>In conf/vars.xml I changed the following</p>
<pre>
&lt;X-PRE-PROCESS cmd="set" data="default_password=whateveryouwant"/>
</pre>
<p>That password is used for phones authenticating to FreeSWITCH, it has nothing to do with PennyTel.</p>
<p><code><br />
&lt;X-PRE-PROCESS cmd="set" data="domain=switch.gruntnet"/><br />
</code></p>
<p>What the phones use as their realm, it should be in the DNS with the ip pointing to FreeSWITCH.</p>
<p><code><br />
  &lt;X-PRE-PROCESS cmd="set" data="default_provider=sip.pennytel.com"/><br />
  &lt;X-PRE-PROCESS cmd="set" data="default_provider_username=61281955555"/><br />
  &lt;X-PRE-PROCESS cmd="set" data="default_provider_password=55555/><br />
  &lt;X-PRE-PROCESS cmd="set" data="default_provider_from_domain=sip.pennytel.com"/><br />
  &lt;!-- true or false --><br />
  &lt;X-PRE-PROCESS cmd="set" data="default_provider_register=true"/><br />
  &lt;X-PRE-PROCESS cmd="set" data="default_provider_contact=1000"/><br />
</code></p>
<p>All the PennyTel setting goes above, I use 1000 to receive incoming calls, my only phone on the network.</p>
<p>Then in conf/dialplan/default/000penntel.xml</p>
<p><code><br />
   &lt;extension name="pennytel"><br />
    &lt;condition field="destination_number" expression="^(.*)$"><br />
      &lt;action application="set" data="effective_caller_id_number=61281955555"/><br />
      &lt;action application="bridge" data="sofia/gateway/sip.pennytel.com/$1"/><br />
     &lt;/condition><br />
   &lt;/extension><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2009/11/28/latest-freeswitch-pennytel-and-billion-5200n-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snow Leopard Resolver</title>
		<link>http://chesterton.id.au/blog/2009/11/19/snow-leopard-resolver/</link>
		<comments>http://chesterton.id.au/blog/2009/11/19/snow-leopard-resolver/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 19:57:44 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=59</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2009/11/19/snow-leopard-resolver/">Snow Leopard Resolver</a></p>
Snow Leopard Resolver I recently upgraded to snow leopard and noticed some DNS weirdness. I couldn&#8217;t ssh to hosts defined in my local DNS, it wouldn&#8217;t resolve, but I could resolve them with the host command. Turns out Snow Leopard made quite a few changes to the resolver, it no longer uses /etc/resolv.conf but mDNSResponder, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2009/11/19/snow-leopard-resolver/">Snow Leopard Resolver</a></p>
<p>I recently upgraded to snow leopard and noticed some DNS weirdness. I couldn&#8217;t ssh to hosts defined in my local DNS, it wouldn&#8217;t resolve, but I could resolve them with the host command.</p>
<p>Turns out Snow Leopard made quite a few changes to the resolver, it no longer uses /etc/resolv.conf but mDNSResponder, at least for apple supplied applications.</p>
<p>Unlike every other OS I&#8217;ve come across, including Leopard, Snow Leopard doesn&#8217;t use the order of DNS servers as first listed, first used. It swaps which DNS it&#8217;s going to use around, seemingly at random times. Some sort of load balancing miss feature?</p>
<p>I had two DNS servers configured, the first one, my local DNS server, the second, my ADSLs DNS server as a backup. The simple fix is to only have one DNS server configured.</p>
<p>There&#8217;s more information here <a href="http://discussions.apple.com/thread.jspa?threadID=2132856&#038;tstart=135">Snow Leopard Resolver</a>.</p>
<p>I&#8217;m not unhappy with OS X, but lately I&#8217;ve been pining to return to a linux based laptop. I think this will be my first and last Mac.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2009/11/19/snow-leopard-resolver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

