5.Dns Rpc Nfs


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

5.Dns Rpc Nfs

  1. 1. Course 3: Network Security, Section 5 <ul><li>Pascal Meunier, Ph.D., M.Sc., CISSP </li></ul><ul><li>May 2004; updated July 30, 2004 </li></ul><ul><li>Developed thanks to the support of Symantec Corporation, </li></ul><ul><li>NSF SFS Capacity Building Program (Award Number 0113725) and the Purdue e-Enterprise Center </li></ul><ul><li>Copyright (2004) Purdue Research Foundation. All rights reserved. </li></ul>
  2. 2. Course 3 Learning Plan <ul><li>Architecture </li></ul><ul><li>Physical and link layer </li></ul><ul><li>Network layer </li></ul><ul><li>Transport layer </li></ul><ul><li>Application layer: DNS, RPC, NFS </li></ul><ul><li>Application layer: Routing </li></ul><ul><li>Wireless networks </li></ul><ul><li>More secure protocols: DNSSEC, IPSEC, IPv6 </li></ul>
  3. 3. Application-Level Attacks <ul><li>Name-space Protocols </li></ul><ul><ul><li>DNS </li></ul></ul><ul><ul><li>NIS </li></ul></ul><ul><ul><li>NetBios (and friends) </li></ul></ul><ul><li>Remote Procedure Calls </li></ul><ul><ul><li>RPC </li></ul></ul><ul><ul><li>DCOM </li></ul></ul><ul><li>Network File System (NFS) </li></ul><ul><li>Routing Protocols </li></ul><ul><ul><li>RIP </li></ul></ul><ul><ul><li>BGP </li></ul></ul><ul><ul><li>OSPF </li></ul></ul>
  4. 4. Learning objectives <ul><li>Understand how name-to-IP (and reverse) mapping issues can result in vulnerabilities </li></ul><ul><li>Understand how SSL is useful </li></ul><ul><li>Be aware of some general, high-level issues in </li></ul><ul><ul><li>Remote procedure calls </li></ul></ul><ul><ul><li>Network file systems </li></ul></ul>
  5. 5. DNS <ul><li>Motivation: DNS Attacks make news </li></ul><ul><ul><li>“Al Jazeera Web Site Faces Sustained DoS Attack and DNS Attacks” (2003) </li></ul></ul><ul><ul><li>Hillary2000.com (Hillary Clinton’s campaign) </li></ul></ul><ul><ul><li>Nike (2000) </li></ul></ul><ul><ul><li>Ricochet Networks (1999) </li></ul></ul><ul><ul><li>AOL (1998) </li></ul></ul><ul><li>Domain Hijacking: A step-by-step guide </li></ul><ul><ul><li>www.securiteam.com (10/2/2000) </li></ul></ul><ul><li>What are DNS attacks, and how do we defend against them? </li></ul>
  6. 6. Outline <ul><li>Review of DNS </li></ul><ul><li>Protocol vulnerabilities and exposures </li></ul><ul><ul><li>Recon </li></ul></ul><ul><ul><li>Cache poisoning </li></ul></ul><ul><ul><li>Access control based on host names </li></ul></ul><ul><li>Implementation vulnerabilities </li></ul><ul><ul><li>Review of vulnerabilities in BIND </li></ul></ul><ul><ul><li>Code examples </li></ul></ul>
  7. 7. Review of DNS <ul><li>Domain Name System </li></ul><ul><ul><li>Well-known implementation: BIND </li></ul></ul><ul><li>Purpose: translate names that humans understand to IP addresses </li></ul><ul><ul><li>e.g., www.cerias.purdue.edu => </li></ul></ul><ul><ul><li>Allows changing IP addresses of servers </li></ul></ul><ul><ul><li>Information is stored in &quot;RR&quot;s: Resource Records </li></ul></ul><ul><li>Many RFCs (complex) </li></ul><ul><li>Distributed system </li></ul><ul><ul><li>Not one server knows all the answers </li></ul></ul><ul><ul><li>Recursive requests may be needed </li></ul></ul><ul><li>Can use either TCP or UDP </li></ul>
  8. 8. Organization <ul><li>&quot;Root&quot; servers point to top level domain servers, like .com, .org, .edu, etc... </li></ul><ul><li>Those point to more specific servers. </li></ul><ul><li>Eventually a server will know the answer </li></ul><ul><li>“nslookup” is an interactive tool to explore the dns hierarchy </li></ul><ul><ul><li>deprecated </li></ul></ul><ul><li>Equivalent on some systems is “dig”, &quot;host&quot; </li></ul>
  9. 9. Example DNS Lookup <ul><li>% host www.google.com www.google.com is an alias for www.google.akadns.net. www.google.akadns.net has address www.google.akadns.net has address </li></ul><ul><li>Note how a DNS name may resolve as several different IP addresses </li></ul>
  10. 10. DNS Is Not Bidirectionally Equivalent <ul><li>% host www.purdue.edu www.purdue.edu has address % host domain name pointer mortar.cc.purdue.edu. </li></ul><ul><li>A different tree is used for IP to host name queries! </li></ul><ul><ul><li>Not as well-maintained (usually) </li></ul></ul><ul><ul><li>Note the &quot;IN-ADDR.ARPA&quot; domain </li></ul></ul><ul><ul><ul><li>Domain name for IP address lookup </li></ul></ul></ul><ul><ul><ul><li>RFC 1035 Section 3.5 </li></ul></ul></ul><ul><ul><li>Note the IP address was reversed </li></ul></ul><ul><ul><li>Who controls the data? </li></ul></ul>
  11. 11. Zones and Domains <ul><li>DNS servers are organized by zones </li></ul><ul><li>DNS name has domains: domain1.domain2.com </li></ul><ul><ul><li>&quot;.com&quot; is a &quot;top-level domain&quot; </li></ul></ul><ul><li>What is the relationship between zones and domains? </li></ul><ul><ul><li>A zone may include subdomains </li></ul></ul><ul><ul><ul><li>Fancy way to say that a server will authoritatively answer queries for specified subdomains as well </li></ul></ul></ul>
  12. 12. Who Controls Data in &quot;IN-ADDR.ARPA&quot;? <ul><li>Hierarchical distributed database </li></ul><ul><ul><li>Data in different zones </li></ul></ul><ul><li>Example query to find out for </li></ul><ul><ul><li>&quot; dig PTR IN &quot; </li></ul></ul><ul><ul><li>&quot;;; ANSWER SECTION: 86400 IN PTR purdue-cs-en.cs.purdue.edu.&quot; </li></ul></ul><ul><ul><li>&quot;;; AUTHORITY SECTION: 10.128.IN-ADDR.ARPA. 43269 IN NS harbor.ecn.purdue.edu. 10.128.IN-ADDR.ARPA. 43269 IN NS pendragon.cs.purdue.edu. 10.128.IN-ADDR.ARPA. 43269 IN NS ns.purdue.edu. 10.128.IN-ADDR.ARPA. 43269 IN NS moe.rice.edu. 10.128.IN-ADDR.ARPA. 43269 IN NS ns2.purdue.edu.&quot; </li></ul></ul>
  13. 13. Host Name Lookups From IP <ul><li>Conclusion: </li></ul><ul><ul><li>The returned host name is under the control of the zone where the host with that IP address is located </li></ul></ul><ul><li>Scenario: </li></ul><ul><ul><li>Name-based authentication mechanism (.rhosts, rlogin, etc...) </li></ul></ul><ul><ul><li>Attacker controls the remote zone </li></ul></ul><ul><ul><ul><li>Says is &quot;innocent.victim.com&quot; </li></ul></ul></ul><ul><ul><li>Victim's DNS trusts remote zone server </li></ul></ul><ul><ul><ul><li>&quot;innocent.victim.com&quot; is within &quot;victim.com&quot; so access is allowed </li></ul></ul></ul><ul><ul><li>Ref.: Bellovin 1995 &quot;Using the Domain Name System for System Break-Ins&quot; </li></ul></ul>
  14. 14. Fix Attempt <ul><li>Do two lookups, using both trees, and refuse access if names are inconsistent </li></ul><ul><li>Example: </li></ul><ul><ul><li>Let's say host &quot;resources.benign.org&quot; allows access from &quot;*.benign.org&quot; </li></ul></ul><ul><li>Possible attack: </li></ul><ul><ul><li>It would be suspicious if &quot; resources.benign.org &quot; received a request from, whose DNS records pointed to &quot; www.benign.org &quot; but no DNS entry for &quot; www.benign.org &quot; included </li></ul></ul>
  15. 15. DNS API <ul><li>a.k.a. &quot; resolver &quot; OS support </li></ul><ul><ul><li>Handles DNS transparently for application </li></ul></ul><ul><li>gethostbyname returns the IP address </li></ul><ul><li>gethostbyaddr returns the host name </li></ul><ul><ul><li>same names on Windows </li></ul></ul><ul><li>Same function names for PHP, .NET, etc... </li></ul><ul><li>Handling of results is opportunity for buffer overflows </li></ul><ul><li>There could be a malicious (or compromised, poisoned) DNS server in the chain </li></ul>
  16. 16. Resolver Attacks <ul><li>Host resolvers have caches for efficiency </li></ul><ul><ul><li>e.g., &quot;ns.purdue.edu. 6619 IN A; </li></ul></ul><ul><li>Caches may be poisoned </li></ul><ul><li>First Attack: </li></ul><ul><ul><li>UDP packets with spoofed source IP address, pretending to come from the authoritative server </li></ul></ul><ul><ul><ul><li>Especially combined with a DoS attack on the server </li></ul></ul></ul><ul><ul><li>DNS uses query numbers to keep track of requests </li></ul></ul><ul><ul><ul><li>DNS cache poisoning via BIND by predictable query IDs. </li></ul></ul></ul><ul><ul><ul><ul><li>CVE-1999-0024 </li></ul></ul></ul></ul><ul><ul><ul><li>Send UDP packet with the IP-domain pair you want the client or server to think is correct, with sniffed or guessed query ID </li></ul></ul></ul>
  17. 17. Additional Cache Poisoning Attacks <ul><li>With DNS replies: </li></ul><ul><ul><li>Spurious (malicious) record returned in answer to another query </li></ul></ul><ul><ul><ul><li>In addition to requested information </li></ul></ul></ul><ul><ul><li>Malicious record returned as a normal part some answer </li></ul></ul><ul><ul><ul><li>Get Alice to query Malory's DNS server somehow (web bug, link, etc...) </li></ul></ul></ul><ul><li>With DNS queries: </li></ul><ul><ul><li>Malory sends a query that contains a spurious reply; Alice’s server believes it and caches it </li></ul></ul><ul><ul><ul><li>No need to trick Alice </li></ul></ul></ul><ul><ul><ul><li>Similar to ARP poisoning and gratuitous ARP replies (replies without receiver having sent a request) </li></ul></ul></ul>
  18. 18. Conclusion <ul><li>You can't authenticate based on host names </li></ul><ul><ul><li>You can't rely on DNS as per the original RFCs </li></ul></ul><ul><li>DNS is more vulnerable if hosted outside your network </li></ul><ul><ul><li>Some attacks (IP spoofing) prevented by ingress filtering </li></ul></ul><ul><ul><ul><li>Don't accept packets from outside, pretending to originate from inside the network </li></ul></ul></ul><ul><ul><ul><li>Except if DNS server is hosted outside the network! </li></ul></ul></ul><ul><ul><ul><ul><li>No defense then </li></ul></ul></ul></ul>
  19. 19. DNS Masters and Slaves <ul><li>a.k.a. Primary and secondary servers </li></ul><ul><li>Two kinds of DNS servers for: </li></ul><ul><ul><li>Load sharing </li></ul></ul><ul><ul><li>Redundancy </li></ul></ul><ul><li>How do you keep slaves up-to-date? </li></ul>
  20. 20. Zone Transfers <ul><li>Get RRs (list of host-IP address pairs) for the zone </li></ul><ul><li>Uses TCP for reliability </li></ul><ul><li>Used by slaves to query master for information </li></ul><ul><ul><li>Polling mechanism (e.g., every 15 minutes) </li></ul></ul><ul><li>Example: </li></ul><ul><ul><li>&quot;dig -t AXFR vulnerable.com > zone.txt&quot; </li></ul></ul>
  21. 21. Attacks on Zone Transfer <ul><li>Lower protocol vulnerabilities can be exploited to load desired information into secondary servers/slaves </li></ul><ul><ul><li>TCP session hijacking </li></ul></ul><ul><ul><li>ARP poisoning (if on same network segment) </li></ul></ul><ul><ul><li>VLAN attacks </li></ul></ul><ul><li>Desirable recon information (attacker requests zone transfer to own machine) </li></ul><ul><ul><li>Should restrict it with IP address restrictions </li></ul></ul><ul><ul><ul><li>Not critical, but an exposure nonetheless </li></ul></ul></ul><ul><ul><ul><li>This is blocked from outside Symantec or CERIAS </li></ul></ul></ul>
  22. 22. DNS Notify <ul><li>Notification to slaves/secondary servers when zone changes occur </li></ul><ul><ul><li>RFC 1996 </li></ul></ul><ul><ul><li>Uses UDP or TCP </li></ul></ul><ul><li>All servers getting the notice: </li></ul><ul><ul><li>Acknowledge the notice </li></ul></ul><ul><ul><li>Check with the server that the new zone version (&quot;SOA RR&quot;) is indeed more recent than theirs </li></ul></ul><ul><ul><li>If so, initiate zone transfers </li></ul></ul>
  23. 23. Attack on DNS Notify <ul><li>With a UDP packet, a notice can be sent </li></ul><ul><ul><li>Other packet to tell slave the new version number (&quot;SOA RR&quot;) </li></ul></ul><ul><li>Zone transfer still uses TCP </li></ul><ul><li>Lower protocol vulnerabilities can then be exploited to load desired information into secondary servers/slaves </li></ul><ul><ul><li>TCP session hijacking </li></ul></ul><ul><ul><li>ARP poisoning (if on same network segment) </li></ul></ul><ul><ul><li>VLAN attacks </li></ul></ul><ul><li>As previous attacks, but now the timing can be controlled by the attacker thanks to notify function </li></ul>
  24. 24. Other DNS Attacks <ul><li>Administrative attacks against registrar (see Domain Hijacking: A step-by-step guide, akin to social engineering attacks) </li></ul>
  25. 25. SSL as a Defense <ul><li>Server has matched private and public keys </li></ul><ul><li>Public key along with the domain name (e.g., cerias.purdue.edu) is signed by a certificate authority (Verisign, Thawte); this is the SSL certificate </li></ul><ul><ul><li>The signature is verified by using the CA's public key </li></ul></ul><ul><ul><li>Every browser has the public keys for CAs </li></ul></ul><ul><li>You know that you are talking to the correct web server, and that the DNS system was not corrupted, because only that server knows its own private key, and the server’s private key is necessary for the encryption. </li></ul>
  26. 26. Question <ul><li>Which access control rule is preferable? a) allow from b) allow from cerias.purdue.edu c) allow from all </li></ul>
  27. 27. Question <ul><li>Which access control rule is preferable? a) allow from b) allow from cerias.purdue.edu c) allow from all </li></ul>
  28. 28. Discussion <ul><li>Which DNS problems would you try to fix first? a) Authentication of servers b) Complexity of the protocol c) Implementation errors d) Integrity of the data e) Availability of the servers </li></ul>
  29. 29. Discussion <ul><li>Which DNS problems would you try to fix first? </li></ul><ul><li>a) Authentication of servers </li></ul><ul><ul><li>UDP allows IP spoofing and injection of malicious data </li></ul></ul><ul><li>b) Complexity of the protocol c) Implementation errors d) Integrity of the data </li></ul><ul><ul><li>Cryptographic mechanisms for integrity also provide authenticity (e.g., signatures) </li></ul></ul><ul><li>e) Availability of the servers </li></ul><ul><ul><li>Important, which is why there is a redundant server architecture </li></ul></ul>
  30. 30. Question <ul><li>Why should you consider SSL in your next client-server program? </li></ul><ul><li>a) it’s faster </li></ul><ul><li>b) it replaces DNS </li></ul><ul><li>c) it guarantees that you are talking to who you should be </li></ul><ul><li>d) it provides reliability and guarantees that the DNS system hasn’t been corrupted </li></ul>
  31. 31. Question <ul><li>Why should you consider SSL in your next client-server program? </li></ul><ul><li>a) it’s faster </li></ul><ul><li>b) it replaces DNS </li></ul><ul><li>c) it guarantees that you are talking to who you should be </li></ul><ul><li>d) it provides reliability and guarantees that the DNS system hasn’t been corrupted </li></ul>
  32. 32. Mini-Lab <ul><li>Explore DNS </li></ul><ul><ul><li>Can you get a zone transfer? </li></ul></ul><ul><ul><li>Do you understand the various types of records? </li></ul></ul><ul><ul><ul><li>Hint: &quot;IN&quot; stands for &quot;internet&quot; </li></ul></ul></ul><ul><ul><ul><ul><li>DNS can store information about lots of things </li></ul></ul></ul></ul><ul><ul><li>How much information can you get? </li></ul></ul><ul><ul><ul><li>Are there exposures? </li></ul></ul></ul><ul><ul><li>Why do some DNS names have dots at the end? </li></ul></ul><ul><ul><ul><li>e.g., &quot;www.benign.com.&quot; </li></ul></ul></ul><ul><ul><ul><ul><li>Hint: think about relative vs absolute paths </li></ul></ul></ul></ul><ul><ul><li>Suggested time: 15-20 minutes </li></ul></ul>
  33. 33. NIS (Network Information Services) <ul><li>SUN technology </li></ul><ul><li>&quot;NIS clients download the necessary username and password data from the NIS server to verify each user login&quot; </li></ul><ul><ul><li>How much can you trust the client? </li></ul></ul><ul><li>Doesn't encrypt the username/password information sent to the clients with each login </li></ul><ul><li>All users have access to the encrypted passwords stored on the NIS server </li></ul><ul><ul><li>Crack at leisure </li></ul></ul>
  34. 34. NIS+ <ul><li>Completely different from NIS </li></ul><ul><li>More secure </li></ul><ul><li>Domain namespace </li></ul><ul><li>Credentials checked every time a NIS+ object is accessed </li></ul><ul><ul><li>DES credentials must be generated by an administrator for each &quot;principal&quot; </li></ul></ul><ul><ul><ul><li>A principal is a user or a machine (process with root privilege) </li></ul></ul></ul><ul><ul><ul><ul><li>Client machines (processes) are authenticated </li></ul></ul></ul></ul><ul><ul><ul><li>More difficult to manage </li></ul></ul></ul>
  35. 35. NetBIOS <ul><li>Network Basic Input/Output System </li></ul><ul><ul><li>Session level protocol </li></ul></ul><ul><li>NetBIOS over TCP </li></ul><ul><ul><li>For the purposes of this tutorial, we consider it at the same level as DNS </li></ul></ul><ul><ul><li>Used almost exclusively by Windows </li></ul></ul><ul><ul><li>Major worm propagation vector </li></ul></ul><ul><li>Three services: </li></ul><ul><ul><li>NetBIOS Name service </li></ul></ul><ul><ul><li>NetBIOS Datagram service </li></ul></ul><ul><ul><li>NetBIOS Session service </li></ul></ul>
  36. 36. NetBIOS Name Service <ul><li>NetBIOS name identifies computer for file sharing and domain authentications </li></ul><ul><li>UDP port 137 </li></ul><ul><li>Name resolution in a network segment </li></ul><ul><li>Map NetBIOS names to IP addresses </li></ul>
  37. 37. NetBIOS Names <ul><li>Domain names </li></ul><ul><li>Computer names </li></ul><ul><li>User names </li></ul><ul><li>Workgroup names </li></ul><ul><li>Special </li></ul><ul><ul><li>e.g., &quot;__MSBROWSE__&quot; </li></ul></ul><ul><li>Types of names </li></ul><ul><ul><li>Unique </li></ul></ul><ul><ul><li>Group </li></ul></ul>
  38. 38. Spoofing NetBIOS Names <ul><li>nbtdeputy </li></ul><ul><ul><li>http://www.securityfriday.com </li></ul></ul><ul><li>Registers a NetBIOS computer name on the network </li></ul><ul><li>Responds to NetBT name-query requests </li></ul><ul><li>Resolves IP address from NetBIOS computer name </li></ul><ul><li>Legitimate use: </li></ul><ul><ul><li>Help access servers on different segments/networks </li></ul></ul><ul><li>Hacker use: </li></ul><ul><ul><li>Impersonate trusted server (while server is under DoS) </li></ul></ul><ul><ul><ul><li>Collect usernames/passwords </li></ul></ul></ul><ul><ul><ul><li>Distribute trojans </li></ul></ul></ul>
  39. 39. Other NetBIOS Issues <ul><li>&quot;Browser elections&quot; </li></ul><ul><ul><li>A malicious machine can be elected as &quot;Browse Master&quot; </li></ul></ul><ul><ul><li>Maintain list of &quot;shares&quot; </li></ul></ul><ul><li>Shares (jargon) </li></ul><ul><ul><li>Anything &quot;shared&quot; over NetBIOS </li></ul></ul><ul><ul><ul><li>Disks </li></ul></ul></ul><ul><ul><ul><li>Printers </li></ul></ul></ul><ul><ul><ul><li>Hidden </li></ul></ul></ul><ul><ul><ul><ul><li>IPC$ (Inter-Process Communication) </li></ul></ul></ul></ul><ul><ul><li>Malicious Browse Master could in theory: </li></ul></ul><ul><ul><ul><li>Intercept confidential documents when they get printed </li></ul></ul></ul><ul><ul><ul><li>Fake trusted file systems so people use trojans or save their confidential documents there </li></ul></ul></ul><ul><ul><ul><li>etc... </li></ul></ul></ul>
  40. 40. Access Control for Shares <ul><li>Active Directory can specify mechanism </li></ul><ul><li>Authentication mechanisms </li></ul><ul><ul><li>Kerberos (requires infrastructure support) </li></ul></ul><ul><ul><li>LM (old, insecure) </li></ul></ul><ul><ul><li>NTLM </li></ul></ul><ul><ul><ul><li>drops back to LM in some occasions </li></ul></ul></ul><ul><ul><ul><li>Cryptanalyzed, has exploitable weaknesses </li></ul></ul></ul><ul><ul><ul><ul><li>Schneier and Mudge 1998 &quot;Cryptanalysis of Microsoft's Point-to-PointTunneling Protocol (PPTP)&quot; </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Exploit by Urity (2004), securityfriday.com </li></ul></ul></ul></ul><ul><ul><li>NULL sessions (no passwords) </li></ul></ul><ul><ul><ul><li>Guests </li></ul></ul></ul><ul><ul><ul><li>etc... </li></ul></ul></ul>
  41. 41. Listing Account Names <ul><li>Anonymous users (NULL sessions) can: </li></ul><ul><ul><li>List domain user names </li></ul></ul><ul><ul><li>Enumerate share names </li></ul></ul><ul><li>Exposure </li></ul><ul><li>Prevention </li></ul><ul><ul><li>Set the registry RestrictAnonymous to 1 </li></ul></ul><ul><ul><ul><li>Still permits a remote anonymous logged in user to call the function NetUserGetInfo </li></ul></ul></ul><ul><ul><ul><ul><li>Acquire detailed account information </li></ul></ul></ul></ul><ul><ul><ul><li>Exploit: &quot;GetAcct&quot; (www.securityfriday.com) </li></ul></ul></ul><ul><ul><li>RestrictNullSessAccess to 2 </li></ul></ul><ul><ul><li>Can be set through the LSA (Local Security Policy) </li></ul></ul><ul><ul><ul><li>XP, 2000 </li></ul></ul></ul>
  42. 42. Worms Exploiting &quot;Weak Shares&quot; <ul><li>&quot;Share level access&quot; for the File and Print Sharing service (TCP port 139) </li></ul><ul><li>Passwords in Windows 95/98/ME are easily retrieved </li></ul><ul><ul><li>Normally, if a password has N characters, and each character has 64 possible values, then the password space is 64^N </li></ul></ul><ul><ul><li>Windows password characters can be guessed one at a time, so the space is 64*N instead </li></ul></ul><ul><ul><ul><li>Because the server assumes that the length of the password sent from the client is correct </li></ul></ul></ul><ul><ul><li>References </li></ul></ul><ul><ul><ul><li>Tereman (2000) securityfriday.com </li></ul></ul></ul><ul><ul><ul><li>Microsoft Security Bulletin (MS00-072) </li></ul></ul></ul>
  43. 43. Recon Tools <ul><li>nbtdump.exe, winnbtdump.exe </li></ul><ul><ul><li>dumps NetBIOS information from Windows NT, Windows 2000 and *NIX Samba servers such as shares, user accounts with comments, etc, and the password policy </li></ul></ul><ul><li>Note that port 445 also provides direct access to NetBIOS </li></ul><ul><ul><li>Attacks against port 139 can also use port 445 </li></ul></ul><ul><ul><li>Windows 2000 and later </li></ul></ul>
  44. 44. References <ul><li>RFC 1001, 1002 </li></ul><ul><li>Northrup 1998 &quot;NetBIOS: Friend or Foe?&quot; </li></ul><ul><ul><li>http://www.windowsitlibrary.com/Content/386/10/1.html </li></ul></ul><ul><ul><ul><li>&quot;NetBIOS is highly vulnerable but we must live with it for some time&quot; </li></ul></ul></ul>
  45. 45. Mini-Lab (20 minutes) <ul><li>Use the Nessus vulnerability scanner to find NetBIOS issues on the class server </li></ul><ul><ul><li>Right-click the desktop </li></ul></ul><ul><ul><ul><li>Under &quot;vulnerability assessment&quot;, select &quot;Nessus&quot; </li></ul></ul></ul><ul><ul><ul><ul><li>That will start the Nessus daemon </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Note the user name and password </li></ul></ul></ul></ul><ul><ul><ul><li>Login to the Nessus client window </li></ul></ul></ul><ul><ul><ul><li>Tab for tests </li></ul></ul></ul><ul><ul><ul><ul><li>Unselect all the tests (button) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Select the Windows tests </li></ul></ul></ul></ul><ul><ul><ul><li>Tab for machines to be scanned </li></ul></ul></ul><ul><ul><ul><ul><li>Enter the IP address of Windows server </li></ul></ul></ul></ul><ul><ul><ul><li>Start the scan </li></ul></ul></ul><ul><ul><ul><li>Click on the network icon and computer in the results </li></ul></ul></ul>
  46. 46. Discussion <ul><li>Can the server be compromised through NetBIOS? </li></ul><ul><ul><li>By guessing the administrator password, Nessus can access the registry remotely to scan for vulnerabilities </li></ul></ul><ul><ul><ul><li>Disable remote registry access </li></ul></ul></ul><ul><ul><ul><li>Choose a good administrator password </li></ul></ul></ul><ul><ul><li>Win 95/98/ME should disable NetBIOS or install a firewall </li></ul></ul><ul><li>What else could an attacker do? </li></ul><ul><li>What would you do to secure the server? </li></ul><ul><ul><li>Are the NetBIOS services needed? </li></ul></ul>
  47. 47. Remote Procedure Calls <ul><li>Sun's rpc </li></ul><ul><li>Microsoft's RPC </li></ul><ul><li>92 entries in ICAT (&quot;rpc&quot;) as of May 2004 </li></ul><ul><li>Example: </li></ul><ul><ul><li>saned in sane-backends 1.0.7 and earlier does not check the IP address of the connecting host during the SANE_NET_INIT RPC call, which allows remote attackers to use that call even if they are restricted in saned.conf. </li></ul></ul><ul><ul><ul><li>CAN-2003-0773 </li></ul></ul></ul><ul><ul><li>And we know how insecure IP-based restriction can be anyway! </li></ul></ul>
  48. 48. RPC <ul><li>Use Port 111 (TCP and UDP) &quot;portmapper&quot; to know on which port services are provided (port 135 on Windows) </li></ul><ul><ul><li>NIS </li></ul></ul><ul><ul><li>NFS </li></ul></ul><ul><ul><li>mount </li></ul></ul><ul><ul><li>sadmin </li></ul></ul><ul><ul><li>etc... </li></ul></ul><ul><li>Utility: rpcinfo </li></ul><ul><li>Exposure if accessible from the internet </li></ul><ul><li>Most of these services are not needed from the internet and contain vulnerabilities and exposures </li></ul>
  49. 49. DCOM (Microsoft) <ul><li>Runs on top of Microsoft RPC </li></ul><ul><ul><li>Allows writing distributed applications </li></ul></ul><ul><li>Remotely control software components with account name and password </li></ul><ul><ul><li>e.g., Internet Explorer </li></ul></ul><ul><li>Exploit: &quot;IE'en&quot; (&quot;Soap&quot; securityfriday.com) </li></ul><ul><ul><li>capture user ID and password in plain text, even on SSL sites </li></ul></ul>
  50. 50. NFS: Network File System <ul><li>Root on a client machine could be trusted as root on the server! </li></ul><ul><ul><li>Remote user ID is trusted as correct </li></ul></ul><ul><ul><li>use the root_squash option in exports </li></ul></ul><ul><ul><ul><li>Replaces &quot;root&quot; with &quot;nobody&quot; </li></ul></ul></ul><ul><ul><ul><li>On by default in RedHat 9+ </li></ul></ul></ul><ul><li>Root on a client machine can assume the identity of any other user (su) and change that user's files </li></ul><ul><ul><li>Solution: Share (&quot;export&quot;) only directories where everything belongs to root (with the above squash option) </li></ul></ul><ul><ul><li>other squash options available </li></ul></ul><ul><li>Setuid programs: blocked by &quot;nosuid&quot; option </li></ul>
  51. 51. Additional Reference <ul><li>http://www2.educ.umu.se/~bjorn/linux/howto/NFS-HOWTO-6.html </li></ul>
  52. 52. Questions or Comments?
  53. 53. About These Slides <ul><li>You are free to copy, distribute, display, and perform the work; and to make derivative works, under the following conditions. </li></ul><ul><ul><li>You must give the original author and other contributors credit </li></ul></ul><ul><ul><li>The work will be used for personal or non-commercial educational uses only, and not for commercial activities and purposes </li></ul></ul><ul><ul><li>For any reuse or distribution, you must make clear to others the terms of use for this work </li></ul></ul><ul><ul><li>Derivative works must retain and be subject to the same conditions, and contain a note identifying the new contributor(s) and date of modification </li></ul></ul><ul><ul><li>For other uses please contact the Purdue Office of Technology Commercialization. </li></ul></ul><ul><li>Developed thanks to the support of Symantec Corporation </li></ul>
  54. 54. Pascal Meunier [email_address] <ul><li>Contributors: </li></ul><ul><li>Jared Robinson, Alan Krassowski, Craig Ozancin, Tim Brown, Wes Higaki, Melissa Dark, Chris Clifton, Gustavo Rodriguez-Rivera </li></ul>