The usual order
- Network sweep (detecting the systems)
- Network tracing (detecting the relations between the systems)
- Port scan
- OS fingerprinting
- Version scanning
- Vulnerability scanning
Network scan
Detect hosts for a domain (use Seclist):
for ip in $(cat common-subdomains.txt); do host $ip.megacorpone.com; done
Reverse lookup: Find domains for addresses:
for ip in $(seq 155 190); do host 50.7.67.$ip; done | grep -v "not found"
Zonefile enumeration
Grab zonefile from a random target domain:
host -a -l fraunhofer.de ns3.fraunhofer.de
Get authorative DNS servers for a domain:
host -t ns $target_domain
Try now zone transfer with all of these servers.
Tools
- dnsrecon
dnsrecon -d $target_doman -t axfr - dnsenum
dnsenum $target_domain
Port scan
- Scan as root. Nmap won’t use ICMP packets and NO ACK packets if UID != 0.
- Consider to use the ‑sT scan in a more sensitive environment. Because incomplete connections like from stealth scans are unusual, there are a big red flag for red teams / IDS / IPS.
First quick scan:
nmap -sS $target | tee nmap-short.txt nmap -sS -oA nmap-short $target proxychains4 -q nmap -Pn -sT $target | tee nmap-short.txt
Second scan:
nmap -sC -sV $target | tee nmap-standard.txt nmap -sC -sV -oA nmap-standard $target proxychains -q nmap -sC -sV -sT -Pn $target | tee nmap-standard.txt
Third scan for vulnerabilities:
nmap -sV -T5 -F $target --script vuln | tee nmap-vuln.txt nmap -sV -oA nmap-vuln -T5 -F $target --script vuln proxychains -q nmap -sV -T5 -sT -Pn -F $target --script vuln | tee nmap-vuln.txt
Fourth complete TCP scan
nmap -sS -p- $target | tee nmap-tcp-full.txt nmap -sS -oA nmap-tcp-full -p- $target proxychains -q nmap -sT -Pn -p- $target | tee nmap-tcp-full.txt
UDP scan
masscan -e tun0 -p U:1-65535 --rate 2000 $target
Tip: To get a nice list of detected versions, take the port from the first scan and list details only for these ports:
nmap $target -p 22,25,80,110,111,119,2049,4555 -sV --reason
Bonus: Make nmap vulscan if you need more.
Quick nc scan:
nc -nvv -w 1 -z 10.2.2.23 1-65535 # Copy output in file cat TEMPFILE.txt | grep -v "Connection refused"
If it should be faster, try something like
Tools
- Dmitry: Active Information Gathering Tool
- Dnmap: Distributed Port Scanning
- Various OS detection tools
- https://canarytokens.org/nest/
Other ideas
- Bring users from the target network to click a link to a legitimate page (or a page which displays an error, server failiure, …) which collects as many as possible information which are send via the browser (maybe also by invoking a JS which collects more information about the environment).
Leave a Reply
You must be logged in to post a comment.