Scanning and Enumeration

Brief Dump of useful scanning tools and useful scripts. Heavily network focused, web application scanning and testing will be covered in another section

Useful NMAP Commands

nmap -p- -A -T4 -iL <input file> -oA <output file>

# -p- all ports
# all scripts


grep for <text> in <file> | cut on the delimiter "Space" and grab the 2nd field | sort unique + natural sort of (version) numbers within text | put & append into <file>
	
grep '/open/' ./nmap/s_u_live.gnmap | cut -d " " -f2 | sort -uV | tee -a ./nmap/hosts-live.txt
	
grep 'Host'

smb
grep '445/open/tcp//' ./nmap/s_u_live.gnmap | cut -d " " -f2 | sort -uV | tee -a ./nmap/hosts-smb.txt

https
grep '443/open/tcp//' ./nmap/s_u_live.gnmap | cut -d " " -f2 | sort -uV | tee -a ./nmap/hosts-ssl.txt

ssh
grep '22/open/tcp//' ./nmap/s_u_live.gnmap | cut -d " " -f2 | sort -uV | tee -a ./nmap/hosts-ssh.txt

Telnet
grep '23/open/tcp//' ./nmap/s_u_live.gnmap | cut -d " " -f2 | sort -uV | tee -a ./nmap/hosts-telnet.txt
++common ports + vulns


# NMAP
# Just for LDAP Account managers
nmap 10.20.10.4 -p80,443,389,636 -sC -sV -Pn -n

# Turn a file of CIDR IP's into a full IP list
nmap -sL -n -iL internalTargets.txt | grep "Nmap scan report" | awk '{print $NF}'

Vulners is included by default in MOST kali linux distributions. 50/50 on blackarch depending on the build

RustScan

Cause I wanna go fast

Multiple IP Scanning

You can scan multiple IPs using a comma separated list like so:

Host Scanning

RustScan can also scan hosts, like so:

CIDR support

RustScan supports CIDR:

Hosts file as input

The file is a new line separated list of IPs / Hosts to scan:

hosts.txt

The argument is:

Individual Port Scanning

RustScan can scan individual ports, like so:

Multiple selected port scanning

You can input a comma separated list of ports to scan:

Ranges of ports

To scan a range of ports:

To run:

Adjusting the Nmap arguments

RustScan, at the moment, runs Nmap by default.

You can adjust the arguments like so:

To run:

Exploit Research

My go to search for quick wins is searching the reported technology using searchsploit.

Random Commands

These are a bunch of bash one liners I use to organize scanning results and format them into something useful

Cut just the usernames from dehashed api results

Pull passwords from dehashed API results

Cut out the usernames from linkedin dumper results

Cut out valid usernames from kerberos_enumusers

Combine 2 files with only the unique lines

Turn a file of CIDR IP's into a full IP list

Last updated