mirror of
https://github.com/jtesta/ssh-audit.git
synced 2024-12-23 06:27:41 +01:00
More output refactor.
This commit is contained in:
parent
96da1af9ef
commit
4ba3485664
14
ssh-audit.py
14
ssh-audit.py
@ -403,11 +403,11 @@ KEX_DB = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def process_algorithms(alg_type, algorithms, maxlen=0):
|
def output_algorithms(alg_type, algorithms, maxlen=0):
|
||||||
for algorithm in algorithms:
|
for algorithm in algorithms:
|
||||||
process_algorithm(alg_type, algorithm, maxlen)
|
output_algorithm(alg_type, algorithm, maxlen)
|
||||||
|
|
||||||
def process_algorithm(alg_type, alg_name, alg_max_len=0):
|
def output_algorithm(alg_type, alg_name, alg_max_len=0):
|
||||||
prefix = '(' + alg_type + ') '
|
prefix = '(' + alg_type + ') '
|
||||||
if alg_max_len == 0:
|
if alg_max_len == 0:
|
||||||
alg_max_len = len(alg_name)
|
alg_max_len = len(alg_name)
|
||||||
@ -461,13 +461,13 @@ def output(banner, kex):
|
|||||||
ml(kex.server.encryption),
|
ml(kex.server.encryption),
|
||||||
ml(kex.server.mac))
|
ml(kex.server.mac))
|
||||||
out.head('\n# key exchange algorithms')
|
out.head('\n# key exchange algorithms')
|
||||||
process_algorithms('kex', kex.kex_algorithms, maxlen)
|
output_algorithms('kex', kex.kex_algorithms, maxlen)
|
||||||
out.head('\n# host-key algorithms')
|
out.head('\n# host-key algorithms')
|
||||||
process_algorithms('key', kex.key_algorithms, maxlen)
|
output_algorithms('key', kex.key_algorithms, maxlen)
|
||||||
out.head('\n# encryption algorithms (ciphers)')
|
out.head('\n# encryption algorithms (ciphers)')
|
||||||
process_algorithms('enc', kex.server.encryption, maxlen)
|
output_algorithms('enc', kex.server.encryption, maxlen)
|
||||||
out.head('\n# message authentication code algorithms')
|
out.head('\n# message authentication code algorithms')
|
||||||
process_algorithms('mac', kex.server.mac, maxlen)
|
output_algorithms('mac', kex.server.mac, maxlen)
|
||||||
out.sep()
|
out.sep()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user