Created
April 15, 2021 00:50
-
-
Save m0pfin/fdf1c46e813f0bbaf0d5f825fb1b955d to your computer and use it in GitHub Desktop.
AutoProxy check and reboot for 911
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob, os | |
import zlib | |
import urllib | |
import socket | |
import requests | |
import ipaddress | |
import time | |
import urllib.request | |
import urllib.error | |
import subprocess | |
import shlex | |
myip = input("Your local ip => ") | |
startport = int(input("Your start port => ")) | |
portsone = int(input("Number of ports => ")) | |
checksec = 60 # Таймаут проверки в секундах | |
def is_bad_proxy(pip): | |
try: | |
urlsec = 'http://binflameaz.com' | |
responses = requests.get(urlsec, proxies=({'http': 'socks5://{}'.format(pip)})) | |
razresh = str(responses.json()['work']) | |
realip = str(responses.json()['ip']) | |
if (razresh == 'true'): | |
return realip | |
except urllib.error.HTTPError as e: | |
return realip | |
except Exception as detail: | |
return True | |
return realip | |
ports = portsone | |
while True: | |
while ports > 0: | |
checkport = startport + ports - 1 | |
ips = str(myip) + ":" + str(checkport) | |
realip = is_bad_proxy(ips) | |
if realip != True: | |
print(ips + " : live | ip - " + str(realip)) | |
else: | |
print(str(checkport) + " : dead") | |
# Поставить свой путь до файла | |
cmd = 'C:/Users/m0pfin/Desktop/911/ProxyTool/AutoProxyTool.exe -changeproxy/US -proxyport=' + str(checkport) | |
args = shlex.split(cmd) | |
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | |
result = p.communicate()[0] | |
print(str(checkport) + ' - Сменили IP') | |
ports = ports - 1 | |
ports = portsone | |
print("Timeout - 60s") | |
time.sleep(checksec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment