2tap.com

Percent encoding (aka URL encoding) all characters

Occasionally I get the urge to perform a bit of (disclaimer: amusing and non-malicious!) cross-site scripting (XSS) against the odd site I find which is just begging to be abused. Here’s a tool to percent-encode all characters in a URL parameter.

URL/Percent-encoding is used to escape reserved characters in a URL when passing parameters around. For example, a GET parameter with an ampersand in it must be escaped since the browser would treat this character as starting the next variable.

The standard URL encoders take an input and replace all reserved characters with their percent-encoded equivalents. I couldn’t find an online tool to enocde all characters so I knocked up a quick bit of JavaScript to do the job.

Why would I want to do this? When playing around with XSS it’s nicer to hide the full payload in the URL rather than giving away hints as to what’s going to happen with all the unreserved characters still human readable.

So here it is: a JavaScript Percent-Encoder.

Categories: Stupid Boy Projects, JavaScript

Canvas Reaction » « Throttling uploads on Linux

2 Comments

  1. This is a good online url-encoder – it is also able encode all characters into percent encoding:
    http://quick-encoder.com/url

  2. Hi, thanks! Exactly what I was looking for 😉

Leave a Reply

Your email address will not be published.

*

Copyright © 2020 2tap.com

Theme by Anders NorenUp ↑