项目作者: sathishshan

项目描述 :
Hex-escaper is used to escape the Hex code and vise-versa and also Encode Decode text into Hex and vise-versa
高级语言: Shell
项目地址: git://github.com/sathishshan/Hex-escaper.git
创建时间: 2019-08-26T02:39:21Z
项目社区:https://github.com/sathishshan/Hex-escaper

开源协议:

下载


Hex-escaper

Hex-escaper is used to escape the Hex code and vise-versa and also Encode Decode text into Hex and vise-versa. In PCRE Regex we have broke the hex code into pair of pieces and escape them with \x (Legacy escape-sequence for hex) to match the pattern. It is very useful & comes to handy once you debugging hex code for Regex (PCRE)

  1. Need two arguments to run the script.
  2. Please use the hex value in double quotes! :D
  3. USAGE:
  4. ./hexescaper Option Hex
  5. EXAMPLE:
  6. ./hexescaper -e "735f796172612d72756c65736574"
  7. OPTIONS:
  8. -e Escape_hex
  9. -r Reverse_hex_escape
  10. -d Double_escape - (escape the escape)
  11. -dr Reversed_double_escape
  12. -we White_escape
  13. -wre White_reverse_escape
  14. -w Just_white space b/w hex
  15. -E Encode_hex - (Convert)
  16. -D Reverse_hex - (Decode)
  1. shan@exploit:~$ ./hexescaper.sh -e "68657865736361706572"
  2. Hex value escaped!
  3. \x68\x65\x78\x65\x73\x63\x61\x70\x65\x72
  4. shan@exploit:~$ ./hexescaper.sh -r "\x68\x65\x78\x65\x73\x63\x61\x70\x65\x72"
  5. Hex value reversed the escape!
  6. 68657865736361706572
  1. shan@exploit:~$ ./hexescaper -d "\x68\x65\x78\x65\x73\x63\x61\x70\x65\x72"
  2. Hex value escape the escaped!
  3. \\x68\\x65\\x78\\x65\\x73\\x63\\x61\\x70\\x65\\x72
  4. shan@exploit:~$ ./hexescaper -dr "\\x68\\x65\\x78\\x65\\x73\\x63\\x61\\x70\\x65\\x72"
  5. Hex value reversed the double escape!
  6. \x68\x65\x78\x65\x73\x63\x61\x70\x65\x72
  1. shan@exploit:~$ ./hexescaper.sh -we "68 65 78 65 73 63 61 70 65 72"
  2. Hex value with whitespace is escaped!
  3. \x68\x65\x78\x65\x73\x63\x61\x70\x65\x72
  4. shan@exploit:~$ ./hexescaper.sh -wre "\x68\x65\x78\x65\x73\x63\x61\x70\x65\x72"
  5. Hex value reversed with whitespace!
  6. 68 65 78 65 73 63 61 70 65 72
  1. shan@exploit:~$ ./hexescaper.sh -E "hexescaper"
  2. Converted the text to hex!
  3. 68657865736361706572
  4. shan@exploit:~$ ./hexescaper.sh -D "68657865736361706572"
  5. Reversed the hex to text!
  6. hexescaper

Caution:

The hex values not have been validated it is hex or not, so if you give correct input it will give you the correct output!