Workspace¶
-
class
baboossh.
Workspace
(name)[source]¶ A container to hold all related objects
The workspace allows to separate environments with dedicated folders and database. Any object (Endpoint, User, Creds, Connection, etc. exists only in its workspace to avoid cluttering the user.
Methods
__init__
(name)Initialize self.
close
()connect
(targets[, verbose, probe_auto])connection_del
(target)Remove a
Connection
from the workspacecreate
(name)Create a new workspace
creds_add
(creds_type, stmt)Add
Creds
to the workspacecreds_del
(creds_id)Delete a
Creds
‘ from the workspacecreds_edit
(creds_id)Edit a
Creds
‘ propertiescreds_show
(creds_id)Show a
Creds
‘ propertiesendpoint_add
(ipaddr, port)Add an
Endpoint
to the workspaceendpoint_del
(endpoint)Remove an
Endpoint
from the workspaceendpoint_search
(field, val[, show_all, add_tag])get_objects
([local, hosts, connections, …])host_del
(host)Remove a
Host
from the workspacehost_search
(field, val[, show_all, add_tag])identify_object
(target)path_add
(src, dst)path_del
(src, dst)path_find_existing
(dst[, as_ip])probe
(targets[, gateway, verbose, find_new])run
(targets, payload, stmt[, verbose])Run a payload on a list of
Connection
scope
(target)search_fields
(obj)set_option
(option, value)Set an option for the Workspace
tunnel_close
(port)tunnel_open
(target[, port])unstore
(data)user_add
(name)Add a
User
to the workspaceuser_del
(name)Remove a
User
from the workspaceAttributes
active
-
connection_close
(target)[source]¶ Close a
Connection
and any connection or tunnel using it- Parameters
target (str) – the Connection string
-
connection_del
(target)[source]¶ Remove a
Connection
from the workspace- Parameters
target (str) – the Connection string
-
classmethod
create
(name: str)[source]¶ Create a new workspace
Create a new workspace with its dedicated folder (in $HOME/.baboossh by default) and its database.
-
creds_add
(creds_type, stmt)[source]¶ Add
Creds
to the workspace- Parameters
creds_type (str) – The Creds ‘ object type
stmt (argparse.Namespace) – the rest of the command be parsed by the object
-
creds_del
(creds_id)[source]¶ Delete a
Creds
‘ from the workspace- Parameters
creds_id (str) – The Creds ‘ id
-
endpoint_add
(ipaddr, port)[source]¶ Add an
Endpoint
to the workspace- Parameters
ipaddr (str) – the Endpoint ‘s IP address
ipaddr – the Endpoint ‘s port
-
endpoint_del
(endpoint)[source]¶ Remove an
Endpoint
from the workspace- Parameters
endpoint (str) – the Endpoint ‘s string (ip:port)
-
endpoint_tag
(endpoint, tagname)[source]¶ Add a
Tag
to anEndpoint
- Parameters
endpoint (str) – the Endpoint ‘s string (ip:port)
tagname (str) – the
Tag
name
-
endpoint_untag
(endpoint, tagname)[source]¶ Remove a
Tag
from anEndpoint
- Parameters
endpoint (str) – the Endpoint ‘s string (ip:port)
tagname (str) – the
Tag
name
-
host_del
(host)[source]¶ Remove a
Host
from the workspace- Parameters
name (str) – The Host ‘s username
-
host_tag
(host, tagname)[source]¶ Add a
Tag
to anHost
- Parameters
host (str) – the Host ‘s string (ip:port)
tagname (str) – the
Tag
name
-
host_untag
(host, tagname)[source]¶ Remove a
Tag
from anHost
- Parameters
host (str) – the Host ‘s string (ip:port)
tagname (str) – the
Tag
name
-
run
(targets, payload, stmt, verbose=False)[source]¶ Run a payload on a list of
Connection
- Parameters
targets ([
Connection
]) – the target listpayload (
Payload
) – the payload to runstmt (argparse.Namespace) – the command parameters to pass to the payload
-