Open Source Discord Webhook Finder

  • Konuyu Başlatan Konuyu Başlatan Haznt
  • Başlangıç tarihi Başlangıç tarihi

Haznt

Prime Üye
Katılım
22 Tem 2021
Mesajlar
6,077
Beğeniler
2,289
Yaş
22
  1. #!/usr/bin/env python3
  2. import os
  3. import re
  4. import sys
  5. import zlib
  6. from pathlib import Path
  7. ASCII_ART = r"""
  8. _____ __ ___ ______
  9. / ___// / / |/_ __/
  10. \__ \/ / / /| | / /
  11. ___/ / /___/ ___ |/ /
  12. /____/_____/_/ |_/_/
  13. """
  14. WEBHOOK_PATTERN = re.compile(
  15. rb'https?://(?:discord(?:app)?\.com)/api/webhooks/\d+/[a-zA-Z0-9_-]+(?:\?.*)?',
  16. re.IGNORECASE
  17. )
  18. def extract_ascii_strings(data, min_len=8):
  19. strings = []
  20. current = bytearray()
  21. for b in data:
  22. if 32 <= b <= 126:
  23. current.append(b)
  24. else:
  25. if len(current) >= min_len:
  26. strings.append(bytes(current))
  27. current = bytearray()
  28. if len(current) >= min_len:
  29. strings.append(bytes(current))
  30. return strings
  31. def find_zlib_streams(data):
  32. results = []
  33. for i in range(len(data) - 2):
  34. if data == 0x78 and (data[i+1] == 0x9C or data[i+1] == 0xDA):
    [*] try:
    [*] decomp = zlib.decompress(data[i:], wbits=zlib.MAX_WBITS)
    [*] for match in WEBHOOK_PATTERN.finditer(decomp):
    [*] results.append(match.group().decode('utf-8', errors='ignore'))
    [*] except zlib.error:
    [*] pass
    [*] return results
    [*]
    [*]def extract_pyinstaller_pyz(data):
    [*] pyz_marker = b'PYZ-00.pyz'
    [*] idx = data.find(pyz_marker)
    [*] if idx == -1:
    [*] return []
    [*] start = idx + len(pyz_marker)
    [*] for offset in range(0, 100):
    [*] if start + offset + 2 > len(data):
    [*] break
    [*] if data[start+offset] == 0x78 and (data[start+offset+1] == 0x9C or data[start+offset+1] == 0xDA):
    [*] try:
    [*] decomp = zlib.decompress(data[start+offset:], wbits=zlib.MAX_WBITS)
    [*] results = []
    [*] for match in WEBHOOK_PATTERN.finditer(decomp):
    [*] results.append(match.group().decode('utf-8', errors='ignore'))
    [*] return results
    [*] except zlib.error:
    [*] pass
    [*] return []
    [*]
    [*]def scan_deep(file_path):
    [*] results = []
    [*] try:
    [*] with open(file_path, 'rb') as f:
    [*] data = f.read()
    [*] except Exception:
    [*] return results
    [*]
    [*] for match in WEBHOOK_PATTERN.finditer(data):
    [*] results.append((0, match.group().decode('utf-8', errors='ignore')))
    [*]
    [*] for s in extract_ascii_strings(data):
    [*] for match in WEBHOOK_PATTERN.finditer(s):
    [*] results.append((0, match.group().decode('utf-8', errors='ignore')))
    [*]
    [*] try:
    [*] text = data.decode('utf-16', errors='ignore')
    [*] for line_num, line in enumerate(text.splitlines(), 1):
    [*] for match in WEBHOOK_PATTERN.finditer(line.encode('utf-8', errors='ignore')):
    [*] results.append((line_num, match.group().decode('utf-8', errors='ignore')))
    [*] except Exception:
    [*] pass
    [*]
    [*] for url in find_zlib_streams(data):
    [*] results.append((0, url))
    [*]
    [*] for url in extract_pyinstaller_pyz(data):
    [*] results.append((0, url))
    [*]
    [*] seen = set()
    [*] unique = []
    [*] for line_num, url in results:
    [*] if url not in seen:
    [*] seen.add(url)
    [*] unique.append((line_num, url))
    [*] return unique
    [*]
    [*]def scan_path(path):
    [*] path = Path(path)
    [*] if path.is_file():
    [*] yield path, scan_deep(path)
    [*] elif path.is_dir():
    [*] for root, dirs, files in os.walk(path):
    [*] for file in files:
    [*] file_path = Path(root) / file
    [*] yield file_path, scan_deep(file_path)
    [*] else:
    [*] raise ValueError(f"{path} is not a valid file or directory.")
    [*]
    [*]def clear():
    [*] os.system('cls' if os.name == 'nt' else 'clear')
    [*]
    [*]def run_scan():
    [*] clear()
    [*] print(ASCII_ART)
    [*] path = input("\nDrag file or folder here (or type path):\n> ").strip('"')
    [*] if not os.path.exists(path):
    [*] print(f"Error: '{path}' does not exist.")
    [*] input("Press Enter to continue...")
    [*] return
    [*]
    [*] clear()
    [*] print(ASCII_ART)
    [*] print("\nScanning... (this may take a while)\n")
    [*] found = False
    [*] for file_path, results in scan_path(path):
    [*] if results:
    [*] found = True
    [*] rel_path = os.path.relpath(file_path, start=os.getcwd())
    [*] for line_num, url in results:
    [*] print(f"{rel_path}:{line_num if line_num else '?'}: {url}")
    [*]
    [*] if not found:
    [*] print("No Webhooks Found")
    [*]
    [*] input("\nPress Enter to return to menu...")
    [*]
    [*]def menu():
    [*] while True:
    [*] clear()
    [*] print(ASCII_ART)
    [*] print("\n[1] Scan for Discord Webhooks")
    [*] print()
    [*] choice = input("Select an option: ")
    [*]
    [*] if choice == "1":
    [*] run_scan()
    [*]
    [*]if __name__ == "__main__":
    [*] menu()
 
es tam olarak ne yapıyor
 
heeee güzelmiş virüs total ya da vb virüsprogramların dan farkı ne sadece webhook tarıyorda gerçekden düzgün çalışıyormu
kontrol ettim ancak ne kadar sağlam çalışıyor bilmiyorum fudlamadığım 4 programda kullandım 4ünde de webhookları buldu
 

Şuanda konuyu görüntüleyen kullanıcılar

Geri
Üst Alt