Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
|
|
|
|
|
|
| 3 |
|
| 4 |
client = InferenceClient(model="Devilishcode/The_Bird_Of_Hermes")
|
| 5 |
|
| 6 |
-
# ================== TRI-MODE SYSTEM
|
| 7 |
|
| 8 |
SYSTEM_SENTINEL = """You are THE_BIRD_OF_HERMES in SENTINEL MODE (Legal Bug Bounty).
|
| 9 |
Strict scope adherence. Safe PoCs only. Always remind user to verify scope and rules."""
|
|
@@ -38,39 +40,55 @@ def the_bird(message, mode="Specter"):
|
|
| 38 |
history.append({"role": "user", "content": message})
|
| 39 |
history.append({"role": "assistant", "content": response})
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
# Dynamic CSS per mode
|
| 42 |
def get_css(mode):
|
| 43 |
if mode == "Sentinel":
|
| 44 |
return """
|
| 45 |
-
body {background:#0a0f1a;color:#a0d8ff;
|
| 46 |
.header {background:linear-gradient(#1e3a8a,#0f172a);border-bottom:6px solid #60a5fa;}
|
| 47 |
.header h1 {color:#60a5fa;text-shadow:0 0 40px #60a5fa;}
|
| 48 |
-
.chat {
|
| 49 |
-
.bot {border-left:8px solid #60a5fa;}
|
| 50 |
"""
|
| 51 |
elif mode == "Specter":
|
| 52 |
return """
|
| 53 |
-
body {background:#0f0a1a;color:#c4b5fd;
|
| 54 |
.header {background:linear-gradient(#4c1d95,#1e0a2e);border-bottom:6px solid #a78bfa;}
|
| 55 |
.header h1 {color:#a78bfa;text-shadow:0 0 50px #a78bfa;}
|
| 56 |
-
.chat {
|
| 57 |
-
.bot {border-left:8px solid #a78bfa;}
|
| 58 |
"""
|
| 59 |
else: # Reaper
|
| 60 |
return """
|
| 61 |
-
body {background:#0a0000;color:#ff8888;
|
| 62 |
.header {background:linear-gradient(#8b0000,#1a0000);border-bottom:6px solid #ff0000;}
|
| 63 |
.header h1 {color:#ff0000;text-shadow:0 0 60px #ff0000,0 0 100px #8b0000;}
|
| 64 |
-
.chat {
|
| 65 |
-
.bot {border-left:8px solid #ff0000;}
|
| 66 |
"""
|
| 67 |
|
| 68 |
-
|
| 69 |
-
.gradio-container {background:transparent;}
|
| 70 |
-
.sidebar {background:rgba(15,0,0,0.95);border-right:3px solid #ff0000;padding:15px;}
|
| 71 |
-
"""
|
| 72 |
-
|
| 73 |
-
with gr.Blocks(css=css_base) as demo:
|
| 74 |
with gr.Row():
|
| 75 |
with gr.Column(scale=1, min_width=260):
|
| 76 |
gr.HTML("<h3 style='color:#ff0000;text-align:center;margin-bottom:25px;'>◢ THE_BIRD_OF_HERMES ◣</h3>")
|
|
@@ -85,21 +103,19 @@ with gr.Blocks(css=css_base) as demo:
|
|
| 85 |
</div>
|
| 86 |
""")
|
| 87 |
|
| 88 |
-
# MAIN CHAT
|
| 89 |
with gr.Group(visible=True) as chat_group:
|
| 90 |
chatbot = gr.Chatbot(height=680)
|
| 91 |
msg = gr.Textbox(placeholder="automate recon • crack wallet • build ransomware...", lines=3, autofocus=True)
|
| 92 |
submit = gr.Button("EXECUTE", variant="primary", size="large")
|
| 93 |
|
| 94 |
-
# AUTO HUNT
|
| 95 |
with gr.Group(visible=True) as hunt_group:
|
| 96 |
gr.Markdown("# AUTO HUNT – Any Target")
|
| 97 |
-
target = gr.Textbox(value="us.gate.com", label="Target
|
| 98 |
hunt_btn = gr.Button("START AUTO HUNT", variant="primary", size="large")
|
| 99 |
short = gr.Textbox(label="Summary")
|
| 100 |
full = gr.Markdown(label="Full Report")
|
| 101 |
|
| 102 |
-
hunt_btn.click(auto_hunt, target, [short, full])
|
| 103 |
|
| 104 |
with gr.Group(visible=False) as forge_group:
|
| 105 |
gr.Markdown("# VIRUS FORGE\nReaper Mode Only.")
|
|
@@ -108,15 +124,15 @@ with gr.Blocks(css=css_base) as demo:
|
|
| 108 |
gr.Markdown("# TRAINING LAB\nAsk in Main Chat: 'train yourself on ...'")
|
| 109 |
|
| 110 |
def update_ui(selected_mode):
|
|
|
|
| 111 |
mode_key = selected_mode.split(" ")[0]
|
| 112 |
-
css = get_css(mode_key)
|
| 113 |
|
| 114 |
return (
|
| 115 |
gr.update(visible=True), # MAIN CHAT
|
| 116 |
gr.update(visible=True), # AUTO HUNT
|
| 117 |
gr.update(visible=mode_key == "Reaper"), # VIRUS FORGE
|
| 118 |
gr.update(visible=True), # TRAINING
|
| 119 |
-
css
|
| 120 |
)
|
| 121 |
|
| 122 |
mode.change(update_ui, mode, [chat_group, hunt_group, forge_group, train_group, demo])
|
|
@@ -133,6 +149,7 @@ with gr.Blocks(css=css_base) as demo:
|
|
| 133 |
|
| 134 |
demo.launch(
|
| 135 |
theme=gr.themes.Base(),
|
|
|
|
| 136 |
server_name="0.0.0.0",
|
| 137 |
server_port=7860,
|
| 138 |
share=False
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
+
import time
|
| 4 |
+
from datetime import datetime
|
| 5 |
|
| 6 |
client = InferenceClient(model="Devilishcode/The_Bird_Of_Hermes")
|
| 7 |
|
| 8 |
+
# ================== TRI-MODE SYSTEM ==================
|
| 9 |
|
| 10 |
SYSTEM_SENTINEL = """You are THE_BIRD_OF_HERMES in SENTINEL MODE (Legal Bug Bounty).
|
| 11 |
Strict scope adherence. Safe PoCs only. Always remind user to verify scope and rules."""
|
|
|
|
| 40 |
history.append({"role": "user", "content": message})
|
| 41 |
history.append({"role": "assistant", "content": response})
|
| 42 |
|
| 43 |
+
# Auto Hunt Function
|
| 44 |
+
def auto_hunt(target, mode):
|
| 45 |
+
if not target:
|
| 46 |
+
return "Enter a target", "# No target provided"
|
| 47 |
+
|
| 48 |
+
domain = target.replace("https://", "").replace("http://", "").split("/")[0]
|
| 49 |
+
report = [f"# AUTO HUNT REPORT — {domain}\nMode: {mode}\nGenerated: {datetime.now().strftime('%Y-%m-%d %H:%M')}\n\n"]
|
| 50 |
+
|
| 51 |
+
if mode == "Reaper":
|
| 52 |
+
report.append("## FULL UNRESTRICTED EXPLOIT CHAIN ACTIVATED\n")
|
| 53 |
+
report.append("Ransomware, C2, rootkit, crypto drain payloads ready on request.\n")
|
| 54 |
+
elif mode == "Specter":
|
| 55 |
+
report.append("## AGGRESSIVE RECON & EDGE ABUSE\n")
|
| 56 |
+
report.append("Heavy OSINT and logic abuse chains suggested.\n")
|
| 57 |
+
else:
|
| 58 |
+
report.append("## SAFE LEGAL RECON ONLY\n")
|
| 59 |
+
report.append("Scope-compliant suggestions only.\n")
|
| 60 |
+
|
| 61 |
+
report.append("**Next Steps:**\n- Verify scope\n- Run manual validation\n- Submit report if in-scope")
|
| 62 |
+
|
| 63 |
+
short = f"Hunt complete in {mode} mode for {domain}"
|
| 64 |
+
full = "\n".join(report)
|
| 65 |
+
return short, full
|
| 66 |
+
|
| 67 |
# Dynamic CSS per mode
|
| 68 |
def get_css(mode):
|
| 69 |
if mode == "Sentinel":
|
| 70 |
return """
|
| 71 |
+
body {background:#0a0f1a;color:#a0d8ff;}
|
| 72 |
.header {background:linear-gradient(#1e3a8a,#0f172a);border-bottom:6px solid #60a5fa;}
|
| 73 |
.header h1 {color:#60a5fa;text-shadow:0 0 40px #60a5fa;}
|
| 74 |
+
.chat {border:4px solid #60a5fa;}
|
|
|
|
| 75 |
"""
|
| 76 |
elif mode == "Specter":
|
| 77 |
return """
|
| 78 |
+
body {background:#0f0a1a;color:#c4b5fd;}
|
| 79 |
.header {background:linear-gradient(#4c1d95,#1e0a2e);border-bottom:6px solid #a78bfa;}
|
| 80 |
.header h1 {color:#a78bfa;text-shadow:0 0 50px #a78bfa;}
|
| 81 |
+
.chat {border:4px solid #a78bfa;}
|
|
|
|
| 82 |
"""
|
| 83 |
else: # Reaper
|
| 84 |
return """
|
| 85 |
+
body {background:#0a0000;color:#ff8888;}
|
| 86 |
.header {background:linear-gradient(#8b0000,#1a0000);border-bottom:6px solid #ff0000;}
|
| 87 |
.header h1 {color:#ff0000;text-shadow:0 0 60px #ff0000,0 0 100px #8b0000;}
|
| 88 |
+
.chat {border:4px solid #ff0000;}
|
|
|
|
| 89 |
"""
|
| 90 |
|
| 91 |
+
with gr.Blocks() as demo: # css moved out
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
with gr.Row():
|
| 93 |
with gr.Column(scale=1, min_width=260):
|
| 94 |
gr.HTML("<h3 style='color:#ff0000;text-align:center;margin-bottom:25px;'>◢ THE_BIRD_OF_HERMES ◣</h3>")
|
|
|
|
| 103 |
</div>
|
| 104 |
""")
|
| 105 |
|
|
|
|
| 106 |
with gr.Group(visible=True) as chat_group:
|
| 107 |
chatbot = gr.Chatbot(height=680)
|
| 108 |
msg = gr.Textbox(placeholder="automate recon • crack wallet • build ransomware...", lines=3, autofocus=True)
|
| 109 |
submit = gr.Button("EXECUTE", variant="primary", size="large")
|
| 110 |
|
|
|
|
| 111 |
with gr.Group(visible=True) as hunt_group:
|
| 112 |
gr.Markdown("# AUTO HUNT – Any Target")
|
| 113 |
+
target = gr.Textbox(value="us.gate.com", label="Target")
|
| 114 |
hunt_btn = gr.Button("START AUTO HUNT", variant="primary", size="large")
|
| 115 |
short = gr.Textbox(label="Summary")
|
| 116 |
full = gr.Markdown(label="Full Report")
|
| 117 |
|
| 118 |
+
hunt_btn.click(auto_hunt, [target, mode], [short, full])
|
| 119 |
|
| 120 |
with gr.Group(visible=False) as forge_group:
|
| 121 |
gr.Markdown("# VIRUS FORGE\nReaper Mode Only.")
|
|
|
|
| 124 |
gr.Markdown("# TRAINING LAB\nAsk in Main Chat: 'train yourself on ...'")
|
| 125 |
|
| 126 |
def update_ui(selected_mode):
|
| 127 |
+
css = get_css(selected_mode.split(" ")[0])
|
| 128 |
mode_key = selected_mode.split(" ")[0]
|
|
|
|
| 129 |
|
| 130 |
return (
|
| 131 |
gr.update(visible=True), # MAIN CHAT
|
| 132 |
gr.update(visible=True), # AUTO HUNT
|
| 133 |
gr.update(visible=mode_key == "Reaper"), # VIRUS FORGE
|
| 134 |
gr.update(visible=True), # TRAINING
|
| 135 |
+
css
|
| 136 |
)
|
| 137 |
|
| 138 |
mode.change(update_ui, mode, [chat_group, hunt_group, forge_group, train_group, demo])
|
|
|
|
| 149 |
|
| 150 |
demo.launch(
|
| 151 |
theme=gr.themes.Base(),
|
| 152 |
+
css=get_css("Reaper"), # default Reaper theme
|
| 153 |
server_name="0.0.0.0",
|
| 154 |
server_port=7860,
|
| 155 |
share=False
|