Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.comp.software.firefox > #18441 > unrolled thread
| Started by | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| First post | 2026-11-03 13:07 -0400 |
| Last post | 2026-11-10 16:16 -0400 |
| Articles | 19 — 5 participants |
Back to article view | Back to alt.comp.software.firefox
PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-03 13:07 -0400
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-04 12:48 -0400
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-07 23:08 -0400
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-07 23:58 -0400
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-08 03:45 -0400
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Simon <invalid@invalid.invalid> - 2026-11-08 04:00 +0000
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-08 02:13 -0400
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes "Carlos E.R." <robin_listas@es.invalid> - 2026-11-08 15:14 +0100
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-08 13:42 -0400
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes christian_acsf-ENTF@soemtron.de (Christian @Soemtron) - 2026-11-11 19:51 +0100
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Paul <nospam@needed.invalid> - 2026-11-08 04:22 -0500
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-08 13:14 -0400
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes "Carlos E.R." <robin_listas@es.invalid> - 2026-11-08 15:19 +0100
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-08 13:06 -0400
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-08 14:49 -0400
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-09 10:36 -0400
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-10 00:00 -0400
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-10 12:52 -0400
Re: PSA: Setting the Windows Firefox Tor browser to use USA exit nodes Maria Sophia <mariasophia@comprehension.com> - 2026-11-10 16:16 -0400
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-03 13:07 -0400 |
| Subject | PSA: Setting the Windows Firefox Tor browser to use USA exit nodes |
| Message-ID | <11cd4bm$2j2k$1@nnrp.usenet.blueworldhosting.com> |
PSA: Setting the Windows Firefox Tor browser to use USA exit nodes
More and more, email/social media/news sites balk at some Tor exit nodes.
So I set it to US exit nodes only.
But there was debugging necessary, so to help others, here's what I did.
The one step is to set this in the torrc file:
C:\> gvim "C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Data\Tor\torrc"
ExitNodes {us}
StrictNodes 1
But these were the (simplified) steps that worked:
1. Close tor browser & find & kill any and all related processes
C:\> tasklist | findstr /i "firefox tor"
C:\> taskkill /f /im tor.exe /im firefox.exe
2. Tor caches old routing paths and consensus lists.
Deleting these forces it to pull a fresh node list:
C:\> del "C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Data\Tor\cached-microdescs"
C:\> del "C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Data\Tor\cached-microdesc-consensus"
Note: I never use plurals, spaces, nor more than 8 character naming.
a. Software goes in: C:\software\browser\tor\.
b. Apps go in: C:\app\browser\tor\.
c. Menus go in: C:\menu\browser\tor\.
Everything after that, is put there by the developer.
3. Add the directive to exit from US nodes only to the torrc file:
C:\> gvim "C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Data\Tor\torrc"
ExitNodes {us}
StrictNodes 1
4. Test using debug mode (which only outputs to standard out):
C:\> "C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Tor\tor.exe" -f "C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Data\Tor\torrc" --Log "notice stdout"
5. Launch the tor browser normally:
"C:\app\browser\tor\Tor Browser\Start Tor Browser.lnk"
TARGET: "C:\app\browser\tor\Tor Browser\Browser\firefox.exe"
STARTIN: "C:\app\browser\tor\Tor Browser"
HINT: Write the location of the torrc file into the link comment
so the future you won't waste time looking for it to edit.
--
Just one person on Usenet paying it forward so all benefit daily.
[toc] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-04 12:48 -0400 |
| Message-ID | <11cfnkn$g6n$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #18441 |
Given the goal is to use one exit node, if possible, per social media web
site, I ran a search for potential USA exit nodes to use per web site.
<https://metrics.torproject.org/>
<https://metrics.torproject.org/rs.html#search>
<https://metrics.torproject.org/rs.html#search/country:us%20flag:exit>
Let's just take a few of them, by way of example for others to benefit.
<https://metrics.torproject.org/rs.html#details/688604204AF0C0473DFFA8CD2E186D1EEAEE6916>
Fingerprint $688604204AF0C0473DFFA8CD2E186D1EEAEE6916
<https://metrics.torproject.org/rs.html#details/B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C>
Fingerprint $B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C
<https://metrics.torproject.org/rs.html#details/BD610AAEAE179EC259B022A178A75C70042407FB>
Fingerprint $BD610AAEAE179EC259B022A178A75C70042407FB
<https://metrics.torproject.org/rs.html#details/9C7B1DB2C5520B21E181EB945A01E9ABA42654A2>
Fingerprint $9C7B1DB2C5520B21E181EB945A01E9ABA42654A2
This line allows the Tor browser to pick among those exit nodes.
ExitNodes $688604204AF0C0473DFFA8CD2E186D1EEAEE6916,$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C,$BD610AAEAE179EC259B022A178A75C70042407FB,$9C7B1DB2C5520B21E181EB945A01E9ABA42654A2
Unfortunately, the following flaws need to be overcome:
1. You can't trivially choose an exit node per web site
2. The exit nodes end up being random (the order listed doesn't matter)
3. If all of those exit nodes are down, it won't connect
3. If we add "us", it doesn't first prefer the listed fingerprinted nodes
ExitNodes {us},$688604204AF0C0473DFFA8CD2E186D1EEAEE6916,$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C,$BD610AAEAE179EC259B022A178A75C70042407FB,$9C7B1DB2C5520B21E181EB945A01E9ABA42654A2
I can write code to ask what web site I'm going to, and then insert
a given USA exit node into the torrc file, but has anyone done that?
--
I rarely fail at getting any computer program to do what I want it to do.
But sometimes a program is so un-customizable, that even I just give up.
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-07 23:08 -0400 |
| Message-ID | <11cop47$v07$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #18445 |
Maria Sophia wrote:
> I can write code to ask what web site I'm going to, and then insert
> a given USA exit node into the torrc file, but has anyone done that?
The goal:
1. We need an exit node that isn't on the shit list (e.g., Cloudflare)
2. In my experience, the USA nodes seem to be challenged fewer times
3. Yet, we don't want to associate Account A, B & C with each other
4. And certainly we don't want the website to know our real IP address
To add further value that will be useful to others, let's say we have
three web sites (or one web site with three profiles) and we want each
profile to be not only distinct in terms of IP address, but consistent
and, known to not be contentious in terms of being on the shit list.
Previously we employed two techniques which *manually* stabilized Tor.
A. gvim "C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Data\Tor\torrc"
ExitNodes {us}
StrictNodes 1
B. <https://metrics.torproject.org/rs.html#search/country:us%20flag:exit>
gvim "C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Data\Tor\torrc"
ExitNodes $6886...,$B8FA...,$BD61...,$9C7B...
The question becomes, always, how to improve the efficiency of that action.
There is no built-in mechanism that I know of, so I searched for code.
I found two potential tor-exit-node selection tools right off the bat.
Note both support Windows and Linux (I'm not sure about macOS per se).
1. Tor ExitNode Changer
<https://github.com/gmolop/Tor-ExitNode-changer>
It seems focused on selecting countries though, and not specific nodes.
a. It edits Tor's torrc
b. by changing the exit-node configuration
c. and then closes and relaunches Tor Browser
2. Tor Control Panel
<https://github.com/abysshint/tor-control-panel>
It seems to be a more sophisticated GUI for configuring tor sessions.
a. Choose relays located in a country (e.g., {us})
b. Choose relays based on the fingerprint (e.g., $A1B2C3...)
c. Choose relays by static IP address (e.g., 192.0.2.15)
d. Choose relays by dynamic CIDR mask (e.g., 192.0.2.0/24)
To obtain...
1. The Tor ExitNode Changer
Windows:
<https://github.com/gmolop/Tor-ExitNode-changer/blob/master/dist/tor_exitNode_changer.bat>
Linux:
<https://github.com/gmolop/Tor-ExitNode-changer/blob/master/dist/tor_exitNode_changer.sh>
2. The Tor Control Panel
Windows
<https://github.com/abysshint/tor-control-panel/releases/tag/v2.3.12.20>
<https://github.com/abysshint/tor-control-panel/releases/download/v2.3.12.20/tor-control-panel-2.3.12.20-win64.exe>
Name: tor-control-panel-2.3.12.20-win64.exe
Size: 12134773 bytes (11 MiB)
SHA256: D5A9A05318D6D99F85A6585A12FC324DB7ECBB8AACFC04E96CF56D481E7F076F
Analysis:
Suppose we have three accounts on the same website:
If we restrict each persona to a single tor exit node (or a CIDR set)
a. Account A always appears from IP 1.
b. Account B always appears from IP 2.
c. Account C always appears from IP 3.
This gives each account a consistent network identity.
Disadvantages?
a. The exit-node operator can potentially observe metadata such as
the destination IP address, connection timing, traffic volume, etc.
b. If an adversary can observe both ends of the connection, timing and
traffic-volume patterns can potentially be correlated.
c. Trust is concentrated in a single exit node per website persona
Have you ever used these tools to set the exit nodes on the fly?
Do you know of others that may work out well for most people?
--
Always seeking efficiency on computers, much like physics seeks entropy
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-07 23:58 -0400 |
| Message-ID | <11cos0e$1ag3$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #18447 |
Maria Sophia wrote:
> 1. The Tor ExitNode Changer
> Windows:
> <https://github.com/gmolop/Tor-ExitNode-changer/blob/master/dist/tor_exitNode_changer.bat>
> Linux:
> <https://github.com/gmolop/Tor-ExitNode-changer/blob/master/dist/tor_exitNode_changer.sh>
I tested the Windows version of the Tor ExitNode changer, where I was
pleasantly surprised to see this useful "pro tip" in the batch file:
<https://github.com/gmolop/Tor-ExitNode-changer/>
:: Pro Tip to pin a "batch" file shortcut to the Windows taskbar
:: copy the .bat file to a temporary .exe file of the same name
:: drag the exe to the taskbar to pin a shortcut to it on the taskbar
:: rename the taskbar target back to .bat on the now-pinned shorcut
:: delete the temporary exe copy and keep the original bat file
To install, even though I use Linux-style file paths in Windows such as
C:\app\browser\tor\.
all I did was put the tor_exitNode_changer script in the same folder
that already contained the torrc (which the tor shortcut points to).
C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Data\Tor\tor_exitNode_changer.bat
Note: Having learned computers on the UNIX/IBM/PDP/DEC/VAX/SunOS/Solaris/RedHat
side of the house, all my Windows paths are "linux like" in that they're all
lower case, 8 characters or fewer, never do I use plurals unless I must, etc.
Then I tapped the taskbar icon that I created using the "pro tip".
_____________________________________
Starting TOR with ExitNode Changer...
Setting up environment variables.....
done/
Creating a new instance of TOR.......
1 file(s) copied.
New instance of TOR created..........
done/
Searching current ExitNode value.....
done/
Creating support files...............
done/
Requesting new ExitNode value........
Then, an "ExitNodes" popup asked:
Enter ISO3166 country code:
https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
Default: us
[OK][Cancel]
When the Tor browser popped up, it had a USA exit node.
It was that easy to set the country code. I'm surprised.
I'm sure it works similarly on Linux using the shell script.
I looked for a Linux version of the more sophisticated GUI but
I didn't see one, but I did just now test the Windows GUI.
Windows
<https://github.com/abysshint/tor-control-panel/releases/tag/v2.3.12.20>
<https://github.com/abysshint/tor-control-panel/releases/download/v2.3.12.20/tor-control-panel-2.3.12.20-win64.exe>
Name: tor-control-panel-2.3.12.20-win64.exe
Size: 12134773 bytes (11 MiB)
SHA256: D5A9A05318D6D99F85A6585A12FC324DB7ECBB8AACFC04E96CF56D481E7F076F
After extracting to C:\tmp\TorControlPanel, I belatedly realized it's
just a simple self-extracting archive (so I didn't need c:\tmp).
12/20/2023 01:32 AM 40,007 Changelog.txt
11/07/2026 11:34 PM <DIR> Data
12/20/2023 02:10 AM 7,132 Defaults.ini
11/07/2026 11:34 PM <DIR> Licenses
11/07/2026 11:34 PM <DIR> Skins
11/07/2026 11:34 PM <DIR> Tor
12/20/2023 04:03 AM 6,081,536 TorControlPanel.exe
12/09/2023 09:06 AM 45,636 Translations.ini
Realizing that's what it was, I moved it into my linux-like program files
C:\app\browser\tor\
Tor Browser\
Browser\
TorBrowser\
Data\
Tor\
torrc
tor_exitNode_changer.bat
TorControlPanel\
TorControlPanel.exe
Defaults.ini
Changelog.txt
Data\
Licenses\
Skins\
Tor\
Translations.ini
Note that the crazy naming (case-specific & long with spaces) is not in
my control as all the files/folders I create are linux-like in simplicity.
And I put a shortcut to it in my C:\menu\browser\tor accordion menu.
C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Data\Tor\TorControlPanel\TorControlPanel.exe
And, of course, I pinned a shortcut to the exe on my taskbar
(where I add a custom comment in that pinned shortcut for the future me).
Tapping that black-shield icon, up popped "Tor Control Panel".
It comes up with a "Change Circuit" button and a "Start" button.
And a few others {Settings,Log,Status,Circuits,Relays,etc.}
The Settings are extensive, so this may take a while to configure.
General,Network,Filter,Server,Hidden Service,Lists,Other
Each of which is an entire page onto itself of various settings.
I clicked Start, since it was overwhelming the setup options.
It found an exit node, in Germany, which wasn't my intent.
So my assessment is this will likely work for the job, but it will
take some getting used to as the goal is the following from the start:
1. Have 3 accounts (either on one social media site, or multiple)
2. Find a reliable Tor exit node that isn't on the shit list
3. Since that's usually in the USA (IMHO), restrict to USA nodes
4. But, since we need to prevent overlap, let's pick specific USA nodes
Best is a set of nodes for profile1, another set for profile 2, etc.
That way, it looks "normal" to the social (or throwaway email) web site.
--
Every working example is someone paying forward a hard-learned lesson.
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-08 03:45 -0400 |
| Message-ID | <11cp9b1$f9s$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #18448 |
Maria Sophia wrote:
> Best is a set of nodes for profile1, another set for profile 2, etc.
> That way, it looks "normal" to the social (or throwaway email) web site.
I'm getting tired after investing a few hours fixing the problems with the
Firefox Tor browser when it comes to choosing exit nodes on the fly.
The code I hacked out below works on my Windows system, but if we want to
port it to Linux, we likely will have to port it to Python first.
The only reason it was written first in Powershell was that the initial
tests (version 1.0) used Powershell, and then it just grew from there.
Anyway, if the Firefox Tor browser is running, this will kill it and then
pop up a query for us to choose which exit nodes we want and then the
script will run the Firefox Tor browser using the selected exit nodes.
As far as I'm aware, this functionality doesn't exist on the net anywhere
but in this post as I didn't want to write it but I couldn't find it.
=== cut here for typical output ===
torset.bat
----------------------------------------
Tor exit node selector
----------------------------------------
1 for Profile 1 (two possible exit nodes)
2 for Profile 2 (one exit node)
3 for Profile 3 (one exit node)
Select profile [1,2,3] or Q to quit: 1
Setting Profile 1...
Ensuring clean state by stopping any existing Tor instances...
Tor Browser is not running. Starting Tor Browser automatically...
Waiting for Tor Browser to initialize and open ControlPort (9151)...
Tor Browser port is open.
Authentication: 250 OK
Waiting for Tor bootstrap to complete...
Tor bootstrap complete (100).
Exit configuration: 250 ExitNodes={US}
SETCONF response: 250 OK
NEWNYM response: 250 OK
New exit configuration: 250 ExitNodes=$688604204AF0C0473DFFA8CD2E186D1EEAEE6916,$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C
ExitNodes verification: Match
General-purpose circuits
-------------------------
Circuit: 8
Exit fingerprint: 634B891DAF74FB17C94C4AA73CB394CE6B2531F1
Profile comparison: Not in profile
Circuit: 18
Exit fingerprint: 688604204AF0C0473DFFA8CD2E186D1EEAEE6916
Profile comparison: Match
Circuit inspection complete.
Tor control session completed successfully.
torset completed successfully.
Press any key to continue . . .
=== cut here for typical output ===
:: ---------------------------------------------------------------------
:: torset.bat
:: Manually set known-good Tor exit nodes for specific web-login profiles
:: Should be ported to python so that it can be ported to Linux as needed
:: ---------------------------------------------------------------------
:: Usage notes:
:: 1. Obtain desired US Tor exit relays:
:: https://metrics.torproject.org/rs.html#search/country:us%20flag:exit
:: 2. Enter their fingerprints in the profile definitions below.
:: 3. Run this script. It cleans up stale sessions, starts Tor, and sets nodes.
:: 4. Allow Tor a bit of time to establish new circuits.
:: 5. Verify the exit relay and exit IP before logging in.
:: ---------------------------------------------------------------------
:: v2p4 20261108 Handled stale process cleanup cleanly in native batch
:: v2p3 20261108 Added automated cleanup of stale Tor/Firefox instances
:: v2p2 20261108 Added full bootstrap completion polling on cold start
:: v2p1 20261108 Fixed $tcp variable scope in try/finally block
:: v2p0 20261108 Added automated Tor Browser startup and port polling
:: v1p9 20261108 Added ControlPort error handling and response validation
:: v1p8 20261108 Cleaned up comments and clarified explanations
:: v1p7 20261108 Identify general-purpose ckts and compare exit fingerprints
:: v1p6 20261108 Display multi-line Tor circuit status via GETINFO
:: v1p5 20261108 Request new Tor circuits after profile selection
:: v1p4 20261108 Added multi-profile exit-node selection menu
:: v1p3 20261108 Set Profile 1 ExitNodes (two fingerprints) via SETCONF
:: v1p2 20261108 Added GETINFO status/bootstrap-phase
:: v1p1 20261108 Retrieve current ExitNodes configuration via GETCONF
:: v1p0 20261108 Tested Tor ControlPort via TCP cookie authentication
:: ---------------------------------------------------------------------
:: Summary:
:: 1. Stop any stale Tor Browser/Firefox instances for a clean start.
:: 2. Launch Tor Browser automatically if not running.
:: 3. Wait for Tor's ControlPort (9151) and 100% bootstrap completion.
:: 4. Connect to Tor's local ControlPort (9151).
:: 5. Authenticate using Tor's control_auth_cookie.
:: 6. Read the current ExitNodes configuration.
:: 7. Apply the selected profile's permitted exit fingerprints.
:: 8. Request new circuits using SIGNAL NEWNYM.
:: 9. Confirm the selected ExitNodes configuration.
:: 10. Check Tor's bootstrap status and inspect circuits.
::
:: Stop and report an error if a required operation fails.
:: This does not prove which circuit a particular website uses.
:: ---------------------------------------------------------------------
@echo off
:: Profile selection
echo ----------------------------------------
echo Tor exit node selector
echo ----------------------------------------
echo.
echo 1 for Profile 1 (two possible exit nodes)
echo 2 for Profile 2 (one exit node)
echo 3 for Profile 3 (one exit node)
echo.
choice /c 123Q /n /m "Select profile [1,2,3] or Q to quit: "
if errorlevel 4 exit /b
if errorlevel 3 goto profile3
if errorlevel 2 goto profile2
goto profile1
:profile1
set "PROFILE=Profile 1"
set "EXITNODES=$688604204AF0C0473DFFA8CD2E186D1EEAEE6916,$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C"
goto run
:profile2
set "PROFILE=Profile 2"
set "EXITNODES=$BD610AAEAE179EC259B022A178A75C70042407FB"
goto run
:profile3
set "PROFILE=Profile 3"
set "EXITNODES=$9C7B1DB2C5520B21E181EB945A01E9ABA42654A2"
goto run
:run
echo.
echo Setting %PROFILE%...
:: Clean up any existing stale Tor/Firefox instances first
echo Ensuring clean state by stopping any existing Tor instances...
taskkill /f /im firefox.exe >nul 2>&1
timeout /t 2 /nobreak >nul
:: begin powershell block, later to be converted to python
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
"$ErrorActionPreference = 'Stop'; ^
$tcp = $null; ^
try { ^
$path = 'C:\app\browser\tbb\Tor Browser\Browser\TorBrowser\Data\Tor\control_auth_cookie'; ^
$torExe = 'C:\app\browser\tbb\Tor Browser\Browser\firefox.exe'; ^
^
if (-not (Test-Path -LiteralPath $path -PathType Leaf)) { ^
Write-Host 'Tor Browser is not running. Starting Tor Browser automatically...'; ^
if (-not (Test-Path -LiteralPath $torExe)) { throw 'Tor Browser executable not found at: ' + $torExe }; ^
Start-Process -FilePath $torExe; ^
Write-Host 'Waiting for Tor Browser to initialize and open ControlPort (9151)...'; ^
$sw = [Diagnostics.Stopwatch]::StartNew(); ^
$ready = $false; ^
while ($sw.ElapsedMilliseconds -lt 45000) { ^
if (Test-Path -LiteralPath $path) { ^
try { ^
$testTcp = New-Object System.Net.Sockets.TcpClient; ^
$testTcp.Connect('127.0.0.1', 9151); ^
$testTcp.Close(); ^
$ready = $true; ^
break; ^
} catch { } ^
}; ^
Start-Sleep -Seconds 2; ^
}; ^
$sw.Stop(); ^
if (-not $ready) { throw 'Timed out waiting for Tor Browser to start and open ControlPort 9151.' }; ^
Write-Host 'Tor Browser port is open.'; ^
}; ^
^
if ([string]::IsNullOrWhiteSpace($env:EXITNODES)) { throw 'No exit nodes defined for this profile.' }; ^
$cookie = [BitConverter]::ToString([IO.File]::ReadAllBytes($path)).Replace('-', ''); ^
$tcp = New-Object System.Net.Sockets.TcpClient; ^
$tcp.ReceiveTimeout = 15000; ^
$tcp.SendTimeout = 15000; ^
$tcp.Connect('127.0.0.1', 9151); ^
$stream = $tcp.GetStream(); ^
$stream.ReadTimeout = 15000; ^
$writer = New-Object System.IO.StreamWriter($stream); ^
$reader = New-Object System.IO.StreamReader($stream); ^
$writer.NewLine = [char]13 + [char]10; ^
$writer.AutoFlush = $true; ^
^
function Read-TorReply { ^
$lines = New-Object 'System.Collections.Generic.List[string]'; ^
while ($true) { ^
$line = $reader.ReadLine(); ^
if ($null -eq $line) { throw 'Tor closed the ControlPort connection unexpectedly.' }; ^
[void]$lines.Add($line); ^
if ($line -match '^250\+') { ^
do { ^
$dataLine = $reader.ReadLine(); ^
if ($null -eq $dataLine) { throw 'Tor closed the connection during a data response.' }; ^
[void]$lines.Add($dataLine); ^
} while ($dataLine -ne '.'); ^
continue ^
}; ^
if ($line -match '^\d{3}-') { continue }; ^
break ^
}; ^
return $lines.ToArray() ^
}; ^
^
function Send-TorCommand($command) { ^
$writer.WriteLine($command); ^
$reply = @(Read-TorReply); ^
if ($reply.Count -eq 0 -or $reply[0] -notmatch '^250[ +\-]') { ^
throw ('Tor rejected command: ' + $command + ' -- ' + ($reply -join ' ')) ^
}; ^
return ,$reply ^
}; ^
^
$auth = Send-TorCommand ('AUTHENTICATE ' + $cookie); ^
Write-Host ('Authentication: ' + $auth[0]); ^
^
Write-Host 'Waiting for Tor bootstrap to complete...'; ^
$bootstrapComplete = $false; ^
$bSw = [Diagnostics.Stopwatch]::StartNew(); ^
while ($bSw.ElapsedMilliseconds -lt 60000) { ^
try { ^
$bootstrap = Send-TorCommand 'GETINFO status/bootstrap-phase'; ^
foreach ($line in $bootstrap) { ^
if ($line -match 'PROGRESS=100') { ^
$bootstrapComplete = $true; ^
break; ^
} ^
}; ^
if ($bootstrapComplete) { break }; ^
} catch { } ^
Start-Sleep -Seconds 2; ^
}; ^
$bSw.Stop(); ^
if (-not $bootstrapComplete) { throw 'Timed out waiting for Tor to finish bootstrapping.' }; ^
Write-Host 'Tor bootstrap complete (100%).'; ^
^
$config = Send-TorCommand 'GETCONF ExitNodes'; ^
Write-Host ('Exit configuration: ' + ($config -join ' ')); ^
$setconf = Send-TorCommand ('SETCONF ExitNodes=' + $env:EXITNODES); ^
Write-Host ('SETCONF response: ' + $setconf[-1]); ^
$newnym = Send-TorCommand 'SIGNAL NEWNYM'; ^
Write-Host ('NEWNYM response: ' + $newnym[-1]); ^
Start-Sleep -Seconds 3; ^
^
$config = Send-TorCommand 'GETCONF ExitNodes'; ^
Write-Host ('New exit configuration: ' + ($config -join ' ')); ^
$actualLine = $null; ^
foreach ($item in $config) { ^
if ($item -match '^250 ExitNodes=') { $actualLine = $item; break } ^
}; ^
if (-not $actualLine) { throw 'Could not verify the new ExitNodes configuration.' }; ^
^
$actualNodes = @(); ^
$actualText = $actualLine -replace '^250 ExitNodes=', ''; ^
foreach ($fp in ($actualText -split ',')) { ^
$actualNodes += $fp.Trim().TrimStart('$').ToUpperInvariant() ^
}; ^
^
$expectedNodes = @(); ^
foreach ($fp in ($env:EXITNODES -split ',')) { ^
$expectedNodes += $fp.Trim().TrimStart('$').ToUpperInvariant() ^
}; ^
if ($actualNodes.Count -ne $expectedNodes.Count) { throw 'ExitNodes verification failed: fingerprint count differs.' }; ^
foreach ($fp in $expectedNodes) { ^
if (-not ($actualNodes -contains $fp)) { throw ('ExitNodes verification failed: missing fingerprint ' + $fp) } ^
}; ^
Write-Host 'ExitNodes verification: Match'; ^
^
$allowed = @{}; ^
foreach ($fp in $expectedNodes) { ^
$allowed[$fp] = $true ^
}; ^
^
$circuitReply = Send-TorCommand 'GETINFO circuit-status'; ^
Write-Host ''; ^
Write-Host 'General-purpose circuits'; ^
Write-Host '-------------------------'; ^
$found = $false; ^
foreach ($line in $circuitReply) { ^
if ($line -notmatch '^\d+\s+BUILT\s+') { continue }; ^
if ($line -notmatch 'PURPOSE=GENERAL') { continue }; ^
$fields = $line -split '\s+'; ^
if ($fields.Count -lt 3) { continue }; ^
$hops = $fields[2] -split ','; ^
$last = ($hops[-1] -split '~')[0].TrimStart('$').ToUpperInvariant(); ^
$found = $true; ^
Write-Host ''; ^
Write-Host ('Circuit: ' + $fields[0]); ^
Write-Host ('Exit fingerprint: ' + $last); ^
if ($allowed.ContainsKey($last)) { ^
Write-Host 'Profile comparison: Match' ^
} else { ^
Write-Host 'Profile comparison: Not in profile' ^
}; ^
}; ^
if (-not $found) { ^
Write-Host 'No built general-purpose circuits found.' ^
}; ^
Write-Host ''; ^
Write-Host 'Circuit inspection complete.'; ^
Write-Host 'Tor control session completed successfully.'; ^
} catch { ^
Write-Host ''; ^
Write-Host ('Error: ' + $_.Exception.Message) -ForegroundColor Red; ^
exit 1 ^
} finally { ^
if ($tcp) { $tcp.Close() } ^
}"
:: end of powershell block
if errorlevel 1 (
echo.
echo torset did not complete successfully.
) else (
echo.
echo torset completed successfully.
)
pause
:: ---------------------------------------------------------------------
:: end of torset.bat
:: ---------------------------------------------------------------------
--
Usenet should be a discussion where everyone adds value to the topic.
[toc] | [prev] | [next] | [standalone]
| From | Simon <invalid@invalid.invalid> |
|---|---|
| Date | 2026-11-08 04:00 +0000 |
| Message-ID | <UySHS.511$v13.100@fx38.iad> |
| In reply to | #18447 |
On 08/11/2026 03:08, Maria Sophia wrote: > 1. We need an exit node that isn't on the shit list (e.g., Cloudflare) CloudFlare user here so not on my shit list. What do you think of this guy called Donald 'Duck' Trump? Do you like oven baked crisps? I eat them a lot with a 1/2 litre of coke per day and I never put on any weight either. How's life treating you Maria? What flavour of crisps do you eat when fucking around with Android phone? You spend all of your time on phone so how's Windows or Linux helping you? Are you still flashing your boobs in public with your Android phone in one hand? Your mate Russel Brand rapist is going for a very long prison sentence.
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-08 02:13 -0400 |
| Message-ID | <11cp3u7$1jej$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #18449 |
Maria Sophia wrote:
> So my assessment is this will likely work for the job, but it will
> take some getting used to as the goal is the following from the start:
UPDATE
My initial assessment is that those prior utilities, basically, suck.
1. "TOR with ExitNode Changer" is too simple (it only sets the country)
2. But the "TCP GUI" is far too complex (it has hundreds of settings!)
All I want is what I would think almost everyone would want, right?
a. When I log into Profile 1, use USA Tor exit node 192.0.2.10
b. When I log into Profile 1, use USA Tor exit node 192.0.2.20
c. When I log into Profile 1, use USA Tor exit node 192.0.2.30
As long as that exit node isn't on the cloudflare shit list,
it will seem normal to the web site (although they know exit nodes).
All we really need to do is change the fingerprint from A to B to C.
SETCONF ExitNodes=$FINGERPRINT_{A,B,C}
StrictExitNodes=1
SIGNAL NEWNYM
Looking to see if Tor Browser already exposes its ControlPort
A. I started the Tor browser
B. powershell Test-NetConnection 127.0.0.1 -Port 9151
C. That concluded Tor Browser was listening on TCP port 9151.
Then I checked for "control_auth_cookie", which was found in:
C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Data\Tor\.
Let's check that the OS can successfully read the cookie file
and that the OS can successfully calculate its SHA256 hash.
certutil -hashfile "control_auth_cookie" SHA256
=> SHA256 hash of control_auth_cookie:
=> 643REDACTEDe0a218f0
=> CertUtil: -hashfile command completed successfully.
Let's test ControlPort authentication using torset.bat
(See below for the torset.bat which can be converted to sh.)
torset.bat
=> Authentication: 250 OK
=> Exit configuration: 250 ExitNodes={US}
=> Bootstrap status: 250-status/bootstrap-phase=NOTICE BOOTSTRAP PROGRESS=100 TAG=done SUMMARY="Done"
=> Press any key to continue . . .
This means we can control & query Tor from the command line to find
a. v1p0 Authentication: 250 OK (authenticated successfully)
b. v1p1 Exit configuration: {US} (the existing US exit restriction is active)
c. v1p2 Bootstrap: PROGRESS=100 (Tor is fully connected to the network)
We can now check whether Tor is connected before choosing exit nodes.
Let's re-use {us} fingerprints that we already found in this thread:
<https://metrics.torproject.org/>
<https://metrics.torproject.org/rs.html#search>
<https://metrics.torproject.org/rs.html#search/country:us%20flag:exit>
Profile1 $688604204AF0C0473DFFA8CD2E186D1EEAEE6916
Profile1 $B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C
Profile2 $BD610AAEAE179EC259B022A178A75C70042407FB
Profile3 $9C7B1DB2C5520B21E181EB945A01E9ABA42654A2
OK. Long story short, after an hour or two, this is a working script.
Note it can be ported to Linux using Python so the concept works for all.
:: ---------------------------------------------------------------------
:: torset.bat
:: Manually set known-good Tor exit nodes for specific web-login profiles
:: ---------------------------------------------------------------------
:: Usage notes:
:: 1. Manually obtain a set of desired known-good US Tor exit relays:
:: https://metrics.torproject.org/rs.html#search/country:us%20flag:exit
:: 2. Enter the desired fingerprints in the profile definitions below
:: 3. Start Tor Browser, and click the [Connect] button if necessary
:: 4. Run this script and select the desired profile
:: 5. Wait for Tor to establish new circuits before browsing
:: 6. Verify the actual exit relay and exit IP before logging in
:: Later I will remove the need to start the Tor browser first
:: ---------------------------------------------------------------------
:: v1p6 20261108 Display multi-line Tor circuit status via GETINFO
:: v1p5 20261108 Request new Tor circuits after profile selection
:: v1p4 20261108 Added multi-profile exit-node selection menu
:: v1p3 20261108 Set Profile 1 ExitNodes (two fingerprints) via SETCONF
:: v1p2 20261108 Added GETINFO status/bootstrap-phase
:: v1p1 20261108 Retrieve current ExitNodes configuration via GETCONF
:: v1p0 20261108 Tested Tor ControlPort via TCP cookie authentication
:: ---------------------------------------------------------------------
:: Summary of what this script does
:: 1. CONNECT
:: Open a TCP connection to Tor's local ControlPort (9151).
:: 2. AUTHENTICATE
:: Read Tor's control_auth_cookie and authenticate with Tor.
:: 3. INSPECT CONFIGURATION
:: Retrieve the currently configured ExitNodes fingerprints.
:: 4. APPLY PROFILE
:: Set ExitNodes to the fingerprints assigned to the selected
:: web-login profile.
:: 5. REQUEST NEW CIRCUITS
:: Send SIGNAL NEWNYM to request fresh Tor circuits.
:: 6. VERIFY CONFIGURATION
:: Read ExitNodes again to confirm the selected configuration.
:: 7. CHECK BOOTSTRAP
:: Retrieve Tor's bootstrap status.
:: 8. INSPECT CIRCUITS
:: Retrieve Tor's circuit-status information.
:: 9. IDENTIFY GENERAL-PURPOSE EXITS
:: Examine BUILT GENERAL circuits and identify their final relay.
:: 10. REPORT RESULTS
:: Compare the reported exit fingerprints with the selected
:: profile's permitted exit fingerprints.
::
:: ExitNodes configuration does not prove that a particular website
:: connection is using a particular exit relay. That will be added.
:: ---------------------------------------------------------------------
@echo off
:: Begin selection menu
echo ----------------------------------------
echo TOR EXIT NODE SELECTOR
echo ----------------------------------------
echo.
echo 1 for Profile 1 (two possible exit nodes)
echo 2 for Profile 2 (one exit node)
echo 3 for Profile 3 (one exit node)
echo.
choice /c 123Q /n /m "Select profile [1,2,3] or Q to quit: "
if errorlevel 4 exit /b
if errorlevel 3 goto profile3
if errorlevel 2 goto profile2
goto profile1
:profile1
set "PROFILE=Profile 1"
set "EXITNODES=$688604204AF0C0473DFFA8CD2E186D1EEAEE6916,$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C"
goto run
:profile2
set "PROFILE=Profile 2"
set "EXITNODES=$BD610AAEAE179EC259B022A178A75C70042407FB"
goto run
:profile3
set "PROFILE=Profile 3"
set "EXITNODES=$9C7B1DB2C5520B21E181EB945A01E9ABA42654A2"
goto run
:run
echo.
echo Setting %PROFILE%...
:: End selection menu
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
"$path = 'C:\app\browser\tbb\Tor Browser\Browser\TorBrowser\Data\Tor\control_auth_cookie'; ^
$cookie = [BitConverter]::ToString([IO.File]::ReadAllBytes($path)).Replace('-', ''); ^
$tcp = New-Object System.Net.Sockets.TcpClient; ^
$tcp.Connect('127.0.0.1', 9151); ^
$stream = $tcp.GetStream(); ^
$writer = New-Object System.IO.StreamWriter($stream); ^
$reader = New-Object System.IO.StreamReader($stream); ^
$writer.NewLine = [char]13 + [char]10; ^
$writer.AutoFlush = $true; ^
$writer.WriteLine('AUTHENTICATE ' + $cookie); ^
$auth = $reader.ReadLine(); ^
Write-Host ('Authentication: ' + $auth); ^
$writer.WriteLine('GETCONF ExitNodes'); ^
$config = $reader.ReadLine(); ^
Write-Host ('Exit configuration: ' + $config); ^
$writer.WriteLine('SETCONF ExitNodes=' + $env:EXITNODES); ^
$setconf = $reader.ReadLine(); ^
Write-Host ('SETCONF response: ' + $setconf); ^
$writer.WriteLine('SIGNAL NEWNYM'); ^
$newnym = $reader.ReadLine(); ^
Write-Host ('NEWNYM response: ' + $newnym); ^
$writer.WriteLine('GETCONF ExitNodes'); ^
$config = $reader.ReadLine(); ^
Write-Host ('New exit configuration: ' + $config); ^
$writer.WriteLine('GETINFO status/bootstrap-phase'); ^
do { $bootstrap = $reader.ReadLine(); ^
if ($bootstrap -ne '250 OK') { Write-Host ('Bootstrap status: ' + $bootstrap) } ^
} while ($bootstrap -ne '250 OK'); ^
$writer.WriteLine('GETINFO circuit-status'); ^
do { $circuit = $reader.ReadLine(); ^
if ($circuit -ne '250 OK') { Write-Host ('Circuit: ' + $circuit) } ^
} while ($circuit -ne '250 OK'); ^
$tcp.Close()"
pause
:: ---------------------------------------------------------------------
:: end of torset.bat
:: ---------------------------------------------------------------------
--
Posted out of the goodness of my heart to kindly help others do what I can.
[toc] | [prev] | [next] | [standalone]
| From | "Carlos E.R." <robin_listas@es.invalid> |
|---|---|
| Date | 2026-11-08 15:14 +0100 |
| Message-ID | <nnc6smx42p.ln2@Telcontar.valinor> |
| In reply to | #18450 |
On 2026-11-08 07:13, Maria Sophia wrote: > Maria Sophia wrote: >> So my assessment is this will likely work for the job, but it will >> take some getting used to as the goal is the following from the start: > > UPDATE > > My initial assessment is that those prior utilities, basically, suck. > 1. "TOR with ExitNode Changer" is too simple (it only sets the country) > 2. But the "TCP GUI" is far too complex (it has hundreds of settings!) Arlen, please don't post a serious reply to what is a trolling or humorous post by somebody else. Reason be, that it is possible that we have killed the subthread and will not see your post. -- Cheers, Carlos. ES🇪🇸, EU🇪🇺;
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-08 13:42 -0400 |
| Message-ID | <11cqcau$2v06$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #18454 |
Carlos E.R. wrote:
> please don't post a serious reply to what is a trolling or
> humorous post by somebody else. Reason be, that it is possible that we
> have killed the subthread and will not see your post.
Hi Carlos,
That's an interesting point where my home-baked newsreader (which we
started on the linux newsgroups with Marek Novotny, decades ago) doesn't
have the capability of "killing a subthread", so that's good to know.
I started with Larry Wall's rn and Kim Storm's nn and Wayne Davison's trn
before I decided to write my own newsreader, which is currently mojibake.
As for a "serious reply" to the trolls, I invest many hours in my posts,
e.g., it took about four hours of concentrated work to solve this issue.
When the uneducated trolls infest a serious thread, it bothers me, perhaps
more than it bothers most people who invest only a few seconds per article.
Anyway, your point is well taken, where I will seriously note that what we
solved in this thread is we fixed a few huge gaping holes in the Firefox
Tor setup ease of use, which, AFAIK, doesn't exist anywhere else but here.
What I did was take Firefox Tor flaws into my own hands, resulting in
a tested "torset.bat" script, which does the following that is useful:
:: ---------------------------------------------------------------------
:: Summary:
:: 1. Present a multi-profile selection menu allowing the user to choose
:: between predefined exit-node configurations (or quit with Q).
:: 2. Terminate any stale or running instances of Firefox Tor Browser
:: to ensure a clean starting environment.
:: 3. Launch the Firefox Tor Browser executable automatically if it is
:: not currently running on the system.
:: 4. Poll local TCP port 9151 and monitor for the existence of Tor's
:: control authentication cookie file.
:: 5. Open a local TCP socket connection to Tor's ControlPort
:: (127.0.0.1:9151) once it becomes available.
:: 6. Authenticate the control session securely using the binary bytes
:: read from Tor's local control_auth_cookie.
:: 7. Poll Tor's bootstrap status via GETINFO until the bootstrap-phase
:: reports 100% completion.
:: 8. Apply the user's selected profile fingerprints to Tor's configuration
:: using the SETCONF ExitNodes command.
:: 9. Issue a SIGNAL NEWNYM command to force Tor to discard old circuits
:: and build new ones using the designated exit nodes.
:: 10. Verify that the active ExitNodes configuration matches the expected
:: profile fingerprints.
:: 11. Query active circuits (GETINFO circuit-status), parse their exit node
:: fingerprints and compare them against the profile whitelist.
:: 12. Output clear verification results to the user console and pause
:: before exiting, leaving the configured browser ready for secure use.
:: ---------------------------------------------------------------------
:: Sample output:
::
:: ----------------------------------------
:: Tor exit node selector
:: ----------------------------------------
::
:: 1 for Profile 1
:: 2 for Profile 2
:: 3 for Profile 3
::
:: Select profile [1,2,3] or Q to quit: 3
::
:: Setting Profile 3...
:: Ensuring clean state by stopping any existing Tor instances...
:: Tor Browser is not running. Starting Tor Browser automatically...
:: Waiting for Tor Browser to initialize and open ControlPort (9151)...
:: Tor Browser port is open.
:: Authentication: 250 OK
:: Waiting for Tor bootstrap to complete...
:: Tor bootstrap complete (100).
:: Exit configuration: 250 ExitNodes={US}
:: SETCONF response: 250 OK
:: NEWNYM response: 250 OK
:: New exit configuration: 250 ExitNodes=$4FA9...,$29A4...
:: ExitNodes verification: Match
::
:: General-purpose circuits
:: -------------------------
::
:: Circuit: 23
:: Exit fingerprint: 4FA9...
:: Profile comparison: Match
::
:: Circuit: 22
:: Exit fingerprint: 29A4...
:: Profile comparison: Match
::
:: Circuit: 7
:: Exit fingerprint: 1B30...
:: Profile comparison: Not in profile
::
:: Circuit: 8
:: Exit fingerprint: C5B5...
:: Profile comparison: Not in profile
::
:: Circuit inspection complete.
:: Tor control session completed successfully.
::
:: torset completed successfully.
:: Press any key to continue . . .
:: --------------------------------------------------------------------
--
On Usenet, we improve our knowledge by sharing & discussing solutions.
[toc] | [prev] | [next] | [standalone]
| From | christian_acsf-ENTF@soemtron.de (Christian @Soemtron) |
|---|---|
| Date | 2026-11-11 19:51 +0100 |
| Message-ID | <H$e-1benVaB@point04.soemtron.de> |
| In reply to | #18450 |
Maria Sophia <mariasophia@comprehension.com> wrote:
> [ControlPort]
> This means we can control & query Tor from the command line to find
Yes but IIRC this doesn't affect the running Torbrowser. That's why I
gave up the ControlPort-thing and patch torrc before start (if needed):
set tor_path=%programfiles%\Tor Browser\Browser
set cnf=%tor_path%\TorBrowser\Data\Tor\torrc
copy "%cnf%" "%cnf%.tmp"
echo # >> "%cnf%"
echo ExitNodes {de} StrictNodes 1 >> "%cnf%"
cd "%tor_path%"
firefox.exe
%windir%\system32\ping.exe 127.0.0.1 -n 4
move /Y "%cnf%.tmp" "%cnf%"
It's a pity that Torbrowser is such limited. It should have a GUI for
that, also for switching circuits to get access to problem-sites,
sometimes after hundreds of tries. (bahn.de is the biggest problem here)
And even more a pity, that the number of (many) TOR-IPs-blocking sites
seems increasing.
I still use 13.5.28, because it's the last I found for Win7. Is there
some user-friendly development since then?
cu,
Christian
PGP Key available.
[toc] | [prev] | [next] | [standalone]
| From | Paul <nospam@needed.invalid> |
|---|---|
| Date | 2026-11-08 04:22 -0500 |
| Message-ID | <11cpf1g$6dnb$1@dont-email.me> |
| In reply to | #18449 |
On Sat, 11/7/2026 11:00 PM, Simon wrote:
> On 08/11/2026 03:08, Maria Sophia wrote:
>> 1. We need an exit node that isn't on the shit list (e.g., Cloudflare)
>
> Do you like oven baked crisps? I eat them a lot with a 1/2 litre of coke
> per day and I never put on any weight either.
I have a Python script that will optimize those crisps
so they are golden brown. Do you apply the catsup to
the crisps ? Or is this an occasion for some gravy ?
We have the gravy when it is poutine. If you want to
put some weight on, try poutine. It's addictive stuff.
You'll have to find someone who knows how to make
it properly, as an amateur job renders it as mush,
and it doesn't have to be like that. The person promoting
this at work, liked unpasturized cheese curds with his.
You can see in this picture, it's well defined, the
elements are separate. If you get it at a place
that doesn't care, it arrives as so much mush. If you
use a national fast food shop version of it, it's mush.
https://en.wikipedia.org/wiki/Poutine
"Others that followed used inferior cheese and the dish's reputation declined.
Poutine was largely perceived as an unsophisticated backwoods creation or
unhealthy junk food[16][10] to be consumed after a night of drinking."
On the contrary, we was sober.
I'm sure the saturated and trans fat in that, is off the charts :-)
When you put on weight, the blame is squarely on the coke.
It couldn't be the gravy.
Paul
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-08 13:14 -0400 |
| Message-ID | <11cqamd$2aub$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #18452 |
Paul wrote: > On the contrary, we was sober. Hi Paul, You recently mentioned one reason I have so many files on my circa 2009 desktop was because of all the python files, but I think it's because of the versions more so than the actual final files, since I save them all. Directory of C:\data\sys\bat\ff\tor 11/08/2026 03:45 AM 11,236 torset.bat 11/08/2026 12:39 AM 1,302 torset.bat_v1p0.txt 11/08/2026 12:47 AM 1,497 torset.bat_v1p1.txt 11/08/2026 12:58 AM 1,695 torset.bat_v1p2.txt 11/08/2026 01:09 AM 2,120 torset.bat_v1p3.txt 11/08/2026 01:19 AM 2,952 torset.bat_v1p4.txt 11/08/2026 01:23 AM 3,138 torset.bat_v1p5.txt 11/08/2026 02:23 AM 5,480 torset.bat_v1p6.txt 11/08/2026 02:47 AM 5,958 torset.bat_v1p7.txt 11/08/2026 02:52 AM 6,002 torset.bat_v1p8.txt 11/08/2026 03:12 AM 8,339 torset.bat_v1p9.txt 11/08/2026 03:18 AM 9,109 torset.bat_v2p0.txt 11/08/2026 03:25 AM 9,200 torset.bat_v2p1.txt 11/08/2026 03:30 AM 9,170 torset.bat_v2p2.txt 11/08/2026 03:32 AM 11,452 torset.bat_v2p3.txt 11/08/2026 03:44 AM 11,372 torset.bat_v2p4.txt 11/08/2026 04:21 AM 12,216 torset.bat_v2p5.txt Looking at the time stamps, it seems I invested about 4 hours fixing the Firefox Tor browser inability to easily set exits. I always wonder if it would have been more fruitful to have invested the same 4 hours in finding software that works. But one advantage of DIY is I learned too much that I didn't even want to know, about how complicated the FF Tor browser is. -- On Usenet, we improve our knowledge by sharing & discussing solutions.
[toc] | [prev] | [next] | [standalone]
| From | "Carlos E.R." <robin_listas@es.invalid> |
|---|---|
| Date | 2026-11-08 15:19 +0100 |
| Message-ID | <10d6smx42p.ln2@Telcontar.valinor> |
| In reply to | #18447 |
On 2026-11-08 04:08, Maria Sophia wrote: > Maria Sophia wrote: >> I can write code to ask what web site I'm going to, and then insert >> a given USA exit node into the torrc file, but has anyone done that? > > The goal: > 1. We need an exit node that isn't on the shit list (e.g., Cloudflare) > 2. In my experience, the USA nodes seem to be challenged fewer times > 3. Yet, we don't want to associate Account A, B & C with each other > 4. And certainly we don't want the website to know our real IP address I have, manually, set the exit country to one of my liking (or a list of countries). I have not used any script. Reason? I am visiting a site that will only reply properly if they see me coming from their own country or their own language zone. I could just as well use a VPN, I have no reason to hide my tracks. It works. I have no desire to choose a certain exit node. -- Cheers, Carlos. ES🇪🇸, EU🇪🇺;
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-08 13:06 -0400 |
| Message-ID | <11cqa6e$155m$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #18453 |
Carlos E.R. wrote: >> The goal: >> 1. We need an exit node that isn't on the shit list (e.g., Cloudflare) >> 2. In my experience, the USA nodes seem to be challenged fewer times >> 3. Yet, we don't want to associate Account A, B & C with each other >> 4. And certainly we don't want the website to know our real IP address > > I have, manually, set the exit country to one of my liking (or a list of > countries). I have not used any script. > > Reason? > > I am visiting a site that will only reply properly if they see me coming > from their own country or their own language zone. I could just as well > use a VPN, I have no reason to hide my tracks. > > It works. > > I have no desire to choose a certain exit node. Hi Carlos, Thank you for adding useful value & perspicuity to this FF Tor thread. Like you, until now, I also had no desire to set even a country, let alone an exit node, but when the web site doesn't like it, we have to fix that. We're all adding value to the newsgroup, which, in this thread is we're adding value to the tribal knowledge on setting Tor Browser exit nodes. a. by country b. by fingerprint In my almost two decades of using the Tor browser (e.g., to log into Protonmail accounts), I let the browser pick and choose exit nodes. Only recently have I run into the kind of exit-node-specific challenges that you seem to be also running into where the country code solved it. In my case, the country code *also* solved the problem, so we're both claiming the same solution seems to work for us in our use models. I started off, in a sophomoric attempt, of setting the country code in th Firefox Tor browser torrc file, but, unfortunately, manual setup sucks. If people don't know why it sucks, fundamentally the torrc file is overwritten every time, so it can't keep any comments that you make. And I add comments since I was trained as a programmer in the 1960s. As you know, in this thread, I sought out software that will *more easily* set the country code (and exit nodes) than editing the torrc file does. I found it for the team! For country codes anyway. Works on Linux/Windows. Windows: <https://github.com/gmolop/Tor-ExitNode-changer/blob/master/dist/tor_exitNode_changer.bat> Linux: <https://github.com/gmolop/Tor-ExitNode-changer/blob/master/dist/tor_exitNode_changer.sh> Since you're on Linux, it would be great if you can test that for the team. As for me, it worked fine in my test, but I wanted even more functionality. I wanted to be able to choose a set of static exit nodes, and use only that static set of exit nodes, and I couldn't find software to do that. You'd think it would be easy to find software that does that, but I gave up after only a few searches so that functionality may already exist. I think the best way to port it to Linux would be to first port it to Python, and then to port that to Linux, but I can't test it out. PS: The classic Snowden response to someone claiming "I have no reason to hide my tracks" so why should anyone else, probably might be simply to ask you to publish your email password, which will lend veracity to your claim. If you truly have no reason to "hide your tracks", then certainly you will tell us, without apprehension, your daily drive email address & password. However, if you do not immediately publish your email address and password, we will accept that as tacit admission some things should stay private. -- We all strive to add privacy that marketing doesn't want us to have.
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-08 14:49 -0400 |
| Message-ID | <11cqg7d$2ml3$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #18441 |
#!/usr/bin/env python3
# ---------------------------------------------------------------------
# torset.py
# Manually set known-good Tor exit nodes for specific web-login profiles
# ---------------------------------------------------------------------
# Usage notes:
# 1. Obtain desired US Tor exit relays:
# https://metrics.torproject.org/rs.html#search/country:us%20flag:exit
# For example:
# "$688604204AF0C0473DFFA8CD2E186D1EEAEE6916"
# "$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C"
# "$BD610AAEAE179EC259B022A178A75C70042407FB",
# "$9C7B1DB2C5520B21E181EB945A01E9ABA42654A2",
# 2. Enter desired fingerprints in the profile definitions, e.g.,
# Profile 1
# "$688604204AF0C0473DFFA8CD2E186D1EEAEE6916"
# "$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C"
# Profile 2
# "$BD610AAEAE179EC259B022A178A75C70042407FB",
# Profile 3
# "$9C7B1DB2C5520B21E181EB945A01E9ABA42654A2",
# 3. Run this script, which cleans stale sessions before starting
# Tor and allowing the user the choice of setting exit nodes
# 4. Allow Tor a bit of time to establish new circuits
# 5. Verify the exit relay and exit IP before logging in
# ---------------------------------------------------------------------
# v2p8 20261108 Reverted profile exit nodes back to original configurations
# v2p7 20261108 Converted native batch/PowerShell implementation to pure Python
# v2p6 20261108 Improved documentation block details and accuracy
# v2p5 20261108 Added new exit nodes and a profile configuration check
# v2p4 20261108 Handled stale process cleanup cleanly in native batch
# v2p3 20261108 Added automated cleanup of stale Tor/Firefox instances
# v2p2 20261108 Added full bootstrap completion polling on cold start
# v2p1 20261108 Fixed $tcp variable scope in try/finally block
# v2p0 20261108 Added automated Tor Browser startup and port polling
# v1p9 20261108 Added ControlPort error handling and response validation
# v1p8 20261108 Cleaned up comments and clarified explanations
# v1p7 20261108 Identify general-purpose ckts and compare exit fingerprints
# v1p6 20261108 Display multi-line Tor circuit status via GETINFO
# v1p5 20261108 Request new Tor circuits after profile selection
# v1p4 20261108 Added multi-profile exit-node selection menu
# v1p3 20261108 Set Profile 1 ExitNodes (two fingerprints) via SETCONF
# v1p2 20261108 Added GETINFO status/bootstrap-phase
# v1p1 20261108 Retrieve current ExitNodes configuration via GETCONF
# v1p0 20261108 Tested Tor ControlPort via TCP cookie authentication
# ---------------------------------------------------------------------
# Summary:
# 1. Present a multi-profile selection menu allowing the user to choose
# between predefined exit-node configurations (or quit with Q).
# 2. Terminate any stale or running instances of Firefox Tor Browser
# to ensure a clean starting environment.
# 3. Launch the Firefox Tor Browser executable automatically if it is
# not currently running on the system.
# 4. Poll local TCP port 9151 and monitor for the existence of Tor's
# control authentication cookie file.
# 5. Open a local TCP socket connection to Tor's ControlPort
# (127.0.0.1:9151) once it becomes available.
# 6. Authenticate the control session securely using the binary bytes
# read from Tor's local control_auth_cookie.
# 7. Poll Tor's bootstrap status via GETINFO until the bootstrap-phase
# reports 100% completion.
# 8. Apply the user's selected profile fingerprints to Tor's configuration
# using the SETCONF ExitNodes command.
# 9. Issue a SIGNAL NEWNYM command to force Tor to discard old circuits
# and build new ones using the designated exit nodes.
# 10. Verify that the active ExitNodes configuration matches the expected
# profile fingerprints.
# 11. Query active circuits (GETINFO circuit-status), parse their exit node
# fingerprints and compare them against the profile whitelist.
# 12. Output clear verification results to the user console and pause
# before exiting, leaving the configured browser ready for secure use.
# ---------------------------------------------------------------------
import os
import socket
import subprocess
import sys
import time
from pathlib import Path
# --- Configuration & Paths ---
COOKIE_PATH = Path(
r"C:\app\browser\tbb\Tor Browser\Browser\TorBrowser\Data\Tor\control_auth_cookie"
)
TOR_EXE = Path(r"C:\app\browser\tbb\Tor Browser\Browser\firefox.exe")
CONTROL_PORT = 9151
# Define selectable profiles with your original exit node fingerprints
PROFILES = {
"1": {
"name": "Profile 1",
"exit_nodes": (
"$688604204AF0C0473DFFA8CD2E186D1EEAEE6916,"
"$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C"
),
},
"2": {
"name": "Profile 2",
"exit_nodes": "$BD610AAEAE179EC259B022A178A75C70042407FB",
},
"3": {
"name": "Profile 3",
"exit_nodes": "$9C7B1DB2C5520B21E181EB945A01E9ABA42654A2",
},
}
def main():
# Step 1: Profile Selection Menu
print("----------------------------------------")
print(" Tor exit node selector ")
print("----------------------------------------")
print()
print(" 1 for Profile 1")
print(" 2 for Profile 2")
print(" 3 for Profile 3")
print(" Q to Quit")
print()
choice = input("Select profile [1,2,3] or Q to quit: ").strip().upper()
if choice == "Q" or choice not in PROFILES:
print("Exiting.")
sys.exit(0)
profile = PROFILES[choice]
print(f"\nSetting {profile['name']}...")
# Step 2: Clean up any stale or running Tor/Firefox instances
print("Ensuring clean state by stopping any existing Tor instances...")
try:
subprocess.run(
["taskkill", "/f", "/im", "firefox.exe"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
except Exception:
pass
time.sleep(2)
# Steps 3 & 4: Launch browser if needed and wait for ControlPort & cookie
if not COOKIE_PATH.is_file():
print("Tor Browser is not running. Starting Tor Browser automatically...")
if not TOR_EXE.is_file():
print(f"ERROR: Tor Browser executable not found at: {TOR_EXE}")
sys.exit(1)
subprocess.Popen([str(TOR_EXE)])
print("Waiting for Tor Browser to initialize and open ControlPort (9151)...")
start_time = time.time()
ready = False
while time.time() - start_time < 45:
if COOKIE_PATH.is_file():
try:
test_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
test_sock.settimeout(2)
test_sock.connect(("127.0.0.1", CONTROL_PORT))
test_sock.close()
ready = True
break
except (socket.error, OSError):
pass
time.sleep(2)
if not ready:
print(
"ERROR: Timed out waiting for Tor Browser to start and open ControlPort"
" 9151."
)
sys.exit(1)
print("Tor Browser port is open.")
# Step 6: Read authentication cookie bytes
try:
cookie_bytes = COOKIE_PATH.read_bytes()
cookie_hex = cookie_bytes.hex().upper()
except Exception as e:
print(f"ERROR: Failed to read control authentication cookie: {e}")
sys.exit(1)
# Helper functions for Tor Control Protocol
def read_tor_reply(sock_file):
lines = []
while True:
line = sock_file.readline()
if not line:
raise RuntimeError("Tor closed the ControlPort connection unexpectedly.")
decoded = line.decode("utf-8", errors="ignore").rstrip("\r\n")
lines.append(decoded)
if decoded.startswith("250+"):
while True:
data_line = sock_file.readline()
if not data_line:
raise RuntimeError(
"Tor closed the connection during a data response."
)
d_decoded = data_line.decode("utf-8", errors="ignore").rstrip(
"\r\n"
)
lines.append(d_decoded)
if d_decoded == ".":
break
continue
if len(decoded) >= 4 and decoded[3] == "-":
continue
break
return lines
def send_command(sock_file, command):
sock_file.write((command + "\r\n").encode("utf-8"))
sock_file.flush()
reply = read_tor_reply(sock_file)
if not reply or not reply[0].startswith("250"):
raise RuntimeError(f"Tor rejected command: {command} -- {' '.join(reply)}")
return reply
# Step 5: Connect to ControlPort
stream = None
s = None
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(15)
s.connect(("127.0.0.1", CONTROL_PORT))
stream = s.makefile("rwb")
# Authenticate session
auth_reply = send_command(stream, f"AUTHENTICATE {cookie_hex}")
print(f"Authentication: {auth_reply[0]}")
# Step 7: Wait for Tor bootstrap completion (100%)
print("Waiting for Tor bootstrap to complete...")
bootstrap_complete = False
b_start = time.time()
while time.time() - b_start < 60:
try:
bootstrap_reply = send_command(stream, "GETINFO status/bootstrap-phase")
for line in bootstrap_reply:
if "PROGRESS=100" in line:
bootstrap_complete = True
break
if bootstrap_complete:
break
except Exception:
pass
time.sleep(2)
if not bootstrap_complete:
raise RuntimeError("Timed out waiting for Tor to finish bootstrapping.")
print("Tor bootstrap complete (100%).")
# Step 8: Apply selected profile ExitNodes via SETCONF
config_reply = send_command(stream, "GETCONF ExitNodes")
print(f"Exit configuration: {' '.join(config_reply)}")
setconf_reply = send_command(
stream, f"SETCONF ExitNodes={profile['exit_nodes']}"
)
print(f"SETCONF response: {setconf_reply[-1]}")
# Step 9: Signal NEWNYM to clear circuits and build new ones
newnym_reply = send_command(stream, "SIGNAL NEWNYM")
print(f"NEWNYM response: {newnym_reply[-1]}")
time.sleep(3)
# Step 10: Verify new ExitNodes configuration matches expected
config_reply = send_command(stream, "GETCONF ExitNodes")
print(f"New exit configuration: {' '.join(config_reply)}")
actual_line = None
for item in config_reply:
if item.startswith("250 ExitNodes="):
actual_line = item
break
if not actual_line:
raise RuntimeError("Could not verify the new ExitNodes configuration.")
actual_text = actual_line.replace("250 ExitNodes=", "")
actual_nodes = [
fp.strip().lstrip("$").upper() for fp in actual_text.split(",") if fp
]
expected_nodes = [
fp.strip().lstrip("$").upper()
for fp in profile["exit_nodes"].split(",")
if fp
]
if set(actual_nodes) != set(expected_nodes):
raise RuntimeError("ExitNodes verification failed: fingerprint mismatch.")
print("ExitNodes verification: Match")
allowed = {fp: True for fp in expected_nodes}
# Step 11: Inspect circuit-status and compare exit fingerprints
circuit_reply = send_command(stream, "GETINFO circuit-status")
print("\nGeneral-purpose circuits")
print("-------------------------")
found = False
for line in circuit_reply:
if "BUILT" not in line or "PURPOSE=GENERAL" not in line:
continue
fields = line.split()
if len(fields) < 3:
continue
circuit_id = fields[0]
hops = fields[2].split(",")
last_hop = hops[-1].split("~")[0].lstrip("$").upper()
found = True
print(f"\nCircuit: {circuit_id}")
print(f"Exit fingerprint: {last_hop}")
if last_hop in allowed:
print("Profile comparison: Match")
else:
print("Profile comparison: Not in profile")
if not found:
print("No built general-purpose circuits found.")
print("\nCircuit inspection complete.")
print("Tor control session completed successfully.")
except Exception as e:
print(f"\nError: {e}", file=sys.stderr)
sys.exit(1)
finally:
if stream:
try:
stream.close()
except Exception:
pass
if s:
try:
s.close()
except Exception:
pass
# Step 12: Output final success message and pause before exit
print("\ntorset completed successfully.")
input("Press Enter to continue . . . ")
if __name__ == "__main__":
main()
# ---------------------------------------------------------------------
# end of torset.py
# ---------------------------------------------------------------------
--
Every working example is someone paying forward a hard-learned lesson.
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-09 10:36 -0400 |
| Message-ID | <11cslog$2dq5$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #18441 |
Maria Sophia wrote:
> PSA: Setting the Windows Firefox Tor browser to use USA exit nodes
Below is portable code that should work on all the major platforms
(Linux/macOS/Windows) to choose per-profile FF Tor browser exit nodes.
I started this project five effort-hours ago assuming it would only
take a few minutes, so I used PowerShell at first, but to leverage
the effort to as many people as possible, which I am won't to do,
I expended another hour to port to Python and then to all platforms.
I tested the code below ONLY on Windows 10, so if someone can test
it on macOS and/or Linux, that would be very useful for the community.
Everything we do, is for everyone to benefit from.
That's how we're wired.
#!/usr/bin/env python3
# ---------------------------------------------------------------------
# torset.py
# Manually set known-good Tor exit nodes for specific web-login profiles
# ---------------------------------------------------------------------
# Usage notes:
# 1. Obtain a set of desired known-to-be-working US Tor exit relays:
# https://metrics.torproject.org/rs.html#search/country:us%20flag:exit
# For example:
# "$688604204AF0C0473DFFA8CD2E186D1EEAEE6916"
# "$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C"
# "$BD610AAEAE179EC259B022A178A75C70042407FB"
# "$9C7B1DB2C5520B21E181EB945A01E9ABA42654A2"
# 2. Enter their fingerprints in the profile definitions, e.g.,
# Profile 1 (gmail)
# "$688604204AF0C0473DFFA8CD2E186D1EEAEE6916"
# "$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C"
# Profile 2 (protonmail)
# "$BD610AAEAE179EC259B022A178A75C70042407FB"
# Profile 3 (facebook)
# "$9C7B1DB2C5520B21E181EB945A01E9ABA42654A2"
# 3. Run this script, which cleans stale sessions before starting
# Tor and then provides a choice of pre-selected exit nodes
# Note: Due to Firefox Tor browser complexities, allow Tor a bit of
# time to establish new circuits and then make sure to manually
# verify the exit relay and exit IP before logging in
# ---------------------------------------------------------------------
# v2p9 20261109 Added sys.platform support for macOS and Linux paths
# v2p8 20261109 Reverted profile exit nodes back to original configurations
# v2p7 20261108 Converted native batch/PowerShell implementation to Python
# v2p6 20261108 Improved documentation in terms of technical accuracy
# v2p5 20261108 Added new exit nodes and a profile configuration check
# v2p4 20261108 Handled stale process cleanup cleanly in native batch
# v2p3 20261108 Added automated cleanup of stale Tor/Firefox instances
# v2p2 20261108 Added full bootstrap completion polling on cold start
# v2p1 20261108 Fixed $tcp variable scope in try/finally block
# v2p0 20261108 Added automated Tor Browser startup and port polling
# v1p9 20261108 Added ControlPort error handling and response validation
# v1p8 20261108 Cleaned up comments and clarified explanations
# v1p7 20261108 Identify general-purpose ckts and compare exit fingerprints
# v1p6 20261108 Display multi-line Tor circuit status via GETINFO
# v1p5 20261108 Request new Tor circuits after profile selection
# v1p4 20261108 Added multi-profile exit-node selection menu
# v1p3 20261108 Set Profile 1 ExitNodes (two fingerprints) via SETCONF
# v1p2 20261108 Added GETINFO status/bootstrap-phase
# v1p1 20261108 Retrieve current ExitNodes configuration via GETCONF
# v1p0 20261108 Tested Tor ControlPort via TCP cookie authentication
# ---------------------------------------------------------------------
# See also...
# Forces a new working Tor exit node:
# <https://github.com/gmolop/Tor-ExitNode-changer/>
# <https://github.com/hevnsnt/IPChanger>
# <https://gist.github.com/kirelagin/9667900>
# Interacts with Tor using the Python stem library:
# <https://pypi.org/project/stem/> <https://stem.torproject.org/>
# <https://github.com/torproject/stem>
# Command-line Tor interaction and Nyx monitor:
# <https://nyx.torproject.org/> <https://github.com/torproject/nyx>
# Configures Tor using a GUI (Windows only):
# <https://github.com/abysshint/tor-control-panel/>
# ---------------------------------------------------------------------
# Summary:
# 1. Present a multi-profile selection menu allowing the user to choose
# between predefined exit-node configurations (or quit with Q).
# 2. Terminate any stale or running instances of Firefox Tor Browser
# to ensure a clean starting environment.
# 3. Launch the Firefox Tor Browser executable automatically if it is
# not currently running on the system.
# 4. Poll local TCP port 9151 and monitor for the existence of Tor's
# control authentication cookie file.
# 5. Open a local TCP socket connection to Tor's ControlPort
# (127.0.0.1:9151) once it becomes available.
# 6. Authenticate the control session securely using the binary bytes
# read from Tor's local control_auth_cookie.
# 7. Poll Tor's bootstrap status via GETINFO until the bootstrap-phase
# reports 100% completion.
# 8. Apply the user's selected profile fingerprints to Tor's configuration
# using the SETCONF ExitNodes command.
# 9. Issue a SIGNAL NEWNYM command to force Tor to discard old circuits
# and build new ones using the designated exit nodes.
# 10. Verify that the active ExitNodes configuration matches the expected
# profile fingerprints.
# 11. Query active circuits (GETINFO circuit-status), parse their exit node
# fingerprints and compare them against the profile whitelist.
# 12. Output clear verification results to the user console and pause
# before exiting, leaving the configured browser ready for secure use.
# ---------------------------------------------------------------------
import os
import socket
import subprocess
import sys
import time
from pathlib import Path
# --- Configuration & Cross-Platform Paths ---
if sys.platform == "win32":
COOKIE_PATH = Path(
r"C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Data\Tor\control_auth_cookie"
)
TOR_EXE = Path(r"C:\app\browser\tor\Tor Browser\Browser\firefox.exe")
KILL_CMD = ["taskkill", "/f", "/im", "firefox.exe"]
elif sys.platform == "darwin": # macOS
TOR_EXE = Path.home() / "Applications" / "TorBrowser.app" / "Contents" / "MacOS" / "firefox"
if not TOR_EXE.is_file():
TOR_EXE = Path("/Applications/TorBrowser.app/Contents/MacOS/firefox")
COOKIE_PATH = Path.home() / "Library" / "Application Support" / "TorBrowser-Data" / "Tor" / "control_auth_cookie"
KILL_CMD = ["pkill", "-f", "torbrowser"]
else: # Linux and other Unix-likes
base_linux = Path.home() / ".local" / "share" / "torbrowser" / "tor" / "x86_64" / "tor-browser"
TOR_EXE = base_linux / "Browser" / "firefox"
COOKIE_PATH = base_linux / "Browser" / "TorBrowser" / "Data" / "Tor" / "control_auth_cookie"
KILL_CMD = ["pkill", "-f", "tor-browser"]
CONTROL_PORT = 9151
# Define selectable profiles with your original exit node fingerprints
PROFILES = {
"1": {
"name": "Profile 1",
"exit_nodes": (
"$688604204AF0C0473DFFA8CD2E186D1EEAEE6916,"
"$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C"
),
},
"2": {
"name": "Profile 2",
"exit_nodes": "$BD610AAEAE179EC259B022A178A75C70042407FB",
},
"3": {
"name": "Profile 3",
"exit_nodes": "$9C7B1DB2C5520B21E181EB945A01E9ABA42654A2",
},
}
def main():
# Step 1: Profile Selection Menu
print("----------------------------------------")
print(" Tor exit node selector ")
print("----------------------------------------")
print()
print(" 1 for Profile 1")
print(" 2 for Profile 2")
print(" 3 for Profile 3")
print(" Q to Quit")
print()
choice = input("Select profile [1,2,3] or Q to quit: ").strip().upper()
if choice == "Q" or choice not in PROFILES:
print("Exiting.")
sys.exit(0)
profile = PROFILES[choice]
print(f"\nSetting {profile['name']}...")
# Step 2: Clean up any stale or running Tor/Firefox instances
print("Ensuring clean state by stopping any existing Tor instances...")
try:
subprocess.run(
KILL_CMD,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
except Exception:
pass
time.sleep(2)
# Steps 3 & 4: Launch browser if needed and wait for ControlPort & cookie
if not COOKIE_PATH.is_file():
print("Tor Browser is not running. Starting Tor Browser automatically...")
if not TOR_EXE.is_file():
print(f"ERROR: Tor Browser executable not found at: {TOR_EXE}")
sys.exit(1)
subprocess.Popen([str(TOR_EXE)])
print("Waiting for Tor Browser to initialize and open ControlPort (9151)...")
start_time = time.time()
ready = False
while time.time() - start_time < 45:
if COOKIE_PATH.is_file():
try:
test_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
test_sock.settimeout(2)
test_sock.connect(("127.0.0.1", CONTROL_PORT))
test_sock.close()
ready = True
break
except (socket.error, OSError):
pass
time.sleep(2)
if not ready:
print(
"ERROR: Timed out waiting for Tor Browser to start and open ControlPort"
" 9151."
)
sys.exit(1)
print("Tor Browser port is open.")
# Step 6: Read authentication cookie bytes
try:
cookie_bytes = COOKIE_PATH.read_bytes()
cookie_hex = cookie_bytes.hex().upper()
except Exception as e:
print(f"ERROR: Failed to read control authentication cookie: {e}")
sys.exit(1)
# Helper functions for Tor Control Protocol
def read_tor_reply(sock_file):
lines = []
while True:
line = sock_file.readline()
if not line:
raise RuntimeError("Tor closed the ControlPort connection unexpectedly.")
decoded = line.decode("utf-8", errors="ignore").rstrip("\r\n")
lines.append(decoded)
if decoded.startswith("250+"):
while True:
data_line = sock_file.readline()
if not data_line:
raise RuntimeError(
"Tor closed the connection during a data response."
)
d_decoded = data_line.decode("utf-8", errors="ignore").rstrip(
"\r\n"
)
lines.append(d_decoded)
if d_decoded == ".":
break
continue
if len(decoded) >= 4 and decoded[3] == "-":
continue
break
return lines
def send_command(sock_file, command):
sock_file.write((command + "\r\n").encode("utf-8"))
sock_file.flush()
reply = read_tor_reply(sock_file)
if not reply or not reply[0].startswith("250"):
raise RuntimeError(f"Tor rejected command: {command} -- {' '.join(reply)}")
return reply
# Step 5: Connect to ControlPort
stream = None
s = None
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(15)
s.connect(("127.0.0.1", CONTROL_PORT))
stream = s.makefile("rwb")
# Authenticate session
auth_reply = send_command(stream, f"AUTHENTICATE {cookie_hex}")
print(f"Authentication: {auth_reply[0]}")
# Step 7: Wait for Tor bootstrap completion (100%)
print("Waiting for Tor bootstrap to complete...")
bootstrap_complete = False
b_start = time.time()
while time.time() - b_start < 60:
try:
bootstrap_reply = send_command(stream, "GETINFO status/bootstrap-phase")
for line in bootstrap_reply:
if "PROGRESS=100" in line:
bootstrap_complete = True
break
if bootstrap_complete:
break
except Exception:
pass
time.sleep(2)
if not bootstrap_complete:
raise RuntimeError("Timed out waiting for Tor to finish bootstrapping.")
print("Tor bootstrap complete (100%).")
# Step 8: Apply selected profile ExitNodes via SETCONF
config_reply = send_command(stream, "GETCONF ExitNodes")
print(f"Exit configuration: {' '.join(config_reply)}")
setconf_reply = send_command(
stream, f"SETCONF ExitNodes={profile['exit_nodes']}"
)
print(f"SETCONF response: {setconf_reply[-1]}")
# Step 9: Signal NEWNYM to clear circuits and build new ones
newnym_reply = send_command(stream, "SIGNAL NEWNYM")
print(f"NEWNYM response: {newnym_reply[-1]}")
time.sleep(3)
# Step 10: Verify new ExitNodes configuration matches expected
config_reply = send_command(stream, "GETCONF ExitNodes")
print(f"New exit configuration: {' '.join(config_reply)}")
actual_line = None
for item in config_reply:
if item.startswith("250 ExitNodes="):
actual_line = item
break
if not actual_line:
raise RuntimeError("Could not verify the new ExitNodes configuration.")
actual_text = actual_line.replace("250 ExitNodes=", "")
actual_nodes = [
fp.strip().lstrip("$").upper() for fp in actual_text.split(",") if fp
]
expected_nodes = [
fp.strip().lstrip("$").upper()
for fp in profile["exit_nodes"].split(",")
if fp
]
if set(actual_nodes) != set(expected_nodes):
raise RuntimeError("ExitNodes verification failed: fingerprint mismatch.")
print("ExitNodes verification: Match")
allowed = {fp: True for fp in expected_nodes}
# Step 11: Inspect circuit-status and compare exit fingerprints
circuit_reply = send_command(stream, "GETINFO circuit-status")
print("\nGeneral-purpose circuits")
print("-------------------------")
found = False
for line in circuit_reply:
if "BUILT" not in line or "PURPOSE=GENERAL" not in line:
continue
fields = line.split()
if len(fields) < 3:
continue
circuit_id = fields[0]
hops = fields[2].split(",")
last_hop = hops[-1].split("~")[0].lstrip("$").upper()
found = True
print(f"\nCircuit: {circuit_id}")
print(f"Exit fingerprint: {last_hop}")
if last_hop in allowed:
print("Profile comparison: Match")
else:
print("Profile comparison: Not in profile")
if not found:
print("No built general-purpose circuits found.")
print("\nCircuit inspection complete.")
print("Tor control session completed successfully.")
except Exception as e:
print(f"\nError: {e}", file=sys.stderr)
sys.exit(1)
finally:
if stream:
try:
stream.close()
except Exception:
pass
if s:
try:
s.close()
except Exception:
pass
# Step 12: Output final success message and pause before exit
print("\ntorset completed successfully.")
input("Press Enter to continue . . . ")
if __name__ == "__main__":
main()
# ---------------------------------------------------------------------
# end of torset.py
# ---------------------------------------------------------------------
--
On Usenet, a good suggestion can make everyone's solution a little better.
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-10 00:00 -0400 |
| Message-ID | <11cu4s3$15vj$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #18465 |
Lawrence D'Oliveiro wrote:
>> try:
>>
>> ...
>>
>> except Exception as e:
>> print(f"\nError: {e}", file=sys.stderr)
>> sys.exit(1)
>> finally:
>> if stream:
>> try:
>> stream.close()
>> except Exception:
>> pass
>> if s:
>> try:
>> s.close()
>> except Exception:
>> pass
>
> Get rid of that enclosing try-block.
Hi Lawrence,
Ah. Perfect! Thanks for pointing out that flaw.
You're the first person to add value on the Python side!
Good catch! You're right.
Dropping that outer try/except/finally block cleans things up tidily.
I goofed. Mea culpa.
Removing the extra wrapper makes the script both more idiomatic & concise.
Much appreciated, as the goal is two fold:
a. Edify everyone
b. Improve the tools so everyone can use them
I love when someone who knows what they're doing points out a flaw
in my thinking as my whole mind, body and soul is about collaboration!
Thanks!
Here's the update.
Let us know if it works on the Linux/macOS side of the house 'cuz
I don't have those platforms, so it's written w/o benefit of testing.
#!/usr/bin/env python3
# ---------------------------------------------------------------------
# torset.py
# Manually set known-good Tor exit nodes for specific web-login profiles
# ---------------------------------------------------------------------
# Usage notes:
# 1. Obtain a set of desired known-to-be-working US Tor exit relays:
# https://metrics.torproject.org/rs.html#search/country:us%20flag:exit
# For example:
# "$688604204AF0C0473DFFA8CD2E186D1EEAEE6916"
# "$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C"
# "$BD610AAEAE179EC259B022A178A75C70042407FB"
# "$9C7B1DB2C5520B21E181EB945A01E9ABA42654A2"
# 2. Enter their fingerprints in the profile definitions, e.g.,
# Profile 1 (gmail)
# "$688604204AF0C0473DFFA8CD2E186D1EEAEE6916"
# "$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C"
# Profile 2 (protonmail)
# "$BD610AAEAE179EC259B022A178A75C70042407FB"
# Profile 3 (facebook)
# "$9C7B1DB2C5520B21E181EB945A01E9ABA42654A2"
# 3. Run this script, which cleans stale sessions before starting
# Tor and then provides a choice of pre-selected exit nodes
# Note: Due to Firefox Tor browser complexities, allow Tor a bit of
# time to establish new circuits and then make sure to manually
# verify the exit relay and exit IP before logging in
# ---------------------------------------------------------------------
# v3p0 20261109 Replaced socket/stream cleanup with Python context managers
# v2p9 20261109 Added sys.platform support for macOS and Linux paths
# v2p8 20261109 Reverted profile exit nodes back to original configurations
# v2p7 20261108 Converted native batch/PowerShell implementation to Python
# v2p6 20261108 Improved documentation in terms of technical accuracy
# v2p5 20261108 Added new exit nodes and a profile configuration check
# v2p4 20261108 Handled stale process cleanup cleanly in native batch
# v2p3 20261108 Added automated cleanup of stale Tor/Firefox instances
# v2p2 20261108 Added full bootstrap completion polling on cold start
# v2p1 20261108 Fixed $tcp variable scope in try/finally block
# v2p0 20261108 Added automated Tor Browser startup and port polling
# v1p9 20261108 Added ControlPort error handling and response validation
# v1p8 20261108 Cleaned up comments and clarified explanations
# v1p7 20261108 Identify general-purpose ckts and compare exit fingerprints
# v1p6 20261108 Display multi-line Tor circuit status via GETINFO
# v1p5 20261108 Request new Tor circuits after profile selection
# v1p4 20261108 Added multi-profile exit-node selection menu
# v1p3 20261108 Set Profile 1 ExitNodes (two fingerprints) via SETCONF
# v1p2 20261108 Added GETINFO status/bootstrap-phase
# v1p1 20261108 Retrieve current ExitNodes configuration via GETCONF
# v1p0 20261108 Tested Tor ControlPort via TCP cookie authentication
# ---------------------------------------------------------------------
# See also...
# Forces a new working Tor exit node:
# <https://github.com/gmolop/Tor-ExitNode-changer/>
# <https://github.com/hevnsnt/IPChanger>
# <https://gist.github.com/kirelagin/9667900>
# Interacts with Tor using the Python stem library:
# <https://pypi.org/project/stem/> <https://stem.torproject.org/>
# <https://github.com/torproject/stem>
# Command-line Tor interaction and Nyx monitor:
# <https://nyx.torproject.org/> <https://github.com/torproject/nyx>
# Configures Tor using a GUI (Windows only):
# <https://github.com/abysshint/tor-control-panel/>
# ---------------------------------------------------------------------
# Summary:
# 1. Present a multi-profile selection menu allowing the user to choose
# between predefined exit-node configurations (or quit with Q).
# 2. Terminate any stale or running instances of Firefox Tor Browser
# to ensure a clean starting environment.
# 3. Launch the Firefox Tor Browser executable automatically if it is
# not currently running on the system.
# 4. Poll local TCP port 9151 and monitor for the existence of Tor's
# control authentication cookie file.
# 5. Open a local TCP socket connection to Tor's ControlPort
# (127.0.0.1:9151) once it becomes available.
# 6. Authenticate the control session securely using the binary bytes
# read from Tor's local control_auth_cookie.
# 7. Poll Tor's bootstrap status via GETINFO until the bootstrap-phase
# reports 100% completion.
# 8. Apply the user's selected profile fingerprints to Tor's configuration
# using the SETCONF ExitNodes command.
# 9. Issue a SIGNAL NEWNYM command to force Tor to discard old circuits
# and build new ones using the designated exit nodes.
# 10. Verify that the active ExitNodes configuration matches the expected
# profile fingerprints.
# 11. Query active circuits (GETINFO circuit-status), parse their exit node
# fingerprints and compare them against the profile whitelist.
# 12. Output clear verification results to the user console and pause
# before exiting, leaving the configured browser ready for secure use.
# ---------------------------------------------------------------------
import os
import socket
import subprocess
import sys
import time
from pathlib import Path
# --- Configuration & Cross-Platform Paths ---
if sys.platform == "win32":
COOKIE_PATH = Path(
r"C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Data\Tor\control_auth_cookie"
)
TOR_EXE = Path(r"C:\app\browser\tor\Tor Browser\Browser\firefox.exe")
KILL_CMD = ["taskkill", "/f", "/im", "firefox.exe"]
elif sys.platform == "darwin": # macOS
TOR_EXE = Path.home() / "Applications" / "TorBrowser.app" / "Contents" / "MacOS" / "firefox"
if not TOR_EXE.is_file():
TOR_EXE = Path("/Applications/TorBrowser.app/Contents/MacOS/firefox")
COOKIE_PATH = Path.home() / "Library" / "Application Support" / "TorBrowser-Data" / "Tor" / "control_auth_cookie"
KILL_CMD = ["pkill", "-f", "torbrowser"]
else: # Linux and other Unix-likes
base_linux = Path.home() / ".local" / "share" / "torbrowser" / "tor" / "x86_64" / "tor-browser"
TOR_EXE = base_linux / "Browser" / "firefox"
COOKIE_PATH = base_linux / "Browser" / "TorBrowser" / "Data" / "Tor" / "control_auth_cookie"
KILL_CMD = ["pkill", "-f", "tor-browser"]
CONTROL_PORT = 9151
# Define selectable profiles with your original exit node fingerprints
PROFILES = {
"1": {
"name": "Profile 1",
"exit_nodes": (
"$688604204AF0C0473DFFA8CD2E186D1EEAEE6916,"
"$B8FA90A8B7DA9B90A09AA04CD2E81E263AA8DA4C"
),
},
"2": {
"name": "Profile 2",
"exit_nodes": "$BD610AAEAE179EC259B022A178A75C70042407FB",
},
"3": {
"name": "Profile 3",
"exit_nodes": "$9C7B1DB2C5520B21E181EB945A01E9ABA42654A2",
},
}
def main():
# Step 1: Profile Selection Menu
print("----------------------------------------")
print(" Tor exit node selector ")
print("----------------------------------------")
print()
print(" 1 for Profile 1")
print(" 2 for Profile 2")
print(" 3 for Profile 3")
print(" Q to Quit")
print()
choice = input("Select profile [1,2,3] or Q to quit: ").strip().upper()
if choice == "Q" or choice not in PROFILES:
print("Exiting.")
sys.exit(0)
profile = PROFILES[choice]
print(f"\nSetting {profile['name']}...")
# Step 2: Clean up any stale or running Tor/Firefox instances
print("Ensuring clean state by stopping any existing Tor instances...")
try:
subprocess.run(
KILL_CMD,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
except Exception:
pass
time.sleep(2)
# Steps 3 & 4: Launch browser if needed and wait for ControlPort & cookie
if not COOKIE_PATH.is_file():
print("Tor Browser is not running. Starting Tor Browser automatically...")
if not TOR_EXE.is_file():
print(f"ERROR: Tor Browser executable not found at: {TOR_EXE}")
sys.exit(1)
subprocess.Popen([str(TOR_EXE)])
print("Waiting for Tor Browser to initialize and open ControlPort (9151)...")
start_time = time.time()
ready = False
while time.time() - start_time < 45:
if COOKIE_PATH.is_file():
try:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as test_sock:
test_sock.settimeout(2)
test_sock.connect(("127.0.0.1", CONTROL_PORT))
ready = True
break
except (socket.error, OSError):
pass
time.sleep(2)
if not ready:
print(
"ERROR: Timed out waiting for Tor Browser to start and open ControlPort"
" 9151."
)
sys.exit(1)
print("Tor Browser port is open.")
# Step 6: Read authentication cookie bytes
try:
cookie_bytes = COOKIE_PATH.read_bytes()
cookie_hex = cookie_bytes.hex().upper()
except Exception as e:
print(f"ERROR: Failed to read control authentication cookie: {e}")
sys.exit(1)
# Helper functions for Tor Control Protocol
def read_tor_reply(sock_file):
lines = []
while True:
line = sock_file.readline()
if not line:
raise RuntimeError("Tor closed the ControlPort connection unexpectedly.")
decoded = line.decode("utf-8", errors="ignore").rstrip("\r\n")
lines.append(decoded)
if decoded.startswith("250+"):
while True:
data_line = sock_file.readline()
if not data_line:
raise RuntimeError(
"Tor closed the connection during a data response."
)
d_decoded = data_line.decode("utf-8", errors="ignore").rstrip(
"\r\n"
)
lines.append(d_decoded)
if d_decoded == ".":
break
continue
if len(decoded) >= 4 and decoded[3] == "-":
continue
break
return lines
def send_command(sock_file, command):
sock_file.write((command + "\r\n").encode("utf-8"))
sock_file.flush()
reply = read_tor_reply(sock_file)
if not reply or not reply[0].startswith("250"):
raise RuntimeError(f"Tor rejected command: {command} -- {' '.join(reply)}")
return reply
# Step 5: Connect to ControlPort using context managers (incorporating Lawrence's feedback)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.settimeout(15)
s.connect(("127.0.0.1", CONTROL_PORT))
with s.makefile("rwb") as stream:
# Authenticate session
auth_reply = send_command(stream, f"AUTHENTICATE {cookie_hex}")
print(f"Authentication: {auth_reply[0]}")
# Step 7: Wait for Tor bootstrap completion (100%)
print("Waiting for Tor bootstrap to complete...")
bootstrap_complete = False
b_start = time.time()
while time.time() - b_start < 60:
try:
bootstrap_reply = send_command(stream, "GETINFO status/bootstrap-phase")
for line in bootstrap_reply:
if "PROGRESS=100" in line:
bootstrap_complete = True
break
if bootstrap_complete:
break
except Exception:
pass
time.sleep(2)
if not bootstrap_complete:
raise RuntimeError("Timed out waiting for Tor to finish bootstrapping.")
print("Tor bootstrap complete (100%).")
# Step 8: Apply selected profile ExitNodes via SETCONF
config_reply = send_command(stream, "GETCONF ExitNodes")
print(f"Exit configuration: {' '.join(config_reply)}")
setconf_reply = send_command(
stream, f"SETCONF ExitNodes={profile['exit_nodes']}"
)
print(f"SETCONF response: {setconf_reply[-1]}")
# Step 9: Signal NEWNYM to clear circuits and build new ones
newnym_reply = send_command(stream, "SIGNAL NEWNYM")
print(f"NEWNYM response: {newnym_reply[-1]}")
time.sleep(3)
# Step 10: Verify new ExitNodes configuration matches expected
config_reply = send_command(stream, "GETCONF ExitNodes")
print(f"New exit configuration: {' '.join(config_reply)}")
actual_line = None
for item in config_reply:
if item.startswith("250 ExitNodes="):
actual_line = item
break
if not actual_line:
raise RuntimeError("Could not verify the new ExitNodes configuration.")
actual_text = actual_line.replace("250 ExitNodes=", "")
actual_nodes = [
fp.strip().lstrip("$").upper() for fp in actual_text.split(",") if fp
]
expected_nodes = [
fp.strip().lstrip("$").upper()
for fp in profile["exit_nodes"].split(",")
if fp
]
if set(actual_nodes) != set(expected_nodes):
raise RuntimeError("ExitNodes verification failed: fingerprint mismatch.")
print("ExitNodes verification: Match")
allowed = {fp: True for fp in expected_nodes}
# Step 11: Inspect circuit-status and compare exit fingerprints
circuit_reply = send_command(stream, "GETINFO circuit-status")
print("\nGeneral-purpose circuits")
print("-------------------------")
found = False
for line in circuit_reply:
if "BUILT" not in line or "PURPOSE=GENERAL" not in line:
continue
fields = line.split()
if len(fields) < 3:
continue
circuit_id = fields[0]
hops = fields[2].split(",")
last_hop = hops[-1].split("~")[0].lstrip("$").upper()
found = True
print(f"\nCircuit: {circuit_id}")
print(f"Exit fingerprint: {last_hop}")
if last_hop in allowed:
print("Profile comparison: Match")
else:
print("Profile comparison: Not in profile")
if not found:
print("No built general-purpose circuits found.")
print("\nCircuit inspection complete.")
print("Tor control session completed successfully.")
# Step 12: Output final success message and pause before exit
print("\ntorset completed successfully.")
input("Press Enter to continue . . . ")
if __name__ == "__main__":
main()
# ---------------------------------------------------------------------
# end of torset.py
# ---------------------------------------------------------------------
--
Every Usenet post should strive to add palpable additional value
so that we can all delight in dissemination of useful knowledge.
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-10 12:52 -0400 |
| Message-ID | <11cvi4e$vjg$1@nnrp.usenet.blueworldhosting.com> |
| In reply to | #18468 |
Maria Sophia wrote: > Let us know if it works on the Linux/macOS side of the house 'cuz > I don't have those platforms, so it's written w/o benefit of testing. Since every thread should strive to add unique value for the newsgroup I wish to note that the Firefox Tor browser updated today, apparently. The script handled it well, even as I did not explicitly code a check for that situation, but it simply waited due to the multiple existing checks. For my personal torset.py script, I've added a half-dozen choices, but when I did so, I noticed that some Tor exit nodes are flagged in red. <https://metrics.torproject.org/rs.html#search/country:us%20flag:exit> One use-model suggestion for those using this script is that you likely want to pick an up-to-date Tor exit node, that isn't flagged in red. For example, these US Tor exit nodes are (apparently) NOT up to date: <https://metrics.torproject.org/rs.html#details/852A74A7814122E48C1529CB72504B84892C57C9> <https://metrics.torproject.org/rs.html#details/E029FF0A9723031FC1139D557357C07A211BFE4E> <https://metrics.torproject.org/rs.html#details/5CEA56320C904E731AE827866C71B90D50696F6A> <https://metrics.torproject.org/rs.html#details/5AE8D6148CB3B153AC6303988A4348949A1266F5> You can tell, I guess, because it says this when you go to those pages: "This relay is running a version of Tor that is too old and may be missing important security fixes. If this is your relay, you should update it as soon as possible." Here's another old-software example, as these things tend to be ephemeral. <https://metrics.torproject.org/rs.html#details/852A74A7814122E48C1529CB72504B84892C57C9> You want something like this, which doesn't say that the software is old. <https://metrics.torproject.org/rs.html#details/B2C3834C5B501FEDAE26FE3227233DC9F75D83AF> Notice the performance graphs, and Identity & Contact Information Nickname: Quintex457 Fingerprint: B2C3834C5B501FEDAE26FE3227233DC9F75D83AF (the unique cryptographic identifier for this relay). Operator Contact: Listed as john[]quintex.com, with a website (quintex.com), Keybase/Twitter handle (aquintex), and abuse reporting email. Hosting Organization: Hosted by Quintex Alliance Consulting (Autonomous System AS62744) in the United States, running on hostname tor57.quintex.com. 2. Network & Performance Addresses: Operates on IPv4 (204.8.96.146:447) and IPv6 ([2620:7:6003::146]:84). Advertised Bandwidth: ~12.47 MiB/s. Uptime & Traffic: Has processed 21.9 TB of total data since it was first seen in August 2026, with a recent uptime of roughly 4 days following its last restart on November 6, 2026. Software: Running Tor 0.4.9.16 on Linux. 3. Relay Flags The relay carries several important consensus flags: Exit & IPv6 Exit: This is an exit node, meaning it is the final hop in a Tor circuit that connects to the destination website or service on the public internet. Fast & Stable: Indicates it has high throughput and reliability compared to the median network performance. Valid & Running: Confirms the directory authorities recognize it as currently active and correctly configured. 4. Exit Policy Summary As an exit node, its exit policy explicitly accepts traffic on specific standard ports while blocking private/internal networks (like local IP ranges) and unlisted ports: Accepted Ports: Port 43 (WHOIS), Port 53 (DNS), Port 80 (HTTP), Port 443 (HTTPS), Port 1194 (OpenVPN), Port 1293, and Port 9418 (Git). Blocked: All other ports (reject *:*) as well as local/private IP ranges to prevent local network scanning or abuse. -- As always, posted to add value to the permanent Usenet record for all to benefit from, out of the goodness of my heart and from that of others.
[toc] | [prev] | [next] | [standalone]
| From | Maria Sophia <mariasophia@comprehension.com> |
|---|---|
| Date | 2026-11-10 16:16 -0400 |
| Message-ID | <11cvu34$1086$2@nnrp.usenet.blueworldhosting.com> |
| In reply to | #18474 |
Maria Sophia wrote:
> For my personal torset.py script, I've added a half-dozen choices, but
> when I did so, I noticed that some Tor exit nodes are flagged in red.
> <https://metrics.torproject.org/rs.html#search/country:us%20flag:exit>
If others want to try it out, here's the latest torset python script.
To give people more options, I added five different sets of choices.
Since we don't want everyone using the same exit nodes, I removed the
actual exit nodes, replacing with dummy nodes, to avoid that happening.
Exit-node fingerprints should be personally selected, which is easy for
your country of choice using this site to find known good exit nodes.
<https://metrics.torproject.org> then select "Relay Search" at bottom
#!/usr/bin/env python3
# ---------------------------------------------------------------------
# python torset.py
# Manually set static known Tor exit nodes for stable web-login accounts
# ---------------------------------------------------------------------
# Usage notes:
# 1. Obtain a set of desired known-to-be-working US Tor exit relays:
# https://metrics.torproject.org/rs.html#search/country:us%20flag:exit
# 2. Enter exit-node fingerprints in the profile definitions, e.g.,
# Profile 1 (gmail)
# "$0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Profile 2 (protonmail)
# "$1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,"
# "$2XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Profile 3 (facebook)
# "$3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,"
# "$4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# "$5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,"
# Profile 4 (youtube)
# "$6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,"
# "$7XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,"
# "$8XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,"
# "$9XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Profile 5 (twitter)
# "$10XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXL:w
# 3. Run this script, which cleans stale sessions before starting
# Tor and then provides a choice of pre-selected exit nodes
# ---------------------------------------------------------------------
# v3p1 20261109 Added examples for profiles with from 1 to 5 exit nodes
# v3p0 20261109 Replaced socket/stream cleanup with Python context managers
# v2p9 20261109 Added sys.platform support for macOS and Linux paths
# v2p8 20261109 Reverted profile exit nodes back to original configurations
# v2p7 20261108 Converted native batch/PowerShell implementation to Python
# v2p6 20261108 Improved documentation in terms of technical accuracy
# v2p5 20261108 Added new exit nodes and a profile configuration check
# v2p4 20261108 Handled stale process cleanup cleanly in native batch
# v2p3 20261108 Added automated cleanup of stale Tor/Firefox instances
# v2p2 20261108 Added full bootstrap completion polling on cold start
# v2p1 20261108 Fixed $tcp variable scope in try/finally block
# v2p0 20261108 Added automated Tor Browser startup and port polling
# v1p9 20261108 Added ControlPort error handling and response validation
# v1p8 20261108 Cleaned up comments and clarified explanations
# v1p7 20261108 Identify general-purpose ckts and compare exit fingerprints
# v1p6 20261108 Display multi-line Tor circuit status via GETINFO
# v1p5 20261108 Request new Tor circuits after profile selection
# v1p4 20261108 Added multi-profile exit-node selection menu
# v1p3 20261108 Set Profile 1 ExitNodes (two fingerprints) via SETCONF
# v1p2 20261108 Added GETINFO status/bootstrap-phase
# v1p1 20261108 Retrieve current ExitNodes configuration via GETCONF
# v1p0 20261108 Tested Tor ControlPort via TCP cookie authentication
# ---------------------------------------------------------------------
# See also... Forces a new working Tor exit node:
# <https://github.com/gmolop/Tor-ExitNode-changer/>
# <https://github.com/hevnsnt/IPChanger>
# <https://gist.github.com/kirelagin/9667900>
# Interacts with Tor using the Python stem library:
# <https://pypi.org/project/stem/> <https://stem.torproject.org/>
# <https://github.com/torproject/stem>
# Command-line Tor interaction and Nyx monitor:
# <https://nyx.torproject.org/> <https://github.com/torproject/nyx>
# Configures Tor using a GUI (Windows only):
# <https://github.com/abysshint/tor-control-panel/>
# ---------------------------------------------------------------------
# Summary:
# 1. Present a multi-profile selection menu allowing the user to choose
# between predefined exit-node configurations (or quit with Q).
# 2. Terminate any stale or running instances of Firefox Tor Browser
# to ensure a clean starting environment.
# 3. Launch the Firefox Tor Browser executable automatically if it is
# not currently running on the system.
# 4. Poll local TCP port 9151 and monitor for the existence of Tor's
# control authentication cookie file.
# 5. Open a local TCP socket connection to Tor's ControlPort
# (127.0.0.1:9151) once it becomes available.
# 6. Authenticate the control session securely using the binary bytes
# read from Tor's local control_auth_cookie.
# 7. Poll Tor's bootstrap status via GETINFO until the bootstrap-phase
# reports 100% completion.
# 8. Apply the user's selected profile fingerprints to Tor's configuration
# using the SETCONF ExitNodes command.
# 9. Issue a SIGNAL NEWNYM command to force Tor to discard old circuits
# and build new ones using the designated exit nodes.
# 10. Verify that the active ExitNodes configuration matches the expected
# profile fingerprints.
# 11. Query active circuits (GETINFO circuit-status), parse their exit node
# fingerprints and compare them against the profile whitelist.
# 12. Output clear verification results to the user console and pause
# before exiting, leaving the configured browser ready for secure use.
# ---------------------------------------------------------------------
import os
import socket
import subprocess
import sys
import time
from pathlib import Path
# --- Begin Configuration & Cross-Platform Paths ---
if sys.platform == "win32":
COOKIE_PATH = Path(
r"C:\app\browser\tor\Tor Browser\Browser\TorBrowser\Data\Tor\control_auth_cookie"
)
TOR_EXE = Path(r"C:\app\browser\tor\Tor Browser\Browser\firefox.exe")
KILL_CMD = ["taskkill", "/f", "/im", "firefox.exe"]
elif sys.platform == "darwin": # macOS
TOR_EXE = Path.home() / "Applications" / "TorBrowser.app" / "Contents" / "MacOS" / "firefox"
if not TOR_EXE.is_file():
TOR_EXE = Path("/Applications/TorBrowser.app/Contents/MacOS/firefox")
COOKIE_PATH = Path.home() / "Library" / "Application Support" / "TorBrowser-Data" / "Tor" / "control_auth_cookie"
KILL_CMD = ["pkill", "-f", "torbrowser"]
else: # Linux and other Unix-likes
base_linux = Path.home() / ".local" / "share" / "torbrowser" / "tor" / "x86_64" / "tor-browser"
TOR_EXE = base_linux / "Browser" / "firefox"
COOKIE_PATH = base_linux / "Browser" / "TorBrowser" / "Data" / "Tor" / "control_auth_cookie"
KILL_CMD = ["pkill", "-f", "tor-browser"]
CONTROL_PORT = 9151
# --- End Configuration & Cross-Platform Paths ---
# Begin profile dictionary
PROFILES = {
"1": {
"name": "Profile 1 (gmail)",
"exit_nodes": (
"$0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
),
},
"2": {
"name": "Profile 2 (protonmail)",
"exit_nodes": (
"$1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,"
"$2XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
),
},
"3": {
"name": "Profile 3 (facebook)",
"exit_nodes": (
"$3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,"
"$4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,"
"$5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
),
},
"4": {
"name": "Profile 4 (youtube)",
"exit_nodes": (
"$6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,"
"$7XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,"
"$8XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,"
"$9XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
),
},
"5": {
"name": "Profile 5 (twitter)",
"exit_nodes": (
"$10XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
),
},
}
# End profile dictionary
def main():
# Step 1: Profile Selection Menu
print(" Tor exit node selector ")
print(" 1 for Profile 1 (gmail)")
print(" 2 for Profile 2 (protonmail)")
print(" 3 for Profile 3 (facebook)")
print(" 4 for Profile 4 (youtube)")
print(" 5 for Profile 5 (twitter)")
print(" Q to Quit")
print()
choice = input("Select profile [1,2,3,4,5] or Q to quit: ").strip().upper()
if choice == "Q" or choice not in PROFILES:
print("Exiting.")
sys.exit(0)
profile = PROFILES[choice]
print(f"\nSetting {profile['name']}...")
# Step 2: Clean up any stale or running Tor/Firefox instances
print("Ensuring clean state by stopping any existing Tor instances...")
try:
subprocess.run(
KILL_CMD,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
except Exception:
pass
time.sleep(2)
# Steps 3 & 4: Launch browser if needed and wait for ControlPort & cookie
if not COOKIE_PATH.is_file():
print("Tor Browser is not running. Starting Tor Browser automatically...")
if not TOR_EXE.is_file():
print(f"ERROR: Tor Browser executable not found at: {TOR_EXE}")
sys.exit(1)
subprocess.Popen([str(TOR_EXE)])
print("Waiting for Tor Browser to initialize and open ControlPort (9151)...")
start_time = time.time()
ready = False
while time.time() - start_time < 45:
if COOKIE_PATH.is_file():
try:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as test_sock:
test_sock.settimeout(2)
test_sock.connect(("127.0.0.1", CONTROL_PORT))
ready = True
break
except (socket.error, OSError):
pass
time.sleep(2)
if not ready:
print(
"ERROR: Timed out waiting for Tor Browser to start and open ControlPort"
" 9151."
)
sys.exit(1)
print("Tor Browser port is open.")
# Step 6: Read authentication cookie bytes
try:
cookie_bytes = COOKIE_PATH.read_bytes()
cookie_hex = cookie_bytes.hex().upper()
except Exception as e:
print(f"ERROR: Failed to read control authentication cookie: {e}")
sys.exit(1)
# Helper functions for Tor Control Protocol
def read_tor_reply(sock_file):
lines = []
while True:
line = sock_file.readline()
if not line:
raise RuntimeError("Tor closed the ControlPort connection unexpectedly.")
decoded = line.decode("utf-8", errors="ignore").rstrip("\r\n")
lines.append(decoded)
if decoded.startswith("250+"):
while True:
data_line = sock_file.readline()
if not data_line:
raise RuntimeError(
"Tor closed the connection during a data response."
)
d_decoded = data_line.decode("utf-8", errors="ignore").rstrip(
"\r\n"
)
lines.append(d_decoded)
if d_decoded == ".":
break
continue
if len(decoded) >= 4 and decoded[3] == "-":
continue
break
return lines
def send_command(sock_file, command):
sock_file.write((command + "\r\n").encode("utf-8"))
sock_file.flush()
reply = read_tor_reply(sock_file)
if not reply or not reply[0].startswith("250"):
raise RuntimeError(f"Tor rejected command: {command} -- {' '.join(reply)}")
return reply
# Step 5: Connect to ControlPort using context managers
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.settimeout(15)
s.connect(("127.0.0.1", CONTROL_PORT))
with s.makefile("rwb") as stream:
# Authenticate session
auth_reply = send_command(stream, f"AUTHENTICATE {cookie_hex}")
print(f"Authentication: {auth_reply[0]}")
# Step 7: Wait for Tor bootstrap completion (100%)
print("Waiting for Tor bootstrap to complete...")
bootstrap_complete = False
b_start = time.time()
while time.time() - b_start < 60:
try:
bootstrap_reply = send_command(stream, "GETINFO status/bootstrap-phase")
for line in bootstrap_reply:
if "PROGRESS=100" in line:
bootstrap_complete = True
break
if bootstrap_complete:
break
except Exception:
pass
time.sleep(2)
if not bootstrap_complete:
raise RuntimeError("Timed out waiting for Tor to finish bootstrapping.")
print("Tor bootstrap complete (100%).")
# Step 8: Apply selected profile ExitNodes via SETCONF
config_reply = send_command(stream, "GETCONF ExitNodes")
print(f"Exit configuration: {' '.join(config_reply)}")
setconf_reply = send_command(
stream, f"SETCONF ExitNodes={profile['exit_nodes']}"
)
print(f"SETCONF response: {setconf_reply[-1]}")
# Step 9: Signal NEWNYM to clear circuits and build new ones
newnym_reply = send_command(stream, "SIGNAL NEWNYM")
print(f"NEWNYM response: {newnym_reply[-1]}")
time.sleep(3)
# Step 10: Verify new ExitNodes configuration matches expected
config_reply = send_command(stream, "GETCONF ExitNodes")
print(f"New exit configuration: {' '.join(config_reply)}")
actual_line = None
for item in config_reply:
if item.startswith("250 ExitNodes="):
actual_line = item
break
if not actual_line:
raise RuntimeError("Could not verify the new ExitNodes configuration.")
actual_text = actual_line.replace("250 ExitNodes=", "")
actual_nodes = [
fp.strip().lstrip("$").upper() for fp in actual_text.split(",") if fp
]
expected_nodes = [
fp.strip().lstrip("$").upper()
for fp in profile["exit_nodes"].split(",")
if fp
]
if set(actual_nodes) != set(expected_nodes):
raise RuntimeError("ExitNodes verification failed: fingerprint mismatch.")
print("ExitNodes verification: Match")
allowed = {fp: True for fp in expected_nodes}
# Step 11: Inspect circuit-status and compare exit fingerprints
circuit_reply = send_command(stream, "GETINFO circuit-status")
print("\nGeneral-purpose circuits")
print("-------------------------")
found = False
for line in circuit_reply:
if "BUILT" not in line or "PURPOSE=GENERAL" not in line:
continue
fields = line.split()
if len(fields) < 3:
continue
circuit_id = fields[0]
hops = fields[2].split(",")
last_hop = hops[-1].split("~")[0].lstrip("$").upper()
found = True
print(f"\nCircuit: {circuit_id}")
print(f"Exit fingerprint: {last_hop}")
if last_hop in allowed:
print("Profile comparison: Match")
else:
print("Profile comparison: Not in profile")
if not found:
print("No built general-purpose circuits found.")
print("\nCircuit inspection complete.")
print("Tor control session completed successfully.")
# Step 12: Output final success message and pause before exit
print("\ntorset completed successfully.")
input("Press Enter to continue . . . ")
if __name__ == "__main__":
main()
# ---------------------------------------------------------------------
# end of torset.py
# ---------------------------------------------------------------------
--
Usenet is where well-educated intelligent friendly people daily gather to
discuss topics of interest and to help learn from each other every day.
[toc] | [prev] | [standalone]
Back to top | Article view | alt.comp.software.firefox
csiph-web