LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-27-2023, 11:44 AM   #1
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Rep: Reputation: 10
Post A question about Tor proxy


Hello,
I have a Debian server with Tor installed on it. This server is located in an internal network and the Tor configuration is as follows:
Code:
RunAsDaemon 1
SOCKSPort 192.168.1.2:9050
DataDirectory @LOCALSTATEDIR@/lib/tor
CookieAuthentication 0
I use Tor by setting a SOCKS5 type proxy in the browser. I use these iptables rules:
Code:
-A INPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -p tcp --dport 9050 -m state --state NEW -j ACCEPT
If I set a public IP address on the NIC, can anyone connect to port 9050 from the Internet? As you can see, I have given internal IP address to Tor in Tor configuration.

Thank you.
 
Old 12-28-2023, 05:29 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,483

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Nobody can tell you because you don't provide enough information on how your internal network accesses the internet.

At the very least provide details of what you're using as a router between your normal internal network and the internet.
 
Old 12-28-2023, 09:49 AM   #3
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by TenTenths View Post
Nobody can tell you because you don't provide enough information on how your internal network accesses the internet.

At the very least provide details of what you're using as a router between your normal internal network and the internet.
Hello,
Thank you so much for your reply.
My internal network is connected to the Internet through a modem:
Quote:
Internal Network ---> Modem ---> Internet
 
Old 12-28-2023, 09:58 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,483

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Quote:
Originally Posted by Jason.nix View Post
Hello,
Thank you so much for your reply.
My internal network is connected to the Internet through a modem:
Ok, so it's still unclear.

Are you telling us you have a modem connected to a computer on your internal network with that computer configured to act as a router, or do you (as is more common these days) connect your internal network to your ISP provided device which is acting as router / "modem"?

Regardless, you should be able to configure whichever part is your router to allow incoming traffic from the WAN side on a specific port to a specific IP/Port on your LAN side, in which case your TOR server should be publicly accessible. Assuming your ISP doesn't block traffic on that port further upstream.
 
Old 12-30-2023, 12:29 AM   #5
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by TenTenths View Post
Ok, so it's still unclear.

Are you telling us you have a modem connected to a computer on your internal network with that computer configured to act as a router, or do you (as is more common these days) connect your internal network to your ISP provided device which is acting as router / "modem"?

Regardless, you should be able to configure whichever part is your router to allow incoming traffic from the WAN side on a specific port to a specific IP/Port on your LAN side, in which case your TOR server should be publicly accessible. Assuming your ISP doesn't block traffic on that port further upstream.
Hello,
Thanks again.
My modem acts like a router and Debian server connected to the Internet directly.
 
Old 01-22-2024, 01:45 AM   #6
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Original Poster
Rep: Reputation: 10
Hello,
No idea?
How can I make a port only accessible to a range of IP addresses?

Thank you.
 
Old 01-23-2024, 02:28 AM   #7
___
Member
 
Registered: Apr 2023
Posts: 155
Blog Entries: 1

Rep: Reputation: Disabled
Maybe https://serverfault.com/questions/24...n-specifc-port
 
1 members found this post helpful.
Old 01-23-2024, 11:52 PM   #8
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by ___ View Post
Hello,
Thank you so much for your reply.
Assuming the Tor proxy is running on the address 192.168.1.2, are the following policies and rules sufficient?
Code:
*filter
:INPUT DROP [862:113997]
:FORWARD DROP [0:0]
:OUTPUT DROP [76190:79547849]
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT
-A INPUT -p tcp -s 192.168.1.0/24 --dst 192.168.1.2 --dport 9050 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 9050 -j DROP
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Tor exit nodes face unusual activity, is Tor being raided or under hack attack? LXer Syndicated Linux News 0 12-23-2014 12:03 AM
LXer: How To Set Up A TOR Middlebox Routing All VirtualBox Virtual Machine Traffic Over The TOR Netw LXer Syndicated Linux News 0 02-08-2012 11:30 AM
LXer: Tor Browser Bundle-Tor Goes Portable LXer Syndicated Linux News 1 09-02-2011 02:29 AM
TOR: traffic between my workstation TOR entry point really not encrypted..? john99 Incognito 3 11-11-2009 01:06 AM
TOR-there seems to be no tor.pkg- what now? me-$-on Slackware 5 06-06-2008 11:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration