diff --git a/customscripts/find_bytes b/customscripts/find_bytes index 80be015..ff13928 100644 --- a/customscripts/find_bytes +++ b/customscripts/find_bytes @@ -1,15 +1,12 @@ #!/bin/bash if [ -z "$1" -o -z "$2" ]; then - echo -e "usage:\n\tbash find_bytes.sh \n\t\tex. bash find_bytes.sh /path/to/dir \"\\\x20\\\x20\"" + echo -e "usage:\n\tfind_bytes \n\t\tex. find_bytes '[\x{20}]' /path/to/dir" exit +else + # ugrep + # -W hexdump binary matches, while keeping text matches as text + # -z decompress files if need be to scan them + # -R recursive + # ug -W -z -R + ug -W -z -R $1 "$2" fi - -# took a fuckton of experimentation to figure out da escapes lmfao -double_bytes="$2" # rename it -path=$1 # rename it - -# format ddmmyyyy-HHMM-SS -log="./recursive-binwalk-$(date +"%d%m%Y-%H%M-%S").txt" # make da log name - -# watch your escapes here. some needs escape, redundant escape, or no escape -find "$path" -type f -exec /bin/bash -c "cmd=\"binwalk --log=$log --raw=$double_bytes {}\"; echo -e \"\n\n==\nfile: {}\nlog: $log\ncommand: \$(printf \\\"%q\\\" \$cmd)\" | tee -a $log; exec \$cmd" \;