| import os |
| import re |
| import requests |
| import gradio as gr |
| import logging |
| import random |
| import time |
| import phonenumbers |
| from phonenumbers import carrier, geocoder, timezone |
|
|
| |
| logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') |
| logger = logging.getLogger(__name__) |
|
|
| |
| HEADER_IMG = "2.png" |
| INDOOR_IMG = "in.jpg" |
|
|
| USER_AGENTS = [ |
| "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36", |
| "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36" |
| ] |
|
|
| |
|
|
| def format_output(title, data_dict): |
| """Memformat data agar sejajar sempurna secara vertikal.""" |
| if not data_dict: |
| return "β Data not available." |
| max_key_len = max(len(str(key)) for key in data_dict.keys()) |
| separator = "β" * 45 |
| header = f" π‘οΈ {title}\n{separator}\n" |
| |
| body = "" |
| for key, value in data_dict.items(): |
| body += f" {str(key).ljust(max_key_len)} : {value}\n" |
| |
| return header + body |
|
|
| def start_tracking(mode, target): |
| if not mode or not target: |
| yield "β Error: Please select a Mode and enter a Target!", "" |
| return |
|
|
| yield f"π‘ Initializing {mode}...", "Establishing secure connection..." |
| time.sleep(1.0) |
|
|
| if mode == "IP Tracker": |
| yield "π Scanning IP Address...", "Searching global database..." |
| try: |
| res = requests.get(f"http://ipwho.is/{target}", timeout=10) |
| data = res.json() |
| if not data.get("success"): |
| yield "β Failed!", f"IP {target} not found or invalid." |
| return |
| |
| info = { |
| "IP Target" : data.get("ip"), |
| "Country" : f"{data.get('country')} {data.get('flag', {}).get('emoji', '')}", |
| "City" : data.get("city"), |
| "ISP" : data.get("connection", {}).get("isp"), |
| "Organization" : data.get("connection", {}).get("org"), |
| "Timezone" : data.get("timezone", {}).get("id"), |
| "Coordinates" : f"{data.get('latitude')}, {data.get('longitude')}", |
| "Google Maps" : f"http://google.com/maps/place/{data.get('latitude')},{data.get('longitude')}" |
| } |
| yield "β
Tracking Complete!", format_output("IP INTELLIGENCE REPORT", info) |
| except Exception as e: |
| yield "β Connection Error", str(e) |
|
|
| elif mode == "Phone Tracker": |
| yield "π Analyzing Phone Number...", "Verifying international prefix..." |
| try: |
| parsed = phonenumbers.parse(target, None) |
| if not phonenumbers.is_valid_number(parsed): |
| yield "β Failed!", "Invalid or non-existent number. Use format (+62...)" |
| return |
| |
| info = { |
| "Number" : phonenumbers.format_number(parsed, phonenumbers.PhoneNumberFormat.INTERNATIONAL), |
| "Location" : geocoder.description_for_number(parsed, "id"), |
| "Carrier/Op" : carrier.name_for_number(parsed, "en"), |
| "Timezone" : ", ".join(timezone.time_zones_for_number(parsed)), |
| "Valid Status" : "Verified β
", |
| "Number Type" : "Mobile" if phonenumbers.number_type(parsed) == 1 else "Fixed Line" |
| } |
| yield "β
Tracking Complete!", format_output("PHONE INTELLIGENCE REPORT", info) |
| except Exception as e: |
| yield "β Format Error", "Ensure the number starts with '+' and country code." |
|
|
| |
| css = """ |
| :root { |
| --primary-600: #ff1212 !important; |
| } |
| .main-header { border: 2px solid #ff1212; border-radius: 12px; padding: 15px; background: white; text-align: center; margin-bottom: 15px; } |
| .main-header h1 { color: #ff1212 !important; font-weight: 900 !important; font-size: 28px !important; margin: 0; } |
| .section-tag { background: #ff1212; color: white; padding: 3px 12px; border-radius: 5px; font-size: 11px; font-weight: 700; display: inline-block; margin: 12px 0; } |
| .char-btn { background: white !important; border-left: 5px solid #ff1212 !important; text-align: left !important; font-size: 14px !important; margin-bottom: 5px !important; width: 100%; color: #4a5568 !important; font-weight: bold !important; } |
| .action-btn { background: #ff1212 !important; color: white !important; font-weight: 700 !important; border-radius: 10px !important; height: 50px !important; width: 100%; border: none !important; margin-top: 5px; cursor: pointer; } |
| .result-box textarea { background: #0a0a0a !important; color: #ff1212 !important; font-family: 'Courier New', monospace !important; font-weight: bold !important; border: 1px solid #ff1212 !important; border-radius: 8px !important; } |
| .warning-card { background: #fff5f5; border: 1px solid #feb2b2; border-radius: 10px; padding: 15px; margin: 10px 0; text-align: center; } |
| .warning-header { color: #c53030; font-weight: 800; font-size: 14px; margin-bottom: 6px; } |
| .warning-body { color: #9b2c2c; font-size: 12px; line-height: 1.5; font-weight: 600; } |
| .note-card { background: #fffcf0; border: 1px solid #f5e6a3; border-radius: 10px; padding: 12px; margin-top: 20px; } |
| .credit-footer { margin-top: 20px; padding: 10px; text-align: center; border-bottom: 4px solid #ff1212; color: #94a3b8; font-weight: 700; font-size: 12px; letter-spacing: 2px; } |
| """ |
|
|
| |
| with gr.Blocks(css=css) as app: |
| with gr.Column(scale=1): |
| gr.HTML(""" |
| <div class="main-header"> |
| <h1>TRACK ATTACK π₯</h1> |
| <p style="color:#555;font-size:13px;font-weight:600;">Advanced Intelligence Gathering Tool</p> |
| </div> |
| """) |
|
|
| if os.path.exists(HEADER_IMG): |
| gr.Image(HEADER_IMG, show_label=False, interactive=False, height=160) |
|
|
| gr.HTML('<div class="section-tag">PILIH MODE LACAK</div>') |
| sel_mode = gr.State("") |
| mode_display = gr.Markdown("π *Status: Select Track (Number Phone or IP Track)*") |
| |
| with gr.Row(): |
| btn_ip = gr.Button("π IP Tracker", elem_classes="char-btn") |
| btn_phone = gr.Button("π Phone Tracker", elem_classes="char-btn") |
|
|
| btn_ip.click(fn=lambda: ("IP Tracker", "π Mode: **IP Tracker Selected**"), outputs=[sel_mode, mode_display]) |
| btn_phone.click(fn=lambda: ("Phone Tracker", "π Mode: **Phone Number Selected**"), outputs=[sel_mode, mode_display]) |
|
|
| target_input = gr.Textbox(label="Target Input", placeholder="Enter IP (e.g. 8.8.8.8) or Phone (e.g. +62...)") |
|
|
| |
| gr.HTML(""" |
| <div class="warning-card"> |
| <div class="warning-header">π MINNA ADVISORY π</div> |
| <div class="warning-body"> |
| To track a number, you must start with the country code!<br> |
| For example (Indonesia): <b>+6282274510026</b>.<br> |
| Please ensure it matches the respective country's format. β¨<br><br> |
| <i>Make sure you enter it correctly; if the number or IP is wrong or does not exist, the tracking will fail.</i> |
| </div> |
| </div> |
| """) |
|
|
| btn_track = gr.Button("STARTING TRACK π₯", elem_classes="action-btn") |
| |
| gr.HTML('<div class="section-tag">GHOSTTRACK / Results Scan</div>') |
| status_out = gr.Textbox(label="System Status", interactive=False) |
| track_output = gr.TextArea(label="Intelligence Report", interactive=False, lines=10, elem_classes="result-box") |
|
|
| if os.path.exists(INDOOR_IMG): |
| gr.Image(INDOOR_IMG, show_label=False, interactive=False, height=180) |
|
|
| btn_track.click(fn=start_tracking, inputs=[sel_mode, target_input], outputs=[status_out, track_output]) |
|
|
| gr.HTML(""" |
| <div class="note-card"> |
| <div style="color: #b58900; font-weight: 800; font-size: 13px;">β οΈ DISCLAIMER</div> |
| <div style="color: #7d6a2a; font-size: 11px; font-style: italic;"> |
| "This tool is for educational purposes. <b>Tools ini tidak akurat 100%</b> because data depends on public databases and provider changes. Use wisely." |
| </div> |
| </div> |
| """) |
|
|
| gr.HTML("""<div class="credit-footer">CREATOR MUTSUMI π₯</div>""") |
|
|
| if __name__ == "__main__": |
| app.launch(server_name="0.0.0.0", server_port=7860) |