Category: Scripting

1)Copy the following code(from <html> to </html> including the two of them as well) as it is and paste it in your notepad….

2)Save it with the name  Game.html

NOTE: Save  it with a     “.html”  and NOT  “.txt:

CODE :starts from the next line


<h2>Try to put all the pieces in alphabetical order, ‘A’ through ‘O’. Awesome!</h2>

<form name=pad>
<table border=2 cellpadding=2 cellspacing=2>
<td colspan=4 align=center>Shift It 4×4 Game</td>


<!– Original: Rohan –>
<!– Web Site: http://Technebula –>

<!– Begin
bx=3; by=3;
for (y=0;y<4;y++)

for (x=0;x<4;x++)
document.write(‘<td><tt><input type=button value=” ” ‘);

function move(x,y)

if (((ax*ay)==0)&&((ax+ay)==1)) {
f.elements[4*y+x].value=” “;
bx=x; by=y; f.msg.value++;
function rndize() {
for (i=0;i<16;i++)
while (document.pad.elements[4*y+x].value!=” “)
// End –>

<td colspan=4><input type=text size=20 name=msg></td>
<a href=””><h2>Play more games online</h2>

Those of us who do a lot of work in the security world have come to realize that there is a ton of cross site scripting (XSS) out there. 80% of dynamic sites (or more) suffer from it. But how many sites allow you to do HTML file uploads comparatively? It’s a much smaller amount, and typically requires some sort of login before you’re allowed to do it. Often times it’s protected by login too, so it’s a relatively small amount of people who could be impacted by any sort of HTML file upload. But that is precisely what’s needed to mount a clickjacking attack (usually one or two pages). Either the attacker has to rent space in the cloud with a stolen credit card, or find some parasitic hosting somewhere.

That’s when I got to thinking… how can you use any old generic reflected XSS attack to mount a clickjacking attack? A few hours later I had a prototype that worked. Here’s how the attack would work. Let’s say a parameter like “search” was vulnerable to reflected XSS. An attacker could do something like:<script>eval(location.hash.slice(1))</script>

This is an old trick that basically says anything that falls into the anchor tag is what the attacker wants to run as the attack. Anchor tags are not sent to the server, they are only seen on the client. So this effectively turns the reflected XSS into a DOM based XSS, which leaves less of a signature on the server as well, incidentally. Then the attacker’s anchor payload would look something like this (this works only in Firefox):<script>eval(location.hash.slice(1))</script>#a=document.body.appendChild(document.createElement(“iframe”));a.d=a.contentDocument;;i=a.d.createElement(“iframe”);;;;”absolute”;”hidden”;;;;;;i.src=”;;a.d.body.appendChild(i);function followmouse(e){xcoord=ycoord=40;xcoord+=e.pageX-50;ycoord+=e.pageY-50;;;}document.onmousemove=followmouse;

So you have a reflected XSS on that instantiates a DOM based XSS which instantiates a clickjacking attack against Obviously you’d need to modify this to actually fit the right coordinates and work in other browsers, but this could easily be used to leverage the attack in situations where an attacker might not be able to otherwise. For instance, if the clickjacking defenses only care about the referrer and the referrer is on the correct domain just a different sub-domain, that could be used to bypass it – and so on. Anyway, I thought some people might think this is interesting. Happy penetration testing!