Added optional domain intercepting
This commit is contained in:
parent
51f55040d9
commit
d0161776a6
9
main.py
9
main.py
@ -6,6 +6,11 @@ import dns.query
|
||||
import dns.message
|
||||
import netifaces
|
||||
import os
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser(description='a DoT Proxy resolver.')
|
||||
parser.add_argument('-r',action="store_true", help='Optional: Disable request intercepting')
|
||||
args = parser.parse_args()
|
||||
print(args)
|
||||
listeningIPs = []
|
||||
print("DoT (DNS over TLS) Proxy resolver - <Written by Caleb Fontenot>")
|
||||
# ASCII Art because why not
|
||||
@ -74,13 +79,13 @@ except:
|
||||
print("Detected posix environment. Linux requires root privleges to open port 53")
|
||||
exit()
|
||||
#server.start_thread()
|
||||
|
||||
# Query upstream DoH server
|
||||
def DoTquery(domain, query_type):
|
||||
#response = pythonDoh.client.query(str(domain), type=str(query_type), server="calebfontenot.com", verbose=True, fallback=False)
|
||||
if args.r == True:
|
||||
if "nintendowifi.net." in str(domain):
|
||||
print(bcolors.FAIL+"Intercepted query!"+bcolors.RESET)
|
||||
return ["172.104.88.237"]
|
||||
else:
|
||||
q = dns.message.make_query(str(domain), str(query_type))
|
||||
response = dns.query.tls(q, "74.80.18.217", server_hostname="calebfontenot.com", port=853)
|
||||
print(response)
|
||||
|
Loading…
Reference in New Issue
Block a user