fix for Debian's fucking braindead packagers

This commit is contained in:
brent s. 2022-10-12 00:45:29 -04:00
parent 6543b230d4
commit 77b22b8b8a
Signed by: bts
GPG Key ID: 8C004C2F93481F6B
1 changed files with 4 additions and 1 deletions

View File

@ -115,7 +115,10 @@ tstamp = int(datetime.datetime.utcnow().timestamp())
# nmap --script ssh2-enum-algos -PN -sV -p22 <host>
magic_ver = 6.5
ssh_ver = subprocess.run(['ssh', '-V'], stderr = subprocess.PIPE).stderr.decode('utf-8').strip().split()[0]
ssh_ver = float(re.sub('^(Open|Sun_)SSH_([0-9\.]+)(p[0-9]+)?,.*$', '\g<2>', ssh_ver))
# FUCK YOU, DEBIAN. FUCK YOU AND ALL OF YOUR DERIVATIVES. YOU'RE FUCKING TRASH.
# YOU BELONG NOWHERE NEAR A DATACENTER.
#ssh_ver = float(re.sub('^(Open|Sun_)SSH_([0-9\.]+)(p[0-9]+)?,.*$', '\g<2>', ssh_ver))
ssh_ver = float(re.sub('^(?:Open|Sun_)SSH_([0-9\.]+)(?:p[0-9]+)?(?:,|\s+).*$', '\g<1>', ssh_ver))
if ssh_ver >= magic_ver:
has_ed25519 = True
supported_keys = ('ed25519', 'rsa')