Zerxs
Market Demand Exploiter
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 2
1000 XP
Sharing a usefull Python Script.
Here's a simple proxy checker which grabs proxies from https://proxyscrape.com using Python
Features
Virustotal link https://www.virustotal.com/gui/file...fee3c8d82426971e5b75da6c185bdc2fed9?nocache=1
Here's a simple proxy checker which grabs proxies from https://proxyscrape.com using Python
Features
- Get to choose timeout
- Get to choose between https, socks4, socks5
- Runs smooth and fast
- color coding doesnt work on windows only linux (script will still work fine though)
- thats about it
Code:
import requests
import socket
from sys import argv,exit
from threading import Thread
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
#Colors
yellow = "\033[1;40;33m"
green = "\033[1;40;32m"
red = "\033[1;40;31m"
reset = "\033[0m"
bold = "\033[0;40;1m"
def info(string):
string = f'{reset}[{yellow}*{reset}] {string}{reset}'
print(string)
def fail(string):
string = f'{reset}[{red}-{reset}] {string}{reset}'
print(string)
def succ(string):
string = f'{reset}[{green}+{reset}] {bold}{string}{reset}'
print(string)
if len(argv) < 4:
exit(f"python3 {argv[0]} <TIMEOUT> <TYPE(HTTP, SOCKS4, SOCKS5)> <OUTPUT>")
timeout = int(argv[1])
proxytype = str(argv[2])
output = open(argv[3], 'w')
unchecked = []
def downloadproxies(url):
r = requests.get(url, verify=False)
proxies = r.text
for proxy in proxies.split("\n"):
proxy = proxy.rstrip().lstrip()
unchecked.append(proxy)
if proxytype.upper() == "HTTP":
downloadproxies("https://api.proxyscrape.com/?request=getproxies&proxytype=http&timeout=10000&country=all&ssl=all&anonymity=all")
elif proxytype.upper() == "SOCKS4":
downloadproxies("https://api.proxyscrape.com/?request=getproxies&proxytype=socks4&timeout=10000&country=all")
elif proxytype.upper() == "SOCKS5":
downloadproxies("https://api.proxyscrape.com/?request=getproxies&proxytype=socks5&timeout=10000&country=all")
else:
exit("Please choose HTTP, SOCKS4, or SOCKS5")
unchecked = list(filter(None, unchecked))
def connectThroughProxy(proxyip, proxyport):
try:
headers = "GET http://google.com/ HTTP/1.1\nHost: google.com\r\n\r\n"
s = socket.socket()
s.settimeout(timeout)
s.connect((proxyip,proxyport))
s.send(headers.encode('utf-8'))
response = s.recv(3000)
succ(f"{proxyip}:{proxyport}")
output.write(f"{proxyip}:{proxyport}\n")
s.close()
except socket.gaierror:
fail(f"{proxyip}:{proxyport}")
pass
except socket.timeout:
fail(f"{proxyip}:{proxyport}")
pass
except ConnectionRefusedError:
fail(f"{proxyip}:{proxyport}")
pass
except ConnectionResetError:
fail(f"{proxyip}:{proxyport}")
pass
except TimeoutError:
fail(f"{proxyip}:{proxyport}")
pass
except OSError:
fail(f"{proxyip}:{proxyport}")
pass
for x in unchecked:
try:
proxy = x.split(":")
proxyip = proxy[0]
proxyport = proxy[1]
t = Thread(target=connectThroughProxy, args=(proxyip, int(proxyport)))
t.start()
except:
pass
t.join()