-
Notifications
You must be signed in to change notification settings - Fork 9
/
olger
executable file
·134 lines (102 loc) · 3.49 KB
/
olger
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/sh
set -e
PROGNAME=$(basename $0)
die() {
echo "$PROGNAME: $*" >&2
exit 1
}
usage() {
if [ "$*" != "" ] ; then
echo "Error: $*"
fi
cat << EOF
Usage: $PROGNAME [OPTION ...] [foo] [bar]
Olger a Red Team tool with ansible playbooks to repair things , D3.js Graph visualization, metasploit and shodan
Options:
-h, --help display this usage message and exit
-n, --genfromnmap [RANGE] [MISSION] delete things
-f, --genfromfile [FILE] generate a graph from nmap xml file
-s, --genfromshodan [QUERY] write output to file
-m, --msfconsole [EXPLOIT_CHECK] [PAYLOAD] [CMD] [LIST] execute msf command for each input in the list
-r, --report [MISSION] write output to file in pdf and dot format
-q, --query [DIR] [QUERY] make querys over raw json or csv data (not ready)
-p, --hapgen [DATAFILE] Generate haproxy configuration
-a, --ansible [INVENTORY] [PLAYBOOK] [OPTIONS] Execute ansible playbooks
-al, --ansible-list Generate playbooks list
EOF
exit 1
}
foo=""
bar=""
delete=0
output="-"
while [ $# -gt 0 ] ; do
case "$1" in
-h|--help)
usage
;;
-n|--genfromnmap)
#scan with nmap an save the results
nmap -v -sV -A $2 -oX data/nmap$3.xml
#convert the results to json
python3 ./bin/converter.py data/nmap$3.xml data/nmap$3.xml.json
#process the data to a json d3 graph
python scripts/olger_lib.py data/nmap$3.xml.json $3 > reports/report$3.txt
#execute the web visualizer server
cd web
python3 -m http.server
;;
-f|--genfromfile)
#convert the results to json
python3 ./bin/converter.py $2 data/nmap$3.xml.json
#process the data to a json d3 graph
python scripts/olger_lib.py data/nmap$3.xml.json $3 > reports/report$3.txt
#execute the web visualizer server
cd web
python3 -m http.server
;;
-r|--report)
#convert graph to a pdf and dot files
node scripts/graphpdf.js $1 | dot -Tpdf > ./reports/$2/report$2.pdf
node scripts/graphpdf.js $1 > ./data.dot && xdot ./reports/$2/data$2.dot
;;
-m|--msfconsole)
#aply metasploit execution to each argument in the list
python3 scripts/olger_msfconsole.py $2 $3 $4 $5
;;
-s|--genfromshodan)
#generate shodan graph and files, you can use this files to launch masive security checks over infrastructures, the shodan list in csv format will be saved in lists forlder
node scripts/shodan.js $2
echo "you can find the output in lists/$2 launch "
;;
-p|--hapgen)
#generate ha proxy configuration, take a look scripts/gen_ha_proxy.py scripts for more details
python scripts/gen_ha_proxy.py $2
echo "configuration file generated in data/haproxy.conf"
;;
-a|--ansible)
#execute ansible playbooks
ansible-playbook -i data/$2 playbooks/$3
;;
-l|--ansible-list)
#list ansible playbooks
ls -lsa $2
;;
-*)
usage "Unknown option '$1'"
;;
*)
if [ -z "$foo" ] ; then
foo="$1"
elif [ -z "$bar" ] ; then
bar="$1"
else
usage "Too many arguments"
fi
;;
esac
shift
done
if [ -z "$bar" ] ; then
usage "Not enough arguments"
fi