ping-c1199.66.11.4# 1 echo request to a hostfping-g199.66.11.0/24# Send echo requests to rangesnmap-PE-PM-PP-sn-n199.66.11.0/24#Send echo, timestamp requests and subnet mask requests
#Using masscan to scan top20ports of nmap in a /24 range (less than 5min)masscan-p20,21-23,25,53,80,110,111,135,139,143,443,445,993,995,1723,3306,3389,5900,8080199.66.11.0/24
nmap-sU-sV--version-intensity0-F-n199.66.11.53/24# The -sV will make nmap test each possible known UDP service packet# The "--version-intensity 0" will make nmap only test the most probable
#ARP discoverynmap-sn<Network>#ARP Requests (Discover IPs)netdiscover-r<Network>#ARP requests (Discover IPs)#NBT discoverynbtscan-r192.168.0.1/24#Search in Domain# Bettercapnet.probeon/off#Discover hosts on current subnet by probing with ARP, mDNS, NBNS, UPNP, and/or WSDsetnet.probe.mdnstrue/false#Enable mDNS discovery probes (default=true)setnet.probe.nbnstrue/false#Enable NetBIOS name service discovery probes (default=true)setnet.probe.upnptrue/false#Enable UPNP discovery probes (default=true)setnet.probe.wsdtrue/false#Enable WSD discovery probes (default=true)setnet.probe.throttle10#10ms between probes sent (default=10)#IPv6alive6<IFACE># Send a pingv6 to multicast.
# Bettercap (if no [MAC] is specificed ff:ff:ff:ff:ff:ff will be used/entire broadcast domain)wol.eth [MAC] #Send a WOL as a raw ethernet packet of type 0x0847wol.udp [MAC] #Send a WOL as an IPv4 broadcast packet to UDP port 9
扫描主机
一旦您发现了所有您想要深入扫描的IP(外部或内部),可以执行不同的操作。
TCP
开放端口:SYN --> SYN/ACK --> RST
关闭端口:SYN --> RST/ACK
过滤端口:SYN --> [无响应]
过滤端口:SYN --> ICMP消息
# Nmap fast scan for the most 1000tcp ports usednmap-sV-sC-O-T4-n-Pn-oAfastscan<IP># Nmap fast scan for all the portsnmap-sV-sC-O-T4-n-Pn-p--oAfullfastscan<IP># Nmap fast scan for all the ports slower to avoid failures due to -T4nmap-sV-sC-O-p--n-Pn-oAfullscan<IP>#Bettercap Scansyn.scan192.168.1.0/24110000#Ports 1-10000
# Check if any of the most common udp services is runningudp-proto-scanner.pl<IP># Nmap fast check if any of the 100 most common UDP services is runningnmap-sU-sV--version-intensity0-n-F-T4<IP># Nmap check if any of the 100 most common UDP services is running and launch defaults scriptsnmap-sU-sV-sC-n-F-T4<IP># Nmap "fast" top 1000 UDP portsnmap-sU-sV--version-intensity0-n-T4<IP># You could use nmap to test all the UDP ports, but that will take a lot of time
sudotcpdump-i<INTERFACE>udpport53#Listen to DNS request to discover what is searching the hosttcpdump-i<IFACE>icmp#Listen to icmp packetssudo bash -c "sudo nohup tcpdump -i eth0 -G 300 -w \"/tmp/dump-%m-%d-%H-%M-%S-%s.pcap\" -W 50 'tcp and (port 80 or port 443)' &"
net.sniffonnet.sniffstatssetnet.sniff.outputsniffed.pcap#Write captured packets to fileset net.sniff.local #If true it will consider packets from/to this computer, otherwise it will skip them (default=false)
setnet.sniff.filter#BPF filter for the sniffer (default=not arp)setnet.sniff.regexp#If set only packets matching this regex will be considered
arp.spoofonsetarp.spoof.targets<IP>#Specific targets to ARP spoof (default=<entire subnet>)setarp.spoof.whitelist#Specific targets to skip while spoofingset arp.spoof.fullduplex true #If true, both the targets and the gateway will be attacked, otherwise only the target (default=false)
set arp.spoof.internal true #If true, local connections among computers of the network will be spoofed, otherwise only connections going to and coming from the Internet (default=false)