I want to use Tor Browser (on Windows 10). It works.
However I found currently no way to define a certain country for the exit node.
How can I achieve this (in Tor Browser)?
I want to use Tor Browser (on Windows 10). It works.
However I found currently no way to define a certain country for the exit node.
How can I achieve this (in Tor Browser)?
You need to modify your torrc
and use ExitNodes
.
It allows the use of fingerprints (if you want to use a specific exit relay) or country codes, which is what you are looking for.
Note the following warning from the man page:
Note that if you list too few nodes here, or if you exclude too many exit nodes with ExcludeExitNodes, you can degrade functionality. For example, if none of the exits you list allows traffic on port 80 or 443, you won’t be able to browse the web.
TLDR;
example: ExitNodes {fr} -->France
or ExitNodes {fr, de} → France or Germany
Ok, thank you.
I have read now some more information.
If I don’t want to change the torrc permanently I can pass a parameter like
tor.exe --ExitNodes “{ca}”
Is this the same for Torbrowser?
As I read -StrictNodes 1 is only a suggestion and refers only to ExcludeNodes
Is there really no way to enforce a certain country for ExitNodes ?
I don’t think it is needed, actually. StrictNodes
is to prevent the creation of circuits with the nodes you exclude for circuits for Hidden Services, Self-tests and others.
If you set ExitNodes {es}
(the country code for Spain) the connection to the Tor network will just fail, as there are no exits in Spain.
It is probably different from ExcludeNodes
, as unless you use StrictNodes
, circuits with excluded nodes will be created if necessary to prevent connection failures.
No idea, as a Linux user, I like to tinker with configuration files. As for the changes being permanent… Well, luckily it’s just a matter of adding/changing/removing that one line.
Maybe someone else has the right answer.
The easiest is to edit the torrc file with a text editor and add or change the line ExitNodes {ca} then start the browser. I do it all the time when I want a specific exit node or remove it when I use to use whatever comes.
The Tor browser starts tor.exe with whatever parameters it uses.
You could make a batch file to first spit out a torrc file to use with the exit node of choice then start the Firefox browser with whatever is in your shortcut on the desktop.
Now this batch file can be as simple or sophisticated as you want.
I would first make a copy of the current torrc file without exitnode as torrcCOPY (Remember, this is Windows. Case is not sensitive in filenames and commands. It’s just to make things more readable.)
Change YOURnameHERE
There is an intentional blank after: Enter 2 Character Country Code:
-----EXAMPLE:
@echo off
setlocal
SET /P CC=Enter 2 Character Country Code:
copy “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrcCOPY” “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc” >NUL
echo ExitNodes {%CC%} >>“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc”
endlocal
“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\firefox.exe”
-----ENDEXAMPLE:
DISCLAIMER: Supplied as is. Tested and works for me.
EDITED LATER:
The original script fails to take into account the occasion where you do not want a specific exit node.
The script is now modified to this:
@echo off
copy “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrcCOPY” “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc” >NUL
setlocal
SET /P CC=Enter 2 Character Country Code:
if .%CC% == . GOTO none
echo ExitNodes {%CC%} >>“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc”
endlocal
:none
“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\firefox.exe”
Another error. It should look like this:
@echo off
copy “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrcCOPY” “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc” >NUL
setlocal
SET /P CC=Enter 2 Character Country Code:
if .%CC% == . GOTO none
echo ExitNodes {%CC%} >>“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc”
:none
endlocal
“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\firefox.exe”