Commit Graph

10342 Commits

Author SHA1 Message Date
Mike Salvatore d509ee7216 Build: Pull Python AppImage v3.7.14 2022-09-14 07:22:44 -04:00
Mike Salvatore 1e3e6c9052 Merge branch '2216-fix-connection-issues' into 2216-tcp-relay 2022-09-14 07:06:03 -04:00
Mike Salvatore e56d4c0ac7
Merge pull request #2284 from guardicore/2216-relay-bb-tests
2216 relay bb tests
2022-09-14 06:56:42 -04:00
vakarisz bc6da3d402 BB: Add documentation about changes to tunneling-11 2022-09-14 12:13:36 +03:00
vakarisz c281666504 BB: Remove tunneling-12 from depth-3 2022-09-14 12:10:06 +03:00
vakarisz 7a33802b7c BB: Add tunneling machines to the list of depth 3 test 2022-09-14 12:06:46 +03:00
Kekoa Kaaikala e7bb5ce535 BB: Add interface to tunneling-11 2022-09-13 19:52:04 +00:00
Kekoa Kaaikala b865c13a3b BB: Revert depth_3_a test 2022-09-13 19:45:57 +00:00
Mike Salvatore 905fb3563e
Merge pull request #2281 from guardicore/2216-prevent-port-collisions
Agent: Add TCPPortSelector
2022-09-13 15:08:56 -04:00
Mike Salvatore 0f0f50208d
Agent: Add missing "param" in docstring
Co-authored-by: Kekoa Kaaikala <kekoa.kaaikala@gmail.com>
2022-09-13 15:07:25 -04:00
Mike Salvatore 04d79a0a35 Agent: Add TCPPortSelector 2022-09-13 12:24:14 -04:00
Kekoa Kaaikala 69063de627 Agent: Add note about unintentional disconnect 2022-09-13 15:38:19 +00:00
Kekoa Kaaikala 4ba4cb583a Agent: Add thread ID to SocketsPipe thread name 2022-09-13 15:32:15 +00:00
Mike Salvatore 70978f9b30 Merge branch '2216-find-servers-concurrently' into 2216-fix-connection-issues 2022-09-12 16:49:07 -04:00
Kekoa Kaaikala 3dd2052dc5 Agent: Add debug logging to TCPRelay 2022-09-12 20:45:37 +00:00
Mike Salvatore c532cdec72 Agent: Detect closed socket in SocketsPipe
When a socket is closed, select.select() returns the socket in the
read_list. A closed socket can be detected by attempting to read from
it. If 0 data is read, then the socket is closed.

See below for more details:
> If a socket is in the output readable list, you can be
  as-close-to-certain-as-we-ever-get-in-this-business that a recv on
  that socket will return something.
https://docs.python.org/3/howto/sockets.html#non-blocking-sockets
https://stackoverflow.com/questions/17386487/python-detect-when-a-socket-disconnects-for-any-reason
https://stackoverflow.com/questions/17705239/is-there-a-way-to-detect-that-tcp-socket-has-been-closed-by-the-remote-peer-wit
2022-09-12 16:35:36 -04:00
Mike Salvatore fe954bb659 Agent: Call pipe.start(), not run()
run() blocks, start() starts the run method on a different thread.
2022-09-12 16:31:03 -04:00
Mike Salvatore 9002c47d56 Agent: Add a timeout on TCPPipeSpawner dest socket 2022-09-12 16:29:19 -04:00
Mike Salvatore 77c97062eb Agent: Wrap relay stop logic in a method 2022-09-12 14:53:19 -04:00
Mike Salvatore 27cb2009fc Agent: Let relay run indefinitely if user hasn't forced a stop 2022-09-12 14:46:42 -04:00
vakaris_zilius c2c2993ff7 Agent: Fix a bug(peeking socket consumes data)
sock.recv takes two parameters instead of one
2022-09-12 15:01:21 +00:00
Mike Salvatore a01785838d Agent: Pass keep_tunnel_open timeout as new_client_timeout 2022-09-12 10:24:26 -04:00
Mike Salvatore 67893b7825 Agent: Find/check island servers concurrently 2022-09-12 10:16:54 -04:00
Mike Salvatore a9edbb2874 Agent: Add ThreadSafeIterator 2022-09-12 10:16:51 -04:00
Mike Salvatore 191ee1a5f9 Agent: Change order of spawn pipe and add relay user
If we were unsuccessful in starting the pipe, we don't want to sit
around and wait for a relay user to connect.
2022-09-12 08:12:17 -04:00
vakarisz 7ff61423dc Agent: Log uncaught errors in tcp_connection_handler.py thread
If there's an uncaught error in the thread, the error won't propagate to the caller and we wouldn't know what went wrong from the logs. This fixes things and all uncaught errors get logged
2022-09-12 12:02:34 +00:00
Kekoa Kaaikala 9ff92d2128 Agent: Fix ident not available in constructor 2022-09-12 11:59:22 +00:00
Kekoa Kaaikala 756bfe488b Agent: Provide address as string to connect() 2022-09-12 11:59:22 +00:00
vakarisz c756c7ace2 BB: Add tunneling test diagrams 2022-09-09 17:51:37 +03:00
vakarisz 46152c0cd2 Island, Agent: Update pydantic to 1.10
Without this update SecretStr is of an unhashable type
2022-09-09 17:04:47 +03:00
Ilija Lazoroski a4b6e2157b Agent: Cast cmd_island_port to int 2022-09-09 14:28:14 +02:00
Ilija Lazoroski 2b4b462c1a Agent: Relock Pipfile 2022-09-09 08:23:00 -04:00
Ilija Lazoroski 867a3a83e7 Agent: Use get_plaintext in SSHExploiter login with password 2022-09-09 08:22:56 -04:00
Ilija Lazoroski 6171b66282 Agent: Fix SSHCollector to publish list of Credentials
Previously it was publish list of lists of Credentials
2022-09-09 08:22:53 -04:00
Kekoa Kaaikala 093e2c79dc Agent: Add relay to servers list for exploited hosts 2022-09-09 08:19:56 -04:00
Mike Salvatore 20649b5e3c Merge pull request #2263 from guardicore/2216-remove-unused-code
2216 remove unused code
2022-09-09 08:19:56 -04:00
Mike Salvatore 0246f6b981 Agent: Convert _cmd_island_port to int in one place 2022-09-09 08:19:56 -04:00
Kekoa Kaaikala 4a2297b097 Island: Remove TunnelTelem 2022-09-09 08:19:56 -04:00
Kekoa Kaaikala 3516fa1fec Agent: Fix: Pass port as int 2022-09-09 08:19:56 -04:00
Kekoa Kaaikala cb45cd8873 Agent: Remove TunnelTelem 2022-09-09 08:19:56 -04:00
Kekoa Kaaikala d335c4081a Agent: Fix TCPRelay missing _interrupted member 2022-09-09 08:19:56 -04:00
Shreya Malviya 7530a89152 Agent: Remove usage of proxies 2022-09-09 08:19:56 -04:00
Kekoa Kaaikala 6051cfa29a Agent: Fix log call exhausting iterator 2022-09-09 08:19:56 -04:00
Kekoa Kaaikala 1c805184fe Agent: Remove unused proxy classes 2022-09-09 08:19:56 -04:00
Mike Salvatore 2fadfd1b31 Merge pull request #2257 from guardicore/2216-notify-relay-when-finished
2216 notify relay when finished
2022-09-09 08:19:56 -04:00
Kekoa Kaaikala d7cabc2f5e Agent: Get rid of default_tunnel 2022-09-09 08:19:56 -04:00
Mike Salvatore 1d58ce36e7 Agent: Use a finally clause to ensure singleton is always unlocked 2022-09-09 08:19:56 -04:00
Kekoa Kaaikala dcb77d6285 Agent: Remove MonkeyTunnel 2022-09-09 08:19:56 -04:00
Kekoa Kaaikala 6c2cab9950 Agent: Disconnect from upstream relay 2022-09-09 08:19:41 -04:00
Kekoa Kaaikala baeb0c9460 Agent: Add function to disconnect from relay 2022-09-09 08:18:17 -04:00