DNS & Port Scanner Tool Script
DNS & Port Scanner Tool Script
PY
import subprocess
import re
import sys
import json
import time
import base64
from datetime import datetime
def print_banner():
print([Link] + [Link] + """
╔══════════════════════════════════════════════════╗
║ ULTIMATE DNS & PORT HUNTER ║
║ Clean URL | Dig | Stegano | GeoIP | Nmap ║
╚══════════════════════════════════════════════════╝
""" + [Link])
try:
# Perintah Nmap: -F (Fast scan/100 port populer), -sV (Cek versi layanan)
cmd = ['nmap', '-F', '-sV', '--open', target]
nmap_output = subprocess.check_output(cmd, encoding='utf-8',
stderr=[Link])
if nmap_output:
result_text = f"\n{[Link]}[!] HASIL NMAP SCAN (Port Terbuka):
{[Link]}\n{nmap_output}"
print(result_text)
if log_file:
log_file.write("\n--- NMAP SCAN RESULT ---\n")
log_file.write(nmap_output + "\n")
else:
print([Link] + " [-] Nmap tidak menemukan port terbuka." +
[Link])
except FileNotFoundError:
print([Link] + " [!] Error: Nmap belum terinstall di sistem kamu."
+ [Link])
except Exception as e:
print([Link] + f" [!] Gagal menjalankan Nmap: {e}" + [Link])
def run_command(command_list):
try:
return subprocess.check_output(command_list, encoding='utf-8',
stderr=[Link]).strip()
except: return None
def get_ip_details(ip):
try:
cmd = ['curl', '-s', f'[Link]
fields=status,country,city,isp']
response = run_command(cmd)
if response:
data = [Link](response)
if [Link]('status') == 'success':
return f"{[Link]('city')}, {[Link]('country')} | ISP:
{[Link]('isp')}"
except: pass
return "Lokasi tidak diketahui"
if r_type == 'A':
ips = [Link](r'\b(?:\d{1,3}\.){3}\d{1,3}\b', raw_output)
for ip in set(ips):
info = get_ip_details(ip)
print([Link] + f" -> INFO IP {ip}: {info}" +
[Link])
if r_type == 'TXT':
content = [Link](r'"([^"]*)"', raw_output)
for text in content:
for found in analyze_steganography(text):
print([Link] + [Link] + f" {found}" +
[Link])
if r_type == 'CNAME':
for line in raw_output.splitlines():
parts = [Link]()
if parts: found_cnames.append(parts[-1].rstrip('.'))
# Auto-Follow CNAME
for next_domain in found_cnames:
if next_domain not in processed:
print([Link] + f"\n[!] Melacak CNAME ke: {next_domain}" +
[Link])
recursive_grabber(next_domain, processed, log_file)
def main():
print_banner()
raw_input = input([Link] + "Masukkan Domain Link: " + [Link]).strip()
if not raw_input: return
target = clean_domain(raw_input)
print([Link] + f"[*] Target Teridentifikasi: {target}" + [Link])
filename = f"recon_{[Link]('.','_')}.txt"
with open(filename, "w") as f:
[Link](f"FULL RECON REPORT: {target}\nGenerated: {[Link]()}\n")
if __name__ == "__main__":
try: main()
except KeyboardInterrupt: print("\n[!] Dihentikan.")
[Link]
import re
import base64
import hashlib
import time
import os
import sys
import itertools
import subprocess
import json
import signal
import pickle
import random
import shutil
import zipfile
from shlex import quote
from datetime import datetime, timedelta
from typing import Dict, List, Iterable, Optional, Tuple
# ==============================================================================
# SEKTOR 01: TERMINAL_CTL_INFERENCE
# ==============================================================================
try:
from colorama import Fore, Style, init
init(autoreset=True)
CLEAR_LINE_TO_END = '\r\033[K'
CURSOR_UP_1 = '\033[1A'
except ImportError:
class DummyColor:
def getattr(self, name): return ""
Fore = DummyColor()
Style = DummyColor()
CLEAR_LINE_TO_END = '\r'
CURSOR_UP_1 = ''
# ==============================================================================
# SEKTOR 02: CORE_CONFIG_DEPLOYMENT (HYPER-TUNED V41)
# ==============================================================================
CPU_COUNT = os.cpu_count() or 4
CONFIG = {
"MAX_PPL": 8,
"SESSION_NAME": "JTR_BFA_SESSION",
# [TUNING V41] Log diperlambat agar CPU tidak sibuk menulis file status
"LOG_INTERVAL_WORKER": 3.0,
"LOG_INTERVAL_MONITOR": 0.5,
"FILES": {
"KEY_TMP": "FOUND_KEY.tmp", "TIME_TMP": "[Link]",
"LOCK": "TERMINAL_LOCK.lock",
"REPORT": "CRACK_REPORT.txt", "STATUS_PREFIX": "STATUS_P", "STATUS_SUFFIX":
".tmp"
},
"WEBHOOK_URL": "",
"MAX_CORES": CPU_COUNT,
# [TUNING V41] Batch dinaikkan ke 3000 untuk mengurangi "File Open Overhead"
"BATCH_SIZE_CRACK": 3000,
}
WORKER_ID_SIGNAL = 0
IS_SIGNALED = False
TOTAL_WORKERS_GLOBAL = CPU_COUNT
CURRENT_ACTIVE_WORKERS = CPU_COUNT
# ==============================================================================
# SEKTOR 03: SYNC_DATA_HANDLER
# ==============================================================================
def check_found_key():
key_path = CONFIG["FILES"]["KEY_TMP"]
time_path = CONFIG["FILES"]["TIME_TMP"]
key = None; elapsed = None
if [Link](key_path):
try:
with open(key_path, 'r') as f: key = [Link]().strip()
if [Link](time_path):
with open(time_path, 'r') as f: elapsed = [Link]().strip()
try:
[Link](key_path)
if [Link](time_path): [Link](time_path)
except Exception: pass
return key, elapsed
except Exception: pass
return None, None
# ==============================================================================
# SEKTOR 04: ARCHIVE_ANALYSIS_ENGINE (V41 OPTIMIZED)
# ==============================================================================
try:
with [Link](path, 'r') as zf:
pass
meta["Enc"] = f"{[Link]}ENCRYPTED (ZIP){Style.RESET_ALL}"
except [Link]:
meta["Enc"] = f"{[Link]}ERROR / CORRUPT ARCHIVE{Style.RESET_ALL}"
except Exception:
meta["Enc"] = f"{[Link]}ENCRYPTED (ZIP){Style.RESET_ALL}"
return meta
except Exception:
return False, None
# ==============================================================================
# SEKTOR 05: POST_CRACK_EXTRACTION
# ==============================================================================
if not [Link](dest_dir):
[Link](dest_dir)
try:
with [Link](path, 'r') as zf:
[Link]([Link]('utf-8'))
[Link](dest_dir)
# ==============================================================================
# SEKTOR 06: INTERFACE_OUTPUT_RENDER
# ==============================================================================
if total_speed > 0:
kps = total_speed / 1000.0; speed_str = f"{kps:,.2f}"; unit_str = "K/S"
else:
speed_str = "0"; unit_str = "P/S"
elapsed_time_str = format_time(elapsed_seconds)
header = (
f"{[Link]}KEY_LEN {current_ppl}{Style.RESET_ALL} | "
f"{[Link]}SPEED ({unit_str}):{Style.RESET_ALL} {[Link]}{speed_str}
{Style.RESET_ALL} | "
f"{[Link]}TESTED_TOTAL:{Style.RESET_ALL} {[Link]}{total_tested:,}
{Style.RESET_ALL} "
f"(RUNTIME: {[Link]}{elapsed_time_str}{Style.RESET_ALL})"
)
key_test_prefix = f"{[Link]}KEY_TEST:{Style.RESET_ALL} "
[Link](CURSOR_UP_1 * 3)
[Link]()
[Link](CLEAR_LINE_TO_END)
[Link](header)
[Link]('\n')
[Link](CLEAR_LINE_TO_END)
[Link](key_test_prefix)
[Link]('\n')
[Link]()
[Link](CONFIG["LOG_INTERVAL_MONITOR"] - total_delay)
RANDOM_TRIAL_DURATION = 1.2
SLOW_PRINT_DELAY = 0.007
base_num_trials = int(RANDOM_TRIAL_DURATION / SLOW_PRINT_DELAY)
num_trials = [Link](base_num_trials, base_num_trials + 20)
anim_charset = GLOBAL_CHARSET
key_length = len(key)
BRIGHT_STYLE = [Link]
PADDING = 60
CURSOR_UP_LINES = 2
print(f"\
n{[Link]}========================================{Style.RESET_ALL}")
print(f"{[Link]}[SYSTEM ALERT] KEY FOUND. VALIDATION SUCCESS.
{Style.RESET_ALL}")
print(f"{[Link]}========================================{Style.RESET_ALL}")
print("\n")
[Link](f"CANDIDATE KEY: {[Link]}INITIALIZING...
{Style.RESET_ALL}\n")
[Link](f"VERIFIED KEY: {[Link]}INITIALIZING...{Style.RESET_ALL}\
n")
[Link]()
[Link](CURSOR_UP_1 * CURSOR_UP_LINES)
[Link]()
for i in range(key_length):
correct_part = key[:i]
target_char = key[i]
for j in range(num_trials):
random_char = [Link](anim_charset)
output_trial = correct_part + random_char + ([Link] + '?' *
(key_length - i - 1) + Style.RESET_ALL)
[Link](f"\r{CURSOR_UP_1}")
[Link](f"CANDIDATE KEY: {BRIGHT_STYLE}{[Link]}
{output_trial:<{PADDING}}{Style.RESET_ALL}")
[Link]()
[Link](SLOW_PRINT_DELAY)
[Link](0.5)
[Link]('\n')
final_key_display = f"{BRIGHT_STYLE}{[Link]}{key}{Style.RESET_ALL}"
# ==============================================================================
# SEKTOR 07: PROCESS_WORKER_EXECUTION
# ==============================================================================
WORKER_ID_SIGNAL = idx
[Link]([Link], signal_handler)
if mode == 'BRUTE':
fppc = args['fppc']; current_ppl = args['current_ppl']
if rem_combs <= 0:
return
start_iter = idx
gen = gen_brute(ppl_len, fppc, GLOBAL_CHARSET, start_iter, total_workers,
rem_combs)
password_batch = []
last_pwd = ""
password_batch.append(pwd)
last_pwd = pwd
if [Link](CONFIG["FILES"]["KEY_TMP"]): return
tested_count = len(password_batch)
tested_local += tested_count
tested_since_log += tested_count
password_batch = []
if found:
write_found_key(key, format_time([Link]() - start_time))
[Link](f"tmux kill-session -t {CONFIG['SESSION_NAME']}")
return
now = [Link]()
status_data = {
"time": format_time(elapsed), "speed": f"{speed:.0f} p/s",
"pwd": last_pwd, "ppl": current_ppl, "tested_count":
tested_local, "ts": now
}
update_worker_status_file(idx, status_data)
last_log = now; tested_since_log = 0
if password_batch:
if not [Link](CONFIG["FILES"]["KEY_TMP"]):
found, key = test_password_batch(path, password_batch)
tested_local += len(password_batch)
if found:
write_found_key(key, format_time([Link]() - start_time))
[Link](f"tmux kill-session -t {CONFIG['SESSION_NAME']}")
return
now = [Link]()
speed = tested_since_log / (now - last_log) if (now - last_log) > 0 else 0
elapsed = now - start_time
status_data = {
"time": format_time(elapsed), "speed": f"{speed:.0f} p/s",
"pwd": last_pwd if last_pwd else "EXHAUSTED", "ppl": current_ppl,
"tested_count": tested_local, "ts": now
}
update_worker_status_file(idx, status_data)
return
else:
return
# ==============================================================================
# SEKTOR 08: MAIN_OP_CENTER_INIT
# ==============================================================================
def get_user_input_safe(prompt):
try:
return input(prompt)
except KeyboardInterrupt:
raise
except EOFError:
raise KeyboardInterrupt
def main_setup():
global TOTAL_WORKERS_GLOBAL, CURRENT_ACTIVE_WORKERS
[Link]("clear")
print(f"{[Link]}============================================={Style.RESET_ALL}
")
print(f"ARCHIVE KEY RECOVERY UTILITY [JTR-BFA CORE V6.1] (RELEASE V41 - HYPER
TURBO)")
print(f"MODULE: High-Performance Brute Force & Dictionary Analysis Core")
print(f"{[Link]}============================================={Style.RESET_ALL}
")
cpu_count = os.cpu_count() or 4
CONFIG["MAX_CORES"] = cpu_count
TOTAL_WORKERS_GLOBAL = cpu_count
CURRENT_ACTIVE_WORKERS = cpu_count
target_dir = "/storage/emulated/0/FFN"
archive_path = ""
files_to_clean = list(CONFIG["FILES"].values())
for file_name in files_to_clean:
if file_name not in ["STATUS_PREFIX", "STATUS_SUFFIX"] and
[Link](file_name):
try: [Link](file_name)
except: pass
for i in range(cpu_count):
status_file = f"{CONFIG['FILES']['STATUS_PREFIX']}{i}{CONFIG['FILES']
['STATUS_SUFFIX']}"
if [Link](status_file):
try: [Link](status_file)
except: pass
if [Link](target_dir):
[Link](target_dir)
files = [f for f in [Link]() if [Link]().endswith(('.zip'))]
if files:
print(f"\n[SCAN] Target Directory [{target_dir}] Archive Files:");
for i, f in enumerate(files): print(f" [{i+1}] {f}")
print(" [0] Manual Archive Path Entry")
while True:
sel = get_user_input_safe(f"{[Link]}[>] Select Archive Index
(0 for Manual Path):{Style.RESET_ALL} ").strip()
if [Link]():
idx = int(sel)
if 0 < idx <= len(files):
archive_path = [Link](files[idx-1]); break
elif idx == 0:
archive_path = get_user_input_safe("Enter Full Archive
Path (.zip): ").strip()
if archive_path.lower().endswith('.zip'): break
else: print(f"{[Link]}[ERROR] File must be a .zip
archive.{Style.RESET_ALL}")
atype = 'zip'
print("-" * 40)
meta = analyze_archive(archive_path)
print(f"TARGET_FILE: {[Link](archive_path)}")
print(f"ARCHIVE_SIZE: {meta['Size']} | MD5_HASH: {meta['MD5']}")
print(f"ENCRYPTION_STATUS: {meta['Enc']}")
print(f"ANALYSIS_MODE: {[Link]}ZIP NATIVE (Hyper-Turbo Optimized)
{Style.RESET_ALL}")
print("-" * 40)
base_args = {
"path": archive_path, "type": atype, "mode": mode, "workers":
CONFIG["MAX_CORES"],
"ifile": "N/A", "tmode": "FAST",
}
current_ppl = 0
if mode == "BRUTE":
while True:
try:
fixed_ppl = int(get_user_input_safe(f"TARGET_KEY_LENGTH (N, Max
{CONFIG['MAX_PPL']}): "))
if 1 <= fixed_ppl <= CONFIG['MAX_PPL']: break
elif fixed_ppl > CONFIG['MAX_PPL']: print(f"{[Link]}[ERROR] Key
Length exceeds Max PPL ({CONFIG['MAX_PPL']}).{Style.RESET_ALL}")
except ValueError:
print(f"{[Link]}[ERROR] Invalid input. Please enter a number.
{Style.RESET_ALL}")
except KeyboardInterrupt:
raise
current_ppl = fixed_ppl
base_args['current_ppl'] = current_ppl
while True:
fppc = get_user_input_safe("INITIAL_CHARACTER (First Position):
").strip()
if len(fppc) == 1 and fppc in GLOBAL_CHARSET:
base_args['fppc'] = fppc; break
elif len(fppc) != 1:
print(f"{[Link]}[ERROR] Initial Character must be single
character.{Style.RESET_ALL}")
else:
print(f"{[Link]}[ERROR] Initial Character '{fppc}' not in
supported charset. Charset size: {len(GLOBAL_CHARSET)}.{Style.RESET_ALL}")
else:
while True:
wlist = get_user_input_safe("WORDLIST_PATH: ").strip()
if [Link](wlist): base_args['wlist'] = [Link](wlist);
break
print("[ERROR] Wordlist Not Found!")
start_monitor_time = [Link]()
KEY_FOUND_FLAG = False
FOUND_KEY = None
target_archive_path = archive_path
if mode == 'BRUTE':
print(f"\n[PROCESS] INITIATING PROCESSORS ({CONFIG['MAX_CORES']} Workers)
for KEY_LEN {current_ppl}...")
[Link](1)
[Link](["tmux", "kill-session", "-t", CONFIG["SESSION_NAME"]],
stderr=[Link])
serialized_args = base64.b64encode([Link](base_args)).decode()
script = [Link](__file__)
[Link]('\n')
[Link]('\n' * 3)
[Link]()
[Link](CURSOR_UP_1 * 3)
[Link]()
current_worker_index = 0
try:
while True:
tmux_status = [Link](["tmux", "has-session", "-t",
CONFIG["SESSION_NAME"]],
stdout=[Link],
stderr=[Link]).returncode
key, elapsed = check_found_key()
if key:
KEY_FOUND_FLAG = True
FOUND_KEY = key
[Link]('\n' * 3)
animate_found_key(key, duration=0.8)
[Link](["tmux", "kill-session", "-t",
CONFIG["SESSION_NAME"]], stderr=[Link])
break
if tmux_status != 0:
[Link]('\n' * 3)
print(f"{[Link]}[INFO] KEY_LEN {current_ppl} Range
Exhausted. Analysis Finished.{Style.RESET_ALL}")
break
if FOUND_KEY:
extract_choice = get_user_input_safe(f"[INPUT] Execute Extraction Routine
(y/n): ").lower().strip()
if extract_choice == 'y':
dest_dir = "/storage/emulated/0/FFN/Extracted_zip"
print(f"{[Link]}[INFO] Extraction Output Target:{Style.RESET_ALL}
{dest_dir}")
extract_archive(target_archive_path, FOUND_KEY, dest_dir)
else:
print(f"{[Link]}[INFO] Extraction Skipped by User Request.
{Style.RESET_ALL}")
if __name__ == "__main__":
if len([Link]) > 1 and [Link][1] == "WORKER":
try:
idx = int([Link][2])
args = [Link](base64.b64decode([Link][3]))
worker_routine(idx, args)
except Exception:
[Link](10)
else:
try:
main_setup()
except KeyboardInterrupt:
print(f"\n{[Link]}[ALERT] SYSTEM INTERRUPT DETECTED. TERMINATING ALL
ACTIVE SESSIONS.{Style.RESET_ALL}")
[Link](["tmux", "kill-session", "-t", CONFIG["SESSION_NAME"]],
stdout=[Link], stderr=[Link])
for i in range(os.cpu_count() or 4):
status_file = f"{CONFIG['FILES']['STATUS_PREFIX']}{i}
{CONFIG['FILES']['STATUS_SUFFIX']}"
if [Link](status_file):
try: [Link](status_file)
except: pass
if [Link](CONFIG["FILES"]["LOCK"]): [Link](CONFIG["FILES"]
["LOCK"])
[Link](0)
HASHCAT (NUMERIC).PY
import re
import base64
import hashlib
import time
import os
import math
import sys
from tabulate import tabulate
import itertools
import subprocess
from shlex import quote
import zipfile
from typing import Dict, List, Iterable
except ImportError:
class DummyColor:
def __getattr__(self, name): return ""
Fore = DummyColor()
Style = DummyColor()
CLEAR_LINE = '\r'
CURSOR_UP_2 = ''
# --------------------------------------------------------------------
# --- KONFIGURASI V56: PURE NUMERIC & NO PADDING ---
# --------------------------------------------------------------------
TOTAL_COMBINATIONS = 10**12
# KONFIGURASI CHUNKING
CHUNK_SIZE = 100_000
TOTAL_WORKERS = 4
FOUND_KEY = None
# INPUT GLOBAL
ARCHIVE_PATH = ""
ARCHIVE_TYPE = ""
INTERNAL_FILE_NAME = ""
TEST_MODE = "FAST"
# Variabel yang Dihapus: BRUTE_MODE, QR_STRING_PREFIX
# --------------------------------------------------------------------
if archive_type == 'zip':
command = ["unzip", "-l", archive_path]
elif archive_type == '7z':
command = ["7z", "l", archive_path]
else:
return []
try:
result = [Link](
command,
capture_output=True,
text=True,
check=False,
timeout=10
)
if [Link] != 0:
return []
output_lines = [Link]().split('\n')
contents = []
if archive_type == 'zip':
in_file_list = False
for line in output_lines:
if [Link](r'^\s*-+\s*$', line):
in_file_list = True
continue
if in_file_list and not [Link](r'files?$', line) and
[Link]():
parts = [Link]().split()
if len(parts) >= 4:
file_name = parts[-1]
if file_name not in ['.', '..'] and not
file_name.endswith('/'):
[Link](file_name)
except Exception:
return []
success = False
if test_mode == 'FAST':
# MODE 1: Uji Integritas (Cepat)
if archive_type == 'zip':
command = [
"unzip", "-qq", "-t", "-P", password_quoted, archive_path
]
try:
result = [Link](command, stdout=[Link],
stderr=[Link], check=False, timeout=5)
if archive_type == 'zip':
success = [Link] in [0, 1]
elif archive_type == '7z':
success = [Link] == 0
except Exception:
pass
try:
if archive_type == 'zip':
command = ["unzip", "-j", "-P", password_quoted, archive_path,
internal_file_quoted, "-d", temp_dir]
elif archive_type == '7z':
command = ["7z", "e", archive_path, internal_file_quoted, f"-
p{password_quoted}", f"-o{temp_dir}", "-y"]
else:
return False
extracted_base_name = [Link](internal_file_name.replace('\\',
'/'))
extracted_file_path = [Link](temp_dir, extracted_base_name)
except Exception:
pass
finally:
try:
if [Link](temp_dir):
for item in [Link](temp_dir):
[Link]([Link](temp_dir, item))
[Link](temp_dir)
except Exception:
pass
return success
# --------------------------------------------------------------------
# --- FUNGSI WORKER BFA PURE NUMERIC ---
# --------------------------------------------------------------------
def brute_force_sequential(
worker_index: int,
session_start_time: float,
archive_path: str,
archive_type: str,
internal_file_name: str,
test_mode: str,
# Argumen yang Dihapus: qr_string_prefix
) -> str | None:
global FOUND_KEY
start_num = worker_index
step_size = TOTAL_WORKERS
total_tested_by_this_worker = 0
last_checked_time = [Link]()
last_tested_count = 0
total_tested_by_this_worker += 1
current_time = [Link]()
time_diff = current_time - last_checked_time
tested_diff = total_tested_by_this_worker - last_tested_count
last_checked_time = current_time
last_tested_count = total_tested_by_this_worker
try:
# Ambil Mutex Lock
lock_fd = [Link](LOCK_FILE, os.O_CREAT | os.O_EXCL | os.O_WRONLY)
[Link](lock_fd)
[Link](CURSOR_UP_2)
[Link](CLEAR_LINE)
pt_s_str = f"{pt_per_second:,.0f}"
progress_info = (
f"\r[{[Link]}{pane_label}/C{virtual_chunk_num}
{Style.RESET_ALL}] "
f"{index_label} "
f"({[Link]}{session_time_str}{Style.RESET_ALL}) "
f"({[Link]}Pt/s: {pt_s_str}{Style.RESET_ALL}): "
f"{[Link]}{password}{Style.RESET_ALL}\n"
f"{[Link]}STATUS: {[Link]}Running...{Style.RESET_ALL}"
)
[Link](progress_info)
[Link]()
[Link](LOCK_FILE)
except FileExistsError:
pass
except Exception:
pass
# --- MUTEX LOGIC END ---
if is_correct:
write_found_key(password, session_time_str)
[Link](CLEAR_LINE)
[Link]()
FOUND_KEY = password
return password
[Link](CLEAR_LINE)
[Link]()
return None
# --------------------------------------------------------------------
# --- FUNGSI UTAMA & SETUP TMUX (Layout 2x2) ---
# --------------------------------------------------------------------
def run_worker(worker_index: int, archive_path_encoded: str, archive_type: str,
internal_file_name_encoded: str, test_mode_encoded: str):
# Argumen yang Dihapus: qr_string_prefix_encoded
session_start_time = [Link]()
found_key = brute_force_sequential(
worker_index, session_start_time, ARCHIVE_PATH, ARCHIVE_TYPE,
INTERNAL_FILE_NAME, TEST_MODE # Argumen Dihapus: ""
)
if found_key:
[Link](CLEAR_LINE)
[Link]()
print(f"{[Link]}✅ Worker berhenti. Kunci ditemukan: {found_key}
{Style.RESET_ALL}")
[Link](5)
def setup_tmux_and_run():
print(f"{[Link]}============================================={Style.RESET_ALL}
")
print(f"JtR V56 ({[Link]}BRUTE FORCE TOOLS{Style.RESET_ALL})")
print(f"{[Link]}============================================={Style.RESET_ALL}
")
print(f"Pane: {[Link]}{TOTAL_WORKERS}{Style.RESET_ALL}")
print(f"📦 key passpharse: *{TOTAL_COMBINATIONS:,}* (0 hingga 999,999,999,999)")
print(f"❗{[Link]} Utilty: John The Ripper Mail Edition{Style.RESET_ALL}")
print("-" * 50)
if mode_choice == '2':
TEST_MODE = 'VERIFY'
print(f"{[Link]}✅ Mode Verifikasi dipilih.{Style.RESET_ALL}")
else:
TEST_MODE = 'FAST'
print(f"{[Link]}✅ Mode Cepat dipilih.{Style.RESET_ALL}")
print("-" * 50)
try:
if [Link](storage_path):
print(f"{[Link]}Navigasi ke: {storage_path}{Style.RESET_ALL}")
[Link](storage_path)
finally:
[Link](current_cwd)
if not [Link](archive_path):
print(f"{[Link]}❌ File arsip tidak ditemukan di jalur: {archive_path}
{Style.RESET_ALL}")
return
ARCHIVE_PATH = archive_path
if ARCHIVE_PATH.lower().endswith('.zip'):
ARCHIVE_TYPE = 'zip'
elif ARCHIVE_PATH.lower().endswith('.7z'):
ARCHIVE_TYPE = '7z'
else:
print(f"{[Link]}❌ Format file tidak didukung ({ARCHIVE_PATH}). Hanya .zip
dan .7z.{Style.RESET_ALL}")
return
# --- 3. Tampilkan dan Pilih File Internal (Jika VERIFY mode) ---
INTERNAL_FILE_NAME = "N/A (FAST MODE)"
if TEST_MODE == 'VERIFY':
print("\n" + "-" * 50)
print(f"{[Link]}Membaca Daftar File di Dalam Arsip (Diperlukan untuk
VERIFY mode)...{Style.RESET_ALL}")
if not internal_files:
print(f"{[Link]}❌ Gagal mendapatkan daftar file internal atau arsip
kosong. Verifikasi Gagal.{Style.RESET_ALL}")
return
for i, f in enumerate(internal_files):
print(f" {[Link]}[{i+1}]{Style.RESET_ALL} {f}")
print("-" * 50)
try:
[Link](["tmux", "-V"], check=True, capture_output=True)
except FileNotFoundError:
print(f"{[Link]}❌ Error: Tmux tidak ditemukan. Harap instal Tmux.
{Style.RESET_ALL}")
[Link](1)
script_path = [Link](__file__)
# Enkode argumen
archive_path_encoded = base64.b64encode(ARCHIVE_PATH.encode()).decode()
internal_file_name_encoded =
base64.b64encode(INTERNAL_FILE_NAME.encode()).decode()
test_mode_encoded = base64.b64encode(TEST_MODE.encode()).decode()
# Argumen yang Dihapus: qr_string_prefix_encoded
try:
# P0: Buat sesi baru
cmd0 = f'python3 {quote(script_path)} 0 {quote(archive_path_encoded)}
{ARCHIVE_TYPE} {quote(internal_file_name_encoded)} {quote(test_mode_encoded)}'
[Link](["tmux", "new-session", "-d", "-s", SESSION_NAME, cmd0],
check=True)
# P1: Split window secara vertikal (P0 di kiri atas, P1 di kiri bawah)
cmd1 = f'python3 {quote(script_path)} 1 {quote(archive_path_encoded)}
{ARCHIVE_TYPE} {quote(internal_file_name_encoded)} {quote(test_mode_encoded)}'
[Link](["tmux", "split-window", "-t", f"{SESSION_NAME}:0.0", "-v",
cmd1], check=True)
# P2: Split window secara vertikal lagi di sebelah kanan P0 (P2 di kanan
atas)
cmd2 = f'python3 {quote(script_path)} 2 {quote(archive_path_encoded)}
{ARCHIVE_TYPE} {quote(internal_file_name_encoded)} {quote(test_mode_encoded)}'
[Link](["tmux", "split-window", "-t", f"{SESSION_NAME}:0.0", "-h",
cmd2], check=True)
if final_key:
total_attempts_gabungan = int(key_number_str) + 1
total_time_seconds = time_to_seconds(total_time_str)
tpa_micro = (total_time_seconds / total_attempts_gabungan) * 1_000_000
if total_time_seconds > 0 else 0
print(f"\
n{[Link]}======================================================================
====={Style.RESET_ALL}")
print(f"{[Link]}BFA Arsip Berhasil! Password ditemukan: {[Link]}
{final_key}{Style.RESET_ALL} (Ditemukan oleh Worker {finder_worker})")
print(f"💾 File Arsip: {ARCHIVE_PATH}")
print(f"📄 Mode Uji: {TEST_MODE}")
if TEST_MODE == 'VERIFY':
print(f"📄 File Internal Uji: {INTERNAL_FILE_NAME}")
# Argumen yang Dihapus: QR String Prefix
print(f"🔑 Tipe Brute Force: {[Link]}PURE NUMERIC (No Padding)
{Style.RESET_ALL}")
print(f"⏰ Total waktu pemulihan: {[Link]}{total_time_str}
{Style.RESET_ALL}")
print(f" Rata-rata Waktu Per Percobaan (TPA): {[Link]}
{tpa_micro:,.3f} \u03bc s{Style.RESET_ALL}")
print(f"\
n{[Link]}======================================================================
====={Style.RESET_ALL}")
except [Link] as e:
print(f"{[Link]}❌ Gagal mengeksekusi perintah Tmux: {e}
{Style.RESET_ALL}")
[Link](1)
if __name__ == "__main__":
if len([Link]) == 6:
try:
worker_index = int([Link][1])
archive_path_encoded = [Link][2]
archive_type = [Link][3]
internal_file_name_encoded = [Link][4]
test_mode_encoded = [Link][5]
[Link]
import base64
import hashlib
import os
import sys
from [Link] import Cipher, algorithms, modes
from [Link] import padding
from [Link] import default_backend
from colorama import Fore, Style, init
init(autoreset=True)
# Fungsi Kriptografi
def derive_key(password: str) -> bytes:
"""Menggunakan SHA256 untuk mendapatkan kunci 16-byte (AES-128)."""
return hashlib.sha256([Link]('utf-8')).digest()[:16]
decrypted_padded = [Link](ciphertext_bytes) +
[Link]()
# Cek validitas data terdekripsi (Harus dimulai dengan "Nama:" atau field
valid)
decoded_str = decrypted_bytes.decode('utf-8')
if not decoded_str.startswith("Nama:"):
return None
return decoded_str
except Exception:
return None
# Padding
padder = padding.PKCS7([Link].block_size).padder()
padded_data = [Link]([Link]('utf-8')) + [Link]()
# Enkripsi
cipher = Cipher([Link](key), [Link](iv), backend=default_backend())
encryptor = [Link]()
ciphertext = [Link](padded_data) + [Link]()
# Fungsi Utama
def run_password_reset():
print(f"\
n{[Link]}============================================={Style.RESET_ALL}")
print(f"{[Link]}🔑 QR IDENTITY PASSWORD RESET V13.0{Style.RESET_ALL}
(Dekripsi -> Enkripsi Ulang)")
print(f"{[Link]}============================================={Style.RESET_ALL}
")
if plaintext_data is None:
print(f"{[Link]}❌ GAGAL: Password Lama tidak valid atau data rusak.
{Style.RESET_ALL}")
return
new_qr_data = f"AES128|IV:{iv_b64_baru}|CT:{ciphertext_b64_baru}"
# 7. Hasil Akhir
print(f"{[Link]}✅ BERHASIL! QR Identity Baru telah dibuat.
{Style.RESET_ALL}")
print(f"{[Link]}Password Baru:{Style.RESET_ALL} {[Link]}{password_baru}
{Style.RESET_ALL}")
print("-" * 50)
print(f"{[Link]}QR Identity BARU:{Style.RESET_ALL} {new_qr_data}")
print("-" * 50)
if __name__ == "__main__":
try:
# Periksa dependensi
if 'cryptography' not in [Link]:
print(f"Error: Library 'cryptography' tidak ditemukan. Harap instal
dengan: pip install cryptography")
[Link]()
run_password_reset()
except Exception as e:
print(f"{[Link]}Terjadi Error Fatal: {e}{Style.RESET_ALL}")
[Link]
import subprocess
import re
import requests
import json
import time
import os
import sys # Import sys untuk [Link] dan [Link]
# --- Fungsi untuk Mencetak Teks Secara Bertahap (Hacker Effect) ---
def print_slowly(text, delay=0.01, end='\n'):
"""Prints text character by character with a delay."""
for char in text:
[Link](char)
[Link]()
[Link](delay)
[Link](end)
[Link]()
def get_network_info():
"""Detects network interface, IP, and CIDR."""
try:
result = [Link](['ip', '-4', 'addr', 'show', 'dev', 'wlan0'],
capture_output=True, text=True, check=False)
if [Link] != 0:
result = [Link](['ip', '-4', 'route', 'get', '[Link]'],
capture_output=True, text=True, check=True)
iface_match = [Link](r'dev (\S+)', [Link])
iface = iface_match.group(1) if iface_match else None
if not iface:
print_slowly(f"{[Link]}[!] Failed to detect network interface.
Make sure you are connected to Wi-Fi.{[Link]}")
return None, None, None
if not cidr:
print_slowly(f"{[Link]}[!] Failed to get CIDR for {iface}. Ensure
IP is configured.{[Link]}")
return None, None, None
my_ip = [Link]('/')[0]
except [Link] as e:
print_slowly(f"{[Link]}[!] Error running 'ip' command: {e}
{[Link]}")
print_slowly(f" Stderr: {[Link]}")
return None, None, None
except Exception as e:
print_slowly(f"{[Link]}[!] An unexpected error occurred: {e}
{[Link]}")
return None, None, None
def get_vendor_info(mac_address):
"""Retrieves vendor information for a given MAC address from an online API."""
if not mac_address or mac_address == "N/A" or
mac_address.startswith("00:00:00"):
return "N/A"
url = f"[Link]
try:
response = [Link](url, timeout=2)
response.raise_for_status()
data = [Link]()
return [Link]('company', 'N/A')
except [Link]:
return "N/A (Connection/API Error)"
except [Link]:
return "N/A (Invalid API format)"
except Exception:
return "N/A (Other Error)"
def scan_arp_cache(iface):
"""Scans the ARP cache for IPv4 devices on the specified interface."""
detected_devices = []
try:
# Using 'ip -4 neigh show dev IFACE' to directly filter IPv4 entries
result = [Link](['ip', '-4', 'neigh', 'show', 'dev', iface],
capture_output=True, text=True, check=True, timeout=10)
lines = [Link]()
if match:
ip = [Link](1)
mac = [Link](2)
status_raw = [Link](3)
status_clean = "N/A"
color = [Link]
if "REACHABLE" in status_raw:
status_clean = "REACHABLE"
color = [Link]
elif "STALE" in status_raw:
status_clean = "STALE"
color = [Link]
elif "DELAY" in status_raw:
status_clean = "DELAY"
color = [Link]
elif "PROBE" in status_raw:
status_clean = "PROBE"
color = [Link]
elif "INCOMPLETE" in status_raw:
status_clean = "INCOMPLETE"
color = [Link]
else:
status_clean = "UNKNOWN"
color = [Link]
return detected_devices
try:
# MAIN LOOP WITH 4-SECOND REFRESH
while True:
[Link]('clear') # Clear screen on each refresh
current_time = [Link]("%Y-%m-%d %H:%M:%S %Z", [Link]())
# Get current local time with timezone
print_slowly(f"{[Link]}====================================================
==={[Link]}", delay=0.005)
print_slowly(f"{[Link]} NETSCAN - Network Scanner
(LIVE) {[Link]}", delay=0.005)
print_slowly(f"{[Link]}====================================================
==={[Link]}", delay=0.005)
print_slowly(f"{[Link]}[*] Network Interface :
{[Link]}{IFACE}{[Link]}", delay=0.01)
print_slowly(f"{[Link]}[*] Network Subnet :
{[Link]}{CIDR}{[Link]}", delay=0.01)
print_slowly(f"{[Link]}[*] Your Local IP :
{[Link]}{MYIP}{[Link]}", delay=0.01)
print_slowly(f"{[Link]}[*] Real-time Vendor Lookup :
{[Link]}Yes (Requires Internet){[Link]}", delay=0.01)
print_slowly(f"{[Link]}[*] Last Updated :
{[Link]}{current_time}{[Link]}", delay=0.01)
print_slowly(f"{[Link]}----------------------------------------------------
---{[Link]}", delay=0.005)
print() # Blank line remains instant
devices = scan_arp_cache(IFACE)
print()
print_slowly(f"{[Link]}[*] Scan Results:{[Link]}",
delay=0.02)
print_slowly(f"{'-'*75}", delay=0.005)
if not devices:
print_slowly(f"{[Link]}No IPv4 devices detected in ARP
cache.{[Link]}", delay=0.02)
print_slowly(f"{[Link]}----------------------------------------------------
---{[Link]}", delay=0.005)
print_slowly(f"Total devices detected: {[Link]}{len(devices)}
{[Link]}", delay=0.02)
print_slowly(f"{[Link]}====================================================
==={[Link]}", delay=0.005)
print()
except KeyboardInterrupt:
print_slowly(f"\n{[Link]}[*] Scan interrupted by user. Exiting
gracefully.{[Link]}", delay=0.02)
[Link](0)
except Exception as e:
print_slowly(f"\n{[Link]}[!] An unexpected error occurred: {e}
{[Link]}", delay=0.02)
[Link](1)
[Link]
import speedtest
import time
from tqdm import tqdm
import os
import requests # Tambahkan library requests untuk keperluan pengecekan
# Variabel global
start_time = 0
progress_bar = None
MAX_RETRIES = 3 # Maksimal percobaan ulang jika terjadi error konfigurasi
def format_speed(speed_bps):
return f"{(speed_bps / 1_000_000):.2f} Mbps"
# ----------------------------------------------------
# --- FUNGSI CALLBACK TQDM ---
# ----------------------------------------------------
bytes_transferred = [Link]
elapsed_time = [Link]() - start_time
if elapsed_time > 0:
current_speed_bps = bytes_transferred / elapsed_time
current_speed_mbps = current_speed_bps / 1_000_000
progress_bar.set_description(f"Speed: {current_speed_mbps:.2f} Mbps")
progress_bar.update(len(block))
# ----------------------------------------------------
# --- FUNGSI UTAMA TES (SATU ITERASI) ---
# ----------------------------------------------------
def jalankan_speedtest_dengan_tqdm():
global start_time, progress_bar
print("\n" + "="*55)
print(f"🚀 MEMULAI TES BARU (Multicore: {THREADS_COUNT}) | Waktu:
{[Link]('%Y-%m-%d %H:%M:%S')}")
print("="*55)
if st is None:
print("❌ Gagal mendapatkan konfigurasi setelah beberapa kali percobaan.
Skip tes ini.")
return
# 4. Tes Download
print("\n⬇️ Memulai Tes Download...")
start_time = [Link]()
progress_bar = tqdm(total=int(TOTAL_BYTES_FINAL * 2), unit='B',
unit_scale=True, desc="Download")
[Link](threads=THREADS_COUNT, callback=tqdm_callback)
progress_bar.close()
# 5. Tes Upload
print("⬆️ Memulai Tes Upload...")
start_time = [Link]()
progress_bar = tqdm(total=int(TOTAL_BYTES_FINAL * 2), unit='B',
unit_scale=True, desc="Upload")
[Link](threads=THREADS_COUNT, callback=tqdm_callback)
progress_bar.close()
final_ping = results_dict['ping']
download_mbps = (results_dict['download'] / 1_000_000)
upload_mbps = (results_dict['upload'] / 1_000_000)
except Exception as e:
print(f"\n❌ Terjadi kesalahan fatal saat tes: {e}")
# ----------------------------------------------------
# --- FUNGSI LOOPING UTAMA ---
# ----------------------------------------------------
def main_loop():
"""Fungsi utama untuk menjalankan tes dalam loop tanpa batas."""
print("Memastikan pustaka 'speedtest-cli', 'tqdm', dan 'requests'
terinstal...")
try:
while True:
jalankan_speedtest_dengan_tqdm()
print(f"\nJeda selama {INTERVAL_DETIK} detik sebelum tes
berikutnya...")
[Link](INTERVAL_DETIK)
except KeyboardInterrupt:
print("\n\n👋 Tes berulang dihentikan oleh pengguna (Ctrl+C). Terima
kasih!")
except Exception as e:
print(f"\nTerjadi kesalahan fatal pada loop: {e}")
if __name__ == "__main__":
main_loop()
[Link]
import socket
import json
import time
import sys
import os
from datetime import datetime
import requests
import re # Pastikan re diimpor
# --- Fungsi untuk Mencetak Teks Secara Bertahap (Efek Hacker) ---
def print_slowly(text, delay=0.01, end='\n'):
"""Mencetak teks karakter per karakter dengan jeda."""
for char in text:
[Link](char)
[Link]()
[Link](delay)
[Link](end)
[Link]()
try:
sock = [Link](socket.AF_INET, socket.SOCK_STREAM)
[Link](timeout)
[Link]((whois_server, 43))
[Link](f"{ip_address}\r\n".encode())
response = b""
while True:
data = [Link](4096)
if not data:
break
response += data
[Link]()
referral_match = None
for line in whois_output.splitlines():
line_lower = [Link]().lower()
if line_lower.startswith("referralserver:"):
referral_server = [Link](":")[1].strip()
if not referral_server.startswith("whois.") and "." in
referral_server:
referral_server = "whois." + referral_server
referral_match = referral_server
break
elif "[Link]" in line_lower and "referral" not in line_lower:
referral_match = "[Link]"
break
elif "[Link]" in line_lower and "referral" not in line_lower:
referral_match = "[Link]"
break
elif "[Link]" in line_lower and "referral" not in line_lower:
referral_match = "[Link]"
break
elif "[Link]" in line_lower and "referral" not in
line_lower:
referral_match = "[Link]"
break
response_referred = b""
while True:
data = [Link](4096)
if not data:
break
response_referred += data
[Link]()
whois_output = response_referred.decode('utf-8', errors='ignore')
print_slowly(f"{[Link]}[+] Referral WHOIS berhasil diikuti.
{[Link]}", delay=0.01)
except Exception as e:
print_slowly(f"{[Link]}[!] Gagal mengikuti referral WHOIS: {e}
{[Link]}", delay=0.01)
return whois_output
except [Link]:
print_slowly(f"{[Link]}[!] WHOIS lookup timed out.{[Link]}",
delay=0.01)
return "WHOIS lookup timed out."
except Exception as e:
print_slowly(f"{[Link]}[!] Gagal melakukan WHOIS lookup: {e}
{[Link]}", delay=0.01)
return f"Gagal melakukan WHOIS lookup: {e}"
if port == 20:
function = "FTP Data (File Transfer Protocol)"
problem = "Biasanya digunakan dengan FTP. Jika port 21 juga terbuka, bisa
jadi ada risiko transfer data tidak terenkripsi."
elif port == 21:
function = "FTP Control (File Transfer Protocol)"
problem = "Sering digunakan untuk transfer file. Rentan terhadap brute-
force, kebocoran kredensial (jika tanpa FTPS/SFTP) dan kerentanan server FTP."
if "proftpd" in banner_lower or "vsftpd" in banner_lower:
problem += " Periksa versi untuk CVEs yang diketahui."
elif port == 22:
function = "SSH (Secure Shell)"
problem = "Akses remote terenkripsi. Risiko brute-force, kata sandi lemah,
atau kerentanan OpenSSH lama. Pastikan hanya menggunakan autentikasi key-based."
if "openssh" in banner_lower:
problem += " Periksa versi OpenSSH untuk CVEs."
elif port == 23:
function = "Telnet"
problem = "!!! RISIKO TINGGI: Tidak terenkripsi, semua lalu lintas
(termasuk kredensial) dapat disadap. Sering digunakan pada perangkat IoT/embedded
dengan default credentials."
if "login" in banner_lower or "busybox" in banner_lower or "buildroot" in
banner_lower:
problem += " Indikasi akses login langsung dan mungkin perangkat
embedded."
elif port == 80:
function = "HTTP (Web Server)"
problem = "Web server tidak terenkripsi. Rentan terhadap serangan aplikasi
web (SQLi, XSS, dll.) dan kebocoran informasi. Seharusnya dialihkan ke HTTPS."
if "apache" in banner_lower or "nginx" in banner_lower or "iis" in
banner_lower:
problem += f" Server web: {[Link]('Server:')[-1].strip() if
'server:' in banner_lower else banner}."
if "server: 360" in banner_lower or "waf" in banner_lower or len(banner) >
100:
problem += " Kemungkinan di belakang WAF/Proxy. Perlu eksplorasi lebih
lanjut."
elif port == 110:
function = "POP3 (Post Office Protocol 3)"
problem = "Menerima email. Seringkali tanpa enkripsi, rentan terhadap
penyadapan kredensial."
elif port == 143:
function = "IMAP (Internet Message Access Protocol)"
problem = "Menerima email. Seringkali tanpa enkripsi, rentan terhadap
penyadapan kredensial."
elif port == 443:
function = "HTTPS (Secure Web Server)"
problem = "Web server terenkripsi (SSL/TLS). Risiko serangan aplikasi web,
konfigurasi SSL/TLS yang lemah (misal: TLS 1.0/1.1, cipher suite lemah), atau
sertifikat kadaluarsa."
if "server:" in banner_lower:
problem += f" Server web: {[Link]('Server:')[-1].strip() if
'server:' in banner_lower else banner}."
elif "connection refused or error" in banner_lower:
problem += " Gagal mengambil banner SSL/TLS, mungkin karena timeout
atau konfigurasi ketat. Perlu cek manual."
elif port == 993:
function = "IMAPS (Secure IMAP)"
problem = "IMAP terenkripsi. Lebih aman, tapi tetap periksa konfigurasi
SSL/TLS dan versi server."
elif port == 995:
function = "POP3S (Secure POP3)"
problem = "POP3 terenkripsi. Lebih aman, tapi tetap periksa konfigurasi
SSL/TLS dan versi server."
elif port == 3389:
function = "RDP (Remote Desktop Protocol)"
problem = "!!! RISIKO TINGGI: Akses remote ke desktop Windows. Sangat
rentan terhadap brute-force, NTLM relay, dan kerentanan sistem RDP."
elif port == 5900:
function = "VNC (Virtual Network Computing)"
problem = "!!! RISIKO TINGGI: Akses remote ke desktop. Seringkali tanpa
enkripsi atau dengan autentikasi lemah. Sangat berisiko."
elif port == 8000 or port == 8080 or port == 8443:
function = "HTTP/S Alternatif (Web Server/Proxy)"
problem = "Server web atau proxy. Sama seperti port 80/443, periksa
aplikasi web dan konfigurasinya."
if "apache" in banner_lower or "nginx" in banner_lower or "iis" in
banner_lower:
problem += f" Server web: {[Link]('Server:')[-1].strip() if
'server:' in banner_lower else banner}."
if "server: 360" in banner_lower or "waf" in banner_lower or len(banner) >
100:
problem += " Kemungkinan di belakang WAF/Proxy. Perlu eksplorasi lebih
lanjut."
else:
problem = "Layanan yang tidak umum atau tidak teridentifikasi. Perlu
penyelidikan lebih lanjut."
return problem, function
scan_results = []
whois_full_output = ""
geoip_results = {}
abuse_email_found = "Tidak ditemukan"
print_slowly(f"{[Link]}====================================================
==={[Link]}", delay=0.005)
print_slowly(f"{[Link]} SIMPLE PUBLIC IP SCANNER (Python)
{[Link]}", delay=0.005)
print_slowly(f"{[Link]} (Penetration Tester Tools) {[Link]}",
delay=0.005)
print_slowly(f"{[Link]}====================================================
==={[Link]}", delay=0.005)
print()
ports = [20, 21, 22, 23, 80, 110, 143, 443, 993, 995, 3389, 5900, 8000, 8080,
8443]
open_ports_count = 0
scan_timeout = 0.7
if result == 0:
open_ports_count += 1
banner = get_banner(target_ip, port, timeout=scan_timeout)
os_guess = get_os_from_banner(banner)
scan_results.append({
"port": port,
"banner": banner,
"os_guess": os_guess,
"problem": problem_desc,
"function": function_desc
})
whois_full_output = perform_whois_lookup(target_ip)
print_slowly(f"\n--- HASIL WHOIS ---{[Link]}", delay=0.01)
print_slowly(whois_full_output, delay=0.001)
print_slowly(f"\n--- AKHIR HASIL WHOIS ---{[Link]}", delay=0.01)
if email_match:
abuse_email_found = email_match
break
if abuse_email_found != "Tidak ditemukan":
break
print_slowly(header_format.format(
res["os_guess"],
res["port"],
problem_truncated,
function_truncated
), delay=0.001)
else:
print_slowly("Tidak ada port terbuka yang ditemukan.", delay=0.01)
if open_ports_count == 0:
conclusion_notes.append(f"{[Link]}Sistem terlihat cukup tertutup dari
luar. Tidak ada port umum yang ditemukan terbuka. Ini adalah konfigurasi keamanan
yang baik.{[Link]}")
else:
conclusion_notes.append(f"{[Link]}Ditemukan {open_ports_count} port
terbuka. Ini meningkatkan 'surface area' yang dapat dieksploitasi.{[Link]}")
has_critical_port = False
for res in scan_results:
if res['port'] in [23, 3389, 5900]: # Telnet, RDP, VNC
conclusion_notes.append(f"{[Link]}[RISIKO TINGGI] Port
{res['port']} ({res['function']}) Terbuka: {res['problem']}{[Link]}")
has_critical_port = True
elif res['port'] in [21, 22]: # FTP, SSH
conclusion_notes.append(f"{[Link]}[PERINGATAN] Port
{res['port']} ({res['function']}) Terbuka: {res['problem']}{[Link]}")
elif res['port'] in [80, 443, 8000, 8080, 8443]: # HTTP/S
conclusion_notes.append(f"{[Link]}[INFORMASI] Port
{res['port']} ({res['function']}) Terbuka: {res['problem']}{[Link]}")
else: # Port lain yang mungkin tidak biasa
conclusion_notes.append(f"{[Link]}[PERINGATAN] Port
{res['port']} ({res['function']}) Terbuka: {res['problem']}{[Link]}")
if has_critical_port:
conclusion_notes.append(f"\n{[Link]}Tindakan mendesak diperlukan
untuk mengamankan port-port berisiko tinggi. Konsultasikan dengan admin sistem atau
penyedia hosting.{[Link]}")
else:
conclusion_notes.append(f"\n{[Link]}Meskipun ada port terbuka,
tidak ada kerentanan *sangat kritis* yang langsung terdeteksi dari pemindaian port
dasar ini. Tetap perhatikan keamanan aplikasi dan layanan yang berjalan.
{[Link]}")
if open_ports_count > 0:
[Link](f"{[Link]}Secara umum, tinjau kembali setiap
port yang ditemukan terbuka. Tanyakan: Apakah layanan ini benar-benar diperlukan
untuk diakses dari internet? Jika tidak, tutup atau batasi aksesnya.
{[Link]}")
try:
with open(filename, 'w') as f:
# Menulis konten ke file
[Link](f"# Laporan Pemindaian IP Publik: {target_ip}\n" if
file_extension == ".md" else f"Laporan Pemindaian IP Publik: {target_ip}\n")
[Link](f"**Tanggal Pemindaian**: {[Link]().strftime('%Y-%m-%d
%H:%M:%S')}\n\n" if file_extension == ".md" else f"Tanggal Pemindaian:
{[Link]().strftime('%Y-%m-%d %H:%M:%S')}\n\n")
print_slowly(f"\
n{[Link]}======================================================={[Link]
ET}", delay=0.005)
if __name__ == "__main__":
try:
import requests
except ImportError:
print(f"{[Link]}Error: Library 'requests' tidak ditemukan.")
print(f"Silakan instal dengan perintah: pip install
requests{[Link]}")
[Link](1)
try:
main()
except KeyboardInterrupt:
print_slowly(f"\n{[Link]}[*] Program dihentikan oleh pengguna.
Keluar dengan rapi.{[Link]}", delay=0.02)
[Link](0)
except Exception as e:
print_slowly(f"\n{[Link]}[!] Terjadi kesalahan tak terduga: {e}
{[Link]}", delay=0.02)
[Link](1)
[Link]
import re
import base64
import hashlib
import time
import os
import math
import sys
from tabulate import tabulate
from periodictable import elements
from typing import Dict, List, Tuple, Iterable
import itertools
import subprocess
from shlex import quote
# GENDER MAPPING
GENDER_ATOM_DECODING: Dict[str, int] = {"P": 15, "S": 16}
GENDER_DECODED_MAPPING: Dict[int, str] = {15: "Pria", 16: "Wanita"}
# --------------------------------------------------------------------
# --- KONFIGURASI V46.16: Fix SyntaxWarning \m ---
# --------------------------------------------------------------------
TOTAL_COMBINATIONS = 10**12 # Batas atas (0 hingga 999,999,999,999)
# KONFIGURASI CHUNKING
CHUNK_SIZE = 100_000
TOTAL_WORKERS = 2
FOUND_KEY = None
SESSION_NAME = "BFA_PYTHON_RUNNER"
LOG_FILE = "FOUND_KEY.log"
LOCK_FILE = "TERMINAL_LOCK.lock"
FOUND_KEY_NUMBER_FILE = "FOUND_KEY_NUMBER.tmp"
global FOUND_KEY
start_num = worker_index
step_size = TOTAL_WORKERS
total_tested_by_this_worker = 0
last_checked_time = [Link]()
last_tested_count = 0
is_even_start = (worker_index == 0)
if is_even_start:
odd_even_label = f"({[Link]}Genap{Style.RESET_ALL})"
else:
odd_even_label = f"({[Link]}Ganjil{Style.RESET_ALL})"
password = str(i)
total_tested_by_this_worker += 1
# Sinkronisasi
if total_tested_by_this_worker % SYNC_CHECK_INTERVAL == 0:
found_key_sync, _, _ = check_for_found_key()
if found_key_sync:
[Link](CLEAR_LINE)
[Link]()
print(f"{[Link]}🛑 STOPPING! Kunci '{found_key_sync}'
ditemukan oleh worker lain.{Style.RESET_ALL}")
return found_key_sync, None
current_time = [Link]()
time_diff = current_time - last_checked_time
tested_diff = total_tested_by_this_worker - last_tested_count
last_checked_time = current_time
last_tested_count = total_tested_by_this_worker
try:
# Ambil Mutex Lock
lock_fd = [Link](LOCK_FILE, os.O_CREAT | os.O_EXCL | os.O_WRONLY)
[Link](lock_fd)
[Link](CURSOR_UP_2)
[Link](CLEAR_LINE)
pt_s_str = f"{pt_per_second:,.0f}"
# LOGIKA DISPLAY
progress_info = (
f"\r[{[Link]}{pane_label}/C{virtual_chunk_num}
{Style.RESET_ALL}] "
f"{odd_even_label} "
f"({[Link]}{session_time_str}{Style.RESET_ALL}) "
f"({[Link]}Pt/s: {pt_s_str}{Style.RESET_ALL}): "
f"{[Link]}{password}{Style.RESET_ALL}\n"
f"{[Link]}STATUS: {[Link]}Running...{Style.RESET_ALL}"
)
[Link](progress_info)
[Link]()
# Lepaskan lock
[Link](LOCK_FILE)
except FileExistsError:
pass
except Exception:
pass
# --- MUTEX LOGIC END ---
[Link](CLEAR_LINE)
[Link]()
FOUND_KEY = password
[Link](CLEAR_LINE)
[Link]()
return None, None
# --- FUNGSI DEKODE DATA & SETUP TMUX (TETAP SAMA) ---
def from_hex(hex_str: str) -> str:
try:
return [Link]("".join(hex_str.split(' '))).decode('utf-8')
except Exception:
return f"{[Link]}[DECODE ERROR: Invalid Hex Data]{Style.RESET_ALL}"
parts = qr_data_raw.split('|')
iv_b64 = next(([Link](':')[1] for p in parts if [Link]('IV:')), None)
ciphertext_b64 = next(([Link](':')[1] for p in parts if [Link]('CT:')),
None)
try:
iv_bytes = base64.b64decode(iv_b64)
ciphertext_bytes = base64.b64decode(ciphertext_b64)
except Exception:
print(f"{[Link]}❌ Kesalahan Base64 Decode di Worker.{Style.RESET_ALL}")
return
session_start_time = [Link]()
found_key, decoded_data = brute_force_sequential(
iv_bytes, ciphertext_bytes, worker_index, chunk_id_str, session_start_time
)
if found_key and not decoded_data:
[Link](CLEAR_LINE)
[Link]()
print(f"{[Link]}✅ Worker berhenti. Kunci ditemukan oleh worker lain:
{found_key}{Style.RESET_ALL}")
[Link](5)
def setup_tmux_and_run():
global qr_data_raw
# Tampilan utama
print(f"{[Link]}============================================={Style.RESET_ALL}
")
# FIX: Menggunakan r-string untuk menghindari SyntaxWarning invalid escape
sequence '\m'
print(r"Advanced Brute Force Attack")
print(f"{[Link]}============================================={Style.RESET_ALL}
")
print(f" Pane Dikerahkan: {[Link]}{TOTAL_WORKERS} (P1: Genap (0, 2, 4...),
P2: Ganjil (1, 3, 5...)){Style.RESET_ALL}")
print(f"📦 Chunk Size (Virtual): *{CHUNK_SIZE:,}*")
print(f"📦 Total Kombinasi: *{TOTAL_COMBINATIONS:,}* (0 hingga
999,999,999,999)")
print(f" Update Progress Setiap: *{LOG_INTERVAL}* Iterasi ({[Link]}Memerlukan
File Mutex{Style.RESET_ALL})")
print("-" * 50)
if not qr_data_raw.startswith("AES128|"):
print(f"{[Link]}❌ Data tidak terdeteksi dienkripsi dengan AES128. Setup
dibatalkan.{Style.RESET_ALL}")
return
try:
[Link](["tmux", "-V"], check=True, capture_output=True)
except FileNotFoundError:
print(f"{[Link]}❌ Error: Tmux tidak ditemukan. Harap instal Tmux.
{Style.RESET_ALL}")
[Link](1)
try:
[Link](["tmux", "new-session", "-d", "-s", SESSION_NAME, cmd1],
check=True)
[Link](["tmux", "split-window", "-t", f"{SESSION_NAME}:0", cmd2],
check=True)
[Link](["tmux", "select-layout", "tiled"], check=True)
if final_key:
total_attempts_gabungan = int(key_number_str) + 1
total_time_seconds = time_to_seconds(total_time_str)
tpa_seconds = 0.0
if total_time_seconds > 0:
# Waktu rata-rata per percobaan
tpa_seconds = total_time_seconds / total_attempts_gabungan
parts = qr_data_raw.split('|')
iv_b64 = next(([Link](':')[1] for p in parts if [Link]('IV:')),
None)
ciphertext_b64 = next(([Link](':')[1] for p in parts if
[Link]('CT:')), None)
try:
iv_bytes = base64.b64decode(iv_b64)
ciphertext_bytes = base64.b64decode(ciphertext_b64)
except Exception:
print(f"{[Link]}❌ Kesalahan Base64 Decode pada proses akhir.
{Style.RESET_ALL}")
return
if decoded_data:
data_tabel_decoded = process_decoded_data(decoded_data)
except [Link] as e:
print(f"{[Link]}❌ Gagal mengeksekusi perintah Tmux: {e}
{Style.RESET_ALL}")
[Link](1)
if __name__ == "__main__":
if len([Link]) == 4:
try:
worker_index = int([Link][1])
chunk_id_str = [Link][2]
qr_data = [Link][3]
run_worker(worker_index, chunk_id_str, qr_data)
except ValueError:
print(f"{[Link]}❌ Error: Argumen tidak valid saat dijalankan
otomatis.{Style.RESET_ALL}")
[Link](1)
else:
setup_tmux_and_run()
[Link]
import sys
import os
import re
import base64
import hashlib
import qrcode
from datetime import datetime
from tabulate import tabulate
from typing import Dict, Any, List, Tuple
# ==============================================================================
# DATA NIK DECODE & KONFIGURASI KRIPTOGRAFI
# ==============================================================================
# Mapping Romawi
ROMAN_MAP = {
1000: 'M', 900: 'CM', 500: 'D', 400: 'CD', 100: 'C',
90: 'XC', 50: 'L', 40: 'XL', 10: 'X', 9: 'IX',
5: 'V', 4: 'IV', 1: 'I'
}
# ==============================================================================
# FUNGSI TRANSFORMASI BARU
# ==============================================================================
if len(nik_clean) != 16:
return f"ERROR: Panjang NIK ({len(nik_clean)}) tidak 16 digit."
if atomic_number:
return elements[atomic_number].symbol
return f"LEN{len(gender)}"
# ==============================================================================
# NIK DECODER (Untuk mendapatkan Umur dan Jenis Kelamin)
# ==============================================================================
dd_raw = int(nik_number[6:8])
mm = nik_number[8:10]
yy = nik_number[10:12]
tgl_lahir_obj = [Link](f"{dd_final}/{mm}/{tahun_lengkap}",
'%d/%m/%Y')
today = [Link]()
except ValueError:
prediksi_usia = "0"
return "", "", "[!] ERROR NIK: Tanggal Lahir (digit 7-12) tidak valid."
# ==============================================================================
# FUNGSI KRIPTOGRAFI AES (ENKRIPSI)
# ==============================================================================
return {
"iv": base64.b64encode(iv).decode('utf-8'),
"ciphertext": base64.b64encode(ciphertext).decode('utf-8')
}
# ==============================================================================
# FUNGSI UTAMA GENERATOR
# ==============================================================================
def run_cryptic_id_generator():
"""Meminta 4 input, mendekode NIK, mentransformasi, dan membuat QR Code."""
print("\n=============================================")
print("MODE: ADVANCED CRYPTIC ID GENERATOR (V1.0)")
print("=============================================")
# 1. GATHERING DATA
nama = input("Masukkan Nama: ").strip()
pekerjaan = input("Masukkan Pekerjaan: ").strip()
status = input("Masukkan Status: ").strip()
nik_number = input("Masukkan NIK 16 Digit: ").strip()
print("-" * 50)
password_key = input("Masukkan Kunci Enkripsi (Teks/Angka Apa Pun): ").strip()
if not password_key:
print("❌ Kunci enkripsi tidak boleh kosong. Keluar.")
return
print("-" * 50)
# Unsur Atom
"Jenis_Kelamin_T": gender_to_periodic_element(data_input["Jenis Kelamin
(dari NIK)"]),
"Umur_T": number_to_periodic_element(data_input["Umur (dari NIK)"]),
# Substitusi Acak
"NIK_T": nik_to_cryptic(data_input["NIK 16 Digit"]),
}
print("==========================================================================="
)
print("📊 DATA IDENTITAS TERKONVERSI (Romawi, Unsur Kimia, & Huruf Acak)")
print("==========================================================================="
)
data_tabel = [
["Nama", data_input["Nama"], data_transformed['Nama_T'], "Romawi (ASCII)"],
["Pekerjaan", data_input["Pekerjaan"], data_transformed['Pekerjaan_T'],
"Romawi (ASCII)"],
["Status", data_input["Status"], data_transformed['Status_T'], "Romawi
(ASCII)"],
["---", "---", "---", "---"],
["Jenis Kelamin", data_input["Jenis Kelamin (dari NIK)"],
data_transformed['Jenis_Kelamin_T'], "Unsur Atom (P/S)"],
["Umur", data_input["Umur (dari NIK)"], data_transformed['Umur_T'], "Unsur
Atom (Nomor Atom)"],
["---", "---", "---", "---"],
["NIK 16 Digit", data_input["NIK 16 Digit"], data_transformed['NIK_T'],
"Huruf Acak (Substitusi)"]
]
# 8. TAMPILKAN RINGKASAN
print("\n=============================================")
print("✅ QR CODE BERHASIL DIBUAT (Advanced Cryptic ID!)")
print("=============================================")
print(f"Kunci Enkripsi (Rahasia): **{password_key}**")
print(f"Nama File: {file_name}")
print(f"Data QR Code (Terenkripsi): '{qr_data_encrypted_final}'")
print("==========================================================================="
)
# ==============================================================================
# EKSEKUSI PROGRAM
# ==============================================================================
if __name__ == "__main__":
[Link]
import random
import string
import sys
from colorama import Fore, Style, init
# ==============================================================================
# 1. DEFINISI KARAKTER SET
# ==============================================================================
# ==============================================================================
# 2. FUNGSI UTAMA GENERATOR
# ==============================================================================
# Pilih karakter acak dari set Penuh (Huruf/Angka/Simbol) untuk sisa panjang
remaining_chars = [[Link](FULL_CHARSET) for _ in
range(remaining_length)]
return "".join(password_list)
# ==============================================================================
# 3. INTERFACE PENGGUNA (MAIN LOOP)
# ==============================================================================
def main():
"""Menjalankan interface pengguna untuk mendapatkan input PPL."""
print(f"{[Link]}=========================================={Style.RESET_ALL}")
print(f"{[Link]} 🔑 Password Generator (PPL max 8){Style.RESET_ALL}")
print(f"{[Link]}=========================================={Style.RESET_ALL}")
print(f"{[Link]}Aturan:{Style.RESET_ALL} Karakter pertama dijamin bukan
simbol.")
MAX_PPL = 64
while True:
try:
# Meminta input dari pengguna
ppl_input = input(f"\n{[Link]}Input PPL (Panjang Password, Max
{MAX_PPL} Character): {Style.RESET_ALL}").strip()
if not ppl_input:
print(f"{[Link]}❌ Input tidak boleh kosong.{Style.RESET_ALL}")
continue
ppl = int(ppl_input)
if ppl <= 0:
print(f"{[Link]}❌ Panjang harus lebih dari 0.{Style.RESET_ALL}")
elif ppl > MAX_PPL:
print(f"{[Link]}❌ Panjang maksimal adalah {MAX_PPL} karakter.
{Style.RESET_ALL}")
else:
# Jika input valid, generate password
password = generate_safe_password(ppl)
# Tampilkan hasil
print(f"\n{[Link]}✅ Password yang Dihasilkan ({ppl}
karakter):{Style.RESET_ALL}")
print(f"{[Link]}{[Link]}{password}{Style.RESET_ALL}")
except ValueError:
print(f"{[Link]}❌ Input harus berupa angka bulat.{Style.RESET_ALL}")
except KeyboardInterrupt:
print(f"\n\n{[Link]}Proses dihentikan pengguna. 👋{Style.RESET_ALL}")
[Link](0)
if __name__ == "__main__":
main()
[Link]
import unittest
import math
import time
import sys
import traceback
import random
import statistics
import logging
from typing import Dict, List, Tuple
from multiprocessing import cpu_count
from [Link] import ProcessPoolExecutor
from joblib import Parallel, delayed
import [Link] as plt
import os
import numpy as np
# Model Koefisien Seret (Cd) Standar (Penggunaan float standar untuk presisi)
# Data tabel ini mewakili Koefisien Seret terhadap Mach Number (x: Mach, y: Cd)
G1_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.220), (0.10, 0.219), (0.20, 0.217), (0.30, 0.214), (0.40, 0.208),
(0.50, 0.199), (0.60, 0.187), (0.70, 0.170), (0.80, 0.153), (0.90, 0.137),
(1.00, 0.125), (1.10, 0.122), (1.20, 0.121), (1.30, 0.120), (1.40, 0.120),
(1.50, 0.120), (1.60, 0.120), (1.70, 0.120), (1.80, 0.120), (1.90, 0.120),
(2.00, 0.120), (2.20, 0.120), (2.40, 0.120), (2.60, 0.120), (2.80, 0.120),
(3.00, 0.120), (3.20, 0.120), (3.40, 0.120), (3.60, 0.120), (3.80, 0.120),
(4.00, 0.1505), (4.20, 0.1500), (4.40, 0.1495), (4.60, 0.1490), (4.80, 0.1485),
(5.00, 0.1480)
]]
G2_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.204), (0.10, 0.203), (0.20, 0.202), (0.30, 0.200), (0.40, 0.196),
(0.50, 0.190), (0.60, 0.181), (0.70, 0.169), (0.80, 0.155), (0.90, 0.141),
(1.00, 0.128), (1.10, 0.125), (1.20, 0.124), (1.30, 0.123), (1.40, 0.123),
(1.50, 0.123), (1.60, 0.123), (1.70, 0.123), (1.80, 0.123), (1.90, 0.123),
(2.00, 0.123), (2.20, 0.122), (2.40, 0.122), (2.60, 0.122), (2.80, 0.122),
(3.00, 0.121), (3.20, 0.121), (3.40, 0.121), (3.60, 0.120), (3.80, 0.120),
(4.00, 0.120), (4.20, 0.120), (4.40, 0.120), (4.60, 0.120), (4.80, 0.120),
(5.00, 0.120)
]]
G3_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.443), (0.10, 0.441), (0.20, 0.437), (0.30, 0.430), (0.40, 0.419),
(0.50, 0.402), (0.60, 0.378), (0.70, 0.350), (0.80, 0.316), (0.90, 0.285),
(1.00, 0.260), (1.10, 0.252), (1.20, 0.245), (1.30, 0.240), (1.40, 0.237),
(1.50, 0.235), (1.60, 0.233), (1.70, 0.231), (1.80, 0.230), (1.90, 0.229),
(2.00, 0.228), (2.20, 0.227), (2.40, 0.226), (2.60, 0.225), (2.80, 0.224),
(3.00, 0.223), (3.20, 0.222), (3.40, 0.221), (3.60, 0.220), (3.80, 0.219),
(4.00, 0.218), (4.20, 0.217), (4.40, 0.216), (4.60, 0.215), (4.80, 0.214),
(5.00, 0.213)
]]
G4_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.219), (0.10, 0.218), (0.20, 0.216), (0.30, 0.213), (0.40, 0.207),
(0.50, 0.198), (0.60, 0.186), (0.70, 0.169), (0.80, 0.152), (0.90, 0.136),
(1.00, 0.124), (1.10, 0.121), (1.20, 0.120), (1.30, 0.119), (1.40, 0.119),
(1.50, 0.119), (1.60, 0.119), (1.70, 0.119), (1.80, 0.119), (1.90, 0.119),
(2.00, 0.119), (2.20, 0.118), (2.40, 0.118), (2.60, 0.118), (2.80, 0.118),
(3.00, 0.117), (3.20, 0.117), (3.40, 0.117), (3.60, 0.116), (3.80, 0.116),
(4.00, 0.116), (4.20, 0.115), (4.40, 0.115), (4.60, 0.115), (4.80, 0.114),
(5.00, 0.114)
]]
G5_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.224), (0.10, 0.223), (0.20, 0.221), (0.30, 0.218), (0.40, 0.212),
(0.50, 0.203), (0.60, 0.191), (0.70, 0.174), (0.80, 0.157), (0.90, 0.141),
(1.00, 0.128), (1.10, 0.125), (1.20, 0.124), (1.30, 0.123), (1.40, 0.123),
(1.50, 0.123), (1.60, 0.123), (1.70, 0.123), (1.80, 0.123), (1.90, 0.123),
(2.00, 0.123), (2.20, 0.122), (2.40, 0.122), (2.60, 0.122), (2.80, 0.122),
(3.00, 0.121), (3.20, 0.121), (3.40, 0.121), (3.60, 0.120), (3.80, 0.120),
(4.00, 0.120), (4.20, 0.120), (4.40, 0.120), (4.60, 0.120), (4.80, 0.120),
(5.00, 0.120)
]]
G6_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.245), (0.10, 0.244), (0.20, 0.242), (0.30, 0.239), (0.40, 0.232),
(0.50, 0.222), (0.60, 0.209), (0.70, 0.191), (0.80, 0.173), (0.90, 0.156),
(1.00, 0.142), (1.10, 0.139), (1.20, 0.138), (1.30, 0.137), (1.40, 0.137),
(1.50, 0.137), (1.60, 0.137), (1.70, 0.137), (1.80, 0.137), (1.90, 0.137),
(2.00, 0.137), (2.20, 0.136), (2.40, 0.136), (2.60, 0.136), (2.80, 0.136),
(3.00, 0.135), (3.20, 0.135), (3.40, 0.135), (3.60, 0.134), (3.80, 0.134),
(4.00, 0.134), (4.20, 0.133), (4.40, 0.133), (4.60, 0.133), (4.80, 0.132),
(5.00, 0.132)
]]
G7_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.2300), (0.10, 0.2295), (0.20, 0.2285), (0.30, 0.2265),
(0.40, 0.2230), (0.50, 0.2175), (0.60, 0.2095), (0.70, 0.1980),
(0.80, 0.1830), (0.90, 0.1690), (0.95, 0.1645), (1.00, 0.1620),
(1.05, 0.1610), (1.10, 0.1605), (1.15, 0.1600), (1.20, 0.1595),
(1.30, 0.1590), (1.40, 0.1585), (1.50, 0.1580), (1.60, 0.1575),
(1.70, 0.1570), (1.80, 0.1565), (1.90, 0.1560), (2.00, 0.1555),
(2.20, 0.1550), (2.40, 0.1545), (2.60, 0.1540), (2.80, 0.1535),
(3.00, 0.1530), (3.20, 0.1525), (3.40, 0.1520), (3.60, 0.1515),
(3.80, 0.1510), (4.00, 0.1505), (4.20, 0.1500), (4.40, 0.1495),
(4.60, 0.1490), (4.80, 0.1485), (5.00, 0.1480)
]]
G8_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.204), (0.10, 0.203), (0.20, 0.202), (0.30, 0.200), (0.40, 0.196),
(0.50, 0.190), (0.60, 0.181), (0.70, 0.169), (0.80, 0.155), (0.90, 0.141),
(1.00, 0.128), (1.10, 0.125), (1.20, 0.124), (1.30, 0.123), (1.40, 0.123),
(1.50, 0.123), (1.60, 0.123), (1.70, 0.123), (1.80, 0.123), (1.90, 0.123),
(2.00, 0.123), (2.20, 0.122), (2.40, 0.122), (2.60, 0.122), (2.80, 0.122),
(3.00, 0.121), (3.20, 0.121), (3.40, 0.121), (3.60, 0.120), (3.80, 0.120),
(4.00, 0.120), (4.20, 0.120), (4.40, 0.120), (4.60, 0.120), (4.80, 0.120),
(5.00, 0.120)
]]
DRAG_MODELS: Dict[str, List[Tuple[float, float]]] = {
'G1': G1_DRAG_TABLE, 'G2': G2_DRAG_TABLE, 'G3': G3_DRAG_TABLE, 'G4':
G4_DRAG_TABLE,
'G5': G5_DRAG_TABLE, 'G6': G6_DRAG_TABLE, 'G7': G7_DRAG_TABLE, 'G8':
G8_DRAG_TABLE
}
value = type_func(user_input)
# Validasi Batasan Nilai
if min_val is not None and value < min_val:
print(f"**[ERROR.002]** Nilai masukan terlalu rendah. Min:
{min_val}. Ulangi Masuk.")
continue
if max_val is not None and value > max_val:
print(f"**[ERROR.003]** Nilai masukan terlalu tinggi. Max:
{max_val}. Ulangi Masuk.")
continue
return value
except ValueError:
print("**[ERROR.004]** Input format tidak valid. Masukkan nilai
numerik. Ulangi Masuk.")
# Interpolasi Linier
for i in range(len(drag_table) - 1):
if drag_table[i][0] <= mach < drag_table[i+1][0]:
x1, y1 = drag_table[i]
x2, y2 = drag_table[i+1]
if x2 - x1 == 0:
return y1
return y1 + (y2 - y1) * (mach - x1) / (x2 - x1)
return 0.2
v_rel_x = vx - wind_vector_x
v_rel_y = vy - wind_vector_y
v_rel_z = vz - wind_vector_z
omega_x = 0.0
omega_y = EARTH_ANGULAR_VELOCITY * [Link](shooter_latitude_rad)
omega_z = EARTH_ANGULAR_VELOCITY * [Link](shooter_latitude_rad)
# 2. Gravitational Force
ay_gravity = -GRAVITY
eotvos_accel = 0.0
# Eotvos adalah bagian dari Coriolis, hanya berlaku untuk komponen Vertikal (Y)
# Tanda positif untuk gerakan ke Timur, negatif untuk Barat (asumsi arah 0-180
= Timur/Utara, 180-360 = Barat/Selatan)
if [Link](shooter_direction_rad) > 0: # Gerakan ke Utara/Timur (Longitude
Positif)
eotvos_accel = 2 * vx_earth * EARTH_ANGULAR_VELOCITY *
[Link](shooter_latitude_rad)
else:
eotvos_accel = -2 * vx_earth * EARTH_ANGULAR_VELOCITY *
[Link](shooter_latitude_rad)
y_prev = state[0:3]
y = [state[i] + dt * state[i+3] for i in range(3)]
v = [state[i+3] + dt * accel[i] for i in range(3)]
y_temp = y[:]
for i in range(3):
# Rumus Midpoint (Leapfrog-esque)
y[i] = y_prev[i] + 2 * dt * v[i]
v[i] = v[i] + 2 * dt * accel[i]
y_prev = y_temp
return y + v
def solve_trajectory_bulirsch_stoer(params_tuple):
"""
Solver Balistik 6-DOF presisi tinggi menggunakan Bulirsch-Stoer.
"""
try:
(angle, mass, velocity, target_distance, wind_data, shooter_direction,
bullet_diameter_mm,
temperature_celsius, pressure_hPa, humidity_percent, spin_rate_rpm,
shooter_latitude_deg, drag_model) = params_tuple
t = 0.0
x, y, z = 0.0, 0.0, 0.0
vx = velocity * [Link](angle)
vy = velocity * [Link](angle)
vz = 0.0
steps_sequence = [2, 4, 6, 8]
results = []
for i in range(len(steps_sequence)):
extrapolated_results[i] = results[i][:]
state = extrapolated_results[0]
except Exception as e:
# Fallback ke hasil langkah terakhir jika Ekstrapolasi gagal
state = results[-1]
def solve_trajectory_for_bisection(params_tuple):
"""Solver yang disederhanakan untuk metode Bisection (hanya mengembalikan jarak
horizontal)."""
(angle, mass, velocity, target_distance, wind_data, shooter_direction,
bullet_diameter_mm,
temperature_celsius, pressure_hPa, humidity_percent, spin_rate_rpm,
shooter_latitude_deg, drag_model) = params_tuple
t = 0.0
x, y, z = 0.0, 0.0, 0.0
vx = velocity * [Link](angle)
vy = velocity * [Link](angle)
vz = 0.0
state = [x, y, z, vx, vy, vz]
# Loop Integrasi
try:
# Ekstrapolasi
extrapolated_results = [[0.0] * 6 for _ in range(len(steps_sequence))]
for i in range(len(steps_sequence)):
extrapolated_results[i] = results[i][:]
state = extrapolated_results[0]
except Exception:
state = results[-1]
x = state[0]
y = state[1]
t += H
return x
def solve_single_mc_run(params_dict):
"""Pembungkus fungsi untuk eksekusi Monte Carlo."""
return solve_trajectory_bulirsch_stoer((
params_dict['angle'], params_dict['mass'], params_dict['velocity'],
params_dict['target_distance'], params_dict['wind_data'],
params_dict['shooter_direction'], params_dict['bullet_diameter_mm'],
params_dict['temperature_celsius'], params_dict['pressure_hPa'],
params_dict['humidity_percent'], params_dict['spin_rate_rpm'],
params_dict['shooter_latitude_deg'], params_dict['drag_model']
))
def solve_trajectory_for_plot(params_tuple):
"""
Menjalankan satu run Integrator Bulirsch-Stoer dan mengembalikan
daftar koordinat (X, Y, Z) untuk visualisasi lintasan.
"""
try:
(angle, mass, velocity, target_distance, wind_data, shooter_direction,
bullet_diameter_mm,
temperature_celsius, pressure_hPa, humidity_percent, spin_rate_rpm,
shooter_latitude_deg, drag_model) = params_tuple
t = 0.0
x, y, z = 0.0, 0.0, 0.0
vx = velocity * [Link](angle)
vy = velocity * [Link](angle)
vz = 0.0
state = [x, y, z, vx, vy, vz]
trajectory_points = [(x, y, z)]
try:
extrapolated_results = [[0.0] * 6 for _ in
range(len(steps_sequence))]
for i in range(len(steps_sequence)):
extrapolated_results[i] = results[i][:]
state = extrapolated_results[0]
except Exception:
state = results[-1]
"""
if not trajectory_points:
print("**[INFO]** Tidak ada data lintasan yang valid untuk diplot.")
return
plt.tight_layout()
[Link](block=False)
[Link](fig)
class TrajectoryTests([Link]):
def setUp(self):
[Link] = 0.01089
[Link] = 823.0
def test_ke(self):
ke = 0.5 * [Link] * [Link]**2
[Link](ke, 3688.0, places=0)
def test_momentum(self):
momentum = [Link] * [Link]
[Link](momentum, 8.96, places=2)
def test_momentum(self):
"""Uji Momentum (kg·m/s) pada Kecepatan Moncong."""
momentum = [Link] * [Link]
[Link](momentum, 8.964, places=1)
if __name__ == "__main__":
[Link](
level=[Link],
format='[LOG:%(levelname)s] [%(asctime)s] - %(message)s',
datefmt='%H:%M:%S'
)
[Link](argv=['first-arg-is-ignored'], exit=False)
while True:
try:
# --- INPUT PARAMETER DASAR AMUNISI & MISI ---
spin_rate_rpm = 0.0
if spin_type == 'r':
while True:
spin_input = input("[INPUT] Twist Laras (cth: 1/15) atau RPM
Stabilisasi (cth: 300000): ")
if '/' in spin_input:
try:
parts = spin_input.split('/')
if len(parts) == 2:
twist_rate_in_inches = float(parts[1])
if twist_rate_in_inches > 0:
spin_rate_rpm = (velocity * 720) /
twist_rate_in_inches
slow_print(f"[LOG] RPM Proyektil Taksiran:
**{spin_rate_rpm:.1f}**")
break
else:
print("**[[Link]]** Nilai twist laras
(pembagi) tidak valid.")
else:
print("**[[Link]]** Format twist laras tidak
valid. Gunakan format '1/x'.")
except (ValueError, IndexError):
print("**[[Link]]** Format twist laras tidak valid.
Gunakan format '1/x'.")
else:
try:
spin_rate_rpm = float(spin_input)
if spin_rate_rpm > 0:
twist_rate_in_inches = (velocity * 720) /
spin_rate_rpm
slow_print(f"[LOG] Twist Laras Ekuivalen:
**1/{twist_rate_in_inches:.1f}**")
break
else:
print("**[[Link]]** Nilai RPM harus lebih besar
dari 0.")
except ValueError:
print("**[[Link]]** Input tidak valid. Masukkan
'1/x' atau nilai RPM.")
else: # spin_type == 's'
spin_rate_rpm = 0.0
slow_print("[LOG] Laras Non-Rifled. Mengatur RPM Proyektil ke
**0.0**.")
wind_data = []
multilayer_choice = get_input_with_retry("[INPUT] Input Angin Multi-
Lapisan (Wind Shear)? (y/t): ", str, choices=['y', 't'])
if multilayer_choice == 'y':
num_layers = get_input_with_retry("[INPUT] Jumlah Lapisan Angin: ",
int, 1, 10)
for i in range(num_layers):
altitude = get_input_with_retry(f"[INPUT] Ketinggian Lapisan
{i+1} (meter): ", float, 0, None)
speed_kmh = get_input_with_retry(f"[INPUT] Kecepatan Angin
Lapisan {i+1} (km/h): ", float, 0, 3000)
angle = get_input_with_retry(f"[INPUT] Arah Angin Lapisan {i+1}
(Derajat Kompas): ", float, 0, 360)
wind_data.append({'altitude': altitude, 'speed': speed_kmh /
3.6, 'angle': angle}) # Konversi ke m/s
wind_data.sort(key=lambda x: x['altitude'])
else:
wind_speed_kmh = float(get_input_with_retry("[INPUT] Kecepatan
Angin Tunggal (km/h): ", float, 0, 3000))
wind_angle = float(get_input_with_retry("[INPUT] Arah Angin Tunggal
(Derajat Kompas): ", float, 0, 360))
wind_data.append({'altitude': 0.0, 'speed': wind_speed_kmh / 3.6,
'angle': wind_angle})
low_angle = 0.0
high_angle = [Link] / 4.0 # Batas awal diatur 45 derajat (Angle
Stopper)
# 20 Iterasi Bisection cukup untuk presisi tinggi (10^-6 rad)
for _ in range(20):
mid_angle = (low_angle + high_angle) / 2.0
params_to_test = (mid_angle, mass, velocity, target_distance,
wind_data, shooter_direction, bullet_diameter_mm,
temperature_celsius, pressure_hPa,
humidity_percent, spin_rate_rpm, shooter_latitude_deg, drag_model)
final_range = solve_trajectory_for_bisection(params_to_test)
if final_range is None: raise Exception("Bisection Solver Failure")
if final_range > target_distance:
high_angle = mid_angle
else:
low_angle = mid_angle
best_angle = (low_angle + high_angle) / 2.0 if [Link]((low_angle
+ high_angle) / 2.0) <= 45 else [Link]("\n[ABORT] CRITICAL: Sudut Melebihi Batas
Militer 45°!")
all_results = []
total_runs_completed = 0
batch_size = 8 # Ukuran batch awal eksponensial
batch_params = []
for i in range(runs_in_this_batch):
# Terapkan Variasi Stochastik (Simulasi Toleransi
Amunisi/Lingkungan)
velocity_factor = [Link](1.0, VMO_STD_DEV) # Vmo
stochastic_params = {
'angle': best_angle,
'mass': mass,
'velocity': velocity * velocity_factor,
'target_distance': target_distance,
'wind_data': [],
'shooter_direction': shooter_direction,
'bullet_diameter_mm': bullet_diameter_mm,
'temperature_celsius': temperature_celsius,
'pressure_hPa': pressure_hPa,
'humidity_percent': humidity_percent,
'spin_rate_rpm': spin_rate_rpm,
'shooter_latitude_deg': shooter_latitude_deg,
'drag_model': drag_model
}
if wind_data:
original_wind = wind_data[0]
stochastic_wind_speed =
[Link](original_wind['speed'], WIND_SPEED_STD_DEV)
stochastic_wind_angle =
[Link](original_wind['angle'], WIND_ANGLE_STD_DEV)
stochastic_params['wind_data'].append({'altitude':
original_wind['altitude'], 'speed': stochastic_wind_speed, 'angle':
stochastic_wind_angle})
batch_params.append(stochastic_params)
start_time_batch = [Link]()
# Eksekusi Paralel
batch_results = list([Link](solve_single_mc_run,
batch_params))
end_time_batch = [Link]()
execution_time_batch = end_time_batch - start_time_batch
all_results.extend(batch_results)
total_runs_completed += runs_in_this_batch
# Eksponensial Batching
batch_size = min(batch_size * 2, num_simulations -
total_runs_completed)
end_time_all = [Link]()
total_execution_time = end_time_all - start_time_all
if not valid_results:
slow_print("\n**[CRITICAL ERROR]** Semua simulasi gagal. Verifikasi
Parameter Input.")
continue
avg_drop = [Link](all_drops)
avg_drift = [Link](all_drifts)
avg_t_final = [Link](all_t_final)
avg_final_ke = [Link](all_final_ke)
avg_final_momentum = [Link](all_final_momentum)
slow_print("\n\n#####################################################")
slow_print("## LAPORAN BALISTIK TAKTIS (LBT) - Selesai")
slow_print("#####################################################")
if trajectory_data:
plot_trajectory_matplotlib(trajectory_data, target_distance)
except Exception as e:
slow_print("\n**[CRITICAL [Link]]** Gagal Eksekusi LBT. Log
Traceback:")
slow_print(f"Error Spesifik: {e}")
traceback.print_exc()
import unittest
import math
import time
import sys
import traceback
import random
import statistics
import logging
from typing import Dict, List, Tuple
from multiprocessing import cpu_count
from [Link] import ProcessPoolExecutor
from joblib import Parallel, delayed
import [Link] as plt
import os
# Standard drag models and constants (using standard float for precision)
G1_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.220), (0.10, 0.219), (0.20, 0.217), (0.30, 0.214), (0.40, 0.208),
(0.50, 0.199), (0.60, 0.187), (0.70, 0.170), (0.80, 0.153), (0.90, 0.137),
(1.00, 0.125), (1.10, 0.122), (1.20, 0.121), (1.30, 0.120), (1.40, 0.120),
(1.50, 0.120), (1.60, 0.120), (1.70, 0.120), (1.80, 0.120), (1.90, 0.120),
(2.00, 0.120), (2.20, 0.120), (2.40, 0.120), (2.60, 0.120), (2.80, 0.120),
(3.00, 0.120), (3.20, 0.120), (3.40, 0.120), (3.60, 0.120), (3.80, 0.120),
(4.00, 0.1505), (4.20, 0.1500), (4.40, 0.1495), (4.60, 0.1490), (4.80, 0.1485),
(5.00, 0.1480)
]]
G2_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.204), (0.10, 0.203), (0.20, 0.202), (0.30, 0.200), (0.40, 0.196),
(0.50, 0.190), (0.60, 0.181), (0.70, 0.169), (0.80, 0.155), (0.90, 0.141),
(1.00, 0.128), (1.10, 0.125), (1.20, 0.124), (1.30, 0.123), (1.40, 0.123),
(1.50, 0.123), (1.60, 0.123), (1.70, 0.123), (1.80, 0.123), (1.90, 0.123),
(2.00, 0.123), (2.20, 0.122), (2.40, 0.122), (2.60, 0.122), (2.80, 0.122),
(3.00, 0.121), (3.20, 0.121), (3.40, 0.121), (3.60, 0.120), (3.80, 0.120),
(4.00, 0.120), (4.20, 0.120), (4.40, 0.120), (4.60, 0.120), (4.80, 0.120),
(5.00, 0.120)
]]
G3_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.443), (0.10, 0.441), (0.20, 0.437), (0.30, 0.430), (0.40, 0.419),
(0.50, 0.402), (0.60, 0.378), (0.70, 0.350), (0.80, 0.316), (0.90, 0.285),
(1.00, 0.260), (1.10, 0.252), (1.20, 0.245), (1.30, 0.240), (1.40, 0.237),
(1.50, 0.235), (1.60, 0.233), (1.70, 0.231), (1.80, 0.230), (1.90, 0.229),
(2.00, 0.228), (2.20, 0.227), (2.40, 0.226), (2.60, 0.225), (2.80, 0.224),
(3.00, 0.223), (3.20, 0.222), (3.40, 0.221), (3.60, 0.220), (3.80, 0.219),
(4.00, 0.218), (4.20, 0.217), (4.40, 0.216), (4.60, 0.215), (4.80, 0.214),
(5.00, 0.213)
]]
G4_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.219), (0.10, 0.218), (0.20, 0.216), (0.30, 0.213), (0.40, 0.207),
(0.50, 0.198), (0.60, 0.186), (0.70, 0.169), (0.80, 0.152), (0.90, 0.136),
(1.00, 0.124), (1.10, 0.121), (1.20, 0.120), (1.30, 0.119), (1.40, 0.119),
(1.50, 0.119), (1.60, 0.119), (1.70, 0.119), (1.80, 0.119), (1.90, 0.119),
(2.00, 0.119), (2.20, 0.118), (2.40, 0.118), (2.60, 0.118), (2.80, 0.118),
(3.00, 0.117), (3.20, 0.117), (3.40, 0.117), (3.60, 0.116), (3.80, 0.116),
(4.00, 0.116), (4.20, 0.115), (4.40, 0.115), (4.60, 0.115), (4.80, 0.114),
(5.00, 0.114)
]]
G5_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.224), (0.10, 0.223), (0.20, 0.221), (0.30, 0.218), (0.40, 0.212),
(0.50, 0.203), (0.60, 0.191), (0.70, 0.174), (0.80, 0.157), (0.90, 0.141),
(1.00, 0.128), (1.10, 0.125), (1.20, 0.124), (1.30, 0.123), (1.40, 0.123),
(1.50, 0.123), (1.60, 0.123), (1.70, 0.123), (1.80, 0.123), (1.90, 0.123),
(2.00, 0.123), (2.20, 0.122), (2.40, 0.122), (2.60, 0.122), (2.80, 0.122),
(3.00, 0.121), (3.20, 0.121), (3.40, 0.121), (3.60, 0.120), (3.80, 0.120),
(4.00, 0.120), (4.20, 0.120), (4.40, 0.120), (4.60, 0.120), (4.80, 0.120),
(5.00, 0.120)
]]
G6_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.245), (0.10, 0.244), (0.20, 0.242), (0.30, 0.239), (0.40, 0.232),
(0.50, 0.222), (0.60, 0.209), (0.70, 0.191), (0.80, 0.173), (0.90, 0.156),
(1.00, 0.142), (1.10, 0.139), (1.20, 0.138), (1.30, 0.137), (1.40, 0.137),
(1.50, 0.137), (1.60, 0.137), (1.70, 0.137), (1.80, 0.137), (1.90, 0.137),
(2.00, 0.137), (2.20, 0.136), (2.40, 0.136), (2.60, 0.136), (2.80, 0.136),
(3.00, 0.135), (3.20, 0.135), (3.40, 0.135), (3.60, 0.134), (3.80, 0.134),
(4.00, 0.134), (4.20, 0.133), (4.40, 0.133), (4.60, 0.133), (4.80, 0.132),
(5.00, 0.132)
]]
G7_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.2300), (0.10, 0.2295), (0.20, 0.2285), (0.30, 0.2265),
(0.40, 0.2230), (0.50, 0.2175), (0.60, 0.2095), (0.70, 0.1980),
(0.80, 0.1830), (0.90, 0.1690), (0.95, 0.1645), (1.00, 0.1620),
(1.05, 0.1610), (1.10, 0.1605), (1.15, 0.1600), (1.20, 0.1595),
(1.30, 0.1590), (1.40, 0.1585), (1.50, 0.1580), (1.60, 0.1575),
(1.70, 0.1570), (1.80, 0.1565), (1.90, 0.1560), (2.00, 0.1555),
(2.20, 0.1550), (2.40, 0.1545), (2.60, 0.1540), (2.80, 0.1535),
(3.00, 0.1530), (3.20, 0.1525), (3.40, 0.1520), (3.60, 0.1515),
(3.80, 0.1510), (4.00, 0.1505), (4.20, 0.1500), (4.40, 0.1495),
(4.60, 0.1490), (4.80, 0.1485), (5.00, 0.1480)
]]
G8_DRAG_TABLE = [(x, y) for x, y in [
(0.00, 0.204), (0.10, 0.203), (0.20, 0.202), (0.30, 0.200), (0.40, 0.196),
(0.50, 0.190), (0.60, 0.181), (0.70, 0.169), (0.80, 0.155), (0.90, 0.141),
(1.00, 0.128), (1.10, 0.125), (1.20, 0.124), (1.30, 0.123), (1.40, 0.123),
(1.50, 0.123), (1.60, 0.123), (1.70, 0.123), (1.80, 0.123), (1.90, 0.123),
(2.00, 0.123), (2.20, 0.122), (2.40, 0.122), (2.60, 0.122), (2.80, 0.122),
(3.00, 0.121), (3.20, 0.121), (3.40, 0.121), (3.60, 0.120), (3.80, 0.120),
(4.00, 0.120), (4.20, 0.120), (4.40, 0.120), (4.60, 0.120), (4.80, 0.120),
(5.00, 0.120)
]]
DRAG_MODELS: Dict[str, List[Tuple[float, float]]] = {
'G1': G1_DRAG_TABLE, 'G2': G2_DRAG_TABLE, 'G3': G3_DRAG_TABLE, 'G4':
G4_DRAG_TABLE,
'G5': G5_DRAG_TABLE, 'G6': G6_DRAG_TABLE, 'G7': G7_DRAG_TABLE, 'G8':
G8_DRAG_TABLE
}
# Konstanta
SIMULATION_DT = 0.01
MAX_SIMULATIONS = 10000
EARTH_ANGULAR_VELOCITY = 7.2921159e-5
R_GAS = 8.314462618
MOLAR_MASS_AIR = 0.0289644
MOLAR_MASS_WATER = 0.01801528
GRAVITY = 9.80665
C_MAGNUS = 0.0000002
GAMMA = 1.4
R_SPECIFIC = 287.058
TOLERANCE = 1e-6 # Tolerance for the DP87 solver
value = type_func(user_input)
if min_val is not None and value < min_val:
print(f"Error: Nilai harus lebih besar dari {min_val}. Silakan coba
lagi.")
continue
if max_val is not None and value > max_val:
print(f"Error: Nilai harus lebih kecil dari {max_val}. Silakan coba
lagi.")
continue
return value
except ValueError:
print("Error: Input tidak valid. Silakan masukkan angka.")
v_rel_x = vx - wind_vector_x
v_rel_y = vy - wind_vector_y
v_rel_z = vz - wind_vector_z
omega_x = 0.0
omega_y = EARTH_ANGULAR_VELOCITY * [Link](shooter_latitude_rad)
omega_z = EARTH_ANGULAR_VELOCITY * [Link](shooter_latitude_rad)
# Drag Force
drag_coefficient = get_drag_coefficient(v_rel_total, temperature_celsius,
drag_model)
ax_drag, ay_drag, az_drag = 0.0, 0.0, 0.0
if v_rel_total > 0:
drag_force = 0.5 * current_rho * drag_coefficient * cross_sectional_area *
v_rel_total**2
ax_drag = -drag_force * v_rel_x / (mass * v_rel_total)
ay_drag = -drag_force * v_rel_y / (mass * v_rel_total)
az_drag = -drag_force * v_rel_z / (mass * v_rel_total)
# Gravitational Force
ay_gravity = -GRAVITY
# Coriolis Force
ax_coriolis = -2 * (omega_y * vz_earth - omega_z * vy_earth)
ay_coriolis = -2 * (omega_z * vx_earth - omega_x * vz_earth)
az_coriolis = -2 * (omega_x * vy_earth - omega_y * vx_earth)
# Magnus Force
ax_magnus, ay_magnus, az_magnus = 0.0, 0.0, 0.0
if spin_rate_rad_s > 0 and v_rel_total > 0:
spin_vector = [spin_rate_rad_s, 0.0, 0.0]
# Eotvos Force
eotvos_accel = 0.0
if shooter_direction_rad >= 0 and shooter_direction_rad <= [Link]:
eotvos_accel = 2 * vx_earth * EARTH_ANGULAR_VELOCITY *
[Link](shooter_latitude_rad)
else:
eotvos_accel = -2 * vx_earth * EARTH_ANGULAR_VELOCITY *
[Link](shooter_latitude_rad)
def solve_trajectory_dp87(params_tuple):
"""
Performs one run of the Dormand-Prince (DP87) integrator.
"""
try:
(angle, mass, velocity, target_distance, wind_data, shooter_direction,
bullet_diameter_mm,
temperature_celsius, pressure_hPa, humidity_percent, spin_rate_rpm,
shooter_latitude_deg, drag_model) = params_tuple
# DP87 Coefficients
c = [0.0, 1/5, 3/10, 4/5, 8/9, 1.0, 1.0]
a = [[0.0], [1/5], [3/40, 9/40], [44/45, -56/15, 32/9],
[19372/6561, -25360/2187, 64448/6561, -212/729],
[9017/3168, -355/33, 46732/5247, 49/176, -5103/18656],
[35/384, 0.0, 500/1113, 125/192, -2187/6784, 11/84]]
b8 = [35/384, 0.0, 500/1113, 125/192, -2187/6784, 11/84, 0.0]
b7 = [5179/57600, 0.0, 7571/16695, 393/640, -92097/339200, 187/2100, 1/40]
t = 0.0
dt = SIMULATION_DT
x, y, z = 0.0, 0.0, 0.0
vx = velocity * [Link](angle)
vy = velocity * [Link](angle)
vz = 0.0
k = []
# Stage 1
k1 = get_acceleration_6dof(state, t, mass, cross_sectional_area,
temperature_celsius, pressure_hPa, humidity_percent,
wind_vector_x, wind_vector_y, wind_vector_z,
spin_rate_rad_s, bullet_diameter_m, shooter_latitude_rad, drag_model,
shooter_direction_rad)
[Link](k1)
# Remaining Stages
for i in range(1, 7):
temp_state_pos = [0.0] * 3
temp_state_vel = [0.0] * 3
sum_a_k_pos = [0.0] * 3
sum_a_k_vel = [0.0] * 3
for l in range(len(a[i-1])):
for j in range(3):
sum_a_k_pos[j] += a[i-1][l] * k[l][j]
for j in range(3):
sum_b8_k_pos = 0.0
sum_b7_k_pos = 0.0
for i in range(7):
sum_b8_k_pos += b8[i] * k[i][j]
sum_b7_k_pos += b7[i] * k[i][j]
if error > 0:
dt_new = 0.9 * dt * (TOLERANCE / error)**(1/8.0)
dt = dt_new
else:
dt *= 1.1
def solve_trajectory_for_bisection(params_tuple):
"""Function optimized for bisection (returns horizontal distance)."""
(angle, mass, velocity, target_distance, wind_data, shooter_direction,
bullet_diameter_mm,
temperature_celsius, pressure_hPa, humidity_percent, spin_rate_rpm,
shooter_latitude_deg, drag_model) = params_tuple
# DP87 Coefficients
c = [0.0, 1/5, 3/10, 4/5, 8/9, 1.0, 1.0]
a = [[0.0], [1/5], [3/40, 9/40], [44/45, -56/15, 32/9],
[19372/6561, -25360/2187, 64448/6561, -212/729],
[9017/3168, -355/33, 46732/5247, 49/176, -5103/18656],
[35/384, 0.0, 500/1113, 125/192, -2187/6784, 11/84]]
b8 = [35/384, 0.0, 500/1113, 125/192, -2187/6784, 11/84, 0.0]
b7 = [5179/57600, 0.0, 7571/16695, 393/640, -92097/339200, 187/2100, 1/40]
t = 0.0
dt = SIMULATION_DT
x, y, z = 0.0, 0.0, 0.0
vx = velocity * [Link](angle)
vy = velocity * [Link](angle)
vz = 0.0
sum_a_k_vel = [0.0] * 3
for l in range(len(a[i-1])):
for j in range(3):
sum_a_k_vel[j] += a[i-1][l] * k[l][j]
next_state_8 = [0.0] * 6
next_state_7 = [0.0] * 6
for j in range(3):
sum_b8_k_pos = 0.0
sum_b7_k_pos = 0.0
for i in range(7):
sum_b8_k_pos += b8[i] * k[i][j]
sum_b7_k_pos += b7[i] * k[i][j]
if error > 0:
dt_new = 0.9 * dt * (TOLERANCE / error)**(1/8.0)
dt = dt_new
else:
dt *= 1.1
return x
def solve_single_mc_run(params_dict):
"""Wrapper function to run a single Monte Carlo simulation."""
return solve_trajectory_dp87((
params_dict['angle'], params_dict['mass'], params_dict['velocity'],
params_dict['target_distance'], params_dict['wind_data'],
params_dict['shooter_direction'], params_dict['bullet_diameter_mm'],
params_dict['temperature_celsius'], params_dict['pressure_hPa'],
params_dict['humidity_percent'], params_dict['spin_rate_rpm'],
params_dict['shooter_latitude_deg'], params_dict['drag_model']
))
def solve_trajectory_for_plot(params_tuple):
"""
Performs one run of the Dormand-Prince (DP87) integrator and returns a list
of (x, y, z) coordinates for plotting.
"""
try:
(angle, mass, velocity, target_distance, wind_data, shooter_direction,
bullet_diameter_mm,
temperature_celsius, pressure_hPa, humidity_percent, spin_rate_rpm,
shooter_latitude_deg, drag_model) = params_tuple
t = 0.0
dt = SIMULATION_DT
x, y, z = 0.0, 0.0, 0.0
vx = velocity * [Link](angle)
vy = velocity * [Link](angle)
vz = 0.0
next_state_8 = [0.0] * 6
next_state_7 = [0.0] * 6
for j in range(3):
sum_b8_k_pos = 0.0
sum_b7_k_pos = 0.0
for i in range(7):
sum_b8_k_pos += b8[i] * k[i][j]
sum_b7_k_pos += b7[i] * k[i][j]
if error > 0:
dt_new = 0.9 * dt * (TOLERANCE / error)**(1/8.0)
dt = dt_new
else:
dt *= 1.1
return trajectory_points
except Exception as e:
print(f"Error in trajectory plot solver: {e}")
return []
# Draw axes
# Vertical Axis (Y)
for i in range(height):
grid[i][0] = '|'
# Add labels
plot_str += f"\n0m{' ' * (width - 6)}{target_distance:.0f}m\n"
plot_str += f"Target at approx. X={int(target_distance * x_scale)}
Y={int((max_y - 0) * y_scale)}\n"
return plot_str
plt.tight_layout()
[Link](block=False)
save_path = "/storage/emulated/0/stcof/"
[Link](save_path, exist_ok=True)
full_path = [Link](save_path, save_name)
[Link](full_path)
print(f"\nPlot lintasan berhasil disimpan sebagai {full_path}")
[Link](fig)
def test_ke(self):
"""Test kinetic energy using standard floats."""
ke = 0.5 * [Link] * [Link]**2
[Link](ke, 7338240, places=0)
def test_momentum(self):
"""Test momentum using standard floats."""
momentum = [Link] * [Link]
[Link](momentum, 8736, places=0)
[Link](argv=['first-arg-is-ignored'], exit=False)
while True:
try:
mass = float(get_input_with_retry("Masukkan massa peluru (kg): ",
float, 0.005, 100))
target_distance = float(get_input_with_retry("Masukkan jarak target
(meter): ", float, 1, 50000))
velocity = float(get_input_with_retry("Masukkan kecepatan peluru (m/s):
", float, 100, 3000))
bullet_diameter_mm = float(get_input_with_retry("Masukkan diameter
peluru (mm): ", float, 1, 500))
spin_rate_rpm = 0.0
if spin_type == 'r':
while True:
spin_input = input("Masukkan twist Laras (cth: 1/15) atau RPM
(cth: 300000): ")
if '/' in spin_input:
try:
parts = spin_input.split('/')
if len(parts) == 2:
twist_rate_in_inches = float(parts[1])
if twist_rate_in_inches > 0:
spin_rate_rpm = (velocity * 720) /
twist_rate_in_inches
print(f"RPM: {spin_rate_rpm:.1f}")
break
else:
print("Nilai twist laras tidak valid.")
else:
print("Format twist laras tidak valid. Gunakan
format '1/x'.")
except (ValueError, IndexError):
print("Format twist laras tidak valid. Gunakan format
'1/x'.")
else:
try:
spin_rate_rpm = float(spin_input)
if spin_rate_rpm > 0:
twist_rate_in_inches = (velocity * 720) /
spin_rate_rpm
print(f"Twist Laras: 1/{twist_rate_in_inches:.1f}")
break
else:
print("Nilai RPM harus lebih besar dari 0.")
except ValueError:
print("Input tidak valid. Silakan coba lagi.")
else: # spin_type == 's'
spin_rate_rpm = 0.0
slow_print("Laras halus (Smoothbore) dipilih. Mengatur RPM menjadi
0.")
wind_data = []
multilayer_choice = get_input_with_retry("Apakah Anda ingin menggunakan
multi-layer wind? (y/t): ", str, choices=['y', 't'])
if multilayer_choice == 'y':
num_layers = get_input_with_retry("Berapa lapisan angin yang akan
dimasukkan?: ", int, 1, 10)
for i in range(num_layers):
altitude = get_input_with_retry(f"Masukkan ketinggian lapisan
{i+1} (meter): ", float, 0, None)
speed_kmh = get_input_with_retry(f"Masukkan kecepatan angin
lapisan {i+1} (km/h): ", float, 0, 3000)
angle = get_input_with_retry(f"Masukkan arah angin lapisan
{i+1} (derajat Kompas): ", float, 0, 360)
wind_data.append({'altitude': altitude, 'speed': speed_kmh /
3.6, 'angle': angle})
wind_data.sort(key=lambda x: x['altitude'])
else:
wind_speed_kmh = float(get_input_with_retry("Masukkan kecepatan
angin tunggal (km/h): ", float, 0, 3000))
wind_angle = float(get_input_with_retry("Masukkan arah angin
tunggal derajat Kompas: ", float, 0, 360))
wind_data.append({'altitude': 0.0, 'speed': wind_speed_kmh / 3.6,
'angle': wind_angle})
all_results = []
total_runs_completed = 0
if runs_in_this_batch <= 0:
break
batch_params = []
for i in range(runs_in_this_batch):
velocity_factor = [Link](0.995, 1.005)
wind_speed_variation = [Link](-0.5, 0.5)
wind_angle_variation = [Link](-5.0, 5.0)
stochastic_params = {
'angle': best_angle,
'mass': mass,
'velocity': velocity * velocity_factor,
'target_distance': target_distance,
'wind_data': [],
'shooter_direction': shooter_direction,
'bullet_diameter_mm': bullet_diameter_mm,
'temperature_celsius': temperature_celsius,
'pressure_hPa': pressure_hPa,
'humidity_percent': humidity_percent,
'spin_rate_rpm': spin_rate_rpm,
'shooter_latitude_deg': shooter_latitude_deg,
'drag_model': drag_model
}
if wind_data:
original_wind = wind_data[0]
stochastic_wind_speed = original_wind['speed'] +
wind_speed_variation
stochastic_wind_angle = original_wind['angle'] +
wind_angle_variation
stochastic_params['wind_data'].append({'altitude':
original_wind['altitude'], 'speed': stochastic_wind_speed, 'angle':
stochastic_wind_angle})
batch_params.append(stochastic_params)
start_time_batch = [Link]()
batch_results = list([Link](solve_single_mc_run,
batch_params))
end_time_batch = [Link]()
execution_time_batch = end_time_batch - start_time_batch
all_results.extend(batch_results)
total_runs_completed += runs_in_this_batch
print(f"{total_runs_completed} run =
{execution_time_batch:.2f}s")
end_time_all = [Link]()
total_execution_time = end_time_all - start_time_all
if not valid_results:
slow_print("\nSemua simulasi gagal. Mohon periksa kembali input dan
log error.")
continue
avg_drop = [Link](all_drops)
avg_drift = [Link](all_drifts)
avg_t_final = [Link](all_t_final)
avg_final_ke = [Link](all_final_ke)
avg_final_momentum = [Link](all_final_momentum)
if avg_drift > 0:
print(f"Windage: Bidik {abs(drift_mil):.0f} titik ke kiri dari
center crosshair.")
else:
print(f"Windage: Bidik {abs(drift_mil):.0f} titik ke kanan dari
center crosshair.")
except Exception as e:
slow_print("\nTerjadi error saat menjalankan program. Detail error:")
slow_print(f"Error spesifik: {e}")
traceback.print_exc()
[Link]
import sys
from typing import Dict, Tuple, List
from collections import Counter
# 6. SMARTFREN
"881": "Smartfren",
"882": "Smartfren",
"883": "Smartfren",
"884": "Smartfren",
"885": "Smartfren",
"886": "Smartfren",
"887": "Smartfren",
"888": "Smartfren",
"889": "Smartfren",
}
# HLR REGION MAP - TIDAK BERUBAH (Hanya menggunakan prefix 812, 857, 878)
HLR_REGION_MAP: Dict[str, str] = {}
for code_kab_kota, data in DATA_JAWA_TIMUR.items():
name = data['nama']
# Prefix Telkomsel
"811": "Telkomsel (HLR Umum Nasional)", "812": "Telkomsel (HLR Umum Nasional)",
"813": "Telkomsel (HLR Umum Nasional)",
"821": "Telkomsel (HLR Umum Nasional)", "822": "Telkomsel (HLR Umum Nasional)",
"823": "Telkomsel (HLR Umum Nasional)",
"851": "Telkomsel (HLR Umum Nasional)", "852": "Telkomsel (HLR Umum Nasional)",
"853": "Telkomsel (HLR Umum Nasional)",
# Prefix Tri
"895": "Tri (HLR Umum Nasional)", "896": "Tri (HLR Umum Nasional)", "897": "Tri
(HLR Umum Nasional)",
"898": "Tri (HLR Umum Nasional)", "899": "Tri (HLR Umum Nasional)",
# Prefix Smartfren
"881": "Smartfren (HLR Umum Nasional)", "882": "Smartfren (HLR Umum Nasional)",
"883": "Smartfren (HLR Umum Nasional)",
"884": "Smartfren (HLR Umum Nasional)", "885": "Smartfren (HLR Umum Nasional)",
"886": "Smartfren (HLR Umum Nasional)",
"887": "Smartfren (HLR Umum Nasional)", "888": "Smartfren (HLR Umum Nasional)",
"889": "Smartfren (HLR Umum Nasional)",
})
# ==============================================================================
# FUNGSI PENDUKUNG (NORMALIZATION & IDENTIFICATION)
# ==============================================================================
# ==============================================================================
# FUNGSI ANALISIS & DISPLAY UTAMA (V21.0 - ROBUST MODE)
# ==============================================================================
if not is_valid_indonesian_input(original_number):
return {"Status": "Filtered", "Catatan": f"{[Link]}Input Filtered
(Irrelevant Format){[Link]}", "ID": str(index)}
if number_type == "INVALID":
return {"Status": "Error", "Catatan": "Invalid Phone Number Input", "ID":
str(index)}
if kode_kab_kota_2d in DATA_JAWA_TIMUR:
name_kab_kota = DATA_JAWA_TIMUR[kode_kab_kota_2d]['nama']
if data['Status'] == 'Filtered':
print(f"\n{[Link]}--- REPORT ID {data['ID']} ---{[Link]}")
print(f"[!] {data['Catatan']}")
print(Colors.SECTION_SEP)
return
operator_color = [Link]("Kode_Warna", [Link])
hlr_info = data['Specific_HLR']
print(Colors.SECTION_SEP)
# ==============================================================================
# FUNGSI UTAMA (V21.0 FINAL)
# ==============================================================================
def run_identifier_final_edition():
print(f"\n{[Link]}{Colors.HEADER_SEP}{[Link]}")
print(f"{[Link]}[+] ANALYZER HLR V21.0: LOKASI REGISTRASI AWAL (ROBUST
MODE){[Link]}")
print(f"{[Link]}[INFO] Data Prefix Operator Diperbarui. Total
{len(OPERATOR_CODES)} Prefix Mobile Terdaftar.{[Link]}")
print(f"{[Link]}{Colors.HEADER_SEP}{[Link]}")
print(f"{[Link]}[INFO] Mode: ROBUST. Analisis HLR mengutamakan Prefix
5D/7D meskipun nomor pendek.{[Link]}")
print(f"{[Link]}[!] EPHEMERAL MODE ACTIVE: Data resident in RAM only
({len(PROCESSED_HOTLIST)} items).{[Link]}")
numbers_to_analyze: List[str] = []
i = 1
while True:
try:
user_input = input(f"TARGET_ID {i:03}: ").strip()
except EOFError:
break
numbers_to_analyze.append(user_input)
i += 1
if not numbers_to_analyze:
print(f"{[Link]}[FATAL] No targets defined. Aborting session.
{[Link]}"); return
normalized_number, _, _, _, _ = clean_and_normalize_number(original_number)
all_analysis_results.append(analysis_data)
display_informant_report(analysis_data, hotlist_status)
# ==============================================================================
# EKSEKUSI PROGRAM
# ==============================================================================
if __name__ == "__main__":
try:
run_identifier_final_edition()
except KeyboardInterrupt:
print(f"\n[STATUS] {[Link]}Program interrupted. Aborting.
{[Link]}")
[Link](0)
except Exception as e:
print(f"\n[FATAL] Unhandled error: {e}")
[Link](1)
[Link]
import sys
import time
import subprocess
import re
import requests
import os
import ipaddress
import platform
from [Link] import urlparse
def clear_screen():
[Link]('cls' if [Link] == 'nt' else 'clear')
try:
req = [Link](api_url, headers=headers, timeout=10)
data = [Link]()
if [Link]('ok') != 1:
print(RED + "[!] Failed to initiate global nodes." + RESET)
return
request_id = [Link]('request_id')
nodes = [Link]('nodes', {})
# Loading Animation
for i in range(5):
[Link](f"\r{CYAN}[WAITING] {'|/-\\'[i % 4]} Receiving
packets...{RESET}")
[Link]()
[Link](1)
print("\n")
result_url = f"[Link]
result_req = [Link](result_url, headers=headers, timeout=10)
results = result_req.json()
if not node_data:
print(f"{location_display:<25} | {YELLOW}WAITING{RESET} | ...")
continue
if pings:
try:
avg_ping = sum([float(p) for p in pings if isinstance(p, (int,
float))]) / len(pings)
latency_ms = avg_ping * 1000
except Exception as e:
print(RED + f"[!] Distributed Probe Error: {e}" + RESET)
try:
proc = [Link](cmd, stdout=[Link],
stderr=[Link], text=True)
last_hop_ip = target
for line in [Link]:
line = [Link]()
if not line: continue
if [Link]("traceroute") or [Link]("Tracing"):
continue
hop_match = [Link](r'^\s*(\d+)', line)
ip_match = [Link](r'([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-fA-F0-9:]+:+
[a-fA-F0-9:]+)', line)
if hop_match and ip_match:
hop_num = hop_match.group(1)
ip_addr = ip_match.group(1)
details = get_ip_details(ip_addr)
display_info = "Unknown"
color = RESET
if details:
if [Link]('status') == 'private':
display_info = f"{YELLOW}LOCAL / PRIVATE NETWORK{RESET}"
color = CYAN
elif [Link]('status') == 'success':
isp = [Link]('isp', 'Unknown')
country = [Link]('country', '')
display_info = f"{isp} ({country})"
color = GREEN
last_hop_ip = ip_addr
print(f"{hop_num:<4} | {color}{ip_addr:<25}{RESET} |
{display_info}")
[Link](0.05)
return last_hop_ip
except:
return target
# 1. RESOLVING
print(YELLOW + "\n[+] EXECUTING DNS LOOKUP..." + RESET)
try:
if validate_ip(user_input):
target_ip = user_input
else:
ns_cmd = ["nslookup", user_input] if [Link]().lower() ==
'windows' else ["dig", "+short", user_input]
target_ip_raw = subprocess.check_output(ns_cmd, text=True)
ip_match = [Link](r'([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)',
target_ip_raw)
if ip_match:
target_ip = ip_match.group(1)
print(f"{GREEN}[+] RESOLVED IP: {target_ip}{RESET}")
else:
raise Exception("DNS Fail")
except:
print(RED + "[-] Host Unreachable." + RESET)
return
# 4. ANIMASI
triangulation_animation()
# 5. TRACEROUTE
last_hop = run_traceroute(target_ip)
ip_data = get_ip_details(final_target)
if address_data:
print(f"{'Nama Jalan':<12}: {GREEN}{address_data['road']}{RESET}")
print(f"{'Kel/Desa':<12}: {GREEN}{address_data['village']}{RESET}")
print(f"{'Kab/Kota':<12}: {GREEN}{address_data['county']}{RESET}")
print(f"{'Provinsi':<12}: {GREEN}{address_data['state']}{RESET}")
print(f"{'Negara':<12}: {GREEN}{address_data['country']}{RESET}")
else:
print(f"{'Kota':<12}: {GREEN}{ip_data.get('city')}{RESET}")
print(f"{'Negara':<12}: {GREEN}{ip_data.get('country')}{RESET}")
# 7. MAP ZOOM
input(BOLD + "\n[PRESS ENTER TO INITIATE SATELLITE FEED]" + RESET)
display_map_chafa(lat, lon)
else:
print(RED + "\n[!] Could not retrieve location data." + RESET)
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("\n[!] ABORTED.")
[Link]
import os
import sys
import time
import requests
# URL untuk Google Maps Satellite di level zoom maksimal (z=21 atau lebih)
# Ini akan memicu 'Open with' di Android
geo_url = f"[Link]
filename = f"prec_hd.png"
url = f"[Link]
{lat}&z={z}&l=sat&size=650,450"
try:
r = [Link](url, headers=headers, timeout=10)
if r.status_code == 200:
with open(filename, 'wb') as f:
[Link]([Link])
[Link]('clear')
print(f"{[Link]}{[Link]}[SYSTEM] HYBRID MODE | ZOOM: {z}x |
STATUS: STABLE{[Link]}")
# Resolusi 146x100p sesuai permintaan sebelumnya
[Link](f"chafa -c full --symbols block+vhalf --dither none --size
146x100 --stretch {filename}")
else:
print(f"{[Link]}[!] Uplink Failed.{[Link]}")
except Exception as e:
print(f"{[Link]}[!] Error: {e}{[Link]}")
def main():
[Link]('clear')
transmit(f"{[Link]}{[Link]} [ SATELLITE HYBRID: TERMINAL + GOOGLE
EARTH ]{[Link]}")
try:
geo = [Link](f"[Link]
lat, lon = geo['lat'], geo['lon']
transmit(f"{[Link]}[+] Target Locked: {geo['city']},
{geo['country']}{[Link]}")
except: return
while True:
try:
z_input = input(f"{[Link]}{[Link]}ZOOM_CMD (1-21) >
{[Link]}")
if z_input == '0': break
if not z_input.isdigit(): continue
if __name__ == "__main__":
main()
[Link]
import os
import sys
import time
import requests
import re
def parse_coordinates(input_str):
"""Mendeteksi apakah input adalah Desimal atau DMS"""
# Pattern 1: Decimal (e.g., -8.74, 115.16)
decimal_match = [Link](r"^(-?\d+\.?\d*)\s*,\s*(-?\d+\.?\d*)$", input_str)
if decimal_match:
return float(decimal_match.group(1)), float(decimal_match.group(2))
if len(matches) == 2:
lat = dms_to_dd(*matches[0])
lon = dms_to_dd(*matches[1])
return lat, lon
filename = "prec_hd.png"
# Yandex Static Maps API
url = f"[Link]
{lat}&z={z}&l=sat&size=650,450"
try:
r = [Link](url, timeout=10)
if r.status_code == 200:
with open(filename, 'wb') as f:
[Link]([Link])
[Link]('clear')
print(f"{[Link]}{[Link]}[ V18 HYBRID SURVEILLANCE ]
{[Link]}")
print(f"{[Link]}TARGET : {tag}{[Link]}")
print(f"{[Link]}COORD : {lat}, {lon}{[Link]}")
print(f"{[Link]}MODE : {'TERMINAL' if int(z) <= 17 else
'EXTERNAL BROWSER'}{[Link]}")
print("-" * 65)
def main():
[Link]('clear')
print(f"{[Link]}{[Link]}")
print(" ╔══════════════════════════════════════════════════╗")
print(" ║ V18: TERMINAL SATELLITE & DEEP SCAN ║")
print(" ║ SUPPORT: IP, DECIMAL, & DMS COORDINATES ║")
print(" ╚══════════════════════════════════════════════════╝{[Link]}")
while True:
try:
z_input = input(f"{[Link]}{[Link]}ZOOM_LEVEL (1-21) [0 to
Back] > {[Link]}")
if z_input == '0':
main()
break
if not z_input.isdigit():
continue
fetch_and_render(lat, lon, z_input, tag)
except KeyboardInterrupt:
print("\nExiting...")
break
if __name__ == "__main__":
main()
[Link]
def start_tor_auto():
try:
check_tor = [Link](['pgrep', 'tor'], capture_output=True)
if check_tor.returncode != 0:
print("[*] Menjalankan TOR di background...")
[Link](['tor'], stdout=[Link],
stderr=[Link])
[Link](5)
except: pass
def get_cctv_list(domain):
print(f"[*] Menelusuri daftar kamera di {domain}...")
gallery_url = f"{domain}/cctv"
cameras = []
try:
r = [Link](gallery_url, proxies=TOR_PROXY, timeout=10)
found = [Link](r'monitor=(\d+)', [Link])
unique_ids = sorted(list(set(found)), key=int)
def get_wlan_ip():
try:
s = [Link](socket.AF_INET, socket.SOCK_DGRAM)
[Link](("[Link]", 80))
return [Link]()[0]
except: return "[Link]"
def create_ui():
html = """
<!DOCTYPE html>
<html>
<head>
<title>GHOST SELECTOR</title>
<script src="[Link]
<style>
body { background: #000; color: #0f0; font-family: monospace; text-
align: center; }
video { width: 95%; max-width: 900px; border: 1px solid #0f0; margin-
top: 10px; }
.controls { display: grid; grid-template-columns: repeat(3, 1fr); max-
width: 350px; margin: 15px auto; gap: 8px; }
button { background: #000; color: #0f0; border: 1px solid #0f0;
padding: 12px; cursor: pointer; }
button:active { background: #0f0; color: #000; }
</style>
</head>
<body>
<h3>:: GHOST RELAY SELECTOR ::</h3>
<video id="video" autoplay muted playsinline></video>
<div class="controls">
<button onclick="cmd('zoom_in')">ZOOM +</button>
<button onclick="cmd('w')">UP</button>
<button onclick="cmd('zoom_out')">ZOOM -</button>
<button onclick="cmd('a')">LEFT</button>
<button onclick="cmd('s')">DOWN</button>
<button onclick="cmd('d')">RIGHT</button>
<button style="grid-column: span 3" onclick="cmd('reset')">RESET
VIEW</button>
</div>
<script>
var video = [Link]('video');
function start() {
if([Link]()) {
var hls = new Hls();
[Link]('stream/index.m3u8');
[Link](video);
}
}
function cmd(k) { fetch('/control?key=' + k); }
setInterval(() => { if([Link]) start(); }, 3000);
start();
</script>
</body>
</html>
"""
with open([Link](WWW_DIR, "[Link]"), "w") as f: [Link](html)
class GhostServer([Link]):
def do_GET(self):
if "/control" in [Link]:
query = parse_qs(urlparse([Link]).query)
key = [Link]('key', [None])[0]
global zoom_state
if key == 'zoom_in' and zoom_state["scale"] < 6: zoom_state["scale"] +=
1
elif key == 'zoom_out' and zoom_state["scale"] > 1: zoom_state["scale"]
-= 1
elif key == 'w': zoom_state["y"] -= 60
elif key == 's': zoom_state["y"] += 60
elif key == 'a': zoom_state["x"] -= 60
elif key == 'd': zoom_state["x"] += 60
elif key == 'reset': zoom_state = {"scale": 1, "x": 0, "y": 0}
self.send_response(200); self.end_headers()
else: super().do_GET()
def run_ffmpeg(url):
while True:
output = [Link](STREAM_DIR, "index.m3u8")
crop_filter = f"crop=iw/{zoom_state['scale']}:ih/{zoom_state['scale']}:
(iw/2-ow/2)+{zoom_state['x']}:(ih/2-oh/2)+{zoom_state['y']}"
if __name__ == "__main__":
[Link]('clear')
start_tor_auto()
print("="*60)
print(" CCTV EVERYWHERE")
print("="*60)
cam_list = get_cctv_list("[Link]
try:
pilihan = int(input("\nNomor Kamera > ")) - 1
target_url = cam_list[pilihan]['url']
# --- INPUT RESOLUSI BARU ---
print("\n[?] Format: Lebar:Tinggi (Contoh: 1280:720, 640:480, 1920:1080)")
input_res = input("R-Transmit Res: ").strip()
if input_res:
SELECTED_RES = input_res
# ---------------------------
except:
print("[!] Pilihan salah atau error."); exit()
create_ui()
my_ip = get_wlan_ip()
[Link](WWW_DIR)
[Link](target=[Link](("", PORT),
GhostServer).serve_forever, daemon=True).start()
V2
import os, subprocess, threading, time, socket, re, requests, shutil, getpass, sys,
signal
import [Link], socketserver, json
from [Link] import urlparse, parse_qs
def cool_effects():
[Link]('clear' if [Link] == 'posix' else 'cls')
print("\033[92m[*] Initializing Ghost System...")
[Link](1)
print(f"[*] Getting IP Address...")
[Link](1.5)
print(f"[*] Local Node: {[Link]([Link]())}")
print("[*] Tor Circuit: Established")
print("-" * 35)
user = input("Username: ")
pw = [Link]("Password: ")
print("\033[92m[+] Access Granted. Loading Dashboard...\033[0m")
[Link](1)
def start_tor_auto():
try:
check_tor = [Link](['pgrep', 'tor'], capture_output=True)
if check_tor.returncode != 0:
[Link](['tor'], stdout=[Link],
stderr=[Link])
[Link](3)
except: pass
def get_cctv_list(domain):
print(f"[*] Scrapping CCTV Database (Full Scan)...")
try:
r = [Link](f"{domain}/cctv", proxies=TOR_PROXY, timeout=10)
found = [Link](r'monitor=(\d+)', [Link])
unique_ids = sorted(list(set(found)), key=int)
if unique_ids:
return [{"name": f"Monitor {m_id}", "url":
f"[Link]
mode=jpeg&monitor={m_id}&user=view&pass=K0minfo"} for m_id in unique_ids]
except: pass
return [{"name": f"Cam {mid}", "url": f"[Link]
bin/nph-zms?mode=jpeg&monitor={mid}&user=view&pass=K0minfo"} for mid in [1, 2, 7,
13, 14, 20, 25]]
def create_ui():
html = """
<!DOCTYPE html>
<html>
<head>
<title>GHOST V6 ULTIMATE</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="[Link]
<style>
body { background: #000; color: #0f0; font-family: 'Consolas',
monospace; text-align: center; margin: 0; -webkit-user-select: none; }
.header { padding: 10px; border-bottom: 1px solid #0f0; background:
#050505; font-size: 14px; }
.video-container { position: relative; width: 98%; max-width: 900px;
margin: 10px auto; border: 1px solid #0f0; background: #000; }
.overlay { position: absolute; top: 0; left: 0; width: 100%; height:
100%; z-index: 10; cursor: default; }
video { width: 100%; display: block; filter: contrast(1.1); }
.controls { display: grid; grid-template-columns: repeat(3, 1fr); max-
width: 400px; margin: 15px auto; gap: 8px; padding: 10px; }
button { background: #000; color: #0f0; border: 1px solid #0f0;
padding: 15px; cursor: pointer; font-size: 12px; font-weight: bold; }
button:active { background: #0f0; color: #000; }
.stats { font-size: 11px; color: #aff; padding-bottom: 5px; }
</style>
</head>
<body oncontextmenu="return false;">
<div class="header">GHOST V6 GOLD | <span id="sync">SYNCING
1.0x</span></div>
<div class="video-container">
<div class="overlay"></div>
<video id="video" autoplay muted playsinline></video>
</div>
<div class="stats">SPD: <span id="speed">0x</span> | FPS: <span
id="fps">0</span> | <span id="bitrate">0</span></div>
<div class="controls">
<button onclick="cmd('zoom_in')">ZOOM +</button>
<button onclick="cmd('w')">UP</button>
<button onclick="cmd('zoom_out')">ZOOM -</button>
<button onclick="cmd('a')">LEFT</button>
<button onclick="cmd('s')">DOWN</button>
<button onclick="cmd('d')">RIGHT</button>
<button onclick="togglePiP()" style="grid-column: span 3; color: #0af;
border-color: #0af;">ENTER PiP MODE</button>
<button onclick="cmd('reset')" style="grid-column: span 3; color: #f00;
border-color: #f00;">RESET VIEW</button>
</div>
<script>
var video = [Link]('video');
function init() {
if([Link]()) {
var hls = new Hls({ lowLatencyMode: true, liveSyncDuration: 1.5
});
[Link]('stream/index.m3u8');
[Link](video);
}
}
function cmd(k) { fetch('/control?key=' + k); }
async function togglePiP() {
if (video !== [Link]) await
[Link]();
else await [Link]();
}
setInterval(() => {
fetch('/stats').then(r => [Link]()).then(d => {
[Link]('speed').innerText = [Link];
[Link]('fps').innerText = [Link];
[Link]('bitrate').innerText = [Link];
});
}, 2000);
init();
</script>
</body>
</html>
"""
with open([Link](WWW_DIR, "[Link]"), "w", encoding="utf-8") as f:
[Link](html)
class GhostServer([Link]):
def end_headers(self):
self.send_header('Cache-Control', 'no-store, no-cache, must-revalidate,
max-age=0')
super().end_headers()
def do_GET(self):
if "/control" in [Link]:
query = parse_qs(urlparse([Link]).query)
key = [Link]('key', [None])[0]
global zoom_state
if key == 'zoom_in': zoom_state["scale"] = min(zoom_state["scale"] + 1,
6)
elif key == 'zoom_out': zoom_state["scale"] = max(zoom_state["scale"] -
1, 1)
elif key == 'w': zoom_state["y"] -= 60
elif key == 's': zoom_state["y"] += 60
elif key == 'a': zoom_state["x"] -= 60
elif key == 'd': zoom_state["x"] += 60
elif key == 'reset': zoom_state = {"scale": 1, "x": 0, "y": 0}
self.send_response(200); self.end_headers()
elif "/stats" in [Link]:
self.send_response(200); self.send_header('Content-Type',
'application/json'); self.end_headers()
[Link]([Link](current_usage).encode())
else: super().do_GET()
def run_ffmpeg(url):
global current_usage
while True:
output = [Link](STREAM_DIR, "index.m3u8")
crop = f"crop=iw/{zoom_state['scale']}:ih/{zoom_state['scale']}:(iw/2-ow/
2)+{zoom_state['x']}:(ih/2-oh/2)+{zoom_state['y']}"
cmd = [
'proxychains4', '-q', 'ffmpeg', '-y',
'-use_wallclock_as_timestamps', '1',
'-fflags', '+genpts+nobuffer',
'-re', # FORCE 1.0x SPEED
'-i', url,
'-vf', f"{crop},fps=20",
'-c:v', 'libx264', '-preset', 'ultrafast', '-tune', 'zerolatency',
'-b:v', OPTIMAL_BITRATE, '-maxrate', OPTIMAL_BITRATE, '-bufsize',
'300k',
'-g', '40', '-f', 'hls', '-hls_time', '2', '-hls_list_size', '3',
'-hls_flags', 'delete_segments', output
]
if __name__ == "__main__":
cool_effects()
start_tor_auto()
cam_list = get_cctv_list("[Link]
for i, cam in enumerate(cam_list): print(f" [{i+1}] {cam['name']}")
try:
pilihan = int(input("\nNomor Kamera > ")) - 1
target_url = cam_list[pilihan]['url']
except: exit()
create_ui()
[Link](WWW_DIR)
run_ffmpeg(target_url)
[Link]
import os
import sys
import time
import random
import json # [NEW] Modul untuk menyimpan ingatan
import subprocess
from collections import Counter
from joblib import Parallel, delayed
from mpmath import mp
from colorama import Fore, Back, Style, init
# ==========================================
# SYSTEM CONFIGURATION & INITIALIZATION
# ==========================================
init(autoreset=True)
[Link] = 100
class SystemConfig:
VERSION = "7.5.0-NSP" # Updated Version
CODENAME = "GOD_EYE_PERMANENT"
CPU_CORES = 8
MC_TRIALS = 1024
TTS_SPEED = "1.3"
MEMORY_FILE = "nsp_core.json" # File penyimpanan otak
# ==========================================
# DATABASE MODULE (WITH NSP)
# ==========================================
class DisasterDatabase:
def __init__(self):
[Link] = [
"General / Unknown", "Apple Brook", "Arch Park", "Coastal Quickrun",
"Devastation Station", "Factory Frenzy", "Fort Indestructible",
"Furious Station", "Glass Office", "Green Hill", "Happy Home",
"Heights School", "Launch Land", "Lucky Mart", "Manic Mansion",
"Party Palace", "Prison Panic", "Rakish Refinery", "Roblox HQ",
"Sky Tower", "Sunny Ranch", "Surf Central", "Trailer Park"
]
[Link] = {
"Acid Rain": {
"weather": "Cloudy", "rating": "LOW",
"visual": "Langit berubah hijau kekuningan.",
"warning": "ACID RAIN DETECTED. DO NOT TOUCH GRASS.",
"strat": "Cari atap beton. Struktur kayu aman tapi bisa
berlubang.",
"map_strat": {"Factory Frenzy": "Masuk lantai dasar pabrik."}
},
"Avalanche": {
"weather": "Sunny", "rating": "HIGH",
"visual": "Gunung Salju muncul di horizon.",
"warning": "AVALANCHE IMMINENT. SEEK COVER.",
"strat": "Sembunyi di sisi bangunan yang membelakangi gunung.",
"map_strat": {"Sky Tower": "TURUN KE LANTAI DASAR SEGERA!"}
},
"Blizzard": {
"weather": "Foggy", "rating": "MEDIUM",
"visual": "Kabut putih tebal, visibility 0%.",
"warning": "EXTREME COLD. FIND SHELTER.",
"strat": "Masuk ruangan tertutup total. Jauhi pintu.",
"map_strat": {"Fort Indestructible": "Masuk sel penjara."}
},
"Deadly Virus": {
"weather": "Sunny", "rating": "MEDIUM",
"visual": "Partikel virus hijau pada player.",
"warning": "BIOHAZARD. MAINTAIN DISTANCE.",
"strat": "Isolasi diri di tempat tinggi/terpencil.",
"map_strat": {"Roblox HQ": "Naik tangga darurat ke atap."}
},
"Earthquake": {
"weather": "Sunny", "rating": "EXTREME",
"visual": "Screen shake intens.",
"warning": "SEISMIC ACTIVITY. EVACUATE BUILDINGS.",
"strat": "Keluar ke tanah lapang. Jauhi struktur tinggi.",
"map_strat": {"Glass Office": "GEDUNG AKAN RUNTUH TOTAL. LARI!"}
},
"Fire": {
"weather": "Sunny", "rating": "MEDIUM",
"visual": "Asap hitam dan api kecil.",
"warning": "INFERNO DETECTED. AVOID FLAMES.",
"strat": "Cari area batu/pasir/aspal.",
"map_strat": {"Green Hill": "Lari ke pantai pasir."}
},
"Flash Flood": {
"weather": "Cloudy", "rating": "HIGH",
"visual": "Air laut pasang dengan cepat.",
"warning": "RISING WATER LEVELS. CLIMB UP.",
"strat": "Naik ke objek tertinggi yang statis.",
"map_strat": {"Launch Land": "Naik ke puncak Roket."}
},
"Meteor Shower": {
"weather": "Sunny", "rating": "HIGH",
"visual": "Bayangan bulat di tanah.",
"warning": "IMPACT INBOUND. KEEP MOVING.",
"strat": "Zig-zag pattern. Jangan diam di satu titik.",
"map_strat": {"Arch Park": "Sembunyi di bawah Arch batu."}
},
"Sandstorm": {
"weather": "Foggy", "rating": "MEDIUM",
"visual": "Kabut kuning, angin kencang.",
"warning": "HIGH WINDS. DODGE DEBRIS.",
"strat": "Berlindung di balik tembok tebal.",
"map_strat": {"Furious Station": "Masuk terowongan rel."}
},
"Thunderstorm": {
"weather": "Cloudy", "rating": "HIGH",
"visual": "Awan hitam pekat, suara guruh.",
"warning": "LIGHTNING STRIKES. STAY LOW.",
"strat": "Jangan jadi objek tertinggi. Tiarap/turun.",
"map_strat": {"Sky Tower": "JANGAN DI ATAP/TANGGA LUAR."}
},
"Tornado": {
"weather": "Cloudy", "rating": "EXTREME",
"visual": "Corong angin berputar.",
"warning": "TORNADO DETECTED. RUN AWAY.",
"strat": "Lari memutar berlawanan arah tornado.",
"map_strat": {"Prison Panic": "Lari ke lapangan basket."}
},
"Tsunami": {
"weather": "Sunny", "rating": "EXTREME",
"visual": "Air laut surut drastis.",
"warning": "TSUNAMI WAVE. HIGH GROUND.",
"strat": "Naik gedung tinggi/bukit. Jauhi kaca.",
"map_strat": {"Glass Office": "CARI BALON HIJAU! GEDUNG MATI."}
},
"Volcanic Eruption": {
"weather": "Sunny", "rating": "HIGH",
"visual": "Gunung api tumbuh dari tanah.",
"warning": "VOLCANIC ACTIVITY. DODGE LAVA.",
"strat": "Jauhi kawah. Perhatikan bayangan lava.",
"map_strat": {"Party Palace": "Tetap di jalan setapak luar."}
}
}
# ==========================================
# ENGINE MODULE
# ==========================================
class MonteCarloEngine:
def __init__(self, db):
[Link] = db
for _ in range(trials):
[Link](secure_rng.choice(pool))
return Counter(results)
results = Parallel(n_jobs=SystemConfig.CPU_CORES)(
delayed(self._simulate_pane)(eligible, SystemConfig.MC_TRIALS)
for _ in range(SystemConfig.CPU_CORES)
)
final_tally = Counter()
for r in results: final_tally.update(r)
return final_tally
# ==========================================
# INTERFACE & AUDIO MODULE
# ==========================================
class UserInterface:
def __init__(self, initial_stats):
[Link] = []
# Load stats from NSP memory instead of 0
[Link] = initial_stats
def boot_sequence(self):
[Link]('clear') # Gunakan 'cls' jika di Windows
steps = [
"Initializing Kernel...",
"Loading Disaster Database...",
"Connecting to Joblib Parallel Backend...",
"Restoring Neural Save Program (NSP)...",
"System Ready."
]
for step in steps:
print([Link] + f"[BOOT] {step}")
[Link](0.15)
[Link](0.5)
# Stats Row
acc = 0.0
if [Link]['total'] > 0:
acc = ([Link]['hits'] / [Link]['total']) * 100
# History
if [Link]:
print([Link] + "\n[ RECENT LOGS ]")
for i, h in enumerate([Link][-3:]):
status = f"{[Link]}HIT " if h['hit'] else f"{[Link]}MISS"
print(f" #{i+1} | {h['map'][:10]}... | {h['pred']} -> {h['actual']}
[{status}{[Link]}]")
# RANK 1 DETAILED
r1_name = top3[0][0]
r1_prob = (top3[0][1] / total_sims) * 100
r1_info = db_ref.data[r1_name]
if len(top3) > 1:
r2_name = top3[1][0]
r2_prob = (top3[1][1] / total_sims) * 100
print(f"{[Link]}SECONDARY : {r2_name} ({r2_prob:.1f}%)")
if len(top3) > 2:
r3_name = top3[2][0]
r3_prob = (top3[2][1] / total_sims) * 100
print(f"{[Link]}TERTIARY : {r3_name} ({r3_prob:.1f}%)")
return strat
# ==========================================
# MAIN APPLICATION LOOP
# ==========================================
def main():
# Initialize Modules
db = DisasterDatabase()
# Pass saved stats to UI so accuracy persists
ui = UserInterface(db.saved_stats)
engine = MonteCarloEngine(db)
ui.boot_sequence()
current_map = "General / Unknown"
try:
while True:
ui.draw_dashboard(current_map)
if cmd == 'EXIT':
print("Initiating NSP Backup Sequence...")
db.save_neural_memory([Link]) # SAVE ON EXIT
[Link](1)
print("Shutting down OMEGA system...")
[Link]()
# Run Simulation
tally = [Link](eligible)
top3 = tally.most_common(3)
total_sims = SystemConfig.CPU_CORES * SystemConfig.MC_TRIALS
# Show Results
tactics = ui.show_results(top3, total_sims, current_map, db)
# Audio Output
tts_msg = f"Alert. {top3[0][0]} Incoming. {tactics}"
Parallel(n_jobs=1)(delayed([Link])(tts_msg) for _ in range(1))
hit = False
actual = "Unknown"
try:
if [Link]() and int(val) < 3:
actual = valid_opts[int(val)]
hit = True
db.update_weights(actual)
# Auto-Save after every correction (Optional but safer)
# db.save_neural_memory([Link])
else:
hit = False
except: pass
# Update Stats
[Link]['total'] += 1
if hit: [Link]['hits'] += 1
[Link]({
"map": current_map,
"pred": top3[0][0],
"actual": actual,
"hit": hit
})
except KeyboardInterrupt:
# [NSP] Save on CTRL+C Force Close
print([Link] + "\n\n[!] EMERGENCY INTERRUPTION DETECTED")
print([Link] + "[NSP] Attempting Emergency Memory Dump...")
db.save_neural_memory([Link])
[Link]()
if __name__ == "__main__":
main()