This commit is contained in:
nm1 2026-11-04 00:33:23 +05:30
commit 74ae93a96e

View file

@ -0,0 +1,73 @@
Tor (The Onion Router)
https://www.linkedin.com/pulse/what-does-happen-inside-tor-network-how-work-arun-kl
tor_anonymity_expert_guide.mp4 https://files.catbox.moe/dqk06e.mp4
https://www.reddit.com/r/explainlikeimfive/comments/c5sw4b/eli5_what_is_a_tor_browser_how_does_it_work_and/
- Let's use a mail analogy. Let's say you want to send an anonymous love letter to someone named Alice. You don't want Alice to know it was you who sent it, and you'd prefer not to let anyone else know you have a crush on Alice either.
Using a standard browser is like handing your letter directly to Alice. Obviously not going to work.
Fortunately, there are thousands of strangers who volunteer to run a love letter anonymization network. Out of the thousands of strangers, you randomly select three of them. Let's call them stranger #1, #2, #3.
So here's what you do: Take your letter addressed to Alice. Place it in an envelope, addressed to stranger #3. And put that envelope into another one addressed to stranger #2, and finally another one addressed to stranger #1.
Now deliver the envelope to stranger #1. Stranger #1 opens it and finds the envelope addressed to stranger #2, which he delivers accordingly. Stranger #2 opens the next envelope, finding and delivering the envelope addressed to stranger #3. Stranger #3 opens it, finding the letter addressed to Alice, and delivers it to Alice. Since it is illegal to open an envelope not addressed to you, each stranger can only open up one layer. (In Tor, this is cryptographically enforced with math, not postal law.)
So what's the final result? Stranger #1 knows who sent the letter, but not its contents nor its ultimate destination. Stranger #2 knows neither who sent it, nor the contents, nor the destination. Stranger #3 knows the contents, but not who sent it. Alice also knows the contents but not who sent it. Thus anonymity is achieved: nobody other than you knows both the contents and the sender.
So that's Tor in a nutshell. There's also a lot of confusion out there about the differences between Tor and VPN. In this analogy, a VPN is like handing your letter to a trusted friend who hands it to Alice. Your friend is in a position of being able to know both contents and sender, so you're putting a lot of faith in your friend (VPN) to not rat you out. But it has the advantage of not letting a stranger (stranger #3) read your letter, and it's simpler with less hops making a VPN more suitable for daily browsing.
- Volunteers who host the tor nodes are normally belong to privacy respecting organisation , countries or universities to avoid legal trouble. There r some nodes which r controlled by FBI, NSA and law enforcement to catch criminals too
- Understanding techinically
to access hidden service of tor when someone visit the onion site it checks with tor database for introduction point then tor magic applies ie relaying through 3 different nodes which r randomly selected and finally it reaches the introduction point. From Introduction point to hidden site again tor magic/circuit happens ie relaying through 3 different nodes then data comes to hidden service right
- i2p : like tor there is another one ie i2p. tor has clear net access means any surface web contents like google.com can be accessed and also tor network like onion . in case of i2p only i2p network can be accessed. Also i2p is faster
one interesting part is, packages in the i2p network change sizes, which makes it more harder to track and fingerprint
tor has registry server for nodes and if that goes down then it would be disaster. Though chances r less bc it is mainatined by tor project. i2p is p2p and is more decentralized than tor
 
 
## hosting sites in tor
https://infosecwriteups.com/hosting-tor-website-on-dark-web-the-safe-way-9890d1947b6a
- Installing tor
`yay -S tor tor-browser`
- In `etc/tor/torrc`
Uncomment following
![dd37075b960f36e6595d582e9c0e6acb.png](../../../_resources/dd37075b960f36e6595d582e9c0e6acb.png)
HiddenServicePort 80 127.0.0.1:PORT. It can be any port number wherever site is hosted in localhost. But 80 must be the one other localhost request will be redirected else site wont run
Another error can be faced
![222ea4fd9e8c09d346f85017d5cd8c55.png](../../../_resources/222ea4fd9e8c09d346f85017d5cd8c55.png)
Sometimes this 9050 PORT may not be available so u can change that too
- Then finally `sudo tor` anywhere. Make sure run it as root. or use `systemctl start tor`
- To get another domain just change the hidden service name
In `/etc/tor/torrc`
It can be
`HiddenServiceDir /var/lib/tor/mysite/` too. Now u will get another onion site tooo start as a `tor` user instead of `root` user
- Separate config file
U can have a separate orrc file too anywhere in user directory too like `~/.torrc` too
Use `tor -f ~/.torrc` to start tor wtith different config
- Multiple services running simuntaneouly
In torrc file
```bash
HiddenServiceDir /var/lib/tor/mysite/
HiddenServicePort 80 127.0.0.1:20108
HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:20100
```
- Starting tor as non root aka as a tor username
Starting tor as root can have some security issues
`systemctl start tor` is a good way of doing that to start as a tor user instead or root
But if we want more customizationa and not stick to default then we can have different torrc file but make sure it is in `etc/tor` directory like `/etc/tor/torrc2`
By default config file is set as `/etc/tor/torrc` so to change it we need to edit `/usr/lib/systemd/system/tor.service` file. Its syslink is created when we enable this service at `/etc/systemd/system/multi-user.target.wants/tor.service`,
Change it like this
```text
ExecStartPre=/usr/bin/tor -f /etc/tor/torrc2 --verify-config
ExecStart=/usr/bin/tor -f /etc/tor/torrc2
```
Then to apply changes reload systemctl by
`systemctl daemon-reload`
and finally restart tor service
`systemctl restart tor`