jee122 commited on
Commit
d6ee61b
·
verified ·
1 Parent(s): 3f45c75

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +215 -157
app.py CHANGED
@@ -1,11 +1,11 @@
1
  import os
2
- from flask import Flask, render_template_string, request, session, redirect, url_for, send_file
3
  import subprocess
 
4
 
5
  app = Flask(__name__)
6
- app.secret_key = os.urandom(24)
7
 
8
- # --- CONFIGURATION & ACCESS CONTROL ---
9
  OWNER_NAME = "WhyLaugh404"
10
  PASSWORDS = {
11
  "owner": "izie19281933",
@@ -13,228 +13,286 @@ PASSWORDS = {
13
  "member": "jst404member"
14
  }
15
 
16
- # --- STYLING (HACKER ELEGANT UI) ---
 
 
 
 
 
 
 
17
  CSS = """
18
  :root {
19
- --bg-color: #0a0a0a;
20
- --accent-color: #00ff41;
21
- --text-color: #d1d1d1;
22
- --card-bg: #141414;
23
- --border-color: #333;
 
 
24
  }
 
25
  body {
26
- background-color: var(--bg-color);
27
- color: var(--text-color);
28
- font-family: 'JetBrains Mono', 'Fira Code', monospace;
29
  margin: 0;
30
- display: flex;
31
- flex-direction: column;
32
- align-items: center;
33
  }
 
34
  .header {
35
- width: 100%;
36
- padding: 20px;
37
- border-bottom: 1px solid var(--border-color);
38
  text-align: center;
39
- background: rgba(0,0,0,0.8);
40
  }
41
- .logo {
42
- width: 80px;
43
- filter: brightness(0) invert(1);
44
- margin-bottom: 10px;
 
 
 
 
45
  }
 
46
  .container {
47
- max-width: 900px;
48
- width: 90%;
49
- margin-top: 30px;
50
  }
51
- .tool-section {
52
- background: var(--card-bg);
53
- border: 1px solid var(--border-color);
54
- padding: 20px;
55
- margin-bottom: 20px;
56
- border-radius: 4px;
57
  }
58
- .tool-section h3 {
59
- color: var(--accent-color);
60
- border-bottom: 1px solid var(--border-color);
61
- padding-bottom: 10px;
 
 
 
 
 
62
  margin-top: 0;
 
 
 
 
 
 
63
  }
64
- input, button {
 
 
 
 
 
65
  background: #000;
66
- border: 1px solid var(--border-color);
67
- color: var(--accent-color);
68
- padding: 10px;
69
- margin: 5px 0;
70
  width: 100%;
 
 
 
71
  }
72
- button:hover {
73
- background: var(--accent-color);
74
- color: #000;
 
 
 
 
 
 
 
 
75
  cursor: pointer;
 
 
 
76
  }
77
- .footer {
78
- margin-top: auto;
79
- padding: 20px;
80
- font-size: 0.8em;
81
- color: #666;
82
  }
83
- .result-box {
 
 
 
 
 
 
 
84
  background: #000;
85
- border: 1px solid var(--accent-color);
86
- padding: 15px;
 
 
 
87
  white-space: pre-wrap;
88
- font-size: 0.9em;
89
- max-height: 400px;
90
  overflow-y: auto;
91
  }
 
 
 
 
 
 
 
 
92
  """
93
 
94
- HTML_LOGIN = """
95
- <!DOCTYPE html>
96
- <html>
97
- <head>
98
- <title>Access Point | {{ owner }}</title>
99
- <style>{{ css }}</style>
100
- </head>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  <body>
102
  <div class="header">
103
- <img src="https://upload.wikimedia.org/wikipedia/commons/a/a6/Anonymous_emblem.svg" class="logo">
104
- <h2>System Authentication</h2>
105
  </div>
106
  <div class="container" style="max-width: 400px;">
107
- <form method="post">
108
- <input type="password" name="auth_pass" placeholder="Enter Credentials" required>
109
- <button type="submit">Decrypt Access</button>
110
- </form>
111
  </div>
112
- <div class="footer">Owner: {{ owner }} | 2026 Node Intelligence</div>
113
- </body>
114
- </html>
115
  """
116
 
117
- HTML_DASHBOARD = """
118
- <!DOCTYPE html>
119
- <html>
120
- <head>
121
- <title>Dashboard | {{ owner }}</title>
122
- <style>{{ css }}</style>
123
- </head>
124
  <body>
125
  <div class="header">
126
- <h2>CENTRAL INTELLIGENCE SYSTEM</h2>
127
- <p style="font-size: 0.8em; color: #666;">Authenticated as: {{ role.upper() }} | Operator: {{ owner }}</p>
 
128
  </div>
129
-
130
  <div class="container">
131
- <div class="tool-section">
132
- <h3>[01] Identity & Username OSINT</h3>
133
- <form action="/scan/sherlock" method="post">
134
- <input type="text" name="target" placeholder="Input Username" required>
135
- <button type="submit">Execute Sherlock Scan</button>
136
- </form>
137
- <form action="/scan/maigret" method="post" style="margin-top:10px;">
138
- <input type="text" name="target" placeholder="Input Username" required>
139
- <button type="submit">Execute Maigret Depth Scan</button>
140
- </form>
141
- </div>
142
-
143
- <div class="tool-section">
144
- <h3>[02] Communication & Mail OSINT</h3>
145
- <form action="/scan/holehe" method="post">
146
- <input type="email" name="target" placeholder="Input Target Email" required>
147
- <button type="submit">Execute Holehe Protocol</button>
148
- </form>
149
- <form action="/scan/phone" method="post" style="margin-top:10px;">
150
- <input type="text" name="target" placeholder="Input Phone Number (ex: +62...)" required>
151
- <button type="submit">Execute PhoneInfoga Scan</button>
152
- </form>
153
  </div>
154
-
155
- <div class="tool-section">
156
- <h3>[03] Platform Specific Recon</h3>
157
- <form action="/scan/ghunt" method="post">
158
- <input type="text" name="target" placeholder="Input Gmail Address" required>
159
- <button type="submit">Execute GHunt Recon</button>
160
- </form>
161
- </div>
162
-
163
- <a href="/logout" style="color: red; text-decoration: none; font-size: 0.8em;">[ TERMINATE SESSION ]</a>
164
  </div>
165
- <div class="footer">Proprietary System of {{ owner }}</div>
166
- </body>
167
- </html>
168
- """
169
 
170
- # --- ROUTES ---
171
 
172
  @app.route('/', methods=['GET', 'POST'])
173
- def index():
174
  if request.method == 'POST':
175
- password = request.form.get('auth_pass')
176
- if password == PASSWORDS['owner']:
177
- session['role'] = 'owner'
178
- elif password == PASSWORDS['admin']:
179
- session['role'] = 'admin'
180
- elif password == PASSWORDS['member']:
181
- session['role'] = 'member'
182
- else:
183
- return "ACCESS DENIED"
184
- return redirect(url_for('index'))
185
 
186
  if 'role' in session:
187
- return render_template_string(HTML_DASHBOARD, css=CSS, owner=OWNER_NAME, role=session['role'])
188
- return render_template_string(HTML_LOGIN, css=CSS, owner=OWNER_NAME)
 
 
189
 
190
- @app.route('/scan/<tool>', methods=['POST'])
191
- def run_scan(tool):
192
- if 'role' not in session: return redirect(url_for('index'))
 
 
193
  target = request.form.get('target')
194
 
195
- # Mapping command berdasarkan tool
196
- commands = {
197
  "sherlock": f"sherlock {target} --timeout 5",
198
- "holehe": f"holehe {target}",
199
  "maigret": f"maigret {target} --timeout 10",
200
- "phone": f"phoneinfoga scan -n {target}",
201
- "ghunt": f"ghunt email {target}"
 
 
 
 
 
 
 
202
  }
203
-
204
- cmd = commands.get(tool)
205
- if not cmd: return "Tool not found."
206
 
207
  try:
 
208
  process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
209
  stdout, stderr = process.communicate()
210
- result = stdout if stdout else stderr
211
 
212
- # Simpan hasil ke file untuk didownload
213
- report_path = f"report_{tool}_{target}.txt"
214
- with open(report_path, "w") as f:
215
- f.write(f"SYSTEM REPORT - OWNER: {OWNER_NAME}\nTARGET: {target}\nTOOL: {tool}\n" + "="*30 + "\n" + result)
216
-
217
  return f"""
218
  <style>{CSS}</style>
219
  <div class="container">
220
- <h3>Scan Result: {tool.upper()}</h3>
221
- <div class="result-box">{result}</div>
222
  <br>
223
- <a href="/download/{report_path}"><button>Download Official Report</button></a>
224
- <a href="/"><button style="background: #333; color: #fff;">Back to Console</button></a>
 
 
225
  </div>
226
  """
227
  except Exception as e:
228
- return f"System Error: {str(e)}"
229
 
230
- @app.route('/download/<filename>')
231
- def download(filename):
232
  return send_file(filename, as_attachment=True)
233
 
234
- @app.route('/logout')
235
- def logout():
236
  session.clear()
237
- return redirect(url_for('index'))
238
 
239
  if __name__ == '__main__':
240
  port = int(os.environ.get("PORT", 7860))
 
1
  import os
 
2
  import subprocess
3
+ from flask import Flask, render_template_string, request, session, redirect, url_for, send_file
4
 
5
  app = Flask(__name__)
6
+ app.secret_key = os.urandom(32)
7
 
8
+ # --- IDENTITY & CREDENTIALS ---
9
  OWNER_NAME = "WhyLaugh404"
10
  PASSWORDS = {
11
  "owner": "izie19281933",
 
13
  "member": "jst404member"
14
  }
15
 
16
+ # --- ACCESS CONTROL (Member Solidarity Version) ---
17
+ ACCESS_LEVELS = {
18
+ "member": ["sherlock", "socialscan", "holehe", "theharvester", "exiftool"],
19
+ "admin": ["sherlock", "socialscan", "holehe", "theharvester", "exiftool", "maigret", "phoneinfoga", "recon-ng"],
20
+ "owner": ["sherlock", "socialscan", "holehe", "theharvester", "exiftool", "maigret", "phoneinfoga", "recon-ng", "ghunt", "cloud_enum", "twint"]
21
+ }
22
+
23
+ # --- STYLING: THE DARK NODE (MR. X DESIGN) ---
24
  CSS = """
25
  :root {
26
+ --bg: #050505;
27
+ --panel: #0d0d0d;
28
+ --accent: #3867d6; /* Steel Blue - More Professional */
29
+ --text: #ececec;
30
+ --muted: #666;
31
+ --border: #1f1f1f;
32
+ --success: #20bf6b;
33
  }
34
+
35
  body {
36
+ background-color: var(--bg);
37
+ color: var(--text);
38
+ font-family: 'Inter', 'JetBrains Mono', monospace;
39
  margin: 0;
40
+ padding: 0;
 
 
41
  }
42
+
43
  .header {
44
+ background: var(--panel);
45
+ border-bottom: 1px solid var(--border);
46
+ padding: 40px 20px;
47
  text-align: center;
 
48
  }
49
+
50
+ .mrx-logo {
51
+ width: 120px;
52
+ height: 120px;
53
+ margin-bottom: 15px;
54
+ border-radius: 50%;
55
+ border: 2px solid var(--accent);
56
+ box-shadow: 0 0 20px rgba(56, 103, 214, 0.3);
57
  }
58
+
59
  .container {
60
+ max-width: 1100px;
61
+ margin: 40px auto;
62
+ padding: 0 20px;
63
  }
64
+
65
+ .grid {
66
+ display: grid;
67
+ grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
68
+ gap: 25px;
 
69
  }
70
+
71
+ .card {
72
+ background: var(--panel);
73
+ border: 1px solid var(--border);
74
+ padding: 25px;
75
+ border-radius: 2px;
76
+ }
77
+
78
+ .card h3 {
79
  margin-top: 0;
80
+ font-size: 0.9em;
81
+ text-transform: uppercase;
82
+ letter-spacing: 2px;
83
+ color: var(--accent);
84
+ border-bottom: 1px solid var(--border);
85
+ padding-bottom: 10px;
86
  }
87
+
88
+ .input-group {
89
+ margin-bottom: 15px;
90
+ }
91
+
92
+ input {
93
  background: #000;
94
+ border: 1px solid var(--border);
95
+ color: #fff;
96
+ padding: 12px;
 
97
  width: 100%;
98
+ box-sizing: border-box;
99
+ outline: none;
100
+ font-family: monospace;
101
  }
102
+
103
+ input:focus {
104
+ border-color: var(--accent);
105
+ }
106
+
107
+ button {
108
+ background: transparent;
109
+ border: 1px solid var(--accent);
110
+ color: var(--accent);
111
+ padding: 10px 20px;
112
+ width: 100%;
113
  cursor: pointer;
114
+ font-weight: bold;
115
+ text-transform: uppercase;
116
+ transition: 0.3s;
117
  }
118
+
119
+ button:hover:not(:disabled) {
120
+ background: var(--accent);
121
+ color: #fff;
 
122
  }
123
+
124
+ button:disabled {
125
+ border-color: var(--muted);
126
+ color: var(--muted);
127
+ cursor: not-allowed;
128
+ }
129
+
130
+ .result-area {
131
  background: #000;
132
+ border-left: 3px solid var(--accent);
133
+ padding: 20px;
134
+ margin-top: 20px;
135
+ font-family: 'JetBrains Mono', monospace;
136
+ font-size: 0.85em;
137
  white-space: pre-wrap;
138
+ color: #ccc;
139
+ max-height: 500px;
140
  overflow-y: auto;
141
  }
142
+
143
+ .badge {
144
+ font-size: 0.7em;
145
+ padding: 3px 8px;
146
+ background: var(--accent);
147
+ color: #fff;
148
+ margin-left: 10px;
149
+ }
150
  """
151
 
152
+ # --- DATABASE TOOLS ---
153
+ TOOLS_MANIFEST = {
154
+ "Target Identification": [
155
+ {"id": "sherlock", "name": "Sherlock", "ph": "Target Username"},
156
+ {"id": "maigret", "name": "Maigret", "ph": "Target Username (Deep)"},
157
+ {"id": "socialscan", "name": "SocialScan", "ph": "Username / Email"}
158
+ ],
159
+ "Signals Intelligence": [
160
+ {"id": "holehe", "name": "Holehe Protocol", "ph": "Target Email"},
161
+ {"id": "phoneinfoga", "name": "PhoneInfoga", "ph": "Phone (+62...)"},
162
+ {"id": "twint", "name": "Twint Intel", "ph": "Twitter Username"}
163
+ ],
164
+ "Network & Metadata": [
165
+ {"id": "theharvester", "name": "theHarvester", "ph": "Target Domain"},
166
+ {"id": "exiftool", "name": "Exif Metadata", "ph": "File URL / Path"},
167
+ {"id": "recon-ng", "name": "Recon-ng", "ph": "Domain/Company"}
168
+ ],
169
+ "Classified (Owner Only)": [
170
+ {"id": "ghunt", "name": "GHunt Recon", "ph": "Target Gmail Address"},
171
+ {"id": "cloud_enum", "name": "Cloud Enumerator", "ph": "Keyword / S3 Bucket"}
172
+ ]
173
+ }
174
+
175
+ # --- TEMPLATES ---
176
+ T_LOGIN = """
177
+ <!DOCTYPE html><html><head><style>{{css}}</style></head>
178
  <body>
179
  <div class="header">
180
+ <img src="https://i.pinimg.com/originals/11/49/09/1149098730999053805f87b8d80f8076.jpg" class="mrx-logo">
181
+ <h2 style="letter-spacing:5px;">SYSTEM AUTH</h2>
182
  </div>
183
  <div class="container" style="max-width: 400px;">
184
+ <form method="post"><input type="password" name="p" placeholder="CREDENTIALS" required><button type="submit" style="margin-top:20px;">ACCESS NODE</button></form>
 
 
 
185
  </div>
186
+ <div style="text-align:center; color:var(--muted); font-size:0.8em; margin-top:50px;">PROPRIETARY OF {{owner}}</div>
187
+ </body></html>
 
188
  """
189
 
190
+ T_DASHBOARD = """
191
+ <!DOCTYPE html><html><head><style>{{css}}</style></head>
 
 
 
 
 
192
  <body>
193
  <div class="header">
194
+ <div style="font-size:0.7em; color:var(--accent);">CONNECTED TO PRIVATE NODE: 127.0.0.1</div>
195
+ <h2 style="margin:10px 0; letter-spacing:3px;">CENTRAL CONSOLE</h2>
196
+ <div style="font-size:0.8em; color:var(--muted);">OPERATOR: {{owner}} | STATUS: <span style="color:var(--success)">ENCRYPTED</span> | ROLE: {{role}}</div>
197
  </div>
 
198
  <div class="container">
199
+ <div class="grid">
200
+ {% for cat, tools in manifest.items() %}
201
+ <div class="card">
202
+ <h3>{{cat}}</h3>
203
+ {% for t in tools %}
204
+ <div class="input-group">
205
+ {% if t.id in allowed %}
206
+ <form action="/run/{{t.id}}" method="post">
207
+ <input type="text" name="target" placeholder="{{t.ph}}" required>
208
+ <button type="submit">EXE_{{t.id.upper()}}</button>
209
+ </form>
210
+ {% else %}
211
+ <button disabled>LOCKED_{{role.upper()}}</button>
212
+ {% endif %}
213
+ </div>
214
+ {% endfor %}
215
+ </div>
216
+ {% endfor %}
 
 
 
 
217
  </div>
218
+ <div style="text-align:center; margin-top:40px;"><a href="/exit" style="color:var(--muted); text-decoration:none; font-size:0.8em;">[ TERMINATE_SESSION ]</a></div>
 
 
 
 
 
 
 
 
 
219
  </div>
220
+ </body></html>
 
 
 
221
 
222
+ # --- SERVER LOGIC ---
223
 
224
  @app.route('/', methods=['GET', 'POST'])
225
+ def entry():
226
  if request.method == 'POST':
227
+ p = request.form.get('p')
228
+ for role, val in PASSWORDS.items():
229
+ if p == val:
230
+ session['role'] = role
231
+ return redirect(url_for('entry'))
232
+ return "INVALID ACCESS"
 
 
 
 
233
 
234
  if 'role' in session:
235
+ return render_template_string(T_DASHBOARD, css=CSS, owner=OWNER_NAME,
236
+ role=session['role'], manifest=TOOLS_MANIFEST,
237
+ allowed=ACCESS_LEVELS[session['role']])
238
+ return render_template_string(T_LOGIN, css=CSS, owner=OWNER_NAME)
239
 
240
+ @app.route('/run/<tool_id>', methods=['POST'])
241
+ def execute(tool_id):
242
+ if 'role' not in session or tool_id not in ACCESS_LEVELS[session['role']]:
243
+ return "UNAUTHORIZED"
244
+
245
  target = request.form.get('target')
246
 
247
+ # Tool Command Mapping
248
+ cmds = {
249
  "sherlock": f"sherlock {target} --timeout 5",
 
250
  "maigret": f"maigret {target} --timeout 10",
251
+ "socialscan": f"socialscan {target}",
252
+ "holehe": f"holehe {target}",
253
+ "phoneinfoga": f"phoneinfoga scan -n {target}",
254
+ "twint": f"twint -u {target}",
255
+ "theharvester": f"python3 /home/user/theHarvester/theHarvester.py -d {target} -l 100 -b google",
256
+ "exiftool": f"exiftool {target}",
257
+ "recon-ng": f"recon-ng -m {target}",
258
+ "ghunt": f"ghunt email {target}",
259
+ "cloud_enum": f"python3 /home/user/cloud_enum/cloud_enum.py -k {target}"
260
  }
 
 
 
261
 
262
  try:
263
+ cmd = cmds.get(tool_id)
264
  process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
265
  stdout, stderr = process.communicate()
266
+ output = stdout if stdout else stderr
267
 
268
+ # Auto-Report Generator
269
+ report_file = f"JST_REPORT_{tool_id.upper()}_{target}.txt"
270
+ with open(report_file, "w") as f:
271
+ f.write(f"SYSTEM REPORT | OPERATOR: {OWNER_NAME}\n" + "="*40 + f"\nTOOL: {tool_id}\nTARGET: {target}\n\n" + output)
272
+
273
  return f"""
274
  <style>{CSS}</style>
275
  <div class="container">
276
+ <h3 style="color:var(--accent)">>_ CONSOLE_OUTPUT: {tool_id.upper()}</h3>
277
+ <div class="result-area">{output}</div>
278
  <br>
279
+ <div style="display:flex; gap:10px;">
280
+ <a href="/dl/{report_file}" style="flex:1"><button>DOWNLOAD_REPORT</button></a>
281
+ <a href="/" style="flex:1"><button style="border-color:var(--muted); color:var(--muted);">BACK_TO_CONSOLE</button></a>
282
+ </div>
283
  </div>
284
  """
285
  except Exception as e:
286
+ return f"CRITICAL_FAILURE: {str(e)}"
287
 
288
+ @app.route('/dl/<filename>')
289
+ def dl(filename):
290
  return send_file(filename, as_attachment=True)
291
 
292
+ @app.route('/exit')
293
+ def exit_node():
294
  session.clear()
295
+ return redirect(url_for('entry'))
296
 
297
  if __name__ == '__main__':
298
  port = int(os.environ.get("PORT", 7860))