Skip to content

5. Executing the Agent

HuskyHacks edited this page Feb 27, 2022 · 5 revisions

The compiled agent can be run with a few different arguments. There is no help menu for the compiled agent, so please reference the following for its possible parameters:

No Arguments

If the agent has been compiled with default values for its parameters (i.e. by setting it up with main.py), those values are used by the agent when running with no arguments. This is the most OPSEC safe way to execute the agent. See the Quickstart guide and main.py for more information.

If the agent has not been compiled with default values for parameters, it will attempt to locate cfg.json in the current working directory. If this file is present, it will run with those parameters.

If there is no cfg.json file available in this case, the agent will exit without establishing a connection.

-d: Debug mode.

Allows you to input each agent parameter via the CLI. Recommended for debugging and testing. Not recommended for operations.

Example:

$ ./offensive_notion -d
[*] Starting!
Getting config options!
[*] Enter agent sleep interval > 5
[*] Enter agent jitter time > 3
[*] Enter parent page id > [....parent page ID....]
[*] Enter API Key > 
[...API key...]
[*] Enter Config File Path > 

[*] Enter Log Level (1-4) > 
5
[+] Admin context: false
[+] Hostname: ubuntu
[?] Config options: ConfigOptions { sleep_interval: 5, jitter_time: 3, parent_page_id: "[...parent page ID...]", api_key: "[...API key...]", config_file_path: "", launch_app: false, log_level: 5 }
[+] Creating page...
[+] zzzZZZzzz: 5 seconds

-b: Base64 encoded config

Allows a base64 encoded version of the configuration options to be passed at execution.

Example:

$ ./offensive_notion -b eyJzbGVlcF9pbnRlcnZhbCI6NSwiaml0dGVyX3RpbWUiOjMsInBhcmVudF9wYWdlX2lkIjoiWy4uLi4gcGFyZW50IHBhZ2UgSUQuLi5dIiwiYXBpX2tleSI6IlsuLi4uc2VjcmV0IGtleS4uLl0iLCJjb25maWdfZmlsZV9wYXRoIjoiY2ZnLmpzb24iLCJsYXVuY2hfYXBwIjpmYWxzZSwibG9nX2xldmVsIjo1fQ==
[*] Starting!
[+] Admin context: false
[+] Hostname: ubuntu
[?] Config options: ConfigOptions { sleep_interval: 5, jitter_time: 3, parent_page_id: "[...parent page ID...]", api_key: "[...API key...]", config_file_path: "", launch_app: false, log_level: 5 }
[+] Creating page...
[+] zzzZZZzzz: 5 seconds

-c: Config file

Passes a config file path to the agent to pull configurations.

Example:

$ cat cfg.json 
{"sleep_interval":5,"jitter_time":3,"parent_page_id":"[...parent page ID...]","api_key":"[...APi key...]","config_file_path":"cfg.json","launch_app":false,"log_level":5}

$ ./offensive_notion -c cfg.json 
[*] Starting!
Object({"api_key": String("[....API key.....]"), "config_file_path": String("cfg.json"), "jitter_time": Number(3), "launch_app": Bool(false), "log_level": Number(5), "parent_page_id": String("[...parent page ID...]"), "sleep_interval": Number(5)})
[+] Admin context: false
[+] Hostname: ubuntu
[?] Config options: ConfigOptions { sleep_interval: 5, jitter_time: 3, parent_page_id: "[...parent page ID....]", api_key: "[...API key....]", config_file_path: "cfg.json", launch_app: false, log_level: 5 }
[+] Creating page...
[+] zzzZZZzzz: 5 seconds