pysoxy
pysoxy copied to clipboard
(enhancement)
Hi MisterDaneel I appreciate your code . I was thinking if I could block few IPs or let pass through only the IPs I want .it would be great . Thanks.
Yeah, this would be useful
Decline Requests from specific sources
On the main function simply add
try:
wrapper, _ = new_socket.accept()
wrapper.setblocking(1)
if __[0] == "127.0.0.1":
wrapper.close()
or create list list with IPs
if __[0] in blacklist:
wrapper.close()
Or to whilelist change it to that
if __[0] not in whilelist:
wrapper.close()
@senshiofficial would this also work if i use domain names? Or whatever is requested by the client? Thanks .
@senshiofficial would this also work if i use domain names? Or whatever is requested by the client? Thanks .
If a device or a Server is connecting to your Proxy it will always be a IP, if you want to block the destination which includes IPs and Domains you could try that
at the request_client()
function simply add
Blocklist Servers from being requested
if dst_addr == "Domain.com" or dst_addr in blacklist:
return 0
you could also blocklist a port for whatever reason you wanna do that
if str(dst_port) == "80" or str(dst_port) in blacklistports:
return 0
Just simply add that before return (dst_addr, dst_port)
@senshiofficial thanks I will try testing later.