Connection¶
-
class
baboossh.Connection(endpoint, user, cred)[source]¶ A
UserandCredsto authenticate on anEndpointA connection represents the working association of those 3 objects to connect a target. It can be used to run payloads on a
Host, open aTunnelto it or use it as a pivot to reach newEndpoints-
id¶ the Connection ‘s id
- Type
int
-
used_by_connections¶ a list of
Connectionusing the current one as a pivot. Used for recursive connection closure.- Type
[Connection,..]
-
used_by_tunnels¶ a list of
Tunnelusing the current connection as a pivot. Used for recursive connection closure.- Type
[Tunnel,..]
-
__init__(endpoint, user, cred)[source]¶ Create the object and fetches info from database if it has been saved.
Methods
__init__(endpoint, user, cred)Create the object and fetches info from database if it has been saved.
close()delete()Delete the Connection from the
Workspace’s databasefind_all([endpoint, user, creds, scope])Find all Connection matching the criteria
find_one([connection_id, endpoint, scope, …])Find a Connection by its id, endpoint or if it can be used as a gateway to an
Endpointfrom_target(arg)get_id(endpoint, user, cred)Generate an ID for unicity
identify(socket)Indentify the host
open([verbose, target])probe([gateway, verbose])run(payload, current_workspace_directory, stmt)save()Save the Connection to the
Workspace’s databaseAttributes
Returns the number of hops between “Local” and the
EndpointReturns whether the Connection is in scope
-
classmethod
find_all(endpoint=None, user=None, creds=None, scope=None)[source]¶ Find all Connection matching the criteria
If two or more arguments are specified, the returned Connections must match each (“AND”)
- Parameters
endpoint (
EndpointorTag) – the Connection endpoint to search or aTagof endpoints to searchuser (
User) – the Connection user to searchcreds (
Creds) – the Connection creds to searchscope (bool) – whether to include only in scope Connections (True), out of scope Connections (False) or both (None)
- Returns
A list of matching Connection.
-
classmethod
find_one(connection_id=None, endpoint=None, scope=None, gateway_to=None)[source]¶ Find a Connection by its id, endpoint or if it can be used as a gateway to an
Endpoint- Parameters
- Returns
A single Connection or None.
-