Compare commits
5 Commits
proxychain
...
master
Author | SHA1 | Date | |
---|---|---|---|
980eadf588 | |||
24d6880a81 | |||
1549877f26 | |||
1464f16371 | |||
9ce08b7207 |
@ -1,3 +1,6 @@
|
|||||||
|
https://raw.githubusercontent.com/proxifly/free-proxy-list/main/proxies/protocols/socks5/data.txt
|
||||||
|
https://raw.githubusercontent.com/sunny9577/proxy-scraper/master/proxies.txt
|
||||||
|
https://github.com/Anonym0usWork1221/Free-Proxies/blob/main/proxy_files/socks5_proxies.txt
|
||||||
https://api.openproxylist.xyz/socks4.txt
|
https://api.openproxylist.xyz/socks4.txt
|
||||||
https://api.openproxylist.xyz/socks5.txt
|
https://api.openproxylist.xyz/socks5.txt
|
||||||
https://api.proxyscrape.com/?request=displayproxies&proxytype=socks4
|
https://api.proxyscrape.com/?request=displayproxies&proxytype=socks4
|
||||||
@ -33,6 +36,7 @@ https://raw.githubusercontent.com/officialputuid/KangProxy/KangProxy/socks5/sock
|
|||||||
https://raw.githubusercontent.com/officialputuid/KangProxy/KangProxy/socks5/socks5.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/socks4.txt
|
||||||
https://raw.githubusercontent.com/prxchk/proxy-list/main/socks5.txt
|
https://raw.githubusercontent.com/prxchk/proxy-list/main/socks5.txt
|
||||||
|
https://raw.githubusercontent.com/fahimscirex/proxybd/master/proxylist/socks5.txt
|
||||||
https://raw.githubusercontent.com/rdavydov/proxy-list/main/proxies/socks4.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/socks5.txt
|
||||||
https://raw.githubusercontent.com/rdavydov/proxy-list/main/proxies_anonymous/socks4.txt
|
https://raw.githubusercontent.com/rdavydov/proxy-list/main/proxies_anonymous/socks4.txt
|
||||||
|
22
main.py
22
main.py
@ -4,14 +4,15 @@ Inspired by https://github.com/acidvegas/proxytools
|
|||||||
import time
|
import time
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
from harvester.proxy import fetch_all, validate_socks
|
from harvester.proxy import fetch_all, validate_socks
|
||||||
|
|
||||||
|
|
||||||
def load_urls(path):
|
def read_file(path):
|
||||||
with open(path, 'r', encoding='utf-8') as file:
|
with open(path, 'r', encoding='utf-8') as file:
|
||||||
urls = [line.strip() for line in file.readlines()]
|
data = [line.strip() for line in file.readlines()]
|
||||||
|
|
||||||
return urls
|
return data
|
||||||
|
|
||||||
|
|
||||||
def write_file(path, data):
|
def write_file(path, data):
|
||||||
@ -24,7 +25,7 @@ def main():
|
|||||||
logging.basicConfig(level=logging.WARN)
|
logging.basicConfig(level=logging.WARN)
|
||||||
|
|
||||||
# Load proxy source list and fetch proxies
|
# Load proxy source list and fetch proxies
|
||||||
urls = load_urls('data/proxy-sources.txt')
|
urls = read_file('data/proxy-sources.txt')
|
||||||
proxies = fetch_all(urls)
|
proxies = fetch_all(urls)
|
||||||
print(f'Fetched {len(proxies)} proxies!')
|
print(f'Fetched {len(proxies)} proxies!')
|
||||||
|
|
||||||
@ -47,13 +48,22 @@ def main():
|
|||||||
valid.append(proxy)
|
valid.append(proxy)
|
||||||
print(f'{proxy} -> {ip}')
|
print(f'{proxy} -> {ip}')
|
||||||
|
|
||||||
|
# Create output directory if it does not exist
|
||||||
|
if not os.path.exists('proxies'):
|
||||||
|
os.makedirs('proxies')
|
||||||
|
|
||||||
# Write to file with timestamp
|
# Write to file with timestamp
|
||||||
write_file(
|
write_file(
|
||||||
path=f'proxies/valid-socks-{time.strftime("%Y%m%d%H%M%S")}.txt',
|
path=f'proxies/valid-socks-{time.strftime("%Y%m%d%H%M%S")}.txt',
|
||||||
data='\n'.join(valid)
|
data='\n'.join(valid)
|
||||||
)
|
)
|
||||||
for proxy in valid:
|
# Write proxychains conf
|
||||||
print(proxy)
|
proxychains_template = read_file('templates/proxychains.conf')
|
||||||
|
proxychains_data = [f'socks5 {proxy.replace(":", " ")}' for proxy in proxies]
|
||||||
|
write_file(
|
||||||
|
path=f'proxies/proxychains-{time.strftime("%Y%m%d%H%M%S")}.conf',
|
||||||
|
data='\n'.join(proxychains_template + proxychains_data)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
# all proxies must be online to play in chain
|
# all proxies must be online to play in chain
|
||||||
# otherwise EINTR is returned to the app
|
# otherwise EINTR is returned to the app
|
||||||
#
|
#
|
||||||
round_robin_chain
|
#round_robin_chain
|
||||||
#
|
#
|
||||||
# Round Robin - Each connection will be done via chained proxies
|
# Round Robin - Each connection will be done via chained proxies
|
||||||
# of chain_len length
|
# of chain_len length
|
||||||
@ -36,14 +36,14 @@ round_robin_chain
|
|||||||
# otherwise EINTR is returned to the app
|
# otherwise EINTR is returned to the app
|
||||||
# These semantics are not guaranteed in a multithreaded environment.
|
# These semantics are not guaranteed in a multithreaded environment.
|
||||||
#
|
#
|
||||||
#random_chain
|
random_chain
|
||||||
#
|
#
|
||||||
# Random - Each connection will be done via random proxy
|
# Random - Each connection will be done via random proxy
|
||||||
# (or proxy chain, see chain_len) from the list.
|
# (or proxy chain, see chain_len) from the list.
|
||||||
# this option is good to test your IDS :)
|
# this option is good to test your IDS :)
|
||||||
|
|
||||||
# Make sense only if random_chain or round_robin_chain
|
# Make sense only if random_chain or round_robin_chain
|
||||||
chain_len = 3
|
chain_len = 2
|
||||||
|
|
||||||
# Quiet mode (no output from library)
|
# Quiet mode (no output from library)
|
||||||
#quiet_mode
|
#quiet_mode
|
Loading…
Reference in New Issue
Block a user