mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1160] [Information] Firejail + Tor #798
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#798
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chiraag-nataraj on GitHub (Mar 25, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1160
I thought I'd leave a little note here about an easy way to make jailed applications work with Tor when they don't have proxy options and don't respect
HTTP_PROXYand its variants. You will need a program calledproxychains(it should be in your repo).Now trying something like
proxychains firejail <program>orfirejail --profile=<path to profile> proxychains <program>will not work since proxychains (and other programs like it) refuse to work on SUID binaries.The key is to use
--env. Usefirejail --env="LD_PRELOAD=libproxychains.so.3" <program>. If you're usingprivate-etc, make sure you whitelistproxychains.conf. If you're usingprivate-bin, make sure you whitelistsh,dig,awk. Oh, and if you're usingseccomp.keep, make sure you whitelistgettid,sigaltstack,epoll_create,getgroups,epoll_ctl,rt_sigsuspend,setsockopt,epoll_wait(I think that was all of them?).Just thought I'd drop that by since I had a lot of trouble at first getting them to work together (I didn't want to use a bridge and other stuff that was detailed here: https://www.void.gr/kargig/blog/2016/12/12/firejail-with-tor-howto/). Hope this helps someone!
@netblue30 commented on GitHub (Mar 26, 2017):
It is by far the best Tor/Firejail howto I've seen so far. I have a link to them here: https://firejail.wordpress.com/2017/03/13/into-the-void-firejail-with-tor-howto/
@chiraag-nataraj commented on GitHub (Mar 27, 2017):
Yeah, I mean...I saw that. Just felt that this is an alternative that works if you have very few applications that won't obey the proxy settings (and if you're using proxychains or something like it already).
@ghost commented on GitHub (Apr 25, 2017):
I'm getting the following result: "ERROR: ld.so: object 'libproxychains.so.3' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored"
I've also tryied using the guide @netblue30 pointed out. But got stuck at the third quotation box, the one that starts with "
firejail --net=tornet /bin/bash". After firejailing bash, using the command "host www.debian.org" returns ";; connection timed out; no servers could be reached".I'm using Debian Jessie with the firejail version available through jessie-backports, that is, "0.9.44.8-1~bpo8+". bridge-utils and proxychains are in versions "1.5-9" and "3.1-6" respectively.
@chiraag-nataraj commented on GitHub (Apr 27, 2017):
Hmmm...are you trying to run an SUID binary with proxychains? That is, is the application you're running with firejail an SUID binary?
@ghost commented on GitHub (Apr 27, 2017):
I wouldn't know how to identify an SUID binary, sorry. But indeed, I messed up by not providing the command I've used for this attempt. I've used "firejail --env="LD_PRELOAD=libproxychains.so.3" chromium". And this is the firejail profile used for this particular application:
Thank you for giving this matter your time and consideration. ;)
@chiraag-nataraj commented on GitHub (May 1, 2017):
Ah, that's why - chromium uses an SUID helper to create its own sandbox. From what I remember, though, chromium should respect the system proxy settings (so if you use something like privoxy, you can just export
http_proxy=localhost:8118,https_proxy=localhost:8118, and the uppercase equivalents and Chromium should Just Work™ 😄)@ghost commented on GitHub (May 2, 2017):
I see @chiraag-nataraj. Anyway, I used Chromium just for testing as I normally use a firejailed Tor Browser. I've now tested the command with another application using the command "firejail --env="LD_PRELOAD=libproxychains.so.3" trans word" and it worked. Anyway, in the case this problem arises in the future, do you have a source I could refer to in order to lear how to setup my system's proxy settings? As of now, it has none. Also, is it possible to declare this environment variable using the applicattion's firejail profile?
Thanks!
@chiraag-nataraj commented on GitHub (May 5, 2017):
Basically, you'll have to export environment variables (that's the easiest way of doing it in my experience): https://justintung.com/2013/04/25/how-to-configure-proxy-settings-in-linux/
I would think you would be able to pass it using
--env, so yes.