-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenum.sh
More file actions
executable file
·49 lines (40 loc) · 1.45 KB
/
enum.sh
File metadata and controls
executable file
·49 lines (40 loc) · 1.45 KB
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
#!/bin/bash
echo "Enter Target(s):"
read target
echo "Enter timing (1-5, with 5 being the fastest and most aggressive):"
read timing
echo "Enter scan type (T for TCP, U for UDP, or S for a stealth scan):"
read scan_type
echo "Enter output type (N for normal, X for XML, G for grepable, J for JSON, A for all formats, or none):"
read output_type
echo "Enter verbosity (0 for normal, 1 for verbose, 2 for very verbose, and so on...):"
read verbosity
scan_type=$(echo $scan_type | tr '[:lower:]' '[:upper:]')
output_type=$(echo $output_type | tr '[:lower:]' '[:upper:]')
if [ "$scan_type" == "T" ]; then
scan_option="-sT"
elif [ "$scan_type" == "U" ]; then
scan_option="-sU"
elif [ "$scan_type" == "S" ]; then
scan_option="-sS"
else
echo "Invalid scan type. Please enter T, U, or S."
exit 1
fi
scan_option="$scan_option -T$timing -sV"
if [ "$output_type" == "A" ]; then
nmap $scan_option -v$verbosity -oN normal_output -oX xml_output -oG grepable_output -oJ json_output $target
elif [ "$output_type" == "N" ]; then
nmap $scan_option -v$verbosity -oN $target
elif [ "$output_type" == "X" ]; then
nmap $scan_option -v$verbosity -oX $target
elif [ "$output_type" == "G" ]; then
nmap $scan_option -v$verbosity -oG $target
elif [ "$output_type" == "J" ]; then
nmap $scan_option -v$verbosity -oJ $target
elif [ "$output_type" == "NONE" ]; then
nmap $scan_option -v$verbosity $target
else
echo "Invalid output type. Please enter N, X, G, J, A, or none."
exit 1
fi