proxytools

- collection of scripts for harvesting & testing proxies
git clone git://git.acid.vegas/proxytools.git
Log | Files | Refs | Archive | README | LICENSE

commit 7ee1669d1c3c84f50424c7195fb7619dffb4e6b0
parent 442c01f2be912bebb438d44303188c5740d53642
Author: acidvegas <acid.vegas@acid.vegas>
Date: Tue, 4 Jul 2023 12:27:02 -0400

Updated sockhub with more URLs and SOCKS4, Updated floodbl to pull DNS replies for more info

Diffstat:
M.screens/floodbl.png | 0
Mfloodbl.py | 95+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------
Msockhub.py | 45+++++++++++++++++++++++++++++++++++++--------

3 files changed, 111 insertions(+), 29 deletions(-)

diff --git a/.screens/floodbl.png b/.screens/floodbl.png
Binary files differ.
diff --git a/floodbl.py b/floodbl.py
@@ -2,12 +2,6 @@
 # FloodBL - Developed by acidvegas in Python (https://git.acid.vegas/proxytools)
 
 '''
-
-Test proxies against a set of Domain Name System-based Blackhole Lists (DNSBL) or Real-time Blackhole Lists (RBL)
-
-'''
-
-'''
 Notes for future improvement:
 
 To query an IPv6 address, you must expand it, then reverse it into "nibble" format.
@@ -23,7 +17,6 @@ To query an IPv6 address, you must expand it, then reverse it into "nibble" form
 
     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
@@ -46,23 +39,84 @@ import os
 import re
 import socket
 
-blackholes = ('dnsbl.dronebl.org','rbl.efnetrbl.org','torexit.dan.me.uk')
-good       = list()
-proxies    = list()
-print_bad  = True
+try:
+	import dns.resolver
+except ImportError:
+	raise SystemExit('error: missing required \'dnspython\' library (https://pypi.org/project/dnspython/)')
+
+# Globals
+good    = list()
+bad     = list()
+unknown = list()
+proxies = list()
+
+blackholes = {
+	'dnsbl.dronebl.org': {
+		'2'  : 'Sample',
+		'3'  : 'IRC Drone',
+		'5'  : 'Bottler',
+		'6'  : 'Unknown spambot or drone',
+		'7'  : 'DDOS Drone',
+		'8'  : 'SOCKS Proxy',
+		'9'  : 'HTTP Proxy',
+		'10' : 'ProxyChain',
+		'11' : 'Web Page Proxy',
+		'12' : 'Open DNS Resolver',
+		'13' : 'Brute force attackers',
+		'14' : 'Open Wingate Proxy',
+		'15' : 'Compromised router / gateway',
+		'16' : 'Autorooting worms',
+		'17' : 'Automatically determined botnet IPs (experimental)',
+		'18' : 'DNS/MX type'
+	},
+#	'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'
+#	}
+}
 
 def check(proxy):
-	formatted_ip = '.'.join(proxy.split('.')[::-1])
+	proxy_ip     = proxy.split(':')[0]
+	formatted_ip = '.'.join(proxy_ip.split('.')[::-1])
 	for blackhole in blackholes:
 		try:
-			socket.gethostbyname(f'{formatted_ip}.{blackhole}')
-		except socket.gaierror:
-			if print_bad:
-				print('\033[1;31mBAD\033[0m  \033[30m|\033[0m ' + proxy.ljust(22) + f'\033[30m({blackhole})\033[0m')
-			break
-		else:
-			print('\033[1;32mGOOD\033[0m \033[30m|\033[0m ' + proxy)
-			good.append(proxy)
+			results = dns.resolver.resolve(f'{formatted_ip}.{blackhole}', 'A')
+			if results:
+				for result in results:
+					data  = result.to_text()
+					reply = data.split('.')[-1:][0]
+					if reply in blackholes[blackhole]:
+						print(f'{proxy_ip.ljust(15)} \033[1;30m|\033[0m {blackhole.ljust(17)} \033[1;30m|\033[0m \033[1;31m{blackholes[blackhole][reply]}\033[0m')
+						bad.append(proxy)
+					else:
+						print(f'{proxy_ip.ljust(15)} \033[1;30m|\033[0m {blackhole.ljust(17)} \033[1;30m|\033[0m Unknown ({data})')
+						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)
+		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:
+		good.append(proxy)
 
 # Main
 print('#'*56)
@@ -93,4 +147,3 @@ with open(args.output, 'w') as output_file:
 print('\033[34mTotal\033[0m : ' + format(len(proxies),           ',d'))
 print('\033[34mGood\033[0m  : ' + format(len(good),              ',d'))
 print('\033[34mBad\033[0m   : ' + format(len(proxies)-len(good), ',d'))
-print('\033[34mDupe\033[0m  : ' + format(initial-len(proxies),   ',d'))
diff --git a/sockhub.py b/sockhub.py
@@ -17,33 +17,63 @@ import urllib.request
 # The current list contains proxy sources that are updated frequently with new proxies
 # Almost all of the Github repos pull from the same place & contain duplicates (which are removed)
 urls = set((
+	'https://api.openproxylist.xyz/socks4.txt'
+	'https://api.openproxylist.xyz/socks5.txt',
+	'https://api.proxyscrape.com/?request=displayproxies&proxytype=socks4',
+	'https://api.proxyscrape.com/v2/?request=displayproxies&protocol=socks4',
+	'https://api.proxyscrape.com/?request=displayproxies&proxytype=socks5',
+	'https://api.proxyscrape.com/v2/?request=displayproxies&protocol=socks5',
+	'https://proxy-list.download/api/v1/get?type=socks4',
+	'https://proxy-list.download/api/v1/get?type=socks5',
+	'https://proxyscan.io/download?type=socks4',
+	'https://proxyscan.io/download?type=socks5',
+	'https://proxyspace.pro/socks4.txt',
+	'https://proxyspace.pro/socks5.txt',
+	'https://raw.githubusercontent.com/ALIILAPRO/Proxy/main/socks4.txt',
 	'https://raw.githubusercontent.com/ALIILAPRO/Proxy/main/socks5.txt',
+	'https://raw.githubusercontent.com/B4RC0DE-TM/proxy-list/main/SOCKS4.txt',
 	'https://raw.githubusercontent.com/B4RC0DE-TM/proxy-list/main/SOCKS5.txt',
 	'https://raw.githubusercontent.com/hookzof/socks5_list/master/proxy.txt',
+	'https://raw.githubusercontent.com/HyperBeats/proxy-list/main/socks4.txt',
 	'https://raw.githubusercontent.com/HyperBeats/proxy-list/main/socks5.txt',
+	'https://raw.githubusercontent.com/jetkai/proxy-list/main/online-proxies/txt/proxies-socks4.txt',
 	'https://raw.githubusercontent.com/jetkai/proxy-list/main/online-proxies/txt/proxies-socks5.txt',
+	'https://raw.githubusercontent.com/manuGMG/proxy-365/main/SOCKS4.txt',
 	'https://raw.githubusercontent.com/manuGMG/proxy-365/main/SOCKS5.txt',
+	'https://raw.githubusercontent.com/mmpx12/proxy-list/master/socks4.txt',
 	'https://raw.githubusercontent.com/mmpx12/proxy-list/master/socks5.txt',
+	'https://raw.githubusercontent.com/monosans/proxy-list/main/proxies/socks4.txt',
 	'https://raw.githubusercontent.com/monosans/proxy-list/main/proxies/socks5.txt',
+	'https://raw.githubusercontent.com/monosans/proxy-list/main/proxies_anonymous/socks4.txt',
 	'https://raw.githubusercontent.com/monosans/proxy-list/main/proxies_anonymous/socks5.txt',
+	'https://raw.githubusercontent.com/MuRongPIG/Proxy-Master/main/socks4.txt',
 	'https://raw.githubusercontent.com/MuRongPIG/Proxy-Master/main/socks5.txt',
+	'https://raw.githubusercontent.com/officialputuid/KangProxy/KangProxy/socks5/socks4.txt',
 	'https://raw.githubusercontent.com/officialputuid/KangProxy/KangProxy/socks5/socks5.txt',
+	'https://raw.githubusercontent.com/prxchk/proxy-list/main/socks4.txt',
 	'https://raw.githubusercontent.com/prxchk/proxy-list/main/socks5.txt',
+	'https://raw.githubusercontent.com/rdavydov/proxy-list/main/proxies/socks4.txt',
 	'https://raw.githubusercontent.com/rdavydov/proxy-list/main/proxies/socks5.txt',
+	'https://raw.githubusercontent.com/rdavydov/proxy-list/main/proxies_anonymous/socks4.txt',
 	'https://raw.githubusercontent.com/rdavydov/proxy-list/main/proxies_anonymous/socks5.txt',
+	'https://raw.githubusercontent.com/roosterkid/openproxylist/main/SOCKS4_RAW.txt',
 	'https://raw.githubusercontent.com/roosterkid/openproxylist/main/SOCKS5_RAW.txt',
+	'https://raw.githubusercontent.com/RX4096/proxy-list/main/online/socks4.txt',
+	'https://raw.githubusercontent.com/RX4096/proxy-list/main/online/socks5.txt',
+	'https://raw.githubusercontent.com/saschazesiger/Free-Proxies/master/proxies/socks4.txt',
 	'https://raw.githubusercontent.com/saschazesiger/Free-Proxies/master/proxies/socks5.txt',
+	'https://raw.githubusercontent.com/ShiftyTR/Proxy-List/master/socks4.txt',
 	'https://raw.githubusercontent.com/ShiftyTR/Proxy-List/master/socks5.txt',
+	'https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/socks4.txt',
 	'https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/socks5.txt',
+	'https://raw.githubusercontent.com/UptimerBot/proxy-list/main/proxies/socks4.txt',
 	'https://raw.githubusercontent.com/UptimerBot/proxy-list/main/proxies/socks5.txt',
+	'https://raw.githubusercontent.com/Zaeem20/FREE_PROXIES_LIST/master/socks4.txt',
 	'https://raw.githubusercontent.com/Zaeem20/FREE_PROXIES_LIST/master/socks5.txt',
+	'https://raw.githubusercontent.com/zevtyardt/proxy-list/main/socks4.txt',
 	'https://raw.githubusercontent.com/zevtyardt/proxy-list/main/socks5.txt',
-	'https://api.openproxylist.xyz/socks5.txt',
-	'https://api.proxyscrape.com/?request=displayproxies&proxytype=socks5',
-	'https://api.proxyscrape.com/v2/?request=displayproxies&protocol=socks5',
-	'https://proxyscan.io/download?type=socks5',
-	'https://proxyspace.pro/socks5.txt',
-	'https://spys.me/socks.txt'
+	'https://spys.me/socks.txt',
+	'https://spys.one/en/socks-proxy-list/'
 ))
 
 def get_source(url):
@@ -85,4 +115,4 @@ if proxies:
 	proxies.sort()
 	with open (proxy_file, 'w') as proxy__file:
 		for proxy in proxies:
-			proxy__file.write(proxy + '\n')
-\ No newline at end of file
+			proxy__file.write(proxy + '\n')