-
Notifications
You must be signed in to change notification settings - Fork 34
/
enum.sh
84 lines (64 loc) · 2.04 KB
/
enum.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
#
# Author: Gary Hooks
# GitHub: http://www.github.com/garyhooks
# Designed for the OSCP to automate some of the initial enumeration tasks
#
# Usage: sh ./enum.sh <IP>
# nmap
# nikto
# dirb
# Declare the constants here
ROOT="/root/hacking/"
DIRECTORY=$ROOT$1
if [ $# -eq 0 ]; then
echo "You need to specify an IP, for example: enum.sh 10.0.0.10"
exit 1
else
IP=$1
fi
mkDirectories() {
if [ ! -d "$ROOT" ]; then
mkdir $ROOT
fi
if [ ! -d "$DIRECTORY" ]; then
mkdir $DIRECTORY
fi
}
do_dns() {
echo "------------------------------------------------------------------------------"
echo " DNS "
echo "------------------------------------------------------------------------------"
echo "\n"
}
do_nmap() {
echo "------------------------------------------------------------------------------"
echo " Starting: nmap -A -sT -p- -oN $DIRECTORY/nmap_sT_allports.nmap $IP"
echo "------------------------------------------------------------------------------"
echo "\n"
nmap -A -sT -p- -oN $DIRECTORY"/nmap_sT_allports.nmap" IP
echo "------------------------------------------------------------------------------"
echo " Starting: nmap -A -sU -p- -oN $DIRECTORY/nmap_sU_allports.nmap $IP"
echo "------------------------------------------------------------------------------"
echo "\n"
nmap -A -sU -p- -oN $DIRECTORY"/nmap_sU_allports.nmap" IP
}
do_nikto() {
echo "------------------------------------------------------------------------------"
echo " Starting: nikto -host IP -port 80 >> $DIRECTORY/nikto.txt"
echo "------------------------------------------------------------------------------"
echo "\n"
nikto -host IP -port 80 >> $DIRECTORY"/nikto.txt"
}
do_dirb() {
echo "------------------------------------------------------------------------------"
echo " Starting: dirb http://$IP ./dirb_big.txt >> $DIRECTORY/dirb.txt"
echo "------------------------------------------------------------------------------"
echo "\n"
dirb http://$IP ./dirb_big.txt >> $DIRECTORY"/dirb.txt"
}
mkDirectories
do_dns
do_nmap
do_nikto
do_dirb