LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-17-2005, 07:10 PM   #1
tom_from_van
Member
 
Registered: Jul 2005
Posts: 50

Rep: Reputation: 15
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.
 
Old 07-17-2005, 08:39 PM   #2
fuubar2003
Member
 
Registered: May 2004
Location: Orlando, Florida
Distribution: SLES10/11, RH4/5 svrs, Fedora, Debian/Ubuntu/Mint; FreeBSD/OpenBSD
Posts: 63

Rep: Reputation: 26
I do not know a command that will turn off inbound pings. You should continue your iptables research. Here are two iptables rules I use to accomplish what you want. The IP is my linux hosts IP address:

ipchains -A forward -p icmp -j DENY
ipchains -A input -j DENY -p icmp --icmp-type ping -i eth0 -s 0/0 -d 192.168.120.70

Here's some links I refer to often:

http://www.netfilter.org/documentati...entation-howto

http://iptables-tutorial.frozentux.n...al.html#BASICS

http://www.siliconvalleyccie.com/lin...bles-intro.htm

http://www.tldp.org/LDP/LGNET/103/odonovan.html

http://techrepublic.com.com/5100-6261_11-1031075-2.html
 
Old 07-17-2005, 09:59 PM   #3
tom_from_van
Member
 
Registered: Jul 2005
Posts: 50

Original Poster
Rep: Reputation: 15
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
 
Old 07-17-2005, 10:28 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
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.
 
Old 07-18-2005, 04:58 AM   #5
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
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.
 
Old 07-18-2005, 09:46 AM   #6
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Rep: Reputation: 32
easy way to do it, is to stop ping is through sysctl commands. And that is where you can stop ping.
 
Old 07-18-2005, 12:59 PM   #7
tom_from_van
Member
 
Registered: Jul 2005
Posts: 50

Original Poster
Rep: Reputation: 15
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
 
Old 07-18-2005, 01:59 PM   #8
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Rep: Reputation: 32
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.
 
Old 07-19-2005, 02:22 PM   #9
tom_from_van
Member
 
Registered: Jul 2005
Posts: 50

Original Poster
Rep: Reputation: 15
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?
 
Old 07-19-2005, 04:07 PM   #10
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 15 03-30-2015 03:39 PM
No ping replies on 127.0.0.1 zzero Linux - Networking 14 03-15-2004 11:17 AM
no ping replies from linux server kags Linux - Networking 5 09-21-2003 10:03 AM
Deactivate Screensaver Donald1000 Linux - General 8 02-27-2003 04:48 AM
deactivate the kpanel Strauss Linux - Software 1 02-13-2001 10:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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