1

Sometimes I'll $ torsocks --shell, then forget I'm in a torified shell and hours later do $ torsocks curl https://website.com.

Does torsocks know not to do tor over tor? Is there some kind of idiot proofing written into torsocks to prevent this kind of activity?

1

Torsocks sets the LD_PRELOAD environment variable to intercept a few system calls.

It does not matter if you use it recursively:

# at first $LD_PRELOAD is unset
$ echo $LD_PRELOAD 

# when we start a torsocks shell is $LD_PRELOAD is set
$ torsocks --shell
/usr/bin/torsocks: New torified shell coming right up...
$ echo $LD_PRELOAD 
/usr/lib/torsocks/libtorsocks.so

# if create a torsocks shell in a torsocks shell $LD_PRELOAD remains unchanged
$ torsocks --shell
/usr/bin/torsocks: New torified shell coming right up...
peter@ivy:~/src$ echo $LD_PRELOAD
/usr/lib/torsocks/libtorsocks.so

# when we exit the two shells, torsocks is deactivated again
peter@ivy:~/src$ exit
peter@ivy:~/src$ exit
peter@ivy:~/src$ echo $LD_PRELOAD

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.