-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.py
More file actions
64 lines (51 loc) · 2.3 KB
/
Copy pathapp.py
File metadata and controls
64 lines (51 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import streamlit as st
import subprocess
import os
# --- Configuration ---
MODEL_NAME = "qwen2.5-coder:1.5b"
THINK_MODE = False
LLM_API_BASE = "http://localhost:11434/v1"
LLM_API_KEY = "ollama"
STRIX_LLM = f"openai/{MODEL_NAME}"
# ---------------------
st.set_page_config(page_title="Strix Visual Explorer", page_icon="🦉", layout="centered")
st.title("🦉 Strix Visual Explorer")
st.markdown("A visual interface for Strix, the AI pentesting tool. Powered by local Ollama.")
st.info(f"**Current LLM**: `{MODEL_NAME}` (Thinking/Reasoning: `{THINK_MODE}`)")
target = st.text_input("Target URL or Local Directory", value="./dummy_app")
if st.button("Start Pentest Scan"):
with st.spinner("Initializing Strix agents..."):
env = os.environ.copy()
env["STRIX_LLM"] = STRIX_LLM
env["LLM_API_BASE"] = LLM_API_BASE
env["LLM_API_KEY"] = LLM_API_KEY
env["STRIX_REASONING_EFFORT"] = "low"
try:
# We run Strix in non-interactive mode
cmd = ["strix", "-n", "--target", target, "--scan-mode", "quick"]
result = subprocess.run(
cmd,
env=env,
capture_output=True,
text=True,
check=False
)
st.subheader("Scan Results")
if result.stdout:
st.code(result.stdout, language="markdown")
# Save the output to output.md
import re
clean_text = re.sub(r'\x1b\[[0-9;]*m', '', result.stdout)
with open("output.md", "w", encoding="utf-8") as f:
f.write(clean_text)
st.success("Report successfully saved to `output.md`")
if result.stderr:
st.error("Errors/Warnings:")
st.code(result.stderr, language="text")
if result.returncode == 0:
st.success("Scan completed successfully. No vulnerabilities found.")
else:
st.warning("Scan completed. Vulnerabilities detected or scan failed.")
except Exception as e:
st.error(f"Error running Strix: {str(e)}")
st.info("Did you install strix-agent? Try running: pip install strix-agent")