diff --git a/burp/start_burp.py b/burp/start_burp.py index 0e85aa6..4f997f4 100644 --- a/burp/start_burp.py +++ b/burp/start_burp.py @@ -2,18 +2,29 @@ import pyautogui import time import os import subprocess +import glob BURP_JAR = "/headless/burpsuite_community.jar" CONFIG_FILE = "/app/burp/project_options.json" -print("Waiting for vnc to start up...") -time.sleep(10) -print("Starting Burp Suite...") -burp_process = subprocess.Popen([ - "java", "-jar", BURP_JAR, - f"--config-file={CONFIG_FILE}" -]) +def start_burp(): + + for filepath in glob.glob('/tmp/burp*'): + try: + if os.path.isfile(filepath): + os.remove(filepath) + print(f"Deleted: {filepath}") + except Exception as e: + print(f"Error deleting {filepath}: {e}") + + burp_process = subprocess.Popen([ + "java", "-jar", BURP_JAR, + f"--config-file={CONFIG_FILE}" + ]) + return burp_process +print("Starting Burp Suite...") +burp_process = start_burp() button = None while True: try: @@ -62,9 +73,5 @@ while True: time.sleep(60) burp_process.terminate() print("Starting Burp Suite...") - burp_process = subprocess.Popen([ - "java", "-jar", BURP_JAR, - f"--config-file={CONFIG_FILE}" - ]) - button = None + burp_process = start_burp()