From 6a332a52a4ba028ba0ff297bc2c8a53301507daa Mon Sep 17 00:00:00 2001 From: "emdee@spm.plastiras.org" Date: Sun, 14 Jan 2024 16:05:47 +0000 Subject: [PATCH] add --- exclude_badExits.txt | 64 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 exclude_badExits.txt diff --git a/exclude_badExits.txt b/exclude_badExits.txt new file mode 100644 index 0000000..67ec8a1 --- /dev/null +++ b/exclude_badExits.txt @@ -0,0 +1,64 @@ +# -*-mode: doctest; tab-width: 0; py-indent-offset: 4; coding: utf-8-unix -*- + +== exclude_badExits testing == + +This is a Python doctest file that is executable documentation. + +exclude_badExits extends nusenu's basic idea of using the stem library to +dynamically exclude nodes that are likely to be bad by putting them +on the ExcludeNodes or ExcludeExitNodes setting of a running Tor. +* https://github.com/nusenu/noContactInfo_Exit_Excluder +* https://github.com/TheSmashy/TorExitRelayExclude + +The basic idea is to exclude Exit nodes that do not have ContactInfo: +* https://github.com/nusenu/ContactInfo-Information-Sharing-Specification + +That can be extended to relays that do not have an email in the contact, +or to relays that do not have ContactInfo that is verified to include them. + +Pass the controller password if needed as an environment variable: + + >>> import os + >>> assert os.environ['TOR_CONTROLLER_PASSWORD'] + +Add our code to the PYTHONPATH + + >>> import sys + >>> sys.path.append(os.path.join(os.getcwd(), 'src', 'exclude_badExits')) + +We'll need the settings defined in {{{/usr/local/etc/testforge/testforge.yml}}} + + >>> print("yaml", file=sys.stderr) + >>> import yaml + >>> sFacts = open('/usr/local/etc/testforge/testforge.yml').read() + >>> assert sFacts + >>> dFacts = yaml.safe_load(sFacts) + +FixMe: use the settings for the ports and directories below. + + >>> import os + >>> os.environ['http_proxy'] = 'http://'+dFacts['HTTP_PROXYHOST']+':'+str(dFacts['HTTP_PROXYPORT']) + >>> os.environ['https_proxy'] = 'http://'+dFacts['HTTPS_PROXYHOST']+':'+str(dFacts['HTTPS_PROXYPORT']) + >>> os.environ['socks_proxy'] = 'socks5://'+dFacts['SOCKS_PROXYHOST']+':'+str(dFacts['SOCKS_PROXYPORT']) + +Load the module: + + >>> print("exclude_badExits", file=sys.stderr) + >>> from exclude_badExits import exclude_badExits + >>> lArgs = ['--help'] + +Read the usage: + + >>> exclude_badExits.iMain(lArgs) + usage: ... + + +Torrc to check for suggestions: + >>> lArgs = ['--torrc', '/etc/tor/torrc-defaults'] + >>> exclude_badExits.iMain(lArgs) + +This may take a while: + + >>> lArgs = ['--proxy_ctl', '9051'] + >>> exclude_badExits.iMain(lArgs) + \ No newline at end of file