Created
March 24, 2021 10:27
-
-
Save NSEcho/93765916a0b5fc2976f6f82d26e79593 to your computer and use it in GitHub Desktop.
Automate external scanning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "You need to provide range file" | |
echo "./scan.sh <FILENAME>" | |
exit 1 | |
fi | |
GREEN='\033[0;32m' | |
END='\033[0m' | |
message() { | |
echo -e "${GREEN}[*] $1 ${END}" | |
} | |
array=( "$@" ) | |
FILENAME="${array[0]}" | |
message "Starting the fast tcp scan" | |
nmap -n -v -Pn -sT -iL "${FILENAME}" --max-retries 2 -T4 -oA nmap_tcp_common_scan_default | |
message "Starting the fast udp scan" | |
nmap -n -v -Pn -sU -iL "${FILENAME}" --max-retries 2 -T4 -oA nmap_udp_common_scan_default | |
message "Starting the all tcp port scans" | |
nmap -n -v -Pn -sT -p 1-65535 -iL "${FILENAME}" --max-retries 2 -T4 -oA nmap_tcp_full_scan_default | |
message "Starting the all udp scans" | |
nmap -n -v -Pn -sU -p 1-65535 -iL "${FILENAME}" --max-retries 2 -T4 -oA nmap_udp_full_scan_default | |
message "Starting ssl-enum-cipher script" | |
nmap -n -v -Pn --script=+ssl-enum-ciphers -iL "${FILENAME}" --max-retries 2 -T4 -oA nmap_ssl_enum_ciphers_default | |
message "Starting ssl-dh-params script" | |
nmap -n -v -Pn --script=+ssl-dh-params -iL "${FILENAME}" --max-retries 2 -T4 -oA nmap_ssl_nmap_dh_params_default | |
message "Starting the ssl-cert script" | |
nmap -n -v -Pn --script=+ssl-cert -iL "${FILENAME}" --max-retries 2 -T4 -oA nmap_ssl_cert_default | |
message "Starting the sshv1 script" | |
nmap -n -v -Pn --script=+ssl-cert -iL "${FILENAME}" --max-retries 2 -T4 -oA nmap_ssl_cert_default | |
message "Starting the sslv2 script" | |
nmap -n -v -Pn --script=+sslv2 -iL "${FILENAME}" --max-retries 2 -T4 -oA nmap_sslv2_default | |
message "Starting the smb-protocols script" | |
nmap -n -v -Pn -p 139,445 --script=+smb-protocols -iL "${FILENAME}" --max-retries 2 -T4 -oA nmap_smb_protocols_default | |
message "Starting the smb-security-mode" | |
nmap -n -v -Pn -p 139,445 --script=+smb-security-mode -iL "${FILENAME}" --max-retries 2 -T4 -oA nmap_smb_security_mode_default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment