diff --git a/usr/bin/unzip_bruteforce b/usr/bin/unzip_bruteforce index 23f96fe..050c09c 100755 --- a/usr/bin/unzip_bruteforce +++ b/usr/bin/unzip_bruteforce @@ -7,16 +7,21 @@ fi LIST=$1 FILE=$2 -LIST=$1 -FILE=$2 +COUNT=$(mktemp) +echo 0 > "$COUNT" +export FILE COUNT + +xargs -a "$LIST" -P4 -I{} bash -c ' + line="$1" + + # atomic-ish counter + n=$(($(<"$COUNT")+1)) + echo "$n" > "$COUNT" + + ((n % 1000 == 0)) && echo "$n tries..." -while IFS= read -r line; do - #echo "try: $line" if unzip -P "$line" -t "$FILE" >/dev/null 2>&1; then echo "FOUND: $line" - break + killall xargs 2>/dev/null fi -done < "$LIST" - -exit 0 - +' _ {}