mirror of
https://github.com/casterbyte/Sara.git
synced 2025-07-05 20:24:30 +02:00
feat: add --skip-confirmation
flag
This enables the use of Sara in scripts where you don't generally want to have a confirmation prompt
This commit is contained in:
parent
848b2bbeb7
commit
e499becd2b
1 changed files with 5 additions and 0 deletions
5
sara.py
5
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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue