From 1a4db4ae79adf853728e1ddb4ff0f067bd36affe Mon Sep 17 00:00:00 2001 From: emdee Date: Thu, 7 Dec 2023 19:51:08 +0000 Subject: [PATCH] updates --- exclude_badExits.py | 16 ++-- exclude_badExits.txt | 2 +- support_onions.py | 170 ++++++++++++++++++++++++++++++++++++++----- 3 files changed, 160 insertions(+), 28 deletions(-) diff --git a/exclude_badExits.py b/exclude_badExits.py index 19d100e..e854ba2 100644 --- a/exclude_badExits.py +++ b/exclude_badExits.py @@ -100,6 +100,9 @@ Look in tor's notice.log for 'Every introduction point for service' ```notice_log``` will parse the notice log for warnings about relays and services that will then be whitelisted. +```--torrc``` will read a file like /etc/tor/torrc and make some +suggestions based on what it finds; it will not edit or change the file. + ```--torrc_output``` will write the torrc ExcludeNodes configuration to a file. ```--good_contacts``` will write the contact info as a ciiss dictionary @@ -140,9 +143,6 @@ To be "good" the ContactInfo must: ```--wellknown_output``` will make the program write the well-known files (```/.well-known/tor-relay/rsa-fingerprint.txt```) to a directory. -```--torrc_output``` will write a file of the commands that it sends to -the Tor controller, so you can include it in a ```/etc/toc/torrc```. - ```--relays_output write the download relays in json to a file. The relays are downloaded from https://onionoo.torproject.org/details @@ -618,7 +618,7 @@ def aParseContact(contact, fp): contact = contact.split(r'\n')[0] for elt in lMORONS: - contact = contact.replace(elt) + contact = contact.replace(elt, '') m = oCONTACT_RE.match(contact) # 450 matches! if m and m.groups and len(m.groups(0)) > 2 and m.span()[1] > 0: @@ -1301,7 +1301,7 @@ def iMain(lArgs): if 'EntryNodes' in aGOOD_NODES[sGOOD_ROOT].keys(): try: - LOG.info(f"{sINCLUDE_GUARD_KEY} {len(aGOOD_NODES[sGOOD_ROOT]['EntryNodes'])} guard nodes") + LOG.info(f"controller {sINCLUDE_GUARD_KEY} {len(aGOOD_NODES[sGOOD_ROOT]['EntryNodes'])} guard nodes") # FixMe for now override StrictNodes it may be unusable otherwise controller.set_conf(sINCLUDE_GUARD_KEY, aGOOD_NODES[sGOOD_ROOT]['EntryNodes']) @@ -1315,12 +1315,12 @@ def iMain(lArgs): controller.set_conf('StrictNodes', oargs.strict_nodes) cur = controller.get_conf('StrictNodes') if int(cur) != oargs.strict_nodes: - LOG.warn(f"OVERRIDING StrictNodes NOT {oargs.strict_nodes}") + LOG.warn(f"controller failed StrictNodes NOT {oargs.strict_nodes}") else: - LOG.info(f"OVERRODE StrictNodes to {oargs.strict_nodes}") + LOG.info(f"controller OVERRODE StrictNodes to {oargs.strict_nodes}") else: - LOG.info(f"StrictNodes is set to {cur}") + LOG.info(f"controller StrictNodes is set to {cur}") except KeyboardInterrupt: return 0 diff --git a/exclude_badExits.txt b/exclude_badExits.txt index 8e0b180..0f164ab 100644 --- a/exclude_badExits.txt +++ b/exclude_badExits.txt @@ -22,7 +22,7 @@ optional arguments: --proxy_host PROXY_HOST, --proxy-host PROXY_HOST proxy host --proxy_port PROXY_PORT, --proxy-port PROXY_PORT - proxy control port + proxy socks port --proxy_ctl PROXY_CTL, --proxy-ctl PROXY_CTL control socket - or port --torrc TORRC torrc to check for suggestions diff --git a/support_onions.py b/support_onions.py index abdc325..ba1d182 100644 --- a/support_onions.py +++ b/support_onions.py @@ -29,45 +29,177 @@ LOG = logging.getLogger() bHAVE_TORR = shutil.which('tor-resolve') +yKNOWN_ONIONS = """ + - facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd # facebook + - duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad # ddg + - zkaan2xfbuxia2wpf7ofnkbz6r5zdbbvxbunvp5g2iebopbfc4iqmbad # hks +""" +# grep -B 1 '