LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-31-2003, 05:29 AM   #1
pix
LQ Newbie
 
Registered: Jul 2003
Location: Sydney, Australia
Distribution: Debian
Posts: 22

Rep: Reputation: 15
blocking port 113


another newbie question...

Looking at hardening an already fairly hardened firewall, and trying to see if I can block port 113, or at least stop it from responding to outside ping requests... Whether this is successfull (or wise) - well at least I can reverse it if I have to.

I have the following script in my iprules file:

# allow ident
iptables -t nat -A PREROUTING -p tcp --dport 113 -i eth0 -j ACCEPT

I could change ACCEPT to DROP I suppose, but another way would be to send this request of to the wild blue yonder (and upset the server in question) by forwarding the request to another non-existant IP address.

What I need to know is how to do the script - any offers?

TIA

cheers...pix
 
Old 07-31-2003, 06:28 AM   #2
max2003
LQ Newbie
 
Registered: May 2003
Distribution: Slackware 9.1
Posts: 26

Rep: Reputation: 15
You can try to change ACCEPT with REJECT.
 
Old 07-31-2003, 06:34 AM   #3
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Assuming that eth0 is your external interface that you don't want people to be able to access 113 on you want something like.
Code:
iptables -A INPUT -p tcp --dport 113 -i eth0 -j REJECT
This isn't a NAT issue as its incomming requests that might be a problem, these will only ever go to the router as you can't get to the IPs behind it. Make sure you do REJECT the packets and not DROP them otherwise you'll experience very long waits when you want to ssh/ftp into the box yourself from outside.

cheers

Jamie...

Last edited by jharris; 07-31-2003 at 06:35 AM.
 
1 members found this post helpful.
Old 07-31-2003, 08:04 PM   #4
pix
LQ Newbie
 
Registered: Jul 2003
Location: Sydney, Australia
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
Thanks, guys. This appears to be the easy way to do it.

cheers...pix
 
Old 07-31-2003, 08:51 PM   #5
pix
LQ Newbie
 
Registered: Jul 2003
Location: Sydney, Australia
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
Just changed my iptables script to that of the above (and also used DROP), and port 113 is still responding to a ping request (ICMP Echo). So that one is not working, for some reason. Any ideas???

cheers...pix
 
Old 08-01-2003, 01:48 AM   #6
max2003
LQ Newbie
 
Registered: May 2003
Distribution: Slackware 9.1
Posts: 26

Rep: Reputation: 15
You must block at least ICMP protocol type 8. Some servers (like pop3 and imap) are checking for your ident service. If you drop ident traffic you wil have a timeout when you try to conect these servers. For these reason you must reject ident traffic, not droping it.

Last edited by max2003; 08-01-2003 at 01:52 AM.
 
Old 08-01-2003, 05:53 AM   #7
pix
LQ Newbie
 
Registered: Jul 2003
Location: Sydney, Australia
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
I had thought about this and wondered if I would have a problem with the POP3 server on my ISP. I guess I will haev to settle for a reject, rather than drop. Thanks for your help

cheers...pix
 
  


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
Port 113 floppywhopper Linux - Security 7 02-07-2008 06:51 PM
Blocking Port 113 XaViaR Linux - Security 6 04-05-2005 08:18 AM
Blocking PING and port 113 on SuSE and other Firewall Questions WarlockofVirgo Linux - Security 12 08-21-2004 01:28 PM
port 113 jthepro Linux - Networking 2 05-24-2004 12:52 PM
113 port spank Linux - Newbie 3 12-02-2003 03:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:02 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