-
Notifications
You must be signed in to change notification settings - Fork 2
/
portscan
executable file
·50 lines (42 loc) · 2.45 KB
/
portscan
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
#!/bin/bash
# =========================================================================== #
# MIT License Copyright (c) 2022 Kris Nóva <kris@nivenly.com> #
# #
# +-----------------------------------------+ #
# | ███╗ ██╗ ██████╗ ██╗ ██╗ █████╗ | #
# | ████╗ ██║██╔═████╗██║ ██║██╔══██╗ | #
# | ██╔██╗ ██║██║██╔██║██║ ██║███████║ | #
# | ██║╚██╗██║████╔╝██║╚██╗ ██╔╝██╔══██║ | #
# | ██║ ╚████║╚██████╔╝ ╚████╔╝ ██║ ██║ | #
# | ╚═╝ ╚═══╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ | #
# +-----------------------------------------+ #
# #
# This machine kills fascists. #
# #
# =========================================================================== #
#
if [ -z "$1" ]; then
echo "Usage: portscan <host:dns:ip_addr:cidr>"
exit 1
fi
# Requires "vulscan" to scan for vulnerabilities
#
# pacaur -S vulscan-git
# -O Enables OS detectionA
# -sV Enables version detection
# -sS TCP SYN/Connect()/ACK/Window/Maimon scans
# --script=vulscan Enables vulscan script
DATE=$(date '+%Y-%m-%d')
TARGET=$@ # Pass all arguments for good measure
# Operating System Scan
sudo -E nmap -O $TARGET | tee out/$1-$DATE.nmap.osscan
# Regular Port Scan
sudo -E nmap $TARGET | tee out/$1-$DATE.nmap.ports
# HTTP
sudo -E nmap --script=http-headers $TARGET | tee out/$1-$DATE.nmap.http
# Common Scripts
sudo -E nmap -sC $TARGET | tee out/$1-$DATE.nmap.common
# Vulnerability (CVE) Scan
sudo -E nmap -sV -sS --script=vulscan/vulscan.nse $TARGET | tee out/$1-$DATE.nmap.vuln
# Security Headers
sudo -E nmap --script http-security-headers $TARGET | tee out/$1-$DATE.nmap.security-headers