hacking contest

hacking exploits security forum
hacking
compliance articles
upgrade backup exec
information security consultant

Full Version: Firewall Under Linux
Hardzen
how can i see what kind of firewall is running under linux
and how i kill or change the permissionīs


is there a fw running



PID TTY TIME CMD
1 ? 00:00:06 init
2 ? 00:00:00 keventd
3 ? 00:00:00 ksoftirqd_CPU0
4 ? 00:00:03 kswapd
5 ? 00:00:00 bdflush
6 ? 00:00:10 kupdated
10 ? 00:00:00 i2oevtd
108 ? 00:00:00 eth0
115 ? 00:00:00 portmap
860 ? 00:00:00 syslogd
935 ? 00:00:00 safe_mysqld
970 ? 00:00:00 mysqld
972 ? 00:00:00 mysqld
973 ? 00:00:00 mysqld
974 ? 00:00:00 mysqld
986 ? 00:00:00 sshd
990 ? 00:00:00 proftpd
992 ? 00:00:00 svscan
995 ? 00:00:00 atd
998 ? 00:00:00 supervise
999 ? 00:00:00 supervise
1000 ? 00:00:00 cron
1001 ? 00:00:00 supervise
1002 ? 00:00:00 supervise
1003 ? 00:00:00 supervise
1004 ? 00:00:00 supervise
1006 ? 00:00:00 qmail-send
1007 ? 00:00:00 multilog
1008 ? 00:00:00 tcpserver
1009 ? 00:00:00 multilog
1010 ? 00:00:01 tcpserver
1012 ? 00:00:00 multilog
1018 ? 00:00:00 splogger
1019 ? 00:00:00 qmail-lspawn
1020 ? 00:00:00 qmail-rspawn
1021 ? 00:00:00 qmail-clean
1035 ? 00:00:00 apache
1045 ? 00:00:00 apache-ssl
1048 tty1 00:00:00 getty
1049 tty2 00:00:00 getty
1050 tty3 00:00:00 getty
1051 tty4 00:00:00 getty
1052 tty5 00:00:00 getty
1053 tty6 00:00:00 getty
1054 ? 00:00:00 svscan
28484 ? 00:00:00 gcache
28486 ? 00:00:02 syslog-ng
28490 ? 00:00:00 apache-ssl
28491 ? 00:00:00 apache-ssl
28492 ? 00:00:00 apache-ssl
28493 ? 00:00:00 apache-ssl
28494 ? 00:00:00 apache-ssl
28496 ? 00:00:00 klogd
17202 ? 00:00:00 apache-ssl
18578 ? 00:00:00 apache
19184 ? 00:00:00 apache
19185 ? 00:00:00 apache
19186 ? 00:00:00 apache
20761 ? 00:00:00 mysqld
20768 ? 00:00:00 mysqld
21028 ? 00:00:00 apache
21030 ? 00:00:00 apache
21351 ? 00:00:00 mysqld
21571 ? 00:00:00 mysqld
21829 ? 00:00:00 mysqld
21838 ? 00:00:00 mysqld
22751 ? 00:00:00 apache
23197 ? 00:00:00 apache
23198 ? 00:00:00 apache
23199 ? 00:00:00 apache
23259 ? 00:00:00 mysqld
23273 ? 00:00:00 mysqld
23792 ? 00:00:00 mysqld
26388 ? 00:00:00 sshd
26390 pts/0 00:00:00 bash
26508 pts/0 00:00:00 ps


greetz Hardzen
w00dy
Linux uses IPTABLES as a firewall. There isnt really some daemon running like u would see in windows. With this said, that doesnt mean the box has IPTABLES configed. Read up on IPTABLES to learn more about linux's basic firewalling.

PS If that is a computer u arent supposed to be on, be careful as several loggers are running.
yuliang11
yes linux uses iptables by default. but depending on your kernel version. if you are using old distro u might be running ipchains. to check wheter your iptables or ipchains is on and off. perhaps u should try something like /etc/init.d/iptables --status . or chkconfig --list. from your ps, uhhh.. hard to know wheter your firewall is running.


--cheers-
icenix
CODE

iptables -L

that'll list SOME Settings...not all

read up on IPTable Scripts... its generaly a way to block a list of default attacks
to block up certain ports do:

CODE

iptables -A INPUT -p tcp --dport PORT -j DROP

That will Deny a port from being accessed, generally.. if you dont want a port being access...youd better close the service itself.

hope i helped
icenix
ikkyu
first off if this isn't your machine then leave it alone, I strongly supect that it isn't since you don't know much about *nix

Secondly, a lesson in terminology, if you are't precise and accurate with your language then you can't talk about technical subjects. A firewall is a dedicated device that isolates two or more networks from each other, the origin being the same term refering to a building technique that limits the spread of fires through a structure by the use of fire resistant bariers. Linux uses a kernel module to alter packts before they reach userspace called iptables (formerly ipchains), this is derived from the berkley net filter as I understand. To see what modules are loaded check /proc/modules. You have listed the output of ps, very good on your part, however when you become more sophistocated you will learn the difference between user and kernel space. To the best of my knowedge there is no way for a userspace app to alter packtes without the aid of a kernel module (this is different from the piss-poor windows design where user and kernel space are poorly defined) so there really an interchangeable "firewall". Check the man pages for iptables to find out how to alter ruleset. Do you homework at http://www.tldp.org/
SyN/AcK
I agree... windows device drivers are such a pain in the ass. I wrote a program for the TDI layer (as opposed to the NDIS layer) that encrypted all packets incoming and outgoing for a secure local network. Pretty painful.

If you really want to know, when you install linux, there is an option where you check High, Medium, or Low for your firewall setting, and can also put your own settings in as well. This would lead me to also believe this is not your system, for you should've remembered this.
raif
if this is your box then you have root access. to determine if the firewall is up and running, type this command:

iptables --list

of course i'm assuming that you are using iptables for a firewall and that you know how to read the resulting ruleset the is output to the screen when this command is issued. if you know nothing about linux firewall rulesets, go here.
raif
oops, almost forgot.

QUOTE
If you really want to know, when you install linux, there is an option where you check High, Medium, or Low for your firewall setting, and can also put your own settings in as well.

this is not true for some linux distributions. in redhat i think this was first implemented in the 7.0 install. in distros like slackware there is no preconfiguration for firewalls during the install. i'm not sure about other distros though.
baudmax
QUOTE (SyN/AcK @ Jan 18 2004, 11:36 PM)
If you really want to know, when you install linux, there is an option where you check High, Medium, or Low for your firewall setting, and can also put your own settings in as well.  This would lead me to also believe this is not your system, for you should've remembered this.

The utility that does this, as you describe low/medium/high w/ some port customization possible under "custom", is Lokkit (see Sec.4.6 & Sec.7 RHL Security Guide). It ships with RedHat 9, I'm not sure about other versions or distros.

Lokkit just creates a simple IPTABLES config file (of the same name) in the /etc/sysconfig folder.

Just type "lokkit" at the shell (may have to be root). NOTE: lokkit will OVERWRITE the existing iptables config file. If you will wish to save the original, cp a backup copy. You can load ruleset from any file with
iptables-restore < config.file

To check if iptables is configured to autorun on boot:
chkconfig --list iptables

chkconfig --levels 345 iptables on
(turns on iptables at boot or runlevel change to runlevels 3,4 & 5)

---
service iptables status:
returns print of current iptables rulelist if running

service iptables stop:
clears iptables rulesets, resets to accept all
(disables firewall)

service iptables start
(enables firewall)
reloads /etc/sysconfig/iptables

If this sounds confusing, then RTFM...

For more information about how to use these applications and what options they offer, refer to the chapter called Basic Firewall Configuration in the Red Hat Linux Customization Guide.

For advanced users and server administrators, manually configuring a firewall with iptables is likely the best option. Refer to Chapter 7 Firewalls for more information. For a comprehensive guide to the iptables command, consult the chapter titled Firewalls and iptables in the Red Hat Linux Reference Guide.

pollo
Man iptables
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.