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 01-03-2006, 04:16 PM   #1
servnov
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2
Posts: 276

Rep: Reputation: 30
possible to close all ports? can you still be hacked?


So there are 65k ports available, is it possible to close all of them to incoming connections? If all your ports are closed can a remote hacker still get in? Can closed ports be forced open and that is where a filtered port comes in?
 
Old 01-03-2006, 04:20 PM   #2
int0x80
Member
 
Registered: Sep 2002
Posts: 310

Rep: Reputation: Disabled
Code:
iptables -P INPUT DROP
 
Old 01-03-2006, 04:26 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
You can close all the ports. It means, in fact, shutting down all applications listening on them. Possible and doable. It does much to make intruder's life harder, but it doesn't make the compromise impossible. You may be tricked into running a script or checking a page that results in malicious software beeing run on your machine, for example. Closing all ports helps, but you still need to be careful.

Closed ports can be only made open if an application (running on your machine) opens them. If you're in control of your programs, you may be quite sure they won't do such thing
 
Old 01-03-2006, 04:32 PM   #4
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Quote:
So there are 65k ports available, is it possible to close all of them to incoming connections?
Yes, as GNUbie pointed out. If you don't like writing iptables commands directly try something like Firestarter of Guarddog which provide GUIs for setting up your firewall.

Quote:
If all your ports are closed can a remote hacker still get in?
Possibly. Security is a complex thing with browser vulnerabilities and the like. However closing all ports to outside connections is a massive help and if you use the computer sensibly your very unlikely to get hacked in Linux.

Code:
Can closed ports be forced open and that is where a filtered port comes in?
Not really. If a firewall is set to not accept traffic on a port then it won't. What exactly do you mean by filtered? It can have different meanings when it comes to ports.

A firewall can either accept a packet on a port (ie its not 'firewalled'), drop the packet and send no response or drop the packet and send a response saying that the port is closed. For most home users just dropping the packet and sending no response is fine and is probably the default on programs like Firestarter and Guarddog.
 
Old 01-03-2006, 06:26 PM   #5
servnov
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2
Posts: 276

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Mara
You can close all the ports. It means, in fact, shutting down all applications listening on them. Possible and doable. It does much to make intruder's life harder, but it doesn't make the compromise impossible. You may be tricked into running a script or checking a page that results in malicious software beeing run on your machine, for example. Closing all ports helps, but you still need to be careful.

Closed ports can be only made open if an application (running on your machine) opens them. If you're in control of your programs, you may be quite sure they won't do such thing
Ah, yes client software flaws could be an avenue of attack. Didnt think of that. Thanks for help.
 
Old 01-03-2006, 06:30 PM   #6
servnov
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2
Posts: 276

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by tkedwards
What exactly do you mean by filtered?
Just going on with what a network mapper (ex. nmap) reports: open, closed, or filtered.

Quote:
Originally Posted by tkedwards
drop the packet and send no response or drop the packet and send a response saying that the port is closed.
This would be the -j DROP and -j REJECT options in iptables, respectively. Correct? Does it just save bandwidth and time to not send a reponse back?
 
Old 01-03-2006, 06:56 PM   #7
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
AFAICT:

Open in nmap is ACCEPT in iptables, ie. a connection can be made

Closed in nmap is REJECT in iptables, ie. the incoming packet is dropped and a response packet saying so is sent back

filtered in nmap is DROP in iptables, ie. the incoming packet is dropped without a response being sent back
 
  


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
How to Close Ports janderson622 Linux - Security 21 01-04-2007 05:59 PM
Which of these ports can I close? buddhahat Linux - Security 6 06-13-2005 07:40 AM
How can I close ports? nectron101 Linux - Networking 3 11-27-2004 11:22 PM
How do I close ports ksgill Linux - Newbie 9 10-09-2003 09:06 PM
Ports, and how to close them? davee Linux - Networking 2 07-24-2003 08:10 AM

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

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