Files
svr/usr/bin/unzip_bruteforce
T
2026-04-02 18:37:39 +02:00

28 lines
484 B
Bash
Executable File

#!/usr/bin/bash
if [ "$#" -lt 1 ] || [ "$#" -gt 3 ]; then
echo "Usage: $0 list file.zip"
exit 1
fi
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..."
if unzip -P "$line" -t "$FILE" >/dev/null 2>&1; then
echo "FOUND: $line"
killall xargs 2>/dev/null
fi
' _ {}