mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-03 04:22:47 -05:00
Add an interactive anti-spoofing prompt in Plink.
At the point when we change over the seat's trust status to untrusted for the last time, to finish authentication, Plink will now present a final interactive prompt saying 'Press Return to begin session'. This is a hint that anything after that that resembles an auth prompt should be treated with suspicion, because _PuTTY_ thinks it's finished authenticating. This is of course an annoying inconvenience for interactive users, so I've tried to reduce its impact as much as I can. It doesn't happen in GUI PuTTY at all (because the trust sigil system is used instead); it doesn't happen if you use plink -batch (because then the user already knows that they _never_ expect an interactive prompt); and it doesn't happen if Plink's standard input is being redirected from anywhere other than the terminal / console (because then it would be pointless for the server to try to scam passphrases out of the user anyway, since the user isn't in a position to enter one in response to a spoof prompt). So it should only happen to people who are using Plink in a terminal for interactive login purposes, and that's not _really_ what I ever intended Plink to be used for (which is why it's never had any out-of-band control UI like OpenSSH's ~ system). If anyone _still_ doesn't like this new prompt, it can also be turned off using the new -no-antispoof flag, if the user is willing to knowingly assume the risk.
This commit is contained in:
@ -534,6 +534,8 @@ static void usage(void)
|
||||
"-no-sanitise-stderr, -no-sanitise-stdout\n");
|
||||
printf(" do/don't strip control chars from standard "
|
||||
"output/error\n");
|
||||
printf(" -no-antispoof omit anti-spoofing prompt after "
|
||||
"authentication\n");
|
||||
printf(" -m file read remote command(s) from file\n");
|
||||
printf(" -s remote command is an SSH subsystem (SSH-2 only)\n");
|
||||
printf(" -N don't start a shell/command (SSH-2 only)\n");
|
||||
@ -678,6 +680,8 @@ int main(int argc, char **argv)
|
||||
} else if (!strcmp(p, "-no-sanitise-stderr") ||
|
||||
!strcmp(p, "-no-sanitize-stderr")) {
|
||||
sanitise_stderr = FORCE_OFF;
|
||||
} else if (!strcmp(p, "-no-antispoof")) {
|
||||
console_antispoof_prompt = false;
|
||||
} else if (*p != '-') {
|
||||
strbuf *cmdbuf = strbuf_new();
|
||||
|
||||
|
Reference in New Issue
Block a user