network reconnaissance and ids cs642 computer security
play

Network reconnaissance and IDS CS642: Computer Security - PowerPoint PPT Presentation

Network reconnaissance and IDS CS642: Computer Security Professor Ristenpart h9p://www.cs.wisc.edu/~rist/ rist at cs dot wisc dot edu University of


  1. Network ¡reconnaissance ¡ and ¡IDS ¡ CS642: ¡ ¡ Computer ¡Security ¡ Professor ¡Ristenpart ¡ h9p://www.cs.wisc.edu/~rist/ ¡ rist ¡at ¡cs ¡dot ¡wisc ¡dot ¡edu ¡ University ¡of ¡Wisconsin ¡CS ¡642 ¡

  2. Let’s ¡play ¡over ¡the ¡network ¡… ¡ ¡ Target ¡acquisiNon ¡ Port ¡scanning ¡ Host ¡fingerprinNng, ¡NMAP ¡ Network ¡IDS ¡basics ¡ Avoiding ¡IDS ¡ University ¡of ¡Wisconsin ¡CS ¡642 ¡

  3. Target ¡acquisiNon ¡ ISP ¡ OrganizaNon ¡ ¡ X ¡ backbone ¡ How ¡do ¡we ¡find ¡vulnerable ¡server(s) ¡within ¡a ¡target ¡organizaNon? ¡ StarNng ¡point: ¡one ¡or ¡more ¡publicly ¡routable ¡IP ¡addresses ¡ -­‑ ¡WHOIS ¡queries ¡are ¡good ¡way ¡to ¡find ¡them ¡ -­‑ ¡Can ¡be ¡used ¡to ¡idenNfy ¡blocks ¡of ¡IP ¡addresses ¡owned ¡

  4. WHOIS ¡fun ¡

  5. We’ve ¡idenNfied ¡target ¡(range ¡of) ¡IPs, ¡ now ¡what? ¡ • Host ¡discovery ¡ – Narrow ¡broad ¡swath ¡of ¡potenNal ¡IPs ¡to ¡ones ¡that ¡have ¡ hosts ¡associated ¡with ¡them ¡ • Service ¡discovery ¡ – For ¡a ¡parNcular ¡host, ¡idenNfy ¡running ¡services ¡ – E.g., ¡is ¡it ¡accepNng ¡SSH ¡connecNons ¡(22) ¡or ¡HTTP ¡(80)? ¡ • OS ¡fingerprinNng ¡ – IdenNfy ¡the ¡OS ¡so_ware ¡version ¡running ¡ ¡ – E.g., ¡Windows ¡vs ¡Linux? ¡ • ApplicaNon ¡fingerprinNng ¡ – same ¡at ¡higher ¡level ¡ ¡ – Apache ¡version ¡1.3 ¡or ¡2.0+? ¡

  6. Port ¡scanners ¡ • NMAP ¡(network ¡map ¡tool) ¡ – De-­‑facto ¡standard ¡for ¡network ¡reconnaissance, ¡tesNng ¡ – Numerous ¡built ¡in ¡scanning ¡methods ¡ ¡ • Increasingly ¡common ¡to ¡perform ¡scans ¡of ¡enNre ¡ IPv4 ¡address ¡space ¡ – Zmap ¡provides ¡more ¡efficient ¡scanning ¡of ¡certain ¡ limited ¡forms ¡than ¡NMAP ¡ • 1 ¡machine ¡=> ¡scan ¡enNre ¡IPv4 ¡range ¡in ¡~45 ¡minutes ¡ • AcNve ¡scanning ¡now ¡used ¡frequently ¡for ¡research ¡

  7. nmap ¡–PN ¡–sT ¡–p ¡22 ¡ ¡192.168.1.0/24 ¡

  8. Some ¡of ¡the ¡NMAP ¡status ¡messages ¡ • open ¡ – host ¡is ¡accepNng ¡connecNons ¡on ¡that ¡port ¡ • closed ¡ – host ¡responds ¡to ¡NMAP ¡probes ¡on ¡port, ¡but ¡does ¡ not ¡accept ¡connecNons ¡ • filtered ¡ – NMAP ¡couldn’t ¡get ¡packets ¡through ¡to ¡host ¡on ¡ that ¡port. ¡ ¡ – Firewall? ¡

  9. Port ¡scan ¡of ¡host ¡

  10. Service ¡detecNon ¡

  11. nmap ¡–PN ¡–sT ¡–p ¡22 ¡ ¡192.168.1.0/24 ¡

  12. Port ¡scan ¡of ¡host ¡

  13. Service ¡detecNon ¡ Firewall ¡so_ware ¡ What ¡is ¡tcpwrapped ¡? ¡ “man ¡tcpd” ¡

  14. OS ¡fingerprinNng ¡

  15. Another ¡example ¡

  16. Network ¡DMZ ¡ Web ¡server ¡ Internet ¡ Inner ¡ Outer ¡ firewall ¡ firewall ¡ Customer ¡ IDS ¡ databases ¡ DMZ ¡(demilitarized ¡zone) ¡helps ¡isolate ¡public ¡network ¡ ¡ components ¡from ¡private ¡network ¡components ¡ Firewall ¡rules ¡to ¡disallow ¡traffic ¡from ¡Internet ¡to ¡internal ¡services ¡

  17. Firewalls ¡ IP ¡packets ¡or ¡ fragments ¡ Internet ¡ Outer ¡ IP ¡ TCP ¡ Appl ¡ firewall ¡ user ¡data ¡ hdr ¡ hdr ¡ hdr ¡ Firewalls ¡apply ¡rules ¡to ¡packets ¡to ¡determine ¡rouNng ¡acNons ¡ • Stateless: ¡decision ¡must ¡be ¡made ¡looking ¡at ¡single ¡ packet ¡(fragment) ¡ • Stateful: ¡reconstruct ¡packets ¡from ¡fragments, ¡maybe ¡ even ¡TCP ¡messages ¡ • Host ¡based ¡or ¡network ¡based ¡

  18. Port ¡scanning ¡behind ¡firewalls: ¡ ¡ Idle ¡scans ¡ • We ¡want ¡to ¡avoid ¡sending ¡any ¡non-­‑spoofed ¡ packets ¡to ¡the ¡target, ¡but ¡sNll ¡want ¡to ¡port ¡ scan ¡it ¡ Web ¡server ¡ Internet ¡ Inner ¡ Outer ¡ firewall ¡ firewall ¡ Customer ¡ IDS ¡ databases ¡ Can ¡send ¡to ¡Web ¡server ¡ Cannot ¡send ¡to ¡Databases ¡ Can ¡send ¡spoofed ¡as ¡Web ¡server ¡

  19. Idle ¡scans ¡ • We ¡want ¡to ¡avoid ¡sending ¡any ¡non-­‑spoofed ¡ packets ¡to ¡the ¡target, ¡but ¡sNll ¡want ¡to ¡port ¡scan ¡it ¡ • Salvatore ¡(AnNrez) ¡Sanfilippo ¡1998 ¡ • So-­‑called ¡idle ¡scan ¡can ¡enable ¡this ¡ 1) Determine ¡IPID ¡of ¡a ¡zombie ¡via ¡SYN/ACK ¡ 2) Send ¡SYN ¡spoofed ¡from ¡zombie ¡ 3) Determine ¡new ¡IPID ¡of ¡zombie ¡via ¡SYN/ACK ¡ ¡ • Old ¡systems: ¡IPID ¡incremented ¡with ¡each ¡IP ¡ packet ¡sent ¡ ¡

  20. IPv4 ¡ Ethernet ¡frame ¡ ¡ ENet ¡ IP ¡ ENet ¡ data ¡ containing ¡ ¡ hdr ¡ hdr ¡ tlr ¡ IP ¡datagram ¡ 4-­‑bit ¡ 4-­‑bit ¡ 8-­‑bit ¡ ¡ 16-­‑bit ¡ ¡ version ¡ hdr ¡len ¡ type ¡of ¡service ¡ total ¡length ¡(in ¡bytes) ¡ 16-­‑bit ¡ ¡ 3-­‑bit ¡ 13-­‑bit ¡ ¡ idenNficaNon ¡ flags ¡ fragmentaNon ¡offset ¡ 8-­‑bit ¡ ¡ 8-­‑bit ¡ ¡ 16-­‑bit ¡ ¡ Nme ¡to ¡live ¡(TTL) ¡ protocol ¡ header ¡checksum ¡ 32-­‑bit ¡ ¡ source ¡IP ¡address ¡ 32-­‑bit ¡ ¡ desNnaNon ¡IP ¡address ¡ opNons ¡(opNonal) ¡

  21. Idle ¡scans ¡ • We ¡want ¡to ¡avoid ¡sending ¡any ¡non-­‑spoofed ¡ packets ¡to ¡the ¡target, ¡but ¡sNll ¡want ¡to ¡port ¡ scan ¡it ¡ Web ¡server ¡ TCP ¡SYN/ACK ¡ TCP ¡SYN/ACK ¡ RST ¡IPID ¡= ¡12345 ¡ TCP ¡SYN/ACK ¡ RST ¡IPID ¡= ¡12346 ¡ RST ¡IPID ¡= ¡12347 ¡ Internet ¡ SYN ¡spoofed ¡as ¡from ¡ ¡ Inner ¡ Outer ¡ Web ¡Server ¡ firewall ¡ firewall ¡ Customer ¡ IDS ¡ databases ¡ Can ¡send ¡to ¡Web ¡server ¡ Cannot ¡send ¡to ¡Databases ¡ If ¡port ¡open ¡final ¡IPID ¡= ¡first ¡+ ¡2 ¡ Can ¡send ¡spoofed ¡as ¡Web ¡server ¡ If ¡port ¡closed ¡final ¡IPID ¡= ¡?? ¡

  22. Idle ¡scans ¡ • We ¡want ¡to ¡avoid ¡sending ¡any ¡non-­‑spoofed ¡ packets ¡to ¡the ¡target, ¡but ¡sNll ¡want ¡to ¡port ¡ scan ¡it ¡ Web ¡server ¡ RST ¡ TCP ¡SYN/ACK ¡ RST ¡IPID ¡= ¡12345 ¡ TCP ¡SYN/ACK ¡ RST ¡IPID ¡= ¡12346 ¡ Internet ¡ SYN ¡spoofed ¡as ¡from ¡ ¡ Inner ¡ Outer ¡ Web ¡Server ¡ firewall ¡ firewall ¡ Customer ¡ IDS ¡ databases ¡ Can ¡send ¡to ¡Web ¡server ¡ Cannot ¡send ¡to ¡Databases ¡ If ¡port ¡open ¡final ¡IPID ¡= ¡first ¡+ ¡2 ¡ Can ¡send ¡spoofed ¡as ¡Web ¡server ¡ If ¡port ¡closed ¡final ¡IPID ¡= ¡first ¡+ ¡1 ¡

  23. Idle ¡scans ¡ From ¡h9p://nmap.org/book/idlescan.html ¡

  24. Idle ¡scan ¡ From ¡h9p://nmap.org/book/idlescan.html ¡

  25. PrevenNng ¡idle ¡scans ¡ • How ¡can ¡we ¡prevent ¡our ¡system ¡from ¡being ¡a ¡ zombie? ¡

  26. Other ¡idle ¡scan ¡type ¡methods? ¡ • Ensafi ¡et ¡al. ¡“Idle ¡Port ¡Scanning ¡and ¡Non-­‑ Interference ¡Analysis ¡of ¡Network ¡Protocol ¡ Stacks ¡Using ¡Model ¡Checking”, ¡USENIX ¡ Security ¡2010 ¡ • IPID ¡is ¡a ¡side ¡channel ¡– ¡maybe ¡there ¡are ¡ others? ¡ – RST ¡rate ¡ – SYN ¡cache ¡size ¡

  27. Idle ¡scan: ¡RST ¡rate ¡limit ¡ From ¡ ¡Ensafi ¡et ¡al. ¡ ¡2010 ¡

  28. SYN ¡caches ¡and ¡SYN ¡cookies ¡ • SYN ¡cache ¡maintains ¡state ¡for ¡outstanding ¡TCP ¡ SYN ¡requests ¡received ¡ – Finite ¡amount ¡of ¡memory ¡ • SYN ¡cookie ¡is ¡mechanism ¡for ¡dealing ¡with ¡DoS ¡ – When ¡SYN ¡cache ¡is ¡full, ¡calculate ¡response’s ¡ISN ¡ (iniNal ¡sequence ¡number) ¡ 3 ¡bits ¡ 5 ¡bits ¡ Max ¡Seg ¡ 24 ¡bits ¡ Nmestamp ¡t ¡ ¡ Size ¡ ¡ MD5(serverIP,serverPort,clientIP,clientPort,t) ¡ mod ¡32 ¡ encoding ¡

  29. Idle ¡scan: ¡SYN ¡cache ¡ From ¡ ¡Ensafi ¡et ¡al. ¡ ¡2010 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend