LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 06-28-2004, 12:05 AM   #1
Mr-TY
LQ Newbie
 
Registered: Jun 2003
Location: Australia
Distribution: RedHat
Posts: 4

Rep: Reputation: 0
Fireall scenario???


if i was making a firewall to do the following

Access a DNS: (client = high to low : low to high)
Connect to the web-server (client)
log into your machine using ssh (server)
get emails from pop3 mail server

this is what i did.

DNS: (client)
iptables -A OUTPUT -p tcp -s 0/0 --sport 1023:65535 -d 0/0 --dport 53 -j ACCEPT
iptables -A OUTPUT -p udp -s 0/0 --sport 1023:65535 -d 0/0 --dport 53 -j ACCEPT

iptables -A INPUT -p tcp -s 0/0 --sport 53 -d 0/0 --dport 1023:65535 -j ACCEPT
iptables -A INPUT -p udp -s 0/0 --sport 53 -d 0/0 --dport 1023:65535 -j ACCEPT


Web-server:
i did the same but replaced the 53 with 80

POP3 email:
replace the port number e.g 53 or 80 with the number 110

SSH:
iptables -A INPUT -p tcp -s 0/0 --sport 1023:65535 -d 0/0 --dport 22 -j ACCEPT
iptables -A INPUT -p udp -s 0/0 --sport 1023:65535 -d 0/0 --dport 22 -j ACCEPT

can sameone please tell me what is wrong...
according to same people i got this wrong
 
Old 07-01-2004, 05:35 PM   #2
woonix
LQ Newbie
 
Registered: Jun 2004
Location: Southern California
Distribution: Debian
Posts: 2

Rep: Reputation: 0
I will try to point out where I think your script could be improved

Quote:
DNS: (client)
iptables -A OUTPUT -p tcp -s 0/0 --sport 1023:65535 -d 0/0 --dport 53 -j ACCEPT
iptables -A OUTPUT -p udp -s 0/0 --sport 1023:65535 -d 0/0 --dport 53 -j ACCEPT

iptables -A INPUT -p tcp -s 0/0 --sport 53 -d 0/0 --dport 1023:65535 -j ACCEPT
iptables -A INPUT -p udp -s 0/0 --sport 53 -d 0/0 --dport 1023:65535 -j ACCEPT
You can eliminate all instances of -s 0/0 and -d 0/0. These are implied if no source or destination is given.

Quote:
SSH:
iptables -A INPUT -p tcp -s 0/0 --sport 1023:65535 -d 0/0 --dport 22 -j ACCEPT
iptables -A INPUT -p udp -s 0/0 --sport 1023:65535 -d 0/0 --dport 22 -j ACCEPT
Compare this to your code for DNS, and I think you will see the problem: you have the --dport and --sport reversed. Your filtering is actually more strict than mine. I don't filter OUTPUT at all because I trust my system not to send anything out that it isn't supposed to. Also, I don't bother to check the destination port on packets I receive. Maybe I'm too trusting

Regards,

woonix
 
  


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
new crash scenario Trio3b Mandriva 1 03-05-2005 01:20 PM
Network Scenario aqman Linux - General 1 12-11-2004 02:20 PM
Best install scenario mobo Linux - General 4 11-13-2004 07:57 AM
install scenario Jeebizz Slackware 8 10-14-2004 04:54 AM
Mandrake Fireall 8.2 and AOL 9.0 apoc63 Mandriva 0 06-19-2004 02:01 PM

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

All times are GMT -5. The time now is 11:53 AM.

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