-
Notifications
You must be signed in to change notification settings - Fork 0
/
mapper.sh
executable file
·61 lines (53 loc) · 1.15 KB
/
mapper.sh
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! /bin/bash
lport="8000"
sport="7000"
print_help(){
echo "Usage: ./mapper.sh [opt]"
echo "[opt]:"
echo -e "\t--db\n\t Fuzz Dropbear\n"
echo -e "\t--ssh\n\t Fuzz OpenSSH\n"
echo -e "\t-p --protocol [Dropbear | OpenSSH]\n\t Alternate way to define protocol\n"
echo -e "\t-l <num>\n\t port to learner\n"
echo -e "\t-s <num>\n\t port to server\n"
echo -e "\t-f --fuzz [client | server]\n\t Fuzz the client or the server\n"
exit
}
if [[ $# < 1 ]]; then
print_help
fi
while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do case $1 in
-h | --help )
print_help
;;
-p | --protocol )
shift; mapper=$1
;;
--db )
mapper="Dropbear"
;;
--ssh )
mapper="OpenSSH"
;;
-l )
shift; lport=$1
;;
-s )
shift; sport=$1
;;
-f | --fuzz )
shift; sut="-f $1"
;;
--client )
sut="-f client"
;;
--server )
sut="-f server"
;;
esac; shift; done
if [[ "$1" == '--' ]]; then shift; fi
if [[ -z "$mapper" ]]; then
echo -e "==> ERROR: '$mapper' is not a valid protocol"
print_help
fi
cd ssh-mapper/
python3 mapper/mapper.py -l localhost:$lport -s localhost:$sport -c $mapper $sut