SSH Connections - Additional Logging and Visibility of Errors
See original GitHub issueADDITIONAL LOGGING
I’m planning on using ssh-audit
in a production environment and would like to be able to demonstrate and record how aggressive a typical audit is.
Currently verbose output only shows the initial SSH connection that’s made to a target server:
However an audit actually makes multiple connections to a target server:
-
The initial connection:
ssh_audit.py
:main
-->audit
-->err = s.connect()
-
Obtaining host key(s):
ssh_audit.py
:main
-->audit
-->HostKeyTest.run(s, kex)
hostkeytest.py
:run
-->perform_test
-->err = s.connect()
(err = s.connect()
runs once per key type [rsa, ed25519, etc]) -
Performing DH group exchange:
ssh_audit.py
:main
-->audit
-->GEXTest.run(s, kex)
gextest.py
:run
-->GEXTest.reconnect
-->err = s.connect()
(GEXTest.reconnect
runs once per group-exchange alg and once per modulus length for each group-exchange alg)
@jtesta Would you be happy to entertain the idea of adding some additional logging so that each SSH connection is output?
If that sounds OK, do you want this to be added to the existing verbose output or would it be more appropriate to add a new --debug
parameter?
VISIBILITY OF ERRORS
When obtaining host key(s) and performing DH group exchange, if s.connect()
or get_banner()
produce an error then currently the error message is suppressed:
Should we at least display a warning rather than hiding errors?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top GitHub Comments
Thanks for the PR! I merged it and then made a small change:
SSH_Socket()
now takes anOutputBuffer
so that all its methods can use it without having to pass it in every time.There’s LOTS of debugging output we can potentially generate. I figure we’ll add it in as needed. I’d be happy to accept debugging lines if you find them helpful.
Thanks again!
@jtesta I’ve submitted a PR, see #99.
When a debug parameter (
-d
/--debug
) is passed, bothVerbose
andDebug
output is displayed.Please can you give me your feedback and suggestions?
Is there any additional logging you want to add to
Debug
?