Created
February 24, 2021 19:47
-
-
Save tanaka-geek/7d374ff976884f3c1e2aa9431fe7fb1e to your computer and use it in GitHub Desktop.
This is for 32bits based offset detection with msf-pattern_offset -q ""
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -eq 0 ] | |
then | |
echo "No arguments supplied" | |
exit 1 | |
fi | |
w=$1 | |
if [ ${#w} != '8' ]; then | |
echo "it must be 8 bytes length like 0001020304" | |
exit 1 | |
fi | |
conv=$(printf "$1" | xxd -r -p) | |
f=${conv: 0:2} | |
s=${conv: 2:4} | |
k1=$(echo -n $f | rev) | |
k2=$(echo -n $s | rev) | |
word=$(printf "$k2$k1") | |
msf-pattern_offset -q "$word" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment