Skip to content

Instantly share code, notes, and snippets.

@eggplants
Last active April 28, 2024 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eggplants/e2cedb62e8232a9bfb270acac0ca51a4 to your computer and use it in GitHub Desktop.
Save eggplants/e2cedb62e8232a9bfb270acac0ca51a4 to your computer and use it in GitHub Desktop.
Connect to `.onion` websites via SOCKS Proxy with Arti (version: 1.1.11)

How to connect to .onion websites via SOCKS Proxy with Arti

Environment

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 23.10
Release:        23.10
Codename:       mantic

$ uname -vorm
6.5.0-14-generic #14-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 14 14:59:49 UTC 2023 x86_64 GNU/Linux

$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/eggplants/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu (default)
1.70-x86_64-unknown-linux-gnu
1.71-x86_64-unknown-linux-gnu

active toolchain
----------------

stable-x86_64-unknown-linux-gnu (default)
rustc 1.75.0 (82e1608df 2023-12-21)

Build Arti binary

Repo: https://gitlab.torproject.org/tpo/core/arti

From crates.io

cargo install arti

From source

To install executable as a systemwide command:

git clone https://gitlab.torproject.org/tpo/core/arti
cargo install --path ./arti/crates/arti

Use as a SOCKS Proxy on Ubuntu

  1. Open Setting > Network > Proxy
  2. Select Manual in Configuration
  3. Set URL localhost / Port 9150 to SOCKS Host Section
  4. Enable Network Proxy
  5. Run $ arti proxy or $ ./path/to/arti proxy

image

Example

CIA official site: http://ciadotgov4sjwlzihbbgxnqg3xiyrg7so2r2o3lt5wz5ypk4sxyjstad.onion

$ arti -o address_filter.allow_onion_addrs=true proxy
2023-12-29T13:26:34Z  INFO arti: Starting Arti 1.1.11 in SOCKS proxy mode on localhost port 9150 ...
2023-12-29T13:26:34Z  INFO arti_client::client: Running without a keystore
2023-12-29T13:26:35Z  INFO tor_dirmgr: Marked consensus usable.
2023-12-29T13:26:35Z  INFO tor_dirmgr: Loaded a good directory from cache.
2023-12-29T13:26:35Z  INFO arti: Sufficiently bootstrapped; system SOCKS now functional.
2023-12-29T13:26:35Z  INFO arti::socks: Listening on [::1]:9150.
2023-12-29T13:26:35Z  INFO arti::socks: Listening on 127.0.0.1:9150.
2023-12-29T13:26:35Z  INFO tor_dirmgr: Marked consensus usable.
2023-12-29T13:26:35Z  INFO tor_dirmgr: Directory is complete. attempt=1
2023-12-29T13:26:35Z  WARN tor_chanmgr::transport::default: Connection to [scrubbed] failed: error: Network is unreachable (os error 101)
2023-12-29T13:26:37Z  WARN tor_guardmgr::guard: Could not connect to guard [scrubbed]. We'll retry later, and let you know if it succeeds.
2023-12-29T13:26:37Z  WARN tor_chanmgr::transport::default: Connection to [scrubbed] failed: error: Network is unreachable (os error 101)
2023-12-29T13:26:39Z  WARN tor_guardmgr::guard: Could not connect to guard [scrubbed]. We'll retry later, and let you know if it succeeds.
2023-12-29T13:26:40Z  WARN tor_chanmgr::transport::default: Connection to [scrubbed] failed: error: Network is unreachable (os error 101)
2023-12-29T13:26:41Z  INFO tor_guardmgr::guard: We have found that guard [scrubbed] is usable.
2023-12-29T13:26:53Z  WARN tor_guardmgr::guard: Could not connect to guard [scrubbed]. We'll retry later, and let you know if it succeeds.
2023-12-29T13:26:55Z  INFO tor_guardmgr::guard: We have found that guard [scrubbed] is usable.
2023-12-29T13:27:34Z  WARN arti::socks: connection exited with error: error: operation timed out at exit
2023-12-29T13:29:03Z  WARN tor_circmgr::hspool: Unable to build preemptive circuit for onion services: error: Problem opening a channel to [scrubbed]: Internal error: internal error (bug) at /home/eggplants/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tor-chanmgr-0.12.0/src/mgr.rs:229:54: channel build task disappeared
Captured(   0: tor_error::internal::Bug::new_inner
   1: tor_chanmgr::mgr::AbstractChanMgr<CF>::get_or_launch::{{closure}}
   2: <tor_proto::circuit::ClientCirc as tor_circmgr::build::Buildable>::create::{{closure}}
   3: <tor_rtcompat::timer::Timeout<T,S> as core::future::future::Future>::poll
   4: tor_circmgr::build::double_timeout::{{closure}}::{{closure}}
   5: tokio::runtime::task::core::Core<T,S>::poll
   6: tokio::runtime::task::harness::Harness<T,S>::poll
   7: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
   8: tokio::runtime::scheduler::multi_thread::worker::Context::run
   9: tokio::runtime::context::set_scheduler
  10: tokio::runtime::context::runtime::enter_runtime
  11: tokio::runtime::scheduler::multi_thread::worker::run
  12: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
  13: tokio::runtime::task::harness::Harness<T,S>::poll
  14: tokio::runtime::blocking::pool::Inner::run
  15: std::sys_common::backtrace::__rust_begin_short_backtrace
  16: core::ops::function::FnOnce::call_once{{vtable.shim}}
  17: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs:2007:9
      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs:2007:9
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/thread.rs:108:17
  18: start_thread
             at ./nptl/pthread_create.c:444:8
  19: __GI___clone3
             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment