catssh
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
if [ "$#" -lt 1 ] || [ "$#" -gt 3 ]; then
|
||||
echo "Usage: $0 arg1 [arg2] [arg3]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# interactive session check
|
||||
if [ -t 0 ]; then
|
||||
echo -n "Delete existing output files? [y/N]: "
|
||||
read ans
|
||||
case "$ans" in
|
||||
y|Y) rm -f *.school ;;
|
||||
*) echo "Aborted"; exit 0 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# process input file
|
||||
while IFS= read -r line; do
|
||||
new_f="${line%.*}.school"
|
||||
f > "$new_f"
|
||||
done < "$FILE"
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,28 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
set -uo pipefail # drop -e
|
||||
|
||||
LIST=${1:-list}
|
||||
FILE=${2:-}
|
||||
|
||||
usage() {
|
||||
echo "usage: $0 [wordlist] <zipfile>"
|
||||
echo "default wordlist: ./list"
|
||||
exit 1
|
||||
}
|
||||
|
||||
[[ -z "$FILE" ]] && usage
|
||||
[[ ! -f "$LIST" ]] && { echo "missing wordlist: $LIST"; exit 1; }
|
||||
[[ ! -f "$FILE" ]] && { echo "missing zip: $FILE"; exit 1; }
|
||||
[[ -z "$FILE" ]] && { echo "usage: $0 [wordlist] <zipfile>"; exit 1; }
|
||||
|
||||
i=0
|
||||
|
||||
while IFS= read -r line; do
|
||||
((i++))
|
||||
|
||||
(( i % 1000 == 0 )) && echo "$i tried..."
|
||||
|
||||
if unzip -P "$line" -t "$FILE" >/dev/null 2>&1; then
|
||||
unzip -P "$line" -t "$FILE" >/dev/null 2>&1
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo "FOUND: $line"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user