Skip to content

Instantly share code, notes, and snippets.

@dumpofmemory
Created March 12, 2020 23:05
Show Gist options
  • Save dumpofmemory/09824b8684696386f415701d2bd4eea3 to your computer and use it in GitHub Desktop.
Save dumpofmemory/09824b8684696386f415701d2bd4eea3 to your computer and use it in GitHub Desktop.
a bash script decode and clean decoded hexstring
echo "\n=-=-=-=-=-=-=-=-=-=-=-= Input hexstring -=-=-=-=-=-=-=-=-=-=\n"
read input
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-= DECODED -=-=-=-=-=-=-=-=-=-=-=-=\n"
decode() {
echo $1 | xxd -r -p
}
OUTPUT="$(decode $input)"
CLEAN=${OUTPUT//[^a-zA-Z0-9_]/.}
echo $CLEAN
echo "\n\n=-=-=-=-=-=-=-=-=-=-=-=-= FINISHED EXECUTION \n"
exit
;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment