Updated most of the proxy tools and added a few scripts I had laying around. Tor work has improved
This commit is contained in:
76
floodbl.py
76
floodbl.py
@@ -1,48 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
# FloodBL - Developed by acidvegas in Python (https://git.acid.vegas/proxytools)
|
||||
|
||||
'''
|
||||
Notes for future improvement:
|
||||
|
||||
To query an IPv6 address, you must expand it, then reverse it into "nibble" format.
|
||||
e.g. if the IP was 2001:db8::1, you expand it to 2001:0db8:0000:0000:0000:0000:0000:0001 and reverse it.
|
||||
In nibble format it is 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2 and add on the dns blacklist you require.
|
||||
|
||||
e.g. 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.tor.dan.me.uk
|
||||
|
||||
If the IP has a match, the DNS server will respond with an "A" record of 127.0.0.100.
|
||||
It will also respond with a "TXT" record with extra information as per below:
|
||||
|
||||
N:<nodename>/P:<port1[,port2]>/F:<flags>
|
||||
|
||||
port1 is the OR (onion router) port, port2 (if specified) is the DR (directory) port.
|
||||
Flags are defined as follows:
|
||||
E Exit
|
||||
X Hidden Exit
|
||||
A Authority
|
||||
B BadExit
|
||||
C NoEdConsensus
|
||||
D V2Dir
|
||||
F Fast
|
||||
G Guard
|
||||
H HSDir
|
||||
N Named
|
||||
R Running
|
||||
S Stable
|
||||
U Unnamed
|
||||
V Valid
|
||||
'''
|
||||
|
||||
import argparse
|
||||
import concurrent.futures
|
||||
import ipaddress
|
||||
import os
|
||||
import re
|
||||
import socket
|
||||
|
||||
try:
|
||||
import dns.resolver
|
||||
except ImportError:
|
||||
raise SystemExit('error: missing required \'dnspython\' library (https://pypi.org/project/dnspython/)')
|
||||
raise SystemExit('missing required \'dnspython\' library (https://pypi.org/project/dnspython/)')
|
||||
|
||||
# Globals
|
||||
good = list()
|
||||
@@ -67,36 +35,22 @@ blackholes = {
|
||||
'15' : 'Compromised router / gateway',
|
||||
'16' : 'Autorooting worms',
|
||||
'17' : 'Automatically determined botnet IPs (experimental)',
|
||||
'18' : 'DNS/MX type'
|
||||
'18' : 'DNS/MX type',
|
||||
'19' : 'Abused VPN Service',
|
||||
'255': 'Uncategorzied threat class'
|
||||
},
|
||||
# 'rbl.efnetrbl.org': { # NOTE: Most IRC networks use DroneBL, un-comment this section to check the EFnetRBL
|
||||
# '1' : "Open Proxy",
|
||||
# '2' : "spamtrap666",
|
||||
# '3' : "spamtrap50",
|
||||
# '4' : "TOR",
|
||||
# '5' : "Drones / Flooding"
|
||||
# },
|
||||
# 'torexit.dan.me.uk': { # TODO: The require a TXT lookup, although IRC daemons do numeric replies...will look into this
|
||||
# 'E' : 'Exit',
|
||||
# 'X' : 'Hidden Exit',
|
||||
# 'A' : 'Authority',
|
||||
# 'B' : 'BadExit',
|
||||
# 'C' : 'NoEdConsensus',
|
||||
# 'D' : 'V2Dir',
|
||||
# 'F' : 'Fast',
|
||||
# 'G' : 'Guard',
|
||||
# 'H' : 'HSDir',
|
||||
# 'N' : 'Named',
|
||||
# 'R' : 'Running',
|
||||
# 'S' : 'Stable',
|
||||
# 'U' : 'Unnamed',
|
||||
# 'V' : 'Valid'
|
||||
# }
|
||||
'rbl.efnetrbl.org': {
|
||||
'1' : "Open Proxy",
|
||||
'2' : "spamtrap666",
|
||||
'3' : "spamtrap50",
|
||||
'4' : "TOR",
|
||||
'5' : "Drones / Flooding"
|
||||
}
|
||||
}
|
||||
|
||||
def check(proxy):
|
||||
proxy_ip = proxy.split(':')[0]
|
||||
formatted_ip = '.'.join(proxy_ip.split('.')[::-1])
|
||||
formatted_ip = ipaddress.ip_address(proxy_ip).reverse_pointer
|
||||
for blackhole in blackholes:
|
||||
try:
|
||||
results = dns.resolver.resolve(f'{formatted_ip}.{blackhole}', 'A')
|
||||
@@ -112,7 +66,7 @@ def check(proxy):
|
||||
unknown.append(proxy)
|
||||
else:
|
||||
print(f'{proxy_ip.ljust(15)} \033[1;30m|\033[0m {blackhole.ljust(17)} \033[1;30m|\033[0m Error (No results)')
|
||||
unkown.append(proxy)
|
||||
unknown.append(proxy)
|
||||
except Exception as ex:
|
||||
print(f'{proxy_ip.ljust(15)} \033[1;30m|\033[0m {blackhole.ljust(17)} \033[1;30m|\033[0m \033[1;32mGOOD\033[0m')
|
||||
if proxy not in bad:
|
||||
@@ -134,7 +88,7 @@ args = parser.parse_args()
|
||||
if not os.path.isfile(args.input):
|
||||
raise SystemExit('no such input file')
|
||||
initial = len(open(args.input).readlines())
|
||||
proxies = set([proxy.split(':')[0] for proxy in re.findall('[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+', open(args.input).read(), re.MULTILINE)])
|
||||
proxies = set([proxy.split(':')[0] for proxy in re.findall('[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+', open(args.input).read(), re.MULTILINE)]) # TODO: handle IPv6 better
|
||||
if not proxies:
|
||||
raise SystemExit('no proxies found from input file')
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=args.threads) as executor:
|
||||
|
||||
Reference in New Issue
Block a user