changeset 42: |
b9e2f76128bb |
parent: |
45f3b1bc3cd7
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Sat, 15 Jun 2024 19:53:29 -0400 |
permissions: |
-rwxr-xr-x |
description: |
sbcl update |
2 #Performs port scan using nmap 6 Utility to scan open ports. Can be used to scan ports for a domain or a list of domains specified in a file. 8 -h, --help Show brief help 9 -d, --domain Domain name or ip to scan 10 -f, --file Spefify a file containing domains/IPs to scan 16 echo "Scanning ports for $1...." 17 nmap
-sT
-T4
$domain | sed
'/^\(Nmap scan\|PORT\|[0-9]\)/!d' | tee
-a
$port_scan_result_file 20 create_port_scan_result_file
() { 21 port_scan_result_file="/tmp/port-scan-`date "+%Y-%m-%d-%H:%M:%S
"`.txt" 22 touch
$port_scan_result_file 25 while getopts "f:d:" opt
; do 29 *
) print_usage
; exit 1 ;; 33 if [ !
-n
"$domain" ] && [ !
-f
"$file" ]; then 34 echo "Option -d $domain or -f $file missing or designates to wrong entry" >
&2 40 if [ -n
"$domain" ]; then 41 create_port_scan_result_file
43 echo "Scan result:$port_scan_result_file" 46 if [ -n
"$file" ]; then 47 create_port_scan_result_file
48 for domain
in $(cat
$file) 52 echo "Scan result: $port_scan_result_file"