home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / patches / ssh-skey.patch < prev    next >
Encoding:
Text File  |  2000-01-22  |  1.9 KB  |  81 lines

  1.  
  2. monkey SSH S/Key patch
  3. ----------------------
  4.  
  5. i wanted to use S/Key with SSH, but as a server-only hack (duh, the
  6. reason you'd want to use OTPs with SSH in the first place is because
  7. you don't trust the client). so here's a quick hack, short and stupid.
  8.  
  9. to build:
  10.  
  11. 1. apply the patch to the clean ssh-1.2.23 distribution.
  12.  
  13. 2. run configure and edit the resulting Makefile, adding
  14.    -DMONKEY_SKEY_HACK to DEFS and -lskey to LIBS.
  15.  
  16. 3. make and install.
  17.  
  18. to use from any standard Unix SSH client:
  19.  
  20.     ssh -v -o "NumberOfPasswordPrompts 5" <hostname>
  21.  
  22. and type "s/key" as your initial password. you will then be prompted
  23. with an S/Key challenge. woo.
  24.  
  25. that is all.
  26.  
  27. -d.
  28.  
  29. ---
  30. http://www.monkey.org/~dugsong/
  31.  
  32. *** auth-passwd.c.orig    Wed May 13 23:11:57 1998
  33. --- auth-passwd.c    Wed May 13 23:11:31 1998
  34. ***************
  35. *** 269,274 ****
  36. --- 269,278 ----
  37.   static int securid_initialized = 0;
  38.   #endif /* HAVE_SECURID */
  39.   
  40. + #ifdef MONKEY_SKEY_HACK
  41. + #include <skey.h>
  42. + #endif /* MONKEY_SKEY_HACK */
  43.   #ifdef KERBEROS
  44.   #if defined(KRB5)
  45.   #include <krb5.h>
  46. ***************
  47. *** 473,478 ****
  48. --- 477,486 ----
  49.       }
  50.   #else /* _AIX41 && HAVE_AUTHENTICATE */
  51.   
  52. + #ifdef MONKEY_SKEY_HACK
  53. +   char *skeyinfo = NULL;
  54. + #endif /* MONKEY_SKEY_HACK */
  55.   #ifdef KERBEROS
  56.     krb5_error_code problem;
  57.     int krb5_options = KDC_OPT_RENEWABLE | KDC_OPT_FORWARDABLE;
  58. ***************
  59. *** 504,509 ****
  60. --- 512,529 ----
  61.       return 0;
  62.     saved_pw_name = xstrdup(pw->pw_name);
  63.     saved_pw_passwd = xstrdup(pw->pw_passwd);
  64. + #ifdef MONKEY_SKEY_HACK
  65. +   if (skey_haskey(pw->pw_name) == 0) {
  66. +     if (strcasecmp(password, "s/key") == 0) {
  67. +       skeyinfo = skey_keyinfo(pw->pw_name);
  68. +       packet_send_debug(skeyinfo ? skeyinfo : "no s/key challenge");
  69. +       return 0;
  70. +     }
  71. +     else if (skey_passcheck(pw->pw_name, password) != -1)
  72. +       return 1;
  73. +   }
  74. + #endif /* MONKEY_SKEY_HACK */
  75.     
  76.   #if defined(KERBEROS)
  77.     if (options.kerberos_authentication)
  78.