while working on the PWB online course, I kept running into the need to do HEX and URL encoding/decoding. I asked on the #offsec iRC channel for a tool in BackTrack to do this, and it was suggested to make use of perl. after a while it became a little cumbersome to use perl one-liners, so I created this perl script to help out. figured I'd share it with others
it takes input from the command-line, or from a file. anytime something is ENcoded, the output is placed all on a single line (think file uploads via SQL injection, etc). feel free to leave comments or suggestions
it can be grabbed from here => githubgit clone git://github.com/fnord0/hURL.git
code is too long now to paste here =(
Code:
.::[ hURL - hexadecimal & URL (en/de)coder v2.1 ]::.
USAGE: ./hURL [ -flag|--flag ] [ -f <file1>,<file2> ] [ string ]
COMMAND LINE ARGUMENTS
-M|--menu => Menu-driven GUI ; ./hURL -M
-U|--URL => URL encode ; ./hURL -U "hello world"
-u|--url => uRL decode ; ./hURL -u "hello%20world"
-D|--DURL => Double URL encode ; ./hURL -D "hello world"
-d|--durl => double URL decode ; ./hURL -d "hello%2520world"
-B|--BASE64 => Base64 encode ; ./hURL -B "hello world"
-b|--base64 => base64 decode ; ./hURL -b "aGVsbG8gd29ybGQ="
-H|--HTML => HTML encode ; ./hURL -H "<hello world>"
-h|--html => hTML decode ; ./hURL -h "<hello world>"
-X|--HEX => ascii -> heX ; ./hURL -X "hello world"
-x|--hex => hex -> ascii ; ./hURL -x "68656c6c6f20776f726c64"
--esc :: output in escaped string ; "\x00\x01\x02\x03 ..."
--pair :: output in hexpair format ; 00010203 ...
-I|--INT => Int -> hex ; ./hURL -I "10"
-i|--int => hex -> int ; ./hURL -i "0xa"
-n|--nint => -int -> hex ; ./hURL -n -- -77
-N|--NHEX => -hex -> iNt ; ./hURL -N 0xffffffb3
-T|--INTB => inT -> bin ; ./hURL -T 30
-t|--bint => bin -> int ; ./hURL -t 1010
-F|--FLOATH => Float -> hex ; ./hURL -F 3.33
-l|--hfloat => hex -> float ; ./hURL -l 0x40551ed8
-o|--octh => octal -> hex ; ./hURL -o 35
-O|--HOCT => hex -> Octal ; ./hURL -O 0x12
-0|--binh => bin -> hex ; ./hURL -0 1100011
-1|--hexb => hex -> bin ; ./hURL -1 0x63
-2|--SHA1 => SHA1 checksum ; ./hURL -2 "hello world"
-3|--SHA224 => SHA224 checksum ; ./hURL -3 "hello world"
-4|--SHA256 => SHA256 checksum ; ./hURL -4 "hello world"
-5|--SHA384 => SHA384 checksum ; ./hURL -5 "hello world"
-6|--SHA512 => SHA512 checksum ; ./hURL -6 "hello world"
-7|--ROT13 => ROT13 encode ; ./hURL -7 "hello world"
-8|--rot13 => ROT13 decode ; ./hURL -8 "uryyb jbeyq"
-9|--stack => push string 2 stack (corelan); ./hURL -9 "hello world"
--esc :: output in escaped string ; "\x00\x01\x02\x03 ..."
--pair :: output in hexpair format ; 00010203 ...
--ansiC :: output in C format ; 0x00, 0x01, 0x02, 0x03 ...
-m|--md5 => md5 digest ; ./hURL -m "hello world"
-e|--net => int -> hex (net-byte order) ; ./hURL -e 4444
-E|--NET => hex (nEt-byte order) -> int ; ./hURL -E 5c11
-w|--wbin => hex [file] -> binary [file] ; ./hURL -w -f <INfile> <OUTfile>
-r|--rbin => binary [file] -> hex (corelan); ./hURL -r -f /tmp/msgbox.bin
--esc :: output in escaped string ; "\x00\x01\x02\x03 ..."
--pair :: output in hexpair format ; 00010203 ...
--ansiC :: output in C format ; 0x00, 0x01, 0x02, 0x03 ...
--color|--nocolor => enable/disable colored output [default is ENABLED]
--corelan => display corelan reference
--help => displays help
--man => displays extended help with examples
--version => displays version information
-s => suppress (display result only)
-f|--file <file1>,<file2> => use file(s) as input
[string] => string as input