h8rt3rmin8r

sed-url-encoder.sh

Jan 10th, 2019
149
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/bash
  2. #------------------------------------------------------------------------------#
  3. ##  URL ENCODER - (Built entirely with 'sed' and 'tr' pipelines)
  4. ##  Created by h8rt3rmin8r on 20190110
  5. #------------------------------------------------------------------------------#
  6.  
  7. INPUT="$1"
  8.  
  9. if [[ "x$1" == "x" ]];
  10. then
  11.     echo "ERROR: No input detected!"
  12. fi
  13.  
  14. echo "${INPUT}" \
  15.     | sed 's/%/%25/g' | sed 's/\ /%20/g' | sed 's/</%3C/g' | sed 's/>/%3E/g' \
  16.     | sed 's/#/%23/g' | sed 's/{/%7B/g' | sed 's/}/%7D/g' | sed 's/|/%7C/g' \
  17.     | sed 's/\\/%5C/g' | sed 's/\^/%5E/g' | sed 's/~/%7E/g' | sed 's/\[/%5B/g' \
  18.     | sed 's/\]/%5D/g' | sed 's/`/%60/g' | sed 's/;/%3B/g' | sed 's/\//%2F/g' \
  19.     | sed 's/?/%3F/g' | sed 's/\:/%3A/g' | sed 's/@/%40/g' | sed 's/=/%3D/g' \
  20.     | sed 's/&/%26/g' | sed 's/\$/%24/g' | sed 's/\!/%21/g' | sed 's/\*/%2A/g' \
  21.     | tr '(' '#' | tr ')' '&' | sed 's/#/%28/g' | sed 's/&/%29/g'
  22.    
  23. #------------------------------------------------------------------------------#
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×