25 lines
409 B
Bash
Executable File
25 lines
409 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -uo pipefail # drop -e
|
|
|
|
LIST=${1:-list}
|
|
FILE=${2:-}
|
|
|
|
[[ -z "$FILE" ]] && { echo "usage: $0 [wordlist] <zipfile>"; exit 1; }
|
|
|
|
i=0
|
|
|
|
while IFS= read -r line; do
|
|
((i++))
|
|
(( i % 1000 == 0 )) && echo "$i tried..."
|
|
|
|
unzip -P "$line" -t "$FILE" >/dev/null 2>&1
|
|
if [[ $? -eq 0 ]]; then
|
|
echo "FOUND: $line"
|
|
exit 0
|
|
fi
|
|
done < "$LIST"
|
|
|
|
echo "not found"
|
|
exit 1
|