Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-17-2005, 07:10 PM
|
#1
|
Member
Registered: Jul 2005
Posts: 50
Rep:
|
how do I deactivate ping replies ?
I am a VERY recent windows defector who just managed to install fedora (after a 2 day nightmare of dnloading & corruption & re-dnloading) last night, and I'm in the process of learning iptables and all of that good, command line, shell scripting stuff but in the meantime, I'm pretty sure my system is responding to pings with ICMP type 3 "administratively prohibited", packets (according to ethereal), which would enable an attacker to verify that I have a host online at this address. Untill I learn to edit the iptables script, is there a quick and easy way to stop this? I can find a gui tool that enables/disables a firewall, and some others for adding vpn tunnels and adding/configuring interfaces, but nothing that does that.
Also, how secure is this latest version of fedora in it's default, personal desktop config?
thx.
|
|
|
07-17-2005, 09:59 PM
|
#3
|
Member
Registered: Jul 2005
Posts: 50
Original Poster
Rep:
|
Here are the contents of my iptables file. My windows experience leads me to believe that if a config file says "don't edit --- machine generated" then you should change the configuration with the interface designed to make the changes on your behalf after solicting input in the form of drop-downs, radio-buttons, etc(as I'm sure you know). Since this file says that, shouldn't that mean there is such a tool somewhere, otherwise how are you supposed to operate your firewall, or am I missing something or dealing with the wrong file?
----------------------------------------------------------------------------
# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
|
|
|
07-17-2005, 10:28 PM
|
#4
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep:
|
Dropping all ICMP is a *very* bad idea.
But to drop incoming pings, add this line right before the line with '--reject-with icmp-host-prohibited'.
Code:
-A INPUT -p icmp --icmp-type 8 -j DROP
I couldn't tell you what FC uses to edit firewall rules, but if you edit that file and run (I think) 'service iptables reload', it should work.
|
|
|
07-18-2005, 04:58 AM
|
#5
|
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188
Rep:
|
Quote:
Originally posted by Matir
I couldn't tell you what FC uses to edit firewall rules, but if you edit that file and run (I think) 'service iptables reload', it should work.
|
if u edit firewall rules (/etc/sysconfig/iptables) manually,
service iptables restart
command will load the rules that u edited.
but the best way is typing iptables rules in console and then if it works u can save that rules with
service iptables save
command.
good luck.
|
|
|
07-18-2005, 09:46 AM
|
#6
|
Member
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465
Rep:
|
easy way to do it, is to stop ping is through sysctl commands. And that is where you can stop ping.
|
|
|
07-18-2005, 12:59 PM
|
#7
|
Member
Registered: Jul 2005
Posts: 50
Original Poster
Rep:
|
Beautiful.
sysctl -w net.ipv4.icmp_echo_ignore_all=1
seems to have done the job. I'm on a standalone box w cable modem so I don't need pings for intra-LAN stuff, and this is just temporary 'til I can work my way through iptables.
Thx
|
|
|
07-18-2005, 01:59 PM
|
#8
|
Member
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465
Rep:
|
to keep it from one reboot to another adit /etc/sysctl.conf
less drastic option (now you also blocked kernel response to ping = localhost ping)
you can try:
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
if you will add any kernel change to the sysctl.conf, you will have to run
#sysctl -p
to check if syntax is correct and to enable new setting immediately
Last edited by broch; 07-18-2005 at 02:06 PM.
|
|
|
07-19-2005, 02:22 PM
|
#9
|
Member
Registered: Jul 2005
Posts: 50
Original Poster
Rep:
|
OK, now that I've had some time to go over documentation, I think I've found the file to modify and the modification to make that will prevent ping responses. The file is "/sysconfig/iptables" and the contents of it are:
-----------
# Generated by iptables-save v1.3.0 on Tue Jul 19 09:49:39 2005
*filter
:FORWARD ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [5033:1360444]
:RH-Firewall-1-INPUT - [0:0]
-A FORWARD -j RH-Firewall-1-INPUT
-A INPUT -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p ipv6-crypt -j ACCEPT
-A RH-Firewall-1-INPUT -p ipv6-auth -j ACCEPT
-A RH-Firewall-1-INPUT -d 224.0.0.251 -p udp -m udp --dport 5353 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Tue Jul 19 09:49:39 2005
-----------
I'm thinking that if I modify line 10 and replace ACCEPT with DROP, it will not only silently ignore echo requests, but the change will be persistent over reboots --- or am I misunderstanding something?
|
|
|
07-19-2005, 04:07 PM
|
#10
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep:
|
If you drop all ICMP, your network will be horribly (well, somewhat) broken. For example, you will be unable to ping anyone else (ICMP ECHOREPLY will be dropped), traceroute will not work (ICMP TIMXCEED), you won't get destination unreachable messages (it'll just be silent) as those are ICMP type 3. Check here to see what all ICMP is used for.
|
|
|
All times are GMT -5. The time now is 10:31 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|