unzip_bruteforce process prallelized

This commit is contained in:
Your Name
2026-04-02 18:37:39 +02:00
parent 6640624020
commit 260db0dff7
+14 -9
View File
@@ -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
' _ {}