77 lines
2.1 KiB
Python
77 lines
2.1 KiB
Python
import pyautogui
|
|
import time
|
|
import os
|
|
import subprocess
|
|
import glob
|
|
|
|
BURP_JAR = "/headless/burpsuite_community.jar"
|
|
CONFIG_FILE = "/app/burp/project_options.json"
|
|
|
|
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:
|
|
button = pyautogui.locateCenterOnScreen("/app/burp/next_button.png", confidence=0.8)
|
|
except:
|
|
pass
|
|
if button:
|
|
print("Clicking on the 'Next' button...")
|
|
pyautogui.click(button)
|
|
button = None
|
|
|
|
try:
|
|
button = pyautogui.locateCenterOnScreen("/app/burp/start_burp.png", confidence=0.8)
|
|
except:
|
|
pass
|
|
if button:
|
|
print("Clicking on the 'Start Burp' button...")
|
|
pyautogui.click(button)
|
|
button = None
|
|
|
|
try:
|
|
button = pyautogui.locateCenterOnScreen("/app/burp/accept.png", confidence=0.8)
|
|
except:
|
|
pass
|
|
if button:
|
|
print("Clicking on the 'Accept' button...")
|
|
pyautogui.click(button)
|
|
button = None
|
|
|
|
try:
|
|
button = pyautogui.locateCenterOnScreen("/app/burp/proxy.png", confidence=0.8)
|
|
except:
|
|
pass
|
|
if button:
|
|
print("Clicking on the 'Proxy' button...")
|
|
pyautogui.click(button)
|
|
button = None
|
|
|
|
try:
|
|
button = pyautogui.locateCenterOnScreen("/app/burp/http_history.png", confidence=0.8)
|
|
except:
|
|
pass
|
|
if button:
|
|
print("Clicking on the 'HTTP History' button...")
|
|
pyautogui.click(button)
|
|
time.sleep(60)
|
|
burp_process.terminate()
|
|
print("Starting Burp Suite...")
|
|
burp_process = start_burp()
|
|
|