home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / internet / ftphack.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  4.0 KB  |  85 lines

  1.  
  2. NCSA TELNET
  3. ~~~~ ~~~~~~
  4. 5) The NCSA Telnet application allows a user to use his or her Mac as a telnet
  5. client and wander around the Internet.  NCSA Telnet also handles incoming FTP
  6. requests.  While this FTP function is easily disabled, many users keep it on
  7. because they either use it regularly or don't even know it exists.
  8.  
  9. * Anyone with a valid username/password can log in to the Mac via FTP and then
  10. change to the "root" directory and perform the normal FTP functions.. both send
  11. and receive.  This means that *every* file on the Mac can be accessed from
  12. *anywhere* on the Internet.  It should be noted that NCSA Telnet does not log
  13. the "who & where" information, meaning there is no log of who used the machine,
  14. meaning there is no way for an intruder to be "caught."
  15.  
  16. * The file "ftppass" contains the list of users allowed to use FTP on that
  17. Macintosh.  If, by using one of the methods mentioned above, someone is able to
  18. access it, it is easily cracked as it has a rather pathetic encryption scheme:
  19. the data fork contains the user's name, a colon, and then an encrypted
  20. password.  The password is easily decrypted; unless it is the entire 10
  21. characters, the last few characters are in order.  That is, the next ASCII code
  22. is 1 + the previous, etc.  Observe this from my "ftppass" file:
  23.  
  24. sample:ucetcr&'()
  25.  
  26. The first part, "sample," is the user's name.  The colon is the basic UNIX-like
  27. delimiter, the rest is the password.  The "real" part of the password is the
  28. characters "ucetcr" ... the remaining "&'()" are just spaces... how do you
  29. tell?  It's in ASCII order.  Look up "&" on an ASCII chart and "'" will follow,
  30. then "(" then ")" .. you get the idea.
  31.  
  32. This password can be discovered by short program XORing the encrypted
  33. characters with a number between 0 and 255.  The program can either a) dump all
  34. XOR results or b) if the password is not the maximum length, the program can
  35. simply scan for a "space" [ASCII 032 decimal] in the password and print it.
  36. The following "cracking" program is written in BASIC [hey, does anyone use that
  37. any more?] and will allow you to decrypt the passwords.  If you can tell that
  38. the password has spaces at the end, you can go ahead and delete line 110.
  39. Otherwise, leave that line in and use your brain [remember your brain?] to
  40. determine if the encrypted goop is a "real" word or just goop.
  41.  
  42. 5 REM "ftppass" brute-force hacker
  43. 10 INPUT "Encrypted password:";I$
  44. 20 FOR X=1 TO 255
  45. 30 FOR Y=1 TO LEN(I$)
  46. 40 Y$=MID$(I$,Y,1)
  47. 50 YA=ASC(Y$)
  48. 60 N=X XOR YA
  49. 70 IF N=32 THEN F=1
  50. 80 N$=N$+CHR$(N)
  51. 90 NEXT Y
  52. 100 IF F THEN ?"Possible password:"N$
  53. 110 ?I$" 'encrypts' to "N$: REM U can delete this line if len<10
  54. 120 N$="":F=0
  55. 130 NEXT X
  56. 140 ?"Finished."
  57.  
  58. Sample run:  [with line 110 deleted]
  59.  
  60. Encrypted password:ucetcr&'()           [gotta type the whole thing]
  61. Possible password:secret !./            [boy, that was tough!]
  62. Possible password:rdbsdu! /.
  63. Possible password:}km|kz./ !            [etc.. just smack ^C at this point.]
  64.  
  65. So the password is "secret" [clever, no?]
  66.  
  67. It should be noted that this program is rather inelegant as I haven't really
  68. reversed the algorithm, just written a brute-force "hacker" for it.  This is
  69. due to laziness on my part.  If I really wanted to do this properly, I would
  70. FTP to the NCSA anonymous site and leech the 700k+ of source and "reverse" it
  71. thataway.  I don't feel like doing that.  I am lazy.  This program works just
  72. dandy for me... [I suspect the encryption program uses the users' name to
  73. encrypt it, but I don't care enough to find out.]
  74.  
  75. I should say that I don't wish to offend the makers of NCSA Telnet or call the
  76. application crap.  It is, indeed, an impressive piece of work; I simply feel
  77. that there are some aspects of it which could use improvement... if not in
  78. terms of security, then at least allowing the user to save selections to disk!
  79.  
  80. BTW- I know that NCSA Telnet is also available for the IBM.  I haven't tested
  81. these with an IBM, but if it's a "true" port, these flaws should exist under
  82. the IBM version as well.
  83.  
  84.  
  85.