-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
184 lines (159 loc) · 6.92 KB
/
Copy pathmain.py
File metadata and controls
184 lines (159 loc) · 6.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#!/usr/bin/env python3
"""
HackIt main entry point
"""
import sys
import time
import os
import platform
# ── Typing Animation ───────────────────────────────────────────────────────────
import re
def _typer(text, delay=0.015, end='\n'):
parts = re.split(r'(\x1b\[[0-9;]*m)', text)
for part in parts:
if not part:
continue
if part.startswith('\x1b['):
sys.stdout.write(part)
sys.stdout.flush()
else:
for ch in part:
sys.stdout.write(ch)
sys.stdout.flush()
time.sleep(delay)
sys.stdout.write(end)
sys.stdout.flush()
C = {
'g': '\033[92m', 'r': '\033[91m', 'c': '\033[96m',
'y': '\033[93m', 'm': '\033[95m', 'b': '\033[94m',
'w': '\033[97m', 'd': '\033[2m', 'n': '\033[0m',
'gb': '\033[92;1m', 'rb': '\033[91;1m', 'cb': '\033[96;1m',
'yb': '\033[93;1m', 'mb': '\033[95;1m', 'bb': '\033[94;1m',
'wb': '\033[97;1m',
}
def _(tag, text=''):
c = C.get(tag, '')
return f'{c}{text}{C["n"]}' if text else c
def _gradient(text, colors, delay=0.003, end='\n'):
n = len(text)
for i, ch in enumerate(text):
idx = int(i / max(n - 1, 1) * (len(colors) - 1))
sys.stdout.write(colors[idx] + ch + C['n'])
sys.stdout.flush()
time.sleep(delay)
sys.stdout.write(end)
sys.stdout.flush()
def _progress_bar(current, total, width=26, color='cb'):
filled = int(current / total * width)
bar = '█' * filled + '░' * (width - filled)
pct = int(current / total * 100)
return f"{_(color, bar)} {_(color, f'{pct:3d}%')}"
def _pulse(tag, text, cycles=1, delay=0.06):
"""Pulse text dim↔bright."""
dim = _('d', text)
bright = _(tag, text)
for c in range(cycles):
sys.stdout.write(f'\r {dim}')
sys.stdout.flush()
time.sleep(delay)
sys.stdout.write(f'\r {bright}')
sys.stdout.flush()
time.sleep(delay)
sys.stdout.write('\n')
sys.stdout.flush()
def welcome_animation():
os.system('clear' if os.name == 'posix' else 'cls')
# ── HACKIT ASCII art logo ──
logo_art = [
" ██╗ ██╗ █████╗ ██████╗██╗ ██╗██╗████████╗",
" ██║ ██║██╔══██╗██╔════╝██║ ██╔╝██║╚══██╔══╝",
" ███████║███████║██║ █████╔╝ ██║ ██║ ",
" ██╔══██║██╔══██║██║ ██╔═██╗ ██║ ██║ ",
" ██║ ██║██║ ██║╚██████╗██║ ██╗██║ ██║ ",
" ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ",
]
for line in logo_art:
_typer(f"{_('w', line)}", delay=0.0015)
# ── Tagline badge ──
_typer(f" {_('d', '┌' + '─'*50 + '┐')}", 0.003)
inner = f" {_('rb', 'HACKIT')} {_('d', 'v2.1.0 •')} {_('wb', 'PENTEST FRAMEWORK')}"
pad = 50 - sum(len(s) for s in [' HACKIT', ' ', 'v2.1.0 •', ' ', 'PENTEST FRAMEWORK', ' '])
_typer(f" {_('d', '│')}{inner}{' ' * pad}{_('d', ' │')}", 0.003)
_typer(f" {_('d', '└' + '─'*50 + '┘')}", 0.003)
_typer("")
# ── Animated hex-loader ──
hex_frames = ['◐', '◓', '◑', '◒']
for i in range(20):
frame = hex_frames[i % 4]
blk = i % 8
col = ['r', 'y', 'g', 'c', 'b', 'm'][blk % 6]
sys.stdout.write(f"\r {_('d', '⟫ ')}{_(col, frame)}{_('d', ' ⟪')} {_(col, 'INITIALIZING')}{_('d', '.' * (i % 4 + 1))}{' ' * (3 - i % 4)}")
sys.stdout.flush()
time.sleep(0.06 + (0.04 if i > 12 else 0))
sys.stdout.write(f"\r {_('g', '✓')} {_('d', 'Engine live')} \n")
sys.stdout.flush()
# ── Module loader ──
module_groups = [
("RECON", 'c', ["OSINT", "Port Scanner", "Subdomain", "Tech Hunter", "Network Scan"]),
("WEB", 'g', ["Web Fuzzer", "Dir Finder", "JS Hunter", "Header Audit", "403 Bypass"]),
("INJECTION", 'r', ["SQLi Engine", "XSS Engine", "RCE Exploit", "Open Redirect"]),
("VULN", 'm', ["CVE Scanner", "Atomix Engine", "NSE Scripts", "SSL Analyzer"]),
("WIRELESS", 'y', ["Deauth Attack", "Beacon Flood", "Evil Twin", "WPA Cracker", "Packet Inject"]),
("ATTACK", 'rb', ["DDoS Suite", "ARP Spoof", "Anonymity Engine"]),
("AI", 'bb', ["AI Agent", "Swarm Scanner", "Autopilot Hunter"]),
("TOOLS", 'wb', ["Web UI", "Config Manager", "Console Shell"]),
]
all_modules = []
for cat_name, cat_color, mods in module_groups:
for m in mods:
all_modules.append((m, cat_name, cat_color))
total = len(all_modules)
for i, (name, cat, color) in enumerate(all_modules):
bar = _progress_bar(i + 1, total, color=color)
print(f" {_(color, '◆')} {_('w', f'{name:20s}')} {_('d', f'{cat:>10s}')} {bar}", end='')
time.sleep(0.045)
sys.stdout.write('\n')
sys.stdout.flush()
_pulse('g', f'✓ {total} modules — all systems nominal', cycles=2)
time.sleep(0.15)
# ── System info panel ──
_typer("")
W = 42
_typer(f" {_('d', '┌' + '─'*W + '┐')}", 0.003)
rows = [
('OS', f'{platform.system()} {platform.release()}'),
('HOST', platform.node()),
('PYTHON', platform.python_version()),
('ARCH', platform.machine()),
('MODS', str(total)),
]
for label, val in rows:
inner = f" {_('w', label)} {_('c', val)}"
pad = W - sum(len(s) for s in [' ', label, ' ', val, ' '])
_typer(f" {_('d', '│')}{inner}{' ' * pad}{_('d', ' │')}", 0.003)
_typer(f" {_('d', '└' + '─'*W + '┘')}", 0.003)
time.sleep(0.25)
# ── Welcome message ──
_typer("")
_typer(f" {_('rb', '▶')} {_('wb', 'Welcome back')} {_('d', '—')} {_('gb', platform.node())} {_('d', 'is online')}", 0.035)
_typer(f" {_('rb', '▶')} {_('d', 'Type')} {_('yb', ' help ')} {_('d', 'for command list')} {_('d', '•')} {_('yb', f'{total}')} {_('d', 'modules ready')}", 0.02)
time.sleep(0.5)
os.system('clear' if os.name == 'posix' else 'cls')
def cli_entry():
no_banner = os.environ.get('HACKIT_NO_BANNER')
if no_banner:
from hackit.cli import cli
cli()
return
argv = [a for a in sys.argv[1:] if a not in ('--no-banner',)]
if len(argv) < len(sys.argv[1:]):
os.environ['HACKIT_NO_BANNER'] = '1'
from hackit.cli import cli
cli()
return
if len(sys.argv) <= 1:
welcome_animation()
from hackit.cli import cli
cli()
if __name__ == '__main__':
cli_entry()