From e499becd2b32a39b1a5f27af196f47c3a8dada5a Mon Sep 17 00:00:00 2001 From: Matthieu Pignolet Date: Sun, 25 May 2025 11:40:27 +0400 Subject: [PATCH 1/4] feat: add `--skip-confirmation` flag This enables the use of Sara in scripts where you don't generally want to have a confirmation prompt --- sara.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sara.py b/sara.py index 240753b..09e9ab2 100644 --- a/sara.py +++ b/sara.py @@ -725,6 +725,8 @@ def get_router_uptime(connection): def confirm_legal_usage(): print(" " + "WARNING: This tool is for security auditing of YOUR OWN RouterOS devices.") print(" " + "Unauthorized use may be illegal. Proceed responsibly.\n") + +def prompt_legal_usage(): response = input(" " + "Do you wish to proceed? [yes/no]: ").strip() if response.lower() != "yes": @@ -741,6 +743,7 @@ def main(): parser.add_argument("--ip", help="The address of your MikroTik router") parser.add_argument("--username", help="SSH username (RO account can be used)") parser.add_argument("--password", help="SSH password") + parser.add_argument("--skip-confirmation", action='store_true', type=bool, help='Skips the confirmation prompt (disclamer: ensure that your are allowed to use this tool)') parser.add_argument("--port", type=int, default=22, help="SSH port (default: 22)") args = parser.parse_args() @@ -754,6 +757,8 @@ def main(): sys.exit(1) confirm_legal_usage() + if not args.skip_confirmation: + prompt_legal_usage() # Start timer start_time = time.time() From 5d0fa56bf3c3854bffdb18bb56607a8f03d33050 Mon Sep 17 00:00:00 2001 From: Matthieu Pignolet Date: Sun, 25 May 2025 11:52:09 +0400 Subject: [PATCH 2/4] fix: remove the `type` argument when using `add_argument` --- sara.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sara.py b/sara.py index 09e9ab2..3bbb850 100644 --- a/sara.py +++ b/sara.py @@ -743,7 +743,7 @@ def main(): parser.add_argument("--ip", help="The address of your MikroTik router") parser.add_argument("--username", help="SSH username (RO account can be used)") parser.add_argument("--password", help="SSH password") - parser.add_argument("--skip-confirmation", action='store_true', type=bool, help='Skips the confirmation prompt (disclamer: ensure that your are allowed to use this tool)') + parser.add_argument("--skip-confirmation", action='store_true', help='Skips the confirmation prompt (disclamer: ensure that your are allowed to use this tool)') parser.add_argument("--port", type=int, default=22, help="SSH port (default: 22)") args = parser.parse_args() From a5e3cfda46a5a662fba67cd1da9e7b5ce2dcad80 Mon Sep 17 00:00:00 2001 From: Matthieu Pignolet Date: Sun, 25 May 2025 11:58:08 +0400 Subject: [PATCH 3/4] feat: add documentation for the `--skip-confrmation` flag --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a84218..5b9591b 100644 --- a/README.md +++ b/README.md @@ -183,6 +183,7 @@ options: --ip IP The address of your MikroTik router --username USERNAME SSH username (RO account can be used) --password PASSWORD SSH password + --skip-confirmation Skips the confirmation prompt (disclamer: ensure that your are allowed to use this tool) --port PORT SSH port (default: 22) ``` @@ -194,7 +195,11 @@ options: 3. `--password` - password for SSH authentication; -4. `--port` - allows you to specify a non-standard SSH port for connection. The default is **22**, but if you have changed the SSH port number, it must be specified manually. +4. `--skip-confirmation` skips the confirmation prompt that asks if you are allowed to use this tool on the target system + + > Please do ensure the legality of what you're doing. + +5. `--port` - allows you to specify a non-standard SSH port for connection. The default is **22**, but if you have changed the SSH port number, it must be specified manually. # Sara's Launch From de02596d133479593ba3538a1227a1f0e94d6b86 Mon Sep 17 00:00:00 2001 From: Matthieu Pignolet Date: Sun, 25 May 2025 12:04:48 +0400 Subject: [PATCH 4/4] fix: add wrong header in the README.md file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b9591b..00783b1 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ caster@kali:~$ sara -h Sara supports the following command line options: ```bash -usage: sara.py [-h] --ip IP --username USERNAME --password PASSWORD [--port PORT] +usage: sara.py [-h] [--ip IP] [--username USERNAME] [--password PASSWORD] [--skip-confirmation] [--port PORT] options: -h, --help show this help message and exit