#!/bin/bash
# Usage: ./script-name <ASCII FILE> | tr -d '\n' > <ENCODED FILE>
# Take a file as the input
testInput=$1
function encode {
case ${1} in
"") echo "%20" ;; "!") echo "%21" ;; "\"") echo "%22" ;;
"#") echo "%23" ;; "$") echo "%24" ;; "&") echo "%26" ;;
"%") echo "%25" ;; "'") echo "%27" ;; "(") echo "%28" ;;
")") echo "%29" ;; '*') echo '%2a' ;; '+') echo '%2b' ;;
',') echo '%2c' ;; '-') echo '%2d' ;; '.') echo '%2e' ;;
"/") echo '%2f' ;; '0') echo '%30' ;; '1') echo '%31' ;;
'2') echo '%32' ;; '3') echo '%33' ;; '4') echo '%34' ;;
'5') echo '%35' ;; '6') echo '%36' ;; '7') echo '%37' ;;
'8') echo '%38' ;; '9') echo '%39' ;; ':') echo '%3a' ;;
';') echo '%3b' ;; '<') echo '%3c' ;; '=') echo '%3d' ;;
'>') echo '%3e' ;; '?') echo '%3f' ;; '@') echo '%40' ;;
'A') echo '%41' ;; 'B') echo '%42' ;; 'C') echo '%43' ;;
'D') echo '%44' ;; 'E') echo '%45' ;; 'F') echo '%46' ;;
'G') echo '%47' ;; 'H') echo '%48' ;; 'I') echo '%49' ;;
'J') echo '%4a' ;; 'K') echo '%4b' ;; 'L') echo '%4c' ;;
'M') echo '%4d' ;; 'N') echo '%4e' ;; 'O') echo '%4f' ;;
'P') echo '%50' ;; 'Q') echo '%51' ;; 'R') echo '%52' ;;
'S') echo '%53' ;; 'T') echo '%54' ;; 'U') echo '%55' ;;
'V') echo '%56' ;; 'W') echo '%57' ;; 'X') echo '%58' ;;
'Y') echo '%59' ;; 'Z') echo '%5a' ;; '[') echo '%5b' ;;
'\\') echo '%5c' ;; ']') echo '%5d' ;; '^') echo '%5e' ;;
'_') echo '%5f' ;; '`') echo '%60' ;; 'a') echo '%61' ;;
'b') echo '%62' ;; 'c') echo '%63' ;; 'd') echo '%64' ;;
'e') echo '%65' ;; 'f') echo '%66' ;; 'g') echo '%67' ;;
'h') echo '%68' ;; 'i') echo '%69' ;; 'j') echo '%6a' ;;
'k') echo '%6b' ;; 'l') echo '%6c' ;; 'm') echo '%6d' ;;
'n') echo '%6e' ;; 'o') echo '%6f' ;; 'p') echo '%70' ;;
'q') echo '%71' ;; 'r') echo '%72' ;; 's') echo '%73' ;;
't') echo '%74' ;; 'u') echo '%75' ;; 'v') echo '%76' ;;
'w') echo '%77' ;; 'x') echo '%78' ;; 'y') echo '%79' ;;
'z') echo '%7a' ;; '{') echo '%7b' ;; '|') echo '%7c' ;;
'}') echo '%7d' ;; '~') echo '%7e' ;;
*) echo $1 ;;
esac
}
while read line
do
for (( c=0; c<${#line}; c++ ))
do
encode ${line:$c:1}
done
echo "%0a"
done < $testInput
echo "\n"
Twitter: @lokut
This blog is for educational purposes only. The opinions expressed in this blog are my own and do not reflect the views of my employers.
Subscribe to:
Post Comments (Atom)
Test Authentication from Linux Console using python3 pexpect
Working with the IT420 lab, you will discover that we need to discover a vulnerable user account. The following python3 script uses the pex...
-
Here is a quick walk through of GetBoo. The first item that I found was you can harvest the usernames of the existing users that are regist...
-
As I was glancing through the logs of my honeypots I spent some time to look at the following logs. In the past I have just overlooked them...
-
I thought I would work through a few of these web applications provided by OWASP on their broken web applications VM. The first one I th...
-
Today looking at the logs of the honeypots, I became curious based on the whois of the IP Addresses attempting to login to SSH which country...
-
Recently I was doing some scanning with a tool that is available on github called masscan. The tool allows you to configure a configuration...
No comments:
Post a Comment