Была задачка сделать прокси через тор, сохраню интересные находки. Возможно, пригодятся.

1. Tor.Net

Ссылка на репозитарий: https://github.com/sharpbrowser/Tor.NET

A managed library to use the Tor network for SOCKS5 communications.

Launching a new Tor process:

ClientCreateParams createParams = new ClientCreateParams();
createParams.ConfigurationFile = "/path/to/config/file";
createParams.DefaultConfigurationFile = "/path/to/default/config/file";
createParams.ControlPassword = ""; // Tor does not use a control password by default, so this can be null or blank
createParams.ControlPort = 9051;
createParams.Path = "/path/to/tor/exe";

Client client = Client.Create(createParams);

2. SocksWebProxy

Ссылка на репозитарий: https://github.com/postworthy/SocksWebProxy

SocksWebProxy is a C# project build to make http communication over the Tor network simple and easy for C# projects.

Project Features

  • C#
  • .NET Standard & .NET Core
  • Simple Interface for WebClient & WebRequest (Just assign a new SocksWebProxy to the *.Proxy attribute)
  • No Need for Privoxy or similar service to translate http traffic to tor
  • Easily Communicate over Tor with C#

3. Tor4NET

Ссылка на репозиторий: https://github.com/Zaczero/Tor4NET

An all-in-one solution to fulfill your .NET dark web needs. This library is built over Tor.NET 


// Directory where Tor files are going to be stored.
// If the directory does not exist, it will create one.
var torDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Tor4NET");

// Use 64-bit Tor on 64-bit system (optional).
var is32Bit = !Environment.Is64BitOperatingSystem;

var tor = new Tor(torDirectory, is32Bit);

// Check for updates and install latest version.
if (tor.CheckForUpdates().Result)

// Disposing the client will exit the Tor process automatically.
using (var client = tor.InitializeClient())
    var http = new WebClient
        // And now let's use Tor as a proxy.
        Proxy = client.Proxy.WebProxy

    var html = http.DownloadString("http://facebookcorewwwi.onion");

// Finally, you can remove all previously downloaded Tor files (optional).

4. TorSharp

Use Tor for your C# HTTP clients. Tor + Privoxy = ❤️ All you need is client code that can use a simple HTTP proxy.


  • Supports:
    • .NET Core (.NET Standard 2.0 and later)
    • .NET Framework (.NET Framework 4.5 and later)
    • Windows
      • ✔️ Windows 10 version 1903
      • Older Windows should work too
    • Linux
      • ✔️ Ubuntu 18.04
      • ✔️ Ubuntu 16.04
      • ✔️ Debian 10
      • ✔️ Debian 9 (confirmed by user)
      • ⚠️ CentOS 7 supported via ExecutablePathOverride (see below)
    • ❌ Mac OS X support is not planned.
  • Uses Privoxy to redirect HTTP proxy traffic to Tor.
  • Uses virtual desktops to manage Tor and Privoxy processes.
  • Optionally downloads the latest version of Tor and Privoxy.


// configure
var settings = new TorSharpSettings
    ZippedToolsDirectory = Path.Combine(Path.GetTempPath(), "TorZipped"),
    ExtractedToolsDirectory = Path.Combine(Path.GetTempPath(), "TorExtracted"),
    PrivoxyPort = 1337,
    TorSocksPort = 1338,
    TorControlPort = 1339,
    TorControlPassword = "foobar"

// download tools
await new TorSharpToolFetcher(settings, new HttpClient()).FetchAsync();

// execute
var proxy = new TorSharpProxy(settings);
var handler = new HttpClientHandler
    Proxy = new WebProxy(new Uri("http://localhost:" + settings.PrivoxyPort))
var httpClient = new HttpClient(handler);
await proxy.ConfigureAndStartAsync();
Console.WriteLine(await httpClient.GetStringAsync("http://api.ipify.org"));
await proxy.GetNewIdentityAsync();
Console.WriteLine(await httpClient.GetStringAsync("http://api.ipify.org"));

5. Закладки на чтение

TOR NEWNYM — автоматическая смена IP в TOR: https://www.evernote.com/l/AP2w9kuuAE9MfI8e0Z0w1XirITC3rOcJ2Os/

HOWTO use the Internet anonymously using Tor and Privoxy: https://www.evernote.com/l/AP1DcGmXndRJk749tCM0O_A2Q141t4Mgj38/

Прокси-сервер с помощью Tor. Основа для многопоточного парсинга: https://www.evernote.com/l/AP3QCtrV3E9JlZQh5cl0Mq_G84LGGQ2b1aI/

Включаем Tor на всю катушку: https://www.evernote.com/l/AP1EsKa8tS1E2aqdGAdJ4wz1w0Tc-vD2hhA/

Нет комментариев
Комментарии к: Разработки на C# под Tor

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Attach images - Only PNG, JPG, JPEG and GIF are supported.

Good Reads




Welcome to Typer

Brief and amiable onboarding is the first thing a new user sees in the theme.
Join Typer
Registration is closed.