Stable and performant Tor library in .NET Core.
Windows | Linux & OSX |
---|---|
git clone https://github.com/nopara73/DotNetTor
cd DotNetTor/
dotnet restore
cd src/DotNetTor.Tests/
dotnet test
ControlPortPassword = "ILoveBitcoin21"
the hash should be: HashedControlPassword 16:0978DBAF70EEB5C46063F3F6FD8CBC7A86DF70D2206916C1E2AE29EAF6
tor --hash-password password
where password is the password
you've chosen. It will give you the HashedControlPassword
.var requestUri = "http://icanhazip.com/";
// 1. Get real IP
using (var httpClient = new HttpClient())
{
var message = httpClient.GetAsync(requestUri).Result;
var content = message.Content.ReadAsStringAsync().Result;
Console.WriteLine($"Your real IP: \t\t{content}");
}
// 2. Get Tor IP
using (var httpClient = new HttpClient(new SocksPortHandler("127.0.0.1", socksPort: 9050)))
{
var message = httpClient.GetAsync(requestUri).Result;
var content = message.Content.ReadAsStringAsync().Result;
Console.WriteLine($"Your Tor IP: \t\t{content}");
// 3. Change Tor IP
var controlPortClient = new ControlPort.Client("127.0.0.1", controlPort: 9051, password: "ILoveBitcoin21");
controlPortClient.ChangeCircuitAsync().Wait();
// 4. Get changed Tor IP
message = httpClient.GetAsync(requestUri).Result;
content = message.Content.ReadAsStringAsync().Result;
Console.WriteLine($"Your other Tor IP: \t{content}");
}
Originally the SocksPort part of this project was a leaned down, modified and .NET Core ported version of the SocketToMe project.
Originally the ControlPort part of this project was a leaned down, modified and .NET Core ported version of the Tor.NET project.
At this point of the development you can still find parts of the former project in the codebase, however the latter has been completely replaced.