Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delidumrul — JavaScript Intelligence Engine

Status Python Deps Patterns Use

"Köprüden geçen geçti, geçmeyeni döver geçirir." — Deli Dumrul

Delidumrul, modern SPA / web uygulamalarının yayınlanmış JavaScript bundle'larından gizli istihbarat çıkarır. Bug bounty ve mavi-takım self-audit için, 63 secret pattern + 10 endpoint deteksiyon regex'i + Source Map V3 dekoderi + Webpack chunk haritalama + 3rd-party URL keşfi ile sıkıştırılmış JS'in altından kim ne sızdırmış görür.

Tek dosya, sadece rich bağımlılığı. ~900 satır. NSA-seviye dahice ama küçük.


🎯 Ne Yapar?

Modül Çıkarılan İstihbarat
Crawler Hedef HTML → tüm <script src> + inline <script> + <link rel=preload>
Fetcher Threadpool ile paralel JS indirme, gzip/deflate decode, proxy desteği, retry
SecretScanner 63 secret regex'i (AWS/GitHub/Slack/Stripe/OpenAI/Anthropic/JWT/Private Keys ...) + Shannon entropy filtreleme + line-no
EndpointExtractor axios / fetch / XHR.open / jQuery / GraphQL / route() / api literal / baseURL / router path
SourceMapDecoder Source Map V3 → sourcesContent ile orijinal kaynak kod rekonstrüksiyonu (--dump-sources ile diske yaz)
WebpackChunkParser webpackChunk.push + lazy chunk URL pattern'leri
URL Extractor Absolute URL'ler → 3rd-party API'leri ortaya çıkarır
Reporters Rich Table (terminal) + JSON + CSV + self-contained HTML (severity renkli)

📦 Kurulum

git clone <repo>
cd delidumrul
pip3 install -r requirements.txt   # sadece 'rich'
chmod +x delidumrul.py

Python 3.8+. Başka hiçbir bağımlılık yok — httpx, aiohttp, bs4 gerektirmez (stdlib + threadpool).


🚀 Hızlı Başlangıç

# 1) Tek komut: hedefi tara, terminale rapor bas
python3 delidumrul.py -u https://app.target.com

# 2) HTML raporu + source map dump
python3 delidumrul.py -u https://app.target.com -o rapor.html --dump-sources ./sources

# 3) Cookie + custom header (kimlik dogrulamali kapsam)
python3 delidumrul.py -u https://portal.target.com \
  -c "session=abc123; csrftoken=xyz" \
  -H "Authorization: Bearer eyJ..." \
  -H "X-Tenant: acme"

# 4) Burp proxy uzerinden
python3 delidumrul.py -u https://target.com --proxy http://127.0.0.1:8080

# 5) Cross-origin JS'leri de cek (3rd-party CDN'ler dahil)
python3 delidumrul.py -u https://app.target.com --cross-origin --max-js 500

# 6) JSON cikti (otomasyona ideal)
python3 delidumrul.py -u https://app.target.com -o report.json --quiet

# 7) Verbose debug
python3 delidumrul.py -u https://app.target.com -vv

🖥 CLI Referansı

HEDEF
  -u, --url URL              Hedef URL (sema yoksa otomatik https://)
  --cross-origin             Hedef host disindaki JS'leri de cek
  --max-js N                 Max harici JS sayisi (default 200)

HTTP
  --timeout SEC              Soket zaman asimi (default 10)
  -w, --workers N            Eszamanli HTTP iscisi (default 12)
  -U, --user-agent UA        User-Agent
  -c, --cookie STR           'a=1; b=2' formatinda
  -H, --header K:V           Ekstra header (tekrarlanabilir)
  --proxy URL                HTTP/HTTPS proxy (Burp/mitmproxy)
  --max-size-mb N            JS body max boyut (default 8 MB)

OZELLIKLER
  --no-sourcemap             Source map cozmeyi atla
  --no-chunks                Webpack chunk parser'i atla
  --secrets-db FILE          Harici secrets_patterns.json yolu

CIKTI
  -o, --output FILE          .json / .csv / .html (uzantidan otomatik)
  --format {auto,json,csv,html}
  --dump-sources DIR         Source map orijinal dosyalarini DIR'a yaz

LOGLAMA
  -v / -vv                   INFO / DEBUG
  -q, --quiet                Sadece hatalar
  --no-color / --no-banner

🧬 Secret Pattern DB (secrets_patterns.json)

63 imzalı, severity'li, harici JSON DB. Yan dosya otomatik yüklenir; bulunmazsa gömülü minimal fallback kullanılır.

Kapsanan kategoriler:

  • Cloud: AWS (Access Key / Secret / Session Token), Google API & OAuth, Firebase, Azure (heuristic)
  • VCS / DevOps: GitHub (PAT/OAuth/App/Refresh), GitLab PAT, npm, Docker Hub PAT, CircleCI
  • Mesajlasma: Slack (Bot/User/App/Refresh/Webhook), Discord (Bot + Webhook)
  • Odeme: Stripe (Live/Test Secret + Restricted), Square, Braintree, Shopify (4 cesit)
  • E-posta/Iletisim: Mailgun, Mailchimp, SendGrid, Twilio (SID/Key/Auth)
  • AI/ML: OpenAI, Anthropic (Claude), HuggingFace
  • Sosyal: LinkedIn, Facebook, Twitter (Bearer/OAuth), Heroku
  • Kripto Anahtarlari: RSA / EC / DSA / OpenSSH / PGP private key block'lari
  • Format-tabanli: JWT, inline Basic Auth URL'leri, Sentry DSN, Algolia, Datadog, PyPI, Okta
  • Heuristic: Generic high-entropy string (Shannon ≥ 4.5)

Kendi pattern'inizi ekleyin:

{
  "id": "my_internal_token",
  "regex": "tok_[A-Za-z0-9]{32}",
  "severity": "critical",
  "label": "Sirket Internal Token",
  "min_entropy": 4.0,
  "group": 0
}

min_entropy opsiyonel — düşük entropi sahte pozitifleri eler. group belirtilirse regex'in N. capture grubu kullanılır (contextual match'ler için).


🧪 Endpoint Pattern'leri

Pattern Yakaladığı
axios / axios_obj axios.get('/x'), axios({url:'/x', method:'POST'})
fetch fetch('/x'), fetch('https://...')
xhr_open xhr.open('DELETE', '/x')
jq_ajax $.get/$.post/$.ajax/$.getJSON('/x')
api_literal String literal'larda /api/v1/..., /v2/..., /graphql/..., /admin/...
url_field url: '/x', baseURL: 'https://api.x', API_URL = ...
route / router_path .route('/x'), path: '/x'
apollo GraphQL query/mutation hint

Yakalanan her endpoint için: path, method, source URL, eşleşen pattern.


🔬 Source Map Reconstruction

Modern bundler'lar (webpack, vite, rollup, esbuild) .js.map dosyalarını yanlışlıkla production'a deploy ediyor. Delidumrul:

  1. JS bundle'ın son satırlarındaki //# sourceMappingURL= yorumunu yakalar
  2. URL'i çeker (relative + inline data:application/json;base64,... destekli)
  3. Source Map V3 JSON'unu parse eder
  4. sourcesContent[] alanından orijinal kaynak dosyaların kodunu çıkarır
  5. --dump-sources DIR ile path hiyerarşisi korunarak diske yazar (webpack:///./src/foo.jsDIR/src/foo.js)

Bu adım bug bounty workflow'unda altın madeni: minified üretim kodundan modüler kaynak ağacını geri elde edersiniz.


📁 Çıktı Formatları

JSON

Tam yapı: target, started/finished, assets (size, status, fetch_ms, sourcemap_url), endpoints, secrets (label, severity, preview, full_value_hash, entropy, line_no), sourcemaps, chunks, external_urls, stats.

CSV

Tek tablo (kind kolonuyla secret/endpoint/sourcemap/external_url ayrımı). pandas / Excel'e direkt açılır.

HTML

Self-contained (dış bağlantı yok). Severity-renkli secret tablosu, expandable source code block'ları, endpoint listesi, 3rd-party URL'ler, webpack chunk haritası.

Rich Table (terminal)

Stats panel + secret tablosu (entropy sıralı) + endpoint tablosu + source map dosyaları.


🥷 OPSEC Notları

  • Same-host filtresi default açık — 3rd-party CDN trafiği üretmez. Açmak için --cross-origin.
  • Proxy desteği — Burp/mitmproxy üzerinden tüm istekleri görüntüleyin.
  • Custom Cookie/Header — kimlik doğrulama gerektiren panellerde session koruyun.
  • SSL doğrulaması kapalı — bug bounty ortamında self-signed cert'lere takılmaz.
  • Body size limit (--max-size-mb) — büyük bundle'ların belleği tüketmesini önler.
  • Threadpool concurrency (-w) — 12 default; agresif tarama için --workers 32, sessiz için 4.

🧪 Test Lab

tests/lab_server.py (örnek): hassas JS sızdıran lokal sunucu. Aracı tanımak için:

python3 tests/lab_server.py &
python3 delidumrul.py -u http://127.0.0.1:19090 -o /tmp/test.html

⚠️ Yasal & Etik

Bu araç yalnızca:

  • Açıkça izinli sızma testi
  • Bug bounty (kapsam dahili)
  • Kendi varlıklarınızın self-audit'i

içindir. İzinsiz tarama bulunduğunuz ülkenin yasalarına göre suç teşkil edebilir. Sızdırılan secret'ları asla yayınlamayın; sorumlu açıklama (responsible disclosure) süreci işletin.


🛠 Geliştirme

delidumrul/
├── delidumrul.py            # ~900 satir, tek dosya
├── secrets_patterns.json    # 63 imza
├── requirements.txt         # sadece 'rich'
├── README.md
└── .gitignore

Tasarım prensipleri:

  1. Tek dosya core — kurulum zahmetsiz; bağımlılık minimum.
  2. Dataclass-first — tüm sonuçlar @dataclass, asdict() ile serializable.
  3. Sessiz hata yok — her except en az log.debug() yazar; -vv ile full trace.
  4. OPSEC-aware default'lar — same-host, body limit, proxy desteği hazır.
  5. Genişletilebilir — yeni secret pattern'i JSON'a 5 satırla eklenir; yeni endpoint pattern'i ENDPOINT_PATTERNS listesine bir tuple.

📝 Sürüm Notları

v1.0 — Initial Release

  • 63 secret regex + entropy filtresi + line-no tracking
  • 10 endpoint pattern (axios/fetch/XHR/jQuery/GraphQL/route/literal/baseURL)
  • Source Map V3 decoder + --dump-sources reconstruction
  • Webpack chunk parser
  • 3rd-party URL extraction
  • Multi-format output (JSON/CSV/HTML/Rich Table)
  • Proxy + cookie + header + cross-origin support
  • 12-worker threadpool fetcher (gzip/deflate)
  • Self-contained: sadece rich bağımlı

🎁 Yol Haritası (Sonraki Sürümler)

  • JS AST parse (Esprima/Acorn yerine basit lex) — string concatenation ile gizlenmiş endpoint'ler
  • WASM bundle support.wasm modüllerinde string extraction
  • Recursive crawl — bulunan endpoint'leri authentıcation sonrası fuzz
  • NPM dependency confusion detection — package.json + lock dosyalarından
  • Lazy chunk auto-fetch — webpack chunk URL'lerini de tara
  • TruffleHog uyumluluk — pattern formatı import/export

PR'lar / issue'lar açığa. İyi avlar 🛡️

About

JavaScript Intelligence Engine - SPA bundle'larindan secret/endpoint/source-map cikartan tek dosya ofansif recon araci. 63 secret regex'i, Source Map V3 dekoderi, webpack chunk parser, multi-format cikti. Bug bounty + self-audit.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages