mirror of
https://github.com/jtesta/ssh-audit.git
synced 2026-06-24 05:19:41 +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
@@ -40,3 +40,8 @@ class TestSocket:
|
||||
s, e = sock.send_packet()
|
||||
assert s == -1
|
||||
assert e == 'not connected'
|
||||
|
||||
def test_socks_proxy_rejected_for_unix_socket_targets(self, virtual_socket):
|
||||
sock = self.ssh_socket(self.OutputBuffer(), 'unix:///tmp/test.sock', 22, socks_proxy='127.0.0.1:1080')
|
||||
err = sock.connect()
|
||||
assert err == '[exception] cannot use a SOCKS5 proxy with UNIX socket targets'
|
||||
|
||||
Reference in New Issue
Block a user