<?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>Disenchant's Blog &#187; Programming</title>
	<atom:link href="http://www.disenchant.ch/blog/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://www.disenchant.ch/blog</link>
	<description>Blog of Sven Vetsch / Disenchant</description>
	<lastBuildDate>Thu, 22 Oct 2009 16:25:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Firefox Security Tool Kit &#8211; Now FF v3 compatible</title>
		<link>http://www.disenchant.ch/blog/firefox-security-tool-kit-now-ff-v3-compatible/133</link>
		<comments>http://www.disenchant.ch/blog/firefox-security-tool-kit-now-ff-v3-compatible/133#comments</comments>
		<pubDate>Sat, 21 Jun 2008 15:06:49 +0000</pubDate>
		<dc:creator>Disenchant</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.disenchant.ch/blog/?p=133</guid>
		<description><![CDATA[I&#8217;ve been asked to make my Firefox Security Tool Kit (FSTK) compatible to the new Firefox version 3 and here it is Download and/or Install the FSTK v3.1 now Additionally to the new version compatibility changes, I replaced the Extension &#8220;User Agent Switcher&#8221; with &#8220;Modify Headers&#8220;. All other extensions are the same as described here.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been asked to make my Firefox Security Tool Kit (FSTK) compatible to the new Firefox version 3 and here it is <img src='http://www.disenchant.ch/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong><a href="http://www.disenchant.ch/blog/files/fstk.xpi">Download and/or Install the FSTK v3.1 now</a></strong></p>
<p>Additionally to the new version compatibility changes, I replaced the Extension &#8220;<a href="http://chrispederick.com/work/user-agent-switcher/">User Agent Switcher</a>&#8221; with &#8220;<a href="https://addons.mozilla.org/en-US/firefox/addon/967">Modify Headers</a>&#8220;. All other extensions are the same as described <a href="http://www.disenchant.ch/blog/firefox-security-tool-kit-fstk-v30/118">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.disenchant.ch/blog/firefox-security-tool-kit-now-ff-v3-compatible/133/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Firefox Security Tool Kit &#8211; FSTK v3.0</title>
		<link>http://www.disenchant.ch/blog/firefox-security-tool-kit-fstk-v30/118</link>
		<comments>http://www.disenchant.ch/blog/firefox-security-tool-kit-fstk-v30/118#comments</comments>
		<pubDate>Tue, 01 Apr 2008 10:50:13 +0000</pubDate>
		<dc:creator>Disenchant</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.disenchant.ch/blog/?p=118</guid>
		<description><![CDATA[About one year ago, I&#8217;ve created a bundle which contained several different extensions for Firefox related to web application security testing. Today I&#8217;d like to release version 3.0 of the Firefox Security Tool Kit or short FSTK, which will make your browser a (nearly) full-fledged webappsec pentesting tool. Download and/or Install the FSTK v3.0 now [...]]]></description>
			<content:encoded><![CDATA[<p>About one year ago, I&#8217;ve created a bundle which contained several different extensions for <a href="http://www.mozilla.com/en-US/firefox/">Firefox</a> related to web application security testing. Today I&#8217;d like to release version 3.0 of the Firefox Security Tool Kit or short FSTK, which will make your browser a (nearly) full-fledged webappsec pentesting tool.</p>
<p><strong><a href="http://www.disenchant.ch/blog/files/fstk.xpi">Download and/or Install the FSTK v3.0 now</a></strong></p>
<p>By installing it to your Firefox, you&#8217;ll get all of the following extensions:</p>
<blockquote><p>
<strong>allcookies</strong><br />
Version: 1.2<br />
By: Bernard Maison<br />
dumps ALL cookies to cookies.txt file<br />
For Firefox versions 1.5 to 2.0.0.*<br />
Homepage: <a href="http://allcookies.mozdev.org">http://allcookies.mozdev.org</a></p>
<p><strong>Cert Viewer Plus</strong><br />
Version: 1.2<br />
By: Kaspar Brand<br />
Certificate viewer enhancements: PEM format view, file export<br />
For Firefox versions 1.5.0.4 to 3.0.0.*<br />
Homepage: <a href="https://addons.mozilla.org/addon/1964/">https://addons.mozilla.org/addon/1964/</a></p>
<p><strong>Firebug</strong><br />
Version: 1.05<br />
By: Joe Hewitt<br />
Web Development Evolved<br />
For Firefox versions 1.5 to 2.0.0.*<br />
Homepage: <a href="http://www.getfirebug.com/">http://www.getfirebug.com/</a></p>
<p><strong>Firecookie</strong><br />
Version: 0.0.5<br />
By: Jan Odvarko<br />
Cookie manager for Firebug. Firebug has to be installed in order to use this extension.<br />
For Firefox versions 2.0 to 3.0b5pre<br />
Homepage: <a href="http://www.janodvarko.cz/firecookie">http://www.janodvarko.cz/firecookie</a></p>
<p><strong>Fire Encrypter</strong><br />
Version: 3.0<br />
By: Ronald van den heetkamp<br />
Encryption, Decryption, and Hashing program.<br />
For Firefox versions 1.5 to 2.0.0.*<br />
Homepage: <a href="http://www.jungsonnstudios.com/Mozilla/">http://www.jungsonnstudios.com/Mozilla/</a></p>
<p><strong>FoxyProxy</strong><br />
Version: 2.7.1<br />
By: LeahScape, Inc.<br />
Premier proxy management for Firefox<br />
For Firefox versions 1.5 to 3.0b4pre<br />
Homepage: <a href="http://foxyproxy.mozdev.org">http://foxyproxy.mozdev.org</a></p>
<p><strong>Live HTTP Headers</strong><br />
Version: 0.13.1<br />
By: Daniel Savard<br />
View HTTP headers of a page and while browsing.<br />
For Firefox versions 0.8 to 2.0.0.*<br />
Homepage: <a href="http://livehttpheaders.mozdev.org/">http://livehttpheaders.mozdev.org/</a></p>
<p><strong>Selenium IDE</strong><br />
Version: 1.0b1<br />
By: Shinya Kasatani<br />
Record, edit and play Selenium tests<br />
For Firefox versions 1.5 to 3.0b3<br />
Homepage: <a href="http://www.openqa.org/selenium-ide/">http://www.openqa.org/selenium-ide/</a></p>
<p><strong>Smart Middle Click</strong><br />
Version: 0.5<br />
By: spiers<br />
Middle click for javascript links.<br />
For Firefox versions 1.5 to 2.0.0.*<br />
Homepage: <a href="http://spiers.free.fr/">http://spiers.free.fr/</a></p>
<p><strong>Tamper Data</strong><br />
Version: 9.8.1<br />
By: Adam Judson<br />
View and modify HTTP/HTTPS headers etc.<br />
For Firefox versions 1.0 to 2.0.0.*<br />
Homepage: <a href="http://tamperdata.mozdev.org">http://tamperdata.mozdev.org</a></p>
<p><strong>User Agent Switcher</strong><br />
Version: 0.6.10<br />
By: Chris Pederick<br />
Adds a menu and a toolbar button to switch the user agent of the browser.<br />
For Firefox versions 1.0 to 2.0.0.*<br />
Homepage: <a href="http://chrispederick.com/work/user-agent-switcher/">http://chrispederick.com/work/user-agent-switcher/</a></p>
<p><strong>Web Developer</strong><br />
Version: 1.1.4<br />
By: Chris Pederick<br />
Adds a menu and a toolbar with various web developer tools.<br />
For Firefox versions 1.0 to 2.0.0.*<br />
Homepage: <a href="http://chrispederick.com/work/web-developer/">http://chrispederick.com/work/web-developer/</a>
</p></blockquote>
<p>Hope you enjoy it <img src='http://www.disenchant.ch/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.disenchant.ch/blog/firefox-security-tool-kit-fstk-v30/118/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Selenium Remote Control</title>
		<link>http://www.disenchant.ch/blog/selenium-remote-control/119</link>
		<comments>http://www.disenchant.ch/blog/selenium-remote-control/119#comments</comments>
		<pubDate>Wed, 26 Mar 2008 20:14:51 +0000</pubDate>
		<dc:creator>Disenchant</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.disenchant.ch/blog/selenium-remote-control/119</guid>
		<description><![CDATA[A working colleague of mine showed me a tool, which I think is really cool for automating tasks during web application security test, even if it&#8217;s not made especially for that. The tool I&#8217;m talking about is called Selenium Remote Control and licensed under the Apache 2.0 License. Let&#8217;s have a look at the description [...]]]></description>
			<content:encoded><![CDATA[<p>A working colleague of mine showed me a tool, which I think is really cool for automating tasks during web application security test, even if it&#8217;s not made especially for that. The tool I&#8217;m talking about is called <a href="http://selenium-rc.openqa.org/">Selenium Remote Control</a> and licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0 License</a>. Let&#8217;s have a look at the description of Selenium:</p>
<blockquote><p>Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser.</p></blockquote>
<p>This is exactly what Selenium is/does <img src='http://www.disenchant.ch/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I can especially recommend the <a href="http://selenium-ide.openqa.org/">Selenium IDE</a>, which&#8217;s a Firefox extension that can record all actions of your browser, replay them and also export the whole thing into HTML, Java, C#, Perl, PHP, Python and Ruby.</p>
<p>This is, how the Selenium IDE looks like:</p>
<p><a href='http://www.disenchant.ch/blog/wp-content/uploads/2008/03/selenium_ide.jpg' title='Selenium IDE'><img src='http://www.disenchant.ch/blog/wp-content/uploads/2008/03/selenium_ide.jpg' alt='Selenium IDE' /></a></p>
<p>I don&#8217;t want to say more on this, just give it a try and have fun <img src='http://www.disenchant.ch/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.disenchant.ch/blog/selenium-remote-control/119/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fix your PHP Code without changing it</title>
		<link>http://www.disenchant.ch/blog/fix-your-php-code-without-changing-it/98</link>
		<comments>http://www.disenchant.ch/blog/fix-your-php-code-without-changing-it/98#comments</comments>
		<pubDate>Thu, 27 Dec 2007 08:03:58 +0000</pubDate>
		<dc:creator>Disenchant</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.disenchant.ch/blog/fix-your-php-code-without-changing-it/98</guid>
		<description><![CDATA[What is it about? This blog posting describes a way on how you can patch security problems and real vulnerabilities in your PHP code, when you&#8217;re not allowed to change the code or for example if this is just not possible for any reason. What you&#8217;ll learn here is something like virtual patching, as we [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What is it about?</strong><br />
This blog posting describes a way on how you can patch security problems and real vulnerabilities in your PHP code, when you&#8217;re not allowed to change the code or for example if this is just not possible for any reason. What you&#8217;ll learn here is something like virtual patching, as we know it from web application firewalls but we don&#8217;t change the code of the already existing application in any way and we don&#8217;t even need new components like such an application firewall. Does this this sounds like black magic to you? Don&#8217;t worry, it&#8217;s not complicated at all <img src='http://www.disenchant.ch/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>What is it not about?</strong><br />
This blog posting will not show you for example how to fix all vulnerabilities you can expect in your PHP code nor is the described technique working against every kind of security problem. If you have the possibility to change the existing code, this is for sure the way to go and not what I&#8217;m writing in this posting. This is really only a technique which you can use when you can&#8217;t change the existing code.</p>
<p>Please also be aware, that I don&#8217;t give you any guarantee, that your PHP web applications are secure after you&#8217;ve done what&#8217;s written in this posting.</p>
<p><strong>Skills you need</strong><br />
I tried to write everything as clear as possible but it&#8217;s good if you&#8217;ve got some basic knowledge of the PHP programming language because I won&#8217;t describe my simple code examples.</p>
<p>So let&#8217;s start with the main content <img src='http://www.disenchant.ch/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>The php.ini</strong><br />
First we should talk about the so called php.ini, which will be our interface between the fixes and the already existing source code. The php.ini is the configuration file for PHP and you can see it&#8217;s actual configuration by simply have a look at the file or by creating a PHP script like the following:</p>
<p>&#x3C;&#x3F;&#x70;&#x68;&#x70;<br />
&#x70;&#x68;&#x70;&#x69;&#x6E;&#x66;&#x6F;&#x28;&#x29;&#x3B;<br />
&#x3F;&#x3E;</p>
<p><strong>Get your own php.ini on shared Servers</strong><br />
(If you&#8217;ve got your own dedicated server, this might not be relevant to you)<br />
This subsection now shows you, how you can work with the php.ini even if you&#8217;re application is hosted on a shared server and you don&#8217;t have access to the main php.ini file. As a first step, you have to create a file with the name .htaccess, which means that it&#8217;s a htaccess file. Under Unix like systems this is not a problem at all but under Windows systems you&#8217;ll get an error when you try to rename a file to &#8220;.htaccess&#8221;, so with the following two steps, you can also create such a file under Windows:</p>
<p>1. Open Notepad or any other text editor.<br />
2. Go to Save As, and chose &#8220;.htaccess&#8221; for the file name <strong>including</strong> the quotes.</p>
<p>Now you can upload the file into your wwwroot directory and add the following line to the .htaccess file, when your php.ini file can be found at /home/disenchant/php.ini:</p>
<p><em>suPHP_ConfigPath /home/disenchant</em></p>
<p>Now, the new defined php.ini will be used instead of the one, your web hoster has set up globally.</p>
<p><strong>The auto_prepend_file Option</strong><br />
So let&#8217;s go into the part of the php.ini which is interesting for us, it&#8217;s the auto_prepend_file option. Just add a line to your php.ini like the following, so that it points for example to the PHP file we made before to display the PHP info page or just create a smaller file with just <em>&#x3C;&#x3F;&#x3D;&#x20;&#x22;&#x74;&#x65;&#x73;&#x74;&#x22;&#x20;&#x3F;&#x3E;</em> in it.</p>
<p><em>auto_prepend_file = /abc/xyz.php</em></p>
<p>As you can see, if you now have a look at any of your PHP scripts in your web browser, the auto_prepend_file option in our php.ini has included our script at the beginning of every file. This is exactly what we need because this way, we can interact with the existing code, even if we never changed something in the original source code. So let&#8217;s go on and fix some vulnerable code.</p>
<p><strong>The vulnerable Code</strong><br />
First we need some vulnerable PHP. The following code is vulnerable to an attack type called &#8220;<a href="http://en.wikipedia.org/wiki/Cross-site_scripting">Cross-Site Scripting</a>&#8220;.</p>
<p>&#x3C;&#x3F;&#x70;&#x68;&#x70;<br />
&#x65;&#x63;&#x68;&#x6F;&#x20;&#x24;&#x5F;&#x47;&#x45;&#x54;&#x5B;&#x27;&#x76;&#x61;&#x72;&#x27;&#x5D;&#x3B;<br />
&#x3F;&#x3E;</p>
<p>We have now to implement an input encoding functionality for the variable called <em>var</em> (of course this can also be done for all variables or just some pre-defined variables). Let&#8217;s have a look at how to write a simple patch for this vulnerability.</p>
<p><strong>The Patch</strong><br />
If we can change the original source code, we would probably use something like the following:</p>
<p>&#x3C;&#x3F;&#x70;&#x68;&#x70;<br />
&#x65;&#x63;&#x68;&#x6F;&#x20;&#x68;&#x74;&#x6D;&#x6C;&#x65;&#x6E;&#x74;&#x69;&#x74;&#x69;&#x65;&#x73;&#x28;&#x24;&#x5F;&#x47;&#x45;&#x54;&#x5B;&#x27;&#x76;&#x61;&#x72;&#x27;&#x5D;&#x2C;&#x20;&#x45;&#x4E;&#x54;&#x5F;&#x51;&#x55;&#x4F;&#x54;&#x45;&#x53;&#x29;&#x3B;<br />
&#x3F;&#x3E;</p>
<p>This will replace (all) characters which can be dangerous or better say, can be used for executing malicious script code, with their equivalent HTML entity. This makes this piece of code secure but in our situation, we won&#8217;t be able to change the code and that&#8217;s why we need the technique I described in this posting, over the php.ini. Instead of modifying the existing source code, we create a new file like this:</p>
<p>&#x3C;&#x3F;&#x70;&#x68;&#x70;<br />
&#x24;&#x5F;&#x47;&#x45;&#x54;&#x5B;&#x27;&#x76;&#x61;&#x72;&#x27;&#x5D;&#x20;&#x3D;&#x20;&#x68;&#x74;&#x6D;&#x6C;&#x65;&#x6E;&#x74;&#x69;&#x74;&#x69;&#x65;&#x73;&#x28;&#x24;&#x5F;&#x47;&#x45;&#x54;&#x5B;&#x27;&#x76;&#x61;&#x72;&#x27;&#x5D;&#x2C;&#x20;&#x45;&#x4E;&#x54;&#x5F;&#x51;&#x55;&#x4F;&#x54;&#x45;&#x53;&#x29;&#x3B;<br />
&#x3F;&#x3E;</p>
<p>Because of the auto_prepend_file option we set in our php.ini, this code will fix our vulnerability <img src='http://www.disenchant.ch/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Final words</strong><br />
As you&#8217;ve seen, this technique can become very helpful under some circumstances and of course I showed you just the basic use of it and you can go much further and for example implement login stuff, session management, white listings and so on through this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.disenchant.ch/blog/fix-your-php-code-without-changing-it/98/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Developing Firefox Extensions &#8211; Paper</title>
		<link>http://www.disenchant.ch/blog/developing-firefox-extensions-paper/96</link>
		<comments>http://www.disenchant.ch/blog/developing-firefox-extensions-paper/96#comments</comments>
		<pubDate>Mon, 19 Nov 2007 17:25:24 +0000</pubDate>
		<dc:creator>Disenchant</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://www.disenchant.ch/blog/developing-firefox-extensions-paper/96</guid>
		<description><![CDATA[When I started to study computer science, I thought that it would cost me less time than it does now. Because of this I don&#8217;t have as much research time as expected. I know, that some people are waiting for my announced papers ans so i decided to release my paper called &#8220;Developing Firefox Extensions&#8221;, [...]]]></description>
			<content:encoded><![CDATA[<p>When I started to study computer science, I thought that it would cost me less time than it does now. Because of this I don&#8217;t have as much research time as expected. I know, that some people are waiting for my announced papers ans so i decided to release my paper called &#8220;Developing Firefox Extensions&#8221;, even if it&#8217;s not finished and also not reviewed. The reason for this step is, that I hadn&#8217;t time to modify the document since the 19. August 2007 and I really think that this is too long to not release any part of it.</p>
<p>Because I&#8217;m not sure how much time I&#8217;ve got to work on it during the next month(s) I&#8217;ll offer also the *.tex documents to everyone who would like to do further work on the paper.</p>
<p>To say a few words about the paper itself, it&#8217;s simply a (at the moment) 31 pages long how-to with examples on how to develop your own extensions for Mozilla Firefox and with some additional work, I think it could be also interesting for schools to use it as teaching material.</p>
<p><a href='http://www.disenchant.ch/blog/wp-content/uploads/2007/11/developing_firefox_extensions.pdf' title='Developing Firefox Extensions'><strong>Download</strong></a></p>
<p>I hope some of you enjoy the paper, even if it&#8217;s not finished <img src='http://www.disenchant.ch/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.disenchant.ch/blog/developing-firefox-extensions-paper/96/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
