Hello I have some questions related to tor.
- How to disable Guard node in torrc file or by using stem
- Is there any method in stem where I can specify my Exit Node. I know a method in torrc file but I don't know how to do it in stem or using controler. for example.
I want this because I want my entry node to be change for every circuit and Exit to be same
controller.set_options({'__DisablePredictedCircuits': '1',
'MaxOnionsPending': '0',
'newcircuitperiod': '999999999',
'maxcircuitdirtiness': '999999999'})
also for if possible in this part it will be good too. mean if I pass my nodes as an argument here
controller.new_circuit()
CodePudding user response:
To disable Guard nodes in the torrc file, you can add the following lines:
UseEntryGuards 0
NumEntryGuards 0
To specify an Exit node in the torrc file, you can add the following line:
ExitNodes $fingerprint
where $fingerprint
is the fingerprint of the Exit node you want to use.
You can use the set_options
method of the Controller class to set the UseEntryGuards, NumEntryGuards, and ExitNodes
options as follows:
from stem import Controller
with Controller.from_port() as controller:
controller.authenticate()
controller.set_options({
'UseEntryGuards': '0',
'NumEntryGuards': '0',
'ExitNodes': '$fingerprint',
})
To specify the Exit node when creating a new circuit, you can use the extend_circuit method of the Controller class as follows:
from stem import Controller
with Controller.from_port() as controller:
controller.authenticate()
controller.new_circuit()
controller.extend_circuit('$fingerprint')
where $fingerprint
is the fingerprint of the Exit node you want to use.