Compare commits

..

3 Commits

Author SHA1 Message Date
d2b13f9b61 Move template to package 2023-11-08 17:49:36 -05:00
c243bee34e Update to use round robin with chain_len 3 2023-11-08 17:49:00 -05:00
12ea3c630f Add default proxychains.conf 2023-11-08 17:44:48 -05:00
3 changed files with 9 additions and 23 deletions

View File

@ -1,6 +1,3 @@
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
@ -36,7 +33,6 @@ 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

View File

@ -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 @@
# 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 = 2 chain_len = 3
# Quiet mode (no output from library) # Quiet mode (no output from library)
#quiet_mode #quiet_mode

22
main.py
View File

@ -4,15 +4,14 @@ 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 read_file(path): def load_urls(path):
with open(path, 'r', encoding='utf-8') as file: with open(path, 'r', encoding='utf-8') as file:
data = [line.strip() for line in file.readlines()] urls = [line.strip() for line in file.readlines()]
return data return urls
def write_file(path, data): def write_file(path, data):
@ -25,7 +24,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 = read_file('data/proxy-sources.txt') urls = load_urls('data/proxy-sources.txt')
proxies = fetch_all(urls) proxies = fetch_all(urls)
print(f'Fetched {len(proxies)} proxies!') print(f'Fetched {len(proxies)} proxies!')
@ -48,22 +47,13 @@ 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)
) )
# Write proxychains conf for proxy in valid:
proxychains_template = read_file('templates/proxychains.conf') print(proxy)
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__':