-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnullsight.py
More file actions
3106 lines (2859 loc) · 161 KB
/
Copy pathnullsight.py
File metadata and controls
3106 lines (2859 loc) · 161 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
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
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
╔══════════════════════════════════════════════════════════════════════════════════════════╗
║ ║
║ ███╗ ██╗██╗ ██╗██╗ ██╗ ███████╗██╗ ██████╗ ██╗ ██╗████████╗ ║
║ ████╗ ██║██║ ██║██║ ██║ ██╔════╝██║██╔════╝ ██║ ██║╚══██╔══╝ ║
║ ██╔██╗ ██║██║ ██║██║ ██║ ███████╗██║██║ ███╗███████║ ██║ ║
║ ██║╚██╗██║██║ ██║██║ ██║ ╚════██║██║██║ ██║██╔══██║ ██║ ║
║ ██║ ╚████║╚██████╔╝███████╗███████╗███████║██║╚██████╔╝██║ ██║ ██║ ║
║ ╚═╝ ╚═══╝ ╚═════╝ ╚══════╝╚══════╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ║
║ ║
║ NullSight v3.0 — WORLD-CLASS AUTHORIZED BULK PENETRATION TESTING SCANNER ║
║ Author: TheDEEP | www.thedeep.uz | 2026 ║
║ ║
║ MODULE 1 : HTTP Probe Scanner — 200+ CVE payloads, LFI/RFI chains, SSRF, ║
║ GraphQL, JWT, XXE, SSTI, deserialization, prototype pollution ║
║ MODULE 2 : System Service Scanner — Real auth verification: ║
║ FTP anonymous login, DB unauthenticated access, Redis/Mongo/MySQL/PG, ║
║ SMTP open relay, Docker RCE, Kubernetes, VNC, Jupyter, RabbitMQ ║
║ MODULE 3 : Misconfig Deep Scan — 100+ misconfig patterns across 20+ categories ║
║ ║
║ ENGINE : Async queue/worker model, zero-copy chunks, adaptive backpressure, ║
║ per-host rate limiting, DNS cache, connection reuse → MAX RPS ║
╚══════════════════════════════════════════════════════════════════════════════════════════╝
"""
# ─────────────────────────────────────────────────────────────────────────────
# IMPORTS
# ─────────────────────────────────────────────────────────────────────────────
import asyncio
import aiohttp
import socket
import json
import csv
import time
import random
import re
import sys
import math
import logging
import struct
import ftplib
import hashlib
import base64
from datetime import datetime
from dataclasses import dataclass, field, asdict
from pathlib import Path
from typing import Optional, Tuple
from urllib.parse import urljoin, urlparse, quote
from rich.console import Console
from rich.table import Table
from rich.panel import Panel
from rich.progress import (Progress, SpinnerColumn, BarColumn,
TextColumn, TimeElapsedColumn, MofNCompleteColumn)
from rich import box
logging.getLogger("asyncio").setLevel(logging.CRITICAL)
logging.getLogger("aiohttp").setLevel(logging.CRITICAL)
DISCLAIMER = """
[bold yellow]⚠ DISCLAIMER / OGOHLANTIRISH ⚠[/bold yellow]
Bu tool [bold red]FAQAT[/bold red] ruxsatnoma bilan penetration testing uchun.
• Faqat o'zingizga tegishli yoki yozma ruxsat olgan tizimlarda foydalaning.
• Ruxsatsiz foydalanish O'zbekiston va xalqaro qonunlarni buzadi.
• This tool performs real authentication attempts on discovered services.
[bold cyan]Davom etish uchun YES yozing:[/bold cyan]
"""
# ─────────────────────────────────────────────────────────────────────────────
# CONFIG
# ─────────────────────────────────────────────────────────────────────────────
@dataclass
class Config:
concurrency: int = 150
timeout: int = 15
connect_timeout: int = 6
read_timeout: int = 12
max_body_bytes: int = 131072 # 128KB
max_retries: int = 2
queue_maxsize: int = 10000
output_dir: str = "NullSight_findings"
url_file: str = "url.txt"
delay_min: float = 0.0
delay_max: float = 0.0 # zero delay by default for max RPS
sys_scan_timeout: int = 6
sys_scan_enabled: bool = True
sys_scan_concurrency: int = 300 # high concurrency for service scan
per_host_limit: int = 20 # max concurrent per host
dns_cache_ttl: int = 600
user_agents: list = field(default_factory=lambda: [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/125.0.0.0 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15",
"Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0",
"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
"Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)",
"curl/8.7.1",
"python-httpx/0.27.0",
"Go-http-client/1.1",
"Wget/1.21.4",
])
CONFIG = Config()
# ─────────────────────────────────────────────────────────────────────────────
# CONTENT-TYPE HELPERS
# ─────────────────────────────────────────────────────────────────────────────
JSON_CT = re.compile(r'application/json|text/json', re.I)
HTML_CT = re.compile(r'text/html|application/xhtml', re.I)
XML_CT = re.compile(r'text/xml|application/xml', re.I)
TEXT_CT = re.compile(r'^text/', re.I)
BIN_EXT = re.compile(
r'\.(zip|tar\.gz|tar|gz|sql|sqlite3|bak|swp|save|jar|war|hprof|db|dump|7z|rar)$', re.I)
def save_extension(path: str, ct: str, body: bytes) -> str:
if BIN_EXT.search(path): return ".bin"
if JSON_CT.search(ct): return ".json"
if HTML_CT.search(ct): return ".html"
if XML_CT.search(ct): return ".xml"
if TEXT_CT.search(ct): return ".txt"
stripped = body[:60].strip()
if stripped.startswith(b"{") or stripped.startswith(b"["): return ".json"
if stripped.startswith(b"<?xml") or stripped.startswith(b"<root"): return ".xml"
return ".txt"
# ─────────────────────────────────────────────────────────────────────────────
# ENTROPY
# ─────────────────────────────────────────────────────────────────────────────
def shannon_entropy(s: str) -> float:
if not s: return 0.0
freq: dict = {}
for c in s: freq[c] = freq.get(c, 0) + 1
length = len(s)
return -sum((v / length) * math.log2(v / length) for v in freq.values())
def has_high_entropy_secret(text: str, threshold: float = 4.2) -> bool:
for token in re.findall(r'[A-Za-z0-9+/=_\-]{20,}', text):
if shannon_entropy(token) >= threshold:
return True
return False
# ─────────────────────────────────────────────────────────────────────────────
# ══════════════════════════════════════════════════════════════════════════════
# SIGNATURES — CRITICAL + HIGH + MEDIUM (200+ signatures)
# required_path_pattern: response URL *path* must match (eliminates FP class)
# html_allowed: False = HTML response rejected immediately
# js_allowed: True = allow application/javascript responses
# ══════════════════════════════════════════════════════════════════════════════
# ─────────────────────────────────────────────────────────────────────────────
@dataclass
class Signature:
name: str
severity: str
pattern: re.Pattern
min_content_length: int = 20
description: str = ""
is_bytes: bool = False
cve: str = ""
tags: list = field(default_factory=list)
required_path_pattern: Optional[re.Pattern] = None
html_allowed: bool = False
js_allowed: bool = False
# Require additional pattern in same response (AND logic)
require_also: Optional[re.Pattern] = None
SIGNATURES: list[Signature] = [
# ══════════════════════════════════════════════════════════
# ENV / SECRET FILES
# ══════════════════════════════════════════════════════════
Signature(
name="Env file — credentials exposed",
severity="CRITICAL",
pattern=re.compile(
r'(?:APP_KEY|APP_SECRET|DB_PASSWORD|DB_PASS|DATABASE_PASSWORD|'
r'SECRET_KEY|SECRET|AWS_SECRET|AWS_SECRET_ACCESS_KEY|AWS_ACCESS_KEY_ID|'
r'API_KEY|API_SECRET|TOKEN|ACCESS_TOKEN|AUTH_TOKEN|JWT_SECRET|'
r'MAIL_PASSWORD|REDIS_PASSWORD|STRIPE_SECRET|STRIPE_KEY|'
r'TWILIO_AUTH_TOKEN|GITHUB_TOKEN|GOOGLE_API_KEY|PRIVATE_KEY|'
r'MYSQL_PASSWORD|MYSQL_ROOT_PASSWORD|POSTGRES_PASSWORD|MONGODB_URI|'
r'DATABASE_URL|PUSHER_APP_SECRET|ENCRYPTION_KEY|PASSWORD_SALT|'
r'OAUTH_SECRET|OAUTH_CLIENT_SECRET|FIREBASE_KEY|SENDGRID_API_KEY|'
r'PAYPAL_SECRET|BRAINTREE_PRIVATE_KEY|CLOUDINARY_API_SECRET|'
r'DIGITALOCEAN_TOKEN|HEROKU_API_KEY|VAULT_TOKEN|'
r'SONAR_TOKEN|JIRA_TOKEN|CONFLUENCE_TOKEN)\s*=\s*\S+',
re.I | re.M),
min_content_length=30,
description="Credential KEY=VALUE found in env/config file",
tags=["env", "secret"],
required_path_pattern=re.compile(
r'/\.env(?:\.|$|/)|/env$|/\.env~|'
r'/env\.(?:backup|local|prod|dev|staging|example|test|old|bak|save|2\d{3})$|'
r'/\.env\.\w+$|/config\.env$',
re.I),
html_allowed=False,
),
Signature(
name="Generic env block (multi-line KEY=VALUE)",
severity="HIGH",
pattern=re.compile(
r'^(?:[A-Za-z_][A-Za-z0-9_]{2,39}=.{2,300}\n){3,}',
re.M),
min_content_length=80,
description="Multiple KEY=VALUE lines — env/config file",
tags=["env"],
required_path_pattern=re.compile(
r'/\.env(?:\.|$|/)|/env$|/\.env~|/config\.env$',
re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# GIT
# ══════════════════════════════════════════════════════════
Signature(
name=".git/config exposed",
severity="CRITICAL",
pattern=re.compile(r'\[core\].*repositoryformatversion', re.S | re.I),
description="Git repository config — source code cloneable",
tags=["git", "source-code"],
required_path_pattern=re.compile(r'/\.git/', re.I),
html_allowed=False,
),
Signature(
name=".git/HEAD exposed",
severity="HIGH",
pattern=re.compile(r'^ref:\s+refs/heads/', re.M),
description="Git HEAD reference exposed",
tags=["git"],
required_path_pattern=re.compile(r'/\.git/', re.I),
html_allowed=False,
),
Signature(
name=".git/COMMIT_EDITMSG exposed",
severity="MEDIUM",
pattern=re.compile(r'^\w{7,}|^(feat|fix|chore|refactor|update|merge|add|remove):', re.M | re.I),
description="Git commit message leaked — repo structure exposed",
tags=["git"],
required_path_pattern=re.compile(r'/\.git/COMMIT_EDITMSG', re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# LINUX SYSTEM FILES
# ══════════════════════════════════════════════════════════
Signature(
name="/etc/passwd exposed",
severity="CRITICAL",
pattern=re.compile(r'root:x:0:0:|nobody:x:\d+:\d+:|www-data:x:\d+|daemon:x:\d+', re.M),
description="Linux passwd file — LFI confirmed",
tags=["lfi", "system"],
html_allowed=False,
),
Signature(
name="/etc/shadow exposed",
severity="CRITICAL",
pattern=re.compile(r'root:\$[0-9a-z$]\$|:\$y\$|:\$6\$|:\$2b\$|:\$1\$', re.M | re.I),
description="Linux shadow — password hashes exposed",
tags=["lfi", "system"],
html_allowed=False,
),
Signature(
name="proc/self/environ LFI",
severity="CRITICAL",
pattern=re.compile(r'PATH=(?:/[^:]+:)+|HOME=/(?:root|home|var|www)|SHELL=(?:/bin|/usr)', re.M),
min_content_length=40,
description="Process environment leaked — LFI confirmed",
tags=["lfi", "rce"],
html_allowed=False,
),
Signature(
name="proc/self/cmdline",
severity="HIGH",
pattern=re.compile(r'(?:python|php|node|java|ruby|nginx|apache|gunicorn|uwsgi)\x00', re.M),
description="Process cmdline exposed",
tags=["lfi"],
required_path_pattern=re.compile(r'proc/self/cmdline|proc/version|proc/self/maps', re.I),
html_allowed=False,
),
Signature(
name="/etc/hosts exposed",
severity="MEDIUM",
pattern=re.compile(r'127\.0\.0\.1\s+localhost|::1\s+localhost', re.M),
description="/etc/hosts file — internal network topology",
tags=["lfi", "system"],
html_allowed=False,
),
Signature(
name="/etc/crontab or cron job exposed",
severity="HIGH",
pattern=re.compile(r'SHELL=/bin/(?:bash|sh)|^\*/\d+\s+\*\s+\*\s+\*\s+\*\s+\w+', re.M),
description="Cron configuration exposed",
tags=["lfi", "system"],
html_allowed=False,
),
Signature(
name="Apache/Nginx config exposed",
severity="HIGH",
pattern=re.compile(
r'ServerName\s+\S+|VirtualHost\s+\*:\d+|'
r'location\s+/\s*\{|server\s+\{|upstream\s+\w+\s*\{',
re.M | re.I),
description="Web server config file exposed",
tags=["lfi", "misconfig"],
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# SSH / KEYS
# ══════════════════════════════════════════════════════════
Signature(
name="SSH private key exposed",
severity="CRITICAL",
pattern=re.compile(r'-----BEGIN (?:RSA|EC|OPENSSH|DSA|PGP|ENCRYPTED) PRIVATE KEY-----'),
description="SSH/PGP private key material exposed",
tags=["ssh", "key"],
html_allowed=False,
),
Signature(
name="AWS credentials/key",
severity="CRITICAL",
pattern=re.compile(
r'(?:AKIA|ASIA|AROA|AIDA)[A-Z0-9]{16}|'
r'aws_secret_access_key\s*=\s*[A-Za-z0-9/+=]{40}',
re.I),
description="AWS access key or secret exposed",
tags=["cloud", "aws"],
html_allowed=False,
),
Signature(
name="GCP service account key",
severity="CRITICAL",
pattern=re.compile(r'"type"\s*:\s*"service_account".*?"private_key"', re.S | re.I),
description="Google Cloud service account JSON exposed",
tags=["cloud", "gcp"],
html_allowed=False,
),
Signature(
name="Azure service principal / connection string",
severity="CRITICAL",
pattern=re.compile(
r'DefaultEndpointsProtocol=https;AccountName=|'
r'"clientSecret"\s*:\s*"[^"]{20,}"|'
r'AZURE_CLIENT_SECRET\s*=\s*\S+',
re.I),
description="Azure credentials/connection string exposed",
tags=["cloud", "azure"],
html_allowed=False,
),
Signature(
name="Service API token (GitHub/Slack/OpenAI/Stripe)",
severity="HIGH",
pattern=re.compile(
r'(?:ghp_|gho_|ghs_|ghr_)[A-Za-z0-9]{36}|'
r'xox[bpars]-[0-9A-Za-z\-]{10,}|'
r'sk-[A-Za-z0-9]{40,}|'
r'sk-proj-[A-Za-z0-9\-_]{40,}|'
r'rk_live_[A-Za-z0-9]{24}|'
r'pk_live_[A-Za-z0-9]{24}'),
description="Service-specific API token exposed",
tags=["token"],
html_allowed=False,
),
Signature(
name="Database connection DSN with credentials",
severity="HIGH",
pattern=re.compile(
r'(?:mysql|postgres|postgresql|mongodb(?:\+srv)?|mssql|redis|'
r'amqp|jdbc:mysql|jdbc:postgresql|jdbc:sqlserver)://[^:\s@]+:[^@\s]{3,}@[^/\s]+',
re.I),
description="Database DSN with embedded credentials",
tags=["database", "secret"],
html_allowed=False,
),
Signature(
name=".aws/credentials exposed",
severity="CRITICAL",
pattern=re.compile(
r'\[default\]|aws_access_key_id\s*=|aws_secret_access_key\s*=', re.I),
description="AWS credentials file exposed",
tags=["cloud", "aws"],
required_path_pattern=re.compile(r'\.aws/credentials|aws_credentials', re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# PHP LFI WRAPPERS
# ══════════════════════════════════════════════════════════
Signature(
name="PHP LFI base64 leak (php://filter)",
severity="CRITICAL",
pattern=re.compile(r'^[A-Za-z0-9+/]{200,}={0,2}$', re.M),
min_content_length=200,
description="php://filter base64 — LFI confirmed, source readable",
tags=["lfi", "php"],
required_path_pattern=re.compile(r'php://|filter=|resource=', re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# LARAVEL
# ══════════════════════════════════════════════════════════
Signature(
name="Laravel APP_KEY exposed",
severity="CRITICAL",
pattern=re.compile(r'APP_KEY=base64:[A-Za-z0-9+/=]{40,}', re.M),
description="Laravel APP_KEY exposed — full decryption/RCE possible",
cve="CVE-2021-3129",
tags=["laravel", "secret"],
html_allowed=False,
),
Signature(
name="Laravel debug stack trace",
severity="CRITICAL",
pattern=re.compile(
r'Illuminate\\[A-Za-z\\]+Exception|laravel\.log|SymfonyDisplayer|'
r'"environment"\s*:\s*"(?:local|development)".*?"debug"\s*:\s*true',
re.I | re.S),
description="Laravel debug mode — stack traces exposed",
cve="CVE-2021-3129",
tags=["laravel", "debug"],
required_path_pattern=re.compile(
r'/telescope|/_debugbar|/log-viewer|/horizon|/laravel-filemanager', re.I),
html_allowed=True,
),
# ══════════════════════════════════════════════════════════
# YII2 — STRICT
# ══════════════════════════════════════════════════════════
Signature(
name="Yii2 debug panel exposed",
severity="CRITICAL",
pattern=re.compile(
r'yii\s+Debug\s+Toolbar|Yii2\s+Debug\s+Panel|'
r'"YII_DEBUG"\s*[:=]\s*true|yii\\base\\[A-Za-z]+Exception',
re.I),
description="Yii2 debug panel — application internals exposed",
tags=["yii", "debug"],
required_path_pattern=re.compile(
r'/debug/default/view|/index\.php\?r=debug|/_debug|/yii2-debug', re.I),
html_allowed=True,
),
# ══════════════════════════════════════════════════════════
# DJANGO
# ══════════════════════════════════════════════════════════
Signature(
name="Django DEBUG=True page",
severity="CRITICAL",
pattern=re.compile(
r"You're seeing this error because you have DEBUG = True|"
r'Django\s+Version:\s+\d|SECRET_KEY\s*=\s*[\'"][^\'"]{20,}[\'"]',
re.I),
description="Django DEBUG mode — settings exposed",
tags=["django", "debug"],
html_allowed=True,
),
# ══════════════════════════════════════════════════════════
# SPRING BOOT ACTUATOR
# ══════════════════════════════════════════════════════════
Signature(
name="Spring Boot actuator /env exposed",
severity="CRITICAL",
pattern=re.compile(
r'"activeProfiles"|"propertySources".*?"source"|'
r'"spring\.datasource\.password"|"spring\.mail\.password"|'
r'"spring\.security\.user\.password"',
re.I | re.S),
description="Spring Boot /actuator/env — credentials in properties",
cve="CVE-2022-22965",
tags=["spring", "actuator"],
required_path_pattern=re.compile(r'/actuator/', re.I),
html_allowed=False,
),
Signature(
name="Spring Boot actuator beans/mappings",
severity="HIGH",
pattern=re.compile(r'"beans":\[|"mappings":\{|"dispatcherServlets"', re.I),
description="Spring Boot actuator endpoint exposed",
tags=["spring", "actuator"],
required_path_pattern=re.compile(r'/actuator/', re.I),
html_allowed=False,
),
Signature(
name="Spring Boot heap dump",
severity="CRITICAL",
pattern=re.compile(rb'JAVA PROFILE \d\.\d|HPROF|java\.lang\.Object', re.I),
min_content_length=50,
description="Spring Boot heap dump — memory contents exposed",
is_bytes=True,
tags=["spring", "java"],
required_path_pattern=re.compile(r'/actuator/heapdump', re.I),
),
Signature(
name="Spring Boot RCE (CVE-2022-22965 Log4Shell chain)",
severity="CRITICAL",
pattern=re.compile(r'uid=\d+\(|/etc/passwd|java\.lang\.Runtime', re.I),
description="Spring Boot RCE via Spring4Shell — command execution confirmed",
cve="CVE-2022-22965",
tags=["spring", "rce"],
html_allowed=True,
),
# ══════════════════════════════════════════════════════════
# JENKINS / CI-CD
# ══════════════════════════════════════════════════════════
Signature(
name="Jenkins credentials.xml exposed",
severity="CRITICAL",
pattern=re.compile(r'<com\.cloudbees\.plugins\.credentials|<hudson\.util\.Secret>', re.I),
description="Jenkins credentials.xml — credentials readable",
tags=["jenkins", "cicd"],
required_path_pattern=re.compile(r'credentials\.xml|/jenkins/', re.I),
html_allowed=False,
),
Signature(
name="Jenkins /script console exposed",
severity="CRITICAL",
pattern=re.compile(r'Groovy Script|<form.*?/script.*?execute|Script Console', re.I | re.S),
description="Jenkins script console — direct Groovy RCE",
tags=["jenkins", "rce"],
required_path_pattern=re.compile(r'/script$|/scriptText', re.I),
html_allowed=True,
),
Signature(
name="TeamCity REST API exposed",
severity="HIGH",
pattern=re.compile(r'"buildTypeId"|"projectId"|"agentId"', re.I),
description="JetBrains TeamCity REST API exposed",
cve="CVE-2024-27198",
tags=["teamcity", "cicd"],
required_path_pattern=re.compile(r'/app/rest/', re.I),
html_allowed=False,
),
Signature(
name="GitLab CI variable exposed",
severity="CRITICAL",
pattern=re.compile(
r'CI_JOB_TOKEN|CI_REGISTRY_PASSWORD|GITLAB_TOKEN|'
r'"variable_type"\s*:\s*"env_var"', re.I),
description="GitLab CI environment variable exposed",
tags=["gitlab", "cicd", "secret"],
html_allowed=False,
),
Signature(
name="GitHub Actions workflow secret ref",
severity="HIGH",
pattern=re.compile(r'\$\{\{\s*secrets\.\w+\s*\}\}|\$\{\{\s*github\.token\s*\}\}', re.I),
description="GitHub Actions secrets reference in workflow output",
tags=["github", "cicd", "secret"],
html_allowed=False,
),
Signature(
name="CircleCI config exposed",
severity="HIGH",
pattern=re.compile(r'version:\s*[23]\njobs:|orbs:|executors:', re.M | re.I),
description="CircleCI pipeline config — potential secret leak",
tags=["circleci", "cicd"],
required_path_pattern=re.compile(r'\.circleci|config\.yml', re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# SSRF CLOUD METADATA
# ══════════════════════════════════════════════════════════
Signature(
name="AWS metadata SSRF confirmed",
severity="CRITICAL",
pattern=re.compile(
r'"Code"\s*:\s*"Success".*?"AccessKeyId"|'
r'ami-[a-f0-9]{8,17}|'
r'"instanceId"\s*:\s*"i-[a-f0-9]{8,17}"',
re.I | re.S),
description="AWS IMDSv1 metadata — SSRF confirmed",
tags=["ssrf", "cloud", "aws"],
html_allowed=False,
),
Signature(
name="GCP metadata SSRF confirmed",
severity="CRITICAL",
pattern=re.compile(
r'"computeMetadata".*?"serviceAccounts"|metadata\.google\.internal',
re.I | re.S),
description="GCP metadata server — SSRF confirmed",
tags=["ssrf", "cloud", "gcp"],
html_allowed=False,
),
Signature(
name="Azure metadata SSRF confirmed",
severity="CRITICAL",
pattern=re.compile(r'"subscriptionId".*?"resourceGroupName"', re.I | re.S),
description="Azure IMDS — SSRF confirmed",
tags=["ssrf", "cloud", "azure"],
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# GRAPHQL
# ══════════════════════════════════════════════════════════
Signature(
name="GraphQL introspection enabled",
severity="HIGH",
pattern=re.compile(r'"__schema"\s*:\s*\{.*?"types"', re.S | re.I),
description="GraphQL introspection — full schema dump possible",
tags=["graphql"],
required_path_pattern=re.compile(r'/graphql|/graphiql|/playground|/api/graphql', re.I),
html_allowed=False,
),
Signature(
name="GraphQL mutations exposed without auth",
severity="HIGH",
pattern=re.compile(r'"mutationType"\s*:\s*\{|"Mutation"\s*:\s*\{', re.I | re.S),
description="GraphQL mutation operations exposed — data modification possible",
tags=["graphql", "auth"],
required_path_pattern=re.compile(r'/graphql|/api/graphql', re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# JWT
# ══════════════════════════════════════════════════════════
Signature(
name="JWT alg:none accepted",
severity="CRITICAL",
pattern=re.compile(r'"alg"\s*:\s*"none"', re.I),
description="JWT alg:none accepted — authentication bypass",
tags=["jwt", "auth"],
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# XXE / XML INJECTION
# ══════════════════════════════════════════════════════════
Signature(
name="XXE file read confirmed",
severity="CRITICAL",
pattern=re.compile(
r'root:x:0:0:|'
r'\[general entities\]|'
r'<!ENTITY\s+\w+\s+SYSTEM|'
r'file:///etc/passwd',
re.I),
description="XXE injection — file read or SSRF confirmed",
tags=["xxe", "lfi"],
html_allowed=True,
),
# ══════════════════════════════════════════════════════════
# SSTI (Server-Side Template Injection)
# ══════════════════════════════════════════════════════════
Signature(
name="SSTI confirmed — math expression evaluated",
severity="CRITICAL",
pattern=re.compile(r'(?<!\d)7777777(?!\d)|(?<!\d)49(?!\d)\s*(?:$|\n)|result.*?49', re.M | re.I),
description="SSTI math probe evaluated — template injection confirmed",
tags=["ssti", "rce"],
html_allowed=True,
),
Signature(
name="SSTI Jinja2/Twig RCE",
severity="CRITICAL",
pattern=re.compile(r'uid=\d+\(|/etc/passwd|subprocess|os\.system', re.I),
description="SSTI RCE payload executed — Jinja2/Twig confirmed",
tags=["ssti", "rce"],
html_allowed=True,
),
# ══════════════════════════════════════════════════════════
# WORDPRESS
# ══════════════════════════════════════════════════════════
Signature(
name="WordPress wp-config.php source",
severity="CRITICAL",
pattern=re.compile(
r"define\s*\(\s*'DB_PASSWORD'\s*,\s*'[^']+'\s*\)|"
r"define\s*\(\s*'AUTH_KEY'\s*,\s*'[^']+'\s*\)",
re.I),
description="WordPress wp-config.php source exposed",
tags=["wordpress", "secret"],
required_path_pattern=re.compile(r'wp-config', re.I),
html_allowed=False,
),
Signature(
name="WordPress user enumeration via REST",
severity="MEDIUM",
pattern=re.compile(r'"id":\d+,"name":"[^"]+","slug":"[^"]+","link":"[^"]+"', re.I),
description="WordPress user list via /wp-json/wp/v2/users",
tags=["wordpress", "enum"],
required_path_pattern=re.compile(r'/wp-json/wp/v2/users', re.I),
html_allowed=False,
),
Signature(
name="WordPress xmlrpc enabled",
severity="MEDIUM",
pattern=re.compile(r'<methodResponse>|<?xml.*?xmlrpc', re.I | re.S),
description="WordPress XML-RPC enabled — brute force/SSRF vector",
tags=["wordpress", "xmlrpc"],
required_path_pattern=re.compile(r'xmlrpc\.php', re.I),
html_allowed=True,
),
# ══════════════════════════════════════════════════════════
# CONTAINER / K8s
# ══════════════════════════════════════════════════════════
Signature(
name="Docker/K8s secrets file",
severity="CRITICAL",
pattern=re.compile(
r'POSTGRES_PASSWORD:|MYSQL_ROOT_PASSWORD:|MONGO_INITDB_ROOT_PASSWORD:|'
r'kind:\s*Secret\b|RABBITMQ_DEFAULT_PASS:',
re.I),
description="Container/Kubernetes secrets exposed",
tags=["docker", "k8s", "secret"],
required_path_pattern=re.compile(
r'docker-compose|kubernetes|k8s/secrets|\.dockerenv', re.I),
html_allowed=False,
),
Signature(
name="Kubernetes API namespaces exposed",
severity="CRITICAL",
pattern=re.compile(r'"apiVersion"\s*:\s*"v1".*?"kind"\s*:\s*"NamespaceList"', re.I | re.S),
description="Kubernetes API — cluster namespace list accessible",
tags=["k8s", "auth"],
html_allowed=False,
),
Signature(
name="Docker daemon API exposed",
severity="CRITICAL",
pattern=re.compile(r'"ApiVersion"\s*:|"MinAPIVersion"\s*:|"DockerRootDir"', re.I),
description="Docker daemon API — container/host full control",
tags=["docker", "rce"],
required_path_pattern=re.compile(r'/version$|/containers/json|/images/json', re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# ELASTICSEARCH / KIBANA
# ══════════════════════════════════════════════════════════
Signature(
name="Elasticsearch cluster exposed",
severity="HIGH",
pattern=re.compile(r'"cluster_name"\s*:|"number_of_nodes"\s*:\s*\d', re.I),
description="Elasticsearch cluster info — unauthenticated",
tags=["elasticsearch"],
required_path_pattern=re.compile(r'/_cat/|/_cluster/|/_nodes|/_all|/_search', re.I),
html_allowed=False,
),
Signature(
name="Elasticsearch index data exposed",
severity="CRITICAL",
pattern=re.compile(r'"_index"\s*:.*?"_source"\s*:\s*\{', re.I | re.S),
description="Elasticsearch — actual document data accessible",
tags=["elasticsearch", "data"],
html_allowed=False,
),
Signature(
name="Kibana dashboard exposed",
severity="HIGH",
pattern=re.compile(r'"kibana":"[^"]+"|"version"\s*:.*?"number"\s*:.*?"buildFlavor"', re.I | re.S),
description="Kibana dashboard — unauthenticated access",
tags=["kibana", "elasticsearch"],
required_path_pattern=re.compile(r'/api/status|/app/kibana', re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# NGINX STATUS
# ══════════════════════════════════════════════════════════
Signature(
name="Nginx stub_status exposed",
severity="HIGH",
pattern=re.compile(r'Active connections:\s+\d+|server accepts handled requests', re.I),
description="Nginx stub_status — server stats exposed",
tags=["nginx"],
required_path_pattern=re.compile(r'/nginx_status|/status$', re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# phpinfo
# ══════════════════════════════════════════════════════════
Signature(
name="phpinfo() exposed",
severity="HIGH",
pattern=re.compile(
r'PHP Version\s*(?:</td>|</b>|\s)\s*\d\.\d|<td class="e">disable_functions', re.I),
description="phpinfo() — full server config exposed",
tags=["php"],
required_path_pattern=re.compile(r'phpinfo\.php|info\.php', re.I),
html_allowed=True,
),
# ══════════════════════════════════════════════════════════
# VITE @fs bypass
# ══════════════════════════════════════════════════════════
Signature(
name="Vite @fs path traversal (CVE-2024-23331 / CVE-2025-30208)",
severity="CRITICAL",
pattern=re.compile(
r'root:x:0:0:|APP_KEY=|APP_SECRET=|DB_PASSWORD=|'
r'-----BEGIN (?:RSA|OPENSSH) PRIVATE KEY-----|PATH=(?:/[^:]+:)+',
re.I | re.M),
description="Vite @fs bypass — arbitrary file read confirmed",
cve="CVE-2024-23331",
tags=["vite", "lfi"],
required_path_pattern=re.compile(r'/@fs/', re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# APACHE PATH TRAVERSAL
# ══════════════════════════════════════════════════════════
Signature(
name="Apache path traversal RCE (CVE-2021-41773/42013)",
severity="CRITICAL",
pattern=re.compile(r'root:x:0:0:|uid=\d+\(\w+\)', re.I),
description="Apache CVE-2021-41773 — path traversal/RCE confirmed",
cve="CVE-2021-41773",
tags=["apache", "lfi", "rce"],
required_path_pattern=re.compile(r'\.%2e|%2e%2e|%%32%65', re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# RCE COMMAND OUTPUT
# ══════════════════════════════════════════════════════════
Signature(
name="RCE — command output confirmed",
severity="CRITICAL",
pattern=re.compile(
r'uid=0\(root\)|uid=\d+\(\w+\)\s+gid=\d+|'
r'Linux\s+\S+\s+\d+\.\d+\.\d+.*?#\d+\s+SMP',
re.I),
description="Remote Code Execution — command output in response",
tags=["rce"],
html_allowed=True,
),
# ══════════════════════════════════════════════════════════
# LOG4SHELL
# ══════════════════════════════════════════════════════════
Signature(
name="Log4Shell callback / OOB (CVE-2021-44228)",
severity="CRITICAL",
pattern=re.compile(r'uid=\d+|/etc/passwd|java\.lang\.Runtime|jndi:', re.I),
description="Log4j JNDI injection — potential OOB callback or code execution",
cve="CVE-2021-44228",
tags=["log4j", "rce"],
html_allowed=True,
),
# ══════════════════════════════════════════════════════════
# DESERIALIZATION
# ══════════════════════════════════════════════════════════
Signature(
name="Java deserialization RCE",
severity="CRITICAL",
pattern=re.compile(rb'\xac\xed\x00\x05|rO0ABQ|java\.lang\.Runtime'),
is_bytes=True,
description="Java serialized object in response — deserialization attack vector",
tags=["deserialization", "java", "rce"],
),
Signature(
name="PHP deserialization object",
severity="HIGH",
pattern=re.compile(r'O:\d+:"[A-Za-z\\]+":'),
description="PHP serialized object exposed — deserialization attack vector",
tags=["deserialization", "php"],
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# PROTOTYPE POLLUTION
# ══════════════════════════════════════════════════════════
Signature(
name="Prototype pollution reflected",
severity="HIGH",
pattern=re.compile(r'"__proto__"\s*:\s*\{.*?"polluted"', re.S | re.I),
description="Prototype pollution payload reflected — merge gadget present",
tags=["prototype-pollution"],
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# PALO ALTO PAN-OS
# ══════════════════════════════════════════════════════════
Signature(
name="PAN-OS GlobalProtect CVE-2024-3400",
severity="CRITICAL",
pattern=re.compile(r'<response\s+status="error"|GP_COOKIE|clientIpAddress', re.I),
description="PAN-OS GlobalProtect — CVE-2024-3400 injection point",
cve="CVE-2024-3400",
tags=["panos", "rce"],
required_path_pattern=re.compile(r'/global-protect/|/ssl-vpn/', re.I),
html_allowed=True,
),
# ══════════════════════════════════════════════════════════
# F5 BIG-IP
# ══════════════════════════════════════════════════════════
Signature(
name="F5 BIG-IP iControl RCE (CVE-2022-1388)",
severity="CRITICAL",
pattern=re.compile(r'"kind"\s*:\s*"tm:|uid=\d+\(', re.I),
description="BIG-IP iControl REST — unauthenticated RCE",
cve="CVE-2022-1388",
tags=["bigip", "rce"],
required_path_pattern=re.compile(r'/mgmt/tm/', re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# CONFLUENCE
# ══════════════════════════════════════════════════════════
Signature(
name="Confluence OGNL injection (CVE-2022-26134)",
severity="CRITICAL",
pattern=re.compile(r'uid=\d+|java\.lang\.Runtime|com\.opensymphony\.xwork2', re.I),
description="Confluence OGNL injection — RCE confirmed",
cve="CVE-2022-26134",
tags=["confluence", "rce"],
required_path_pattern=re.compile(r'\.action|confluence', re.I),
html_allowed=True,
),
# ══════════════════════════════════════════════════════════
# IVANTI / CITRIX
# ══════════════════════════════════════════════════════════
Signature(
name="Ivanti Connect Secure RCE (CVE-2024-21887)",
severity="CRITICAL",
pattern=re.compile(r'uid=\d+\(|/etc/passwd|command.*?executed', re.I),
description="Ivanti Connect Secure — command injection confirmed",
cve="CVE-2024-21887",
tags=["ivanti", "rce"],
required_path_pattern=re.compile(r'/api/v1/totp/user-backup-code|/dana-na/', re.I),
html_allowed=True,
),
Signature(
name="Citrix NetScaler auth bypass (CVE-2023-3519)",
severity="CRITICAL",
pattern=re.compile(r'uid=\d+\(|/nsconfig/ns\.conf|/etc/passwd', re.I),
description="Citrix NetScaler ADC — auth bypass/RCE",
cve="CVE-2023-3519",
tags=["citrix", "rce"],
required_path_pattern=re.compile(r'/cgi/login|/owa/auth|smb', re.I),
html_allowed=True,
),
# ══════════════════════════════════════════════════════════
# ATLASSIAN JIRA
# ══════════════════════════════════════════════════════════
Signature(
name="Jira user enumeration / SSRF",
severity="HIGH",
pattern=re.compile(r'"displayName"\s*:\s*"[^"]+",\s*"emailAddress"\s*:', re.I),
description="Jira REST API — user PII accessible",
tags=["jira", "enum"],
required_path_pattern=re.compile(r'/rest/api/\d+/user|/rest/api/latest/user', re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# GRAFANA
# ══════════════════════════════════════════════════════════
Signature(
name="Grafana admin default creds (CVE-2021-43798)",
severity="CRITICAL",
pattern=re.compile(r'"orgId"\s*:\s*\d+|"isGrafanaAdmin"\s*:\s*true', re.I),
description="Grafana API authenticated — default admin/admin accepted",
cve="CVE-2021-43798",
tags=["grafana", "auth"],
required_path_pattern=re.compile(r'/api/org|/api/admin|/api/users', re.I),
html_allowed=False,
),
Signature(
name="Grafana path traversal (CVE-2021-43798)",
severity="CRITICAL",
pattern=re.compile(r'root:x:0:0:|APP_KEY=|DB_PASSWORD=', re.I),
description="Grafana plugin directory traversal — file read",
cve="CVE-2021-43798",
tags=["grafana", "lfi"],
required_path_pattern=re.compile(r'/public/plugins/', re.I),
html_allowed=False,
),
# ══════════════════════════════════════════════════════════
# MATTERMOST / ROCKETCHAT
# ══════════════════════════════════════════════════════════
Signature(
name="Mattermost API token leak",
severity="HIGH",
pattern=re.compile(r'"token"\s*:\s*"[a-z0-9]{26}"', re.I),
description="Mattermost API auth token exposed",
tags=["mattermost", "token"],