nmap -T4 -F ip
nmap -sV -T4 -O -F -A --version-light ip
Scan all port
nmap -p- -T4 -v ip
Scan With Script & Version
nmap -A -T4 -sC -sV ip
Scan All Local
nmap 192.168.1.1/24 -sn -T4 ip
Scan with scripts
nmap -sC ip
nmap --script "default,discovery,exploit,version,vuln" ip
nmap --script "default,discovery,exploit,version,vuln,servicetags,ntp-monlist,dns-recursion,snmp-sysdescr" ip
Scan udp
sudo nmap -sU -T4 ip
sudo nmap -sUV -T4 -F --version-intensity 0 ip
sudo nmap -sU -A -PN -n -pU:19,53,123,161 -script=ntp-monlist,dns-recursion,snmp-sysdescr ip
sudo nmap -sU -pU:19,53,123,161 -Pn -n --max-retries=0 ip
Domain Name System (DNS) is the hierarchical and distributed naming system used to identify computers reachable through the Internet. These are most commonly used to map human-friendly domain names to the numerical IP addresses computers need to locate services.
Any Information
dig ANY @dns_ip domain
Information
dig TXT @dns_ip domain
Tranfert Zone
dig axfr @dns_ip domain
Reverse Lookup
dig -x ip @dns_ip
Reverse All Address
dnsrecon -r 127.0.0.0/24 -n ip_dns
SNMP
Port: 161 / 162
SNMP is used to monitor the network, detect network faults, and sometimes even used to configure remote devices.
List devices
snmp-check ip
RPCBind
The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. - redhat
A Network File System (NFS) allows remote hosts to mount file systems over a network and interact with those file systems as though they are mounted locally. - redhat
sudo tcpdump -i any -c <MAX_PACKETS> host 192.168.1.1 '&&' port 80 '&&' src 1.1.1.1
Print HTTP content
sudo tcpdump -i any -c10 -nn -A port 80
Save
sudo tcpdump -i any -w file.pcap
Python
from scapy.all import *
scapy_cap = rdpcap('file.pcap')
i = 0
for packet in scapy_cap:
if type(packet[TCP].payload) == scapy.packet.Raw:
try:
print(i, ':', packet[TCP].payload.load.decode())
except:
print(i, ':', packet[TCP].payload.load)
i += 1