-
-
Notifications
You must be signed in to change notification settings - Fork 784
Expand file tree
/
Copy pathtestnc.sh
More file actions
executable file
·42 lines (34 loc) · 601 Bytes
/
Copy pathtestnc.sh
File metadata and controls
executable file
·42 lines (34 loc) · 601 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
function usage() {
echo "Usage: "$0" <ip> <port> <wordlist> [<prefix>] [<suffix>]"
if [ -n "$1" ] ; then
echo "Error: "$1"!"
fi
exit
}
if [ $# -lt 3 ] || [ $# -gt 5 ] ; then
usage
fi
ip=$1
port=$2
wordlist=$3
if ! [ -f $wordlist ] ; then
usage "wordlist file not found"
fi
if [ $# -ge 4 ] ; then
prefix=$4
else
prefix=""
fi
if [ $# -eq 5 ] ; then
suffix=$5
else
suffix=""
fi
for w in $(cat $wordlist) ; do
input=$prefix$w$suffix
input=`echo $input | tr '[:lower:]' '[:upper:]'`
echo $input
echo $input | nc -nv $ip $port
done
exit;