LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-18-2012, 05:56 AM   #1
roll84
LQ Newbie
 
Registered: Mar 2010
Posts: 3

Rep: Reputation: 0
How does stealth port scan protection work?


Code:
 #Port-scanner protection
iptables -A pfc -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 2/s --limit-burst  4 -j RETURN
iptables -A pfc -p tcp --tcp-flags SYN,ACK,FIN,RST RST -j DROP
I cant understand the role of tcp flag option. Manuel says first list is mask second is flag must be set. Does it examine packets including RST ??

I know -m limit meaning but how does tcp-flags prevent port scanning?
 
Old 05-18-2012, 06:50 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
I can't see how that would be effective .. port scans can be customised pretty heavily, for example running nmap with a syn scan would not be stopped by these rules, you could also alter the timing to avoid these limits.
 
Old 05-20-2012, 09:14 AM   #3
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by roll84 View Post

I know -m limit meaning but how does tcp-flags prevent port scanning?

It doesn't; that's a mis-statement of the problem. Essentially, what we have here is 'if we are getting a lot of new stuff from one source, it can't be constructive, we'll just drop it'. Look at the flags that the traffic that it catches doesn't have.

Quote:
...you could also alter the timing to avoid these limits...
That's true, and until you can just look for the 'packets that you probably just want to drop' flag, and I don't think that'll be along in a hurry, will always be true of this kind of thing. OTOH, if you can make scanning pretty tedious for a (presumed) evil-doer, then they'll probably go and make a mess on someone else's lawn first.

As with many of these things, there is an extent to which these things can do good, but there is also an extent to which these things can be gamed, so you've got to asses whether they are really doing any good. (Or, in this case, more likely cause the legitimate users of the network inconvenience by stopping them from scanning.) But the point is that there is a cost, and it may not be apparent what that is until you sit back and think about it in context.

If, for example, you are only trying to hide where you have put your ssh port, you might be better advised to ensure that ssh was otherwise secured. Potentially.
 
Old 05-20-2012, 10:25 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Actually "stealth" is one of those problems that has been created and hyped by a person or persons in the previous millennium. Best filed under "/IntarWEB/misconceptions/security by obscurity" and left to rot there w/o implementing it. Better search for: hardening, intrusion detection, port scan detection.
 
  


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
Stealth Port 80 raypen Slackware 11 03-23-2006 10:17 PM
Port Scan: Closed Port instead of Stealth unihiekka Linux - Security 9 12-26-2005 08:51 PM
stealth port 1 tcpmux in firestarter biophysics Linux - Security 2 04-26-2005 02:23 PM
How to stealth port #113 ? johnm1957 Linux - Networking 5 06-05-2002 10:25 PM
iptables - advanced port blocking/stealth mode siymann Linux - Security 1 10-26-2001 05:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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