mirror of
https://github.com/jtesta/ssh-audit.git
synced 2026-06-24 13:29:42 +02:00
Add --socks argument for scanning via SOCKS5 proxy (#347)
* Add --socks argument for scanning via SOCKS5 proxy Implement SOCKS5 proxy support without external dependencies: - Add socks_proxy field to AuditConf - Add --socks host:port CLI argument with input validation - Implement SOCKS5 handshake (no-auth, domain-name addressing) in SSH_Socket._connect_via_socks5() Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Michał Majchrowicz <sectroyer@gmail.com> * Add SOCKS proxy regression tests --------- Signed-off-by: Michał Majchrowicz <sectroyer@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
3bd2dd95a9
commit
f369689cd1
@@ -165,3 +165,18 @@ class TestAuditConf:
|
||||
self._test_conf(conf, host='localhost', level='fail')
|
||||
with pytest.raises(SystemExit):
|
||||
conf = c('-l something localhost')
|
||||
|
||||
def test_audit_conf_process_commandline_socks_proxy(self):
|
||||
c = lambda x: self.process_commandline(self.OutputBuffer, x.split()) # noqa
|
||||
|
||||
conf = c('--socks 127.0.0.1:1080 localhost')
|
||||
assert conf.socks_proxy == '127.0.0.1:1080'
|
||||
|
||||
with pytest.raises(SystemExit):
|
||||
c('--socks localhost localhost')
|
||||
|
||||
with pytest.raises(SystemExit):
|
||||
c('--socks localhost:0 localhost')
|
||||
|
||||
with pytest.raises(SystemExit):
|
||||
c('--socks localhost:65536 localhost')
|
||||
|
||||
Reference in New Issue
Block a user