LinuxQuestions.org
Review your favorite Linux distribution.
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 09-25-2013, 07:10 PM   #1
symeon.mattes
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Rep: Reputation: Disabled
iptables: No chain/target/match by that name.


Hi,

I'm trying to write the following rule in the iptable
Code:
iptables -I INPUT -d myipaddres -p tcp --dport 80 -m string --to 70 --algo bm --string '/w00tw00t.' -j DROP
but I receive the message

Code:
iptables: No chain/target/match by that name.
What I would like to do is to block all the request from wootwoot that its ip address change continuously

Thanks in advance

Last edited by symeon.mattes; 09-25-2013 at 08:01 PM.
 
Old 09-25-2013, 09:30 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
output of
Code:
iptables -L -n
please.
 
Old 09-26-2013, 04:18 AM   #3
symeon.mattes
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Hi the output of what you asked is:

Quote:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
 
Old 09-26-2013, 05:15 AM   #4
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
I think that you have the syntax of the -I option wrong. It is iptables -I 'table' 'number' 'rule'.

So you have specified the 'table' as INPUT, which should be fine and dandy, but the rule number as '-d', which is probably less so. (And the rule to be inserted as 'myipaddres -p tcp --dport 80 -m string --to 70 --algo bm --string '/w00tw00t.' -j DROP', which would also be not what you wanted).

Just one question; rather than rejecting based on the string "/w00tw00t." might you not be better using the stateful features just to reject anything unsolicited?
 
Old 09-26-2013, 06:46 AM   #5
symeon.mattes
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
What I have in my /var/log/httpd/error_log is:

Quote:
[Thu Sep 26 14:16:50 2013] [error] [client 188.165.212.175] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind : )
I found in link1 and link2 that to get rid of these entries I could use the iptables.

So the correcty syntax what would be? Do you have anyother suggestions on how I should handle it?

Last edited by symeon.mattes; 09-26-2013 at 06:47 AM.
 
Old 09-26-2013, 07:41 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Isn't w00tw00t a Plesk/Virtuozo exploit?
 
Old 09-26-2013, 08:35 AM   #7
symeon.mattes
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
I'm not so sure for that. I do have though plesk installed.
 
Old 09-26-2013, 08:39 AM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
It seems to work on my system, or at least outputs no errors. Perhaps you don't have the module for that function for iptables loaded? Or other kernel settings that influence it. /proc/sys/net/..... Otherwise try double quotes instead of single quotes. Both worked for me, but iptables -L outputted double quotes "" for both additions.

$ lsmod

Is the myipaddress ipv4 or ipv6? If it's a VAR you might prefix it with $. Otherwise I don't know. Check the bugreports, as it could be your iptables version. I had to revamp the syntax of my aging firewall not too long ago because of changes in the iptables syntax / reserved words list. I don't recall exactly, but ctstate instead of state and conntrack instead of track. It's been a while, and I'm more of an app guy than a network one.
 
Old 09-26-2013, 08:46 AM   #9
symeon.mattes
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
When I type lsmod I just receive
Quote:
Module Size Used by
This means that the iptables are not installed in the linux kernel?
 
Old 09-26-2013, 10:27 AM   #10
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by symeon.mattes View Post
I'm not so sure for that. I do have though plesk installed.
Hope it's current.
 
Old 09-26-2013, 10:34 AM   #11
symeon.mattes
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Do you mean that Plesk creates this error or there are others trying to exploit a bug of Plesk?
 
Old 09-26-2013, 11:17 AM   #12
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Habitual View Post
Isn't w00tw00t a Plesk/Virtuozo exploit?
Wrong question (well, unless you can't find LQs search function that is ;-p)
https://www.linuxquestions.org/quest...6/#post4899149
 
Old 09-26-2013, 01:37 PM   #13
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 symeon.mattes View Post
I found in link1 and link2 that to get rid of these entries I could use the iptables.

So the correcty syntax what would be? Do you have anyother suggestions on how I should handle it?
Well, looking at the two links, link 2 has the syntax right, link 1, which has copied from link 2, has made a modification, and it hasn't.

link 2 uses -A which adds the succeeding rule, and that's fine, but link 1 uses -I which inserts the rule and, as it inserts, it needs to know where to insert the rule (well, they both need to know which table you are working on, but that part doesn't change and isn't the issue).

That 'where' part is the position (rule number) at which the insert is to take place, so you could fix this by specifying the appropriate number for your rule set, or, if this works within your rule set, you could just add (-A) the rule, to put this rule as the last rule in this particular table.

I still don't recommend that you do this, but that would be how to avoid the syntax error.

The rule that you are trying to add has a significant overhead in kernel memory use and (probably) in processor cycles. That's because there is all sorts of packet re-asssembly going on behind the scenes, and doing that makes your server vulnerable to all sorts of attacks that, while currently rare, aren't exactly difficult to implement. And, while you could argue that 'nobody knows', that's 'security by obscurity' and eventually someone will come along and just try this kind of attack 'because they can'.

You seem to be doing this, as far as I can tell, to keep your log files clean. That isn't a worthwhile objective. Log files are for logging stuff, and while it can easily be worth rate-limiting entries into log files, just to protect against someone trying to overload logging, a clean log file isn't security. Just let log files accumulate data (and look at the data at appropriate intervals, of course); that's what log files are for.
 
Old 09-26-2013, 02:08 PM   #14
symeon.mattes
LQ Newbie
 
Registered: Sep 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
@salasi. So you are suggesting me to ignore this "w00tw00t" scanning in my server? From the log file it's pretty obvious that the server has already reject it...but it was a little bit weard, and thut's why I started looking at it. Some suggest things as you did and others to put the entry in the iptable. If there is a load in the cpu by this entry, then I don't think it's worth of it. It's going to consume more power checking all packages than to have a few errors...I think
 
Old 09-27-2013, 03:24 AM   #15
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 symeon.mattes View Post
From the log file it's pretty obvious that the server has already reject it...
If the server has already rejected it, isn't that the biggest part of the battle? You should worry if you thought that there was, for example, an new version of this that might not be rejected by the current measures or if you thought that you might suddenly get hit by millions of them and that might cause a problem, but otherwise I don't see that its worth getting excited about. Certainly not worth taking any new risks in order to keep this from the log files...

Quote:
Originally Posted by symeon.mattes View Post
If there is a load in the cpu by this entry, then I don't think it's worth of it. It's going to consume more power checking all packages than to have a few errors...I think
Some of the 'fancier' options for iptables can consume (relatively) lots of resources - the 'plain and simple' ones don't, and are really pretty efficient, and getting excited about a few 'plain and simple' rules either way is usually, in practice, pointless (but may still be appealing from the point of view of 'neatness', and neatness and comprehensibility do have a value, even if the advantage is difficult to quantify).

The potential problem I see with this specific rule is that, while packet fragmentation is possible, iptables has to buffer fragmented packets to rebuild them and then do some kind of 'best match' scan against the re-assembled packets. Firstly, if you think of the 'slow_loris' type of attack, an evildoer could force you to keep open a massive number of buffers and that could, eventually, be unfortunate. Secondly, the best match scan could use a lot of resources (although that's more of a hypothetical issue, in that, never having used it, I just worry that it could) and that could be unfortunate too.

For the 'scan resources' attack, the evildoer would need to create packets coming in at a high rate while for the 'buffer resources' attack lots of fragmented packets, keeping connections open for as long as possible, would be necessary. So, these would be different attacks, but both difficult to block (ok, it would be easy if the evildoer used a single IP or small number of IPs to attack, but they probably wouldn't).

So, for me, I'd want a pretty clear advantage from doing it to feel that it was worth the risks. And, at the moment, I haven't seen what that advantage might be.

The other way of approaching this might be to use the rule and subject the server to all sorts of stress testing to assure yourself that it wasn't going to be a problem, even under the most extreme loads that you could contrive. To me, this seems to be getting all extreme over something of a non-issue, but, if you want to do that (you never know...you might show up some unrelated issue) it would also be a valid way forward.
 
1 members found this post helpful.
  


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
iptables: No chain/target/match by that name yanlongxiang Linux - Networking 2 08-17-2012 06:55 AM
[SOLVED] iptables: no chain/target/match by that name raducu1605 Linux - Server 3 01-26-2012 04:53 PM
iptables: No chain/target/match by that name secretlydead Linux - Networking 2 04-08-2010 10:42 PM
iptables: No chain/target/match by that name - with 2.6.17.7 tp11235 Linux - Kernel 10 03-24-2010 02:15 AM
iptables: No chain/target/match by that name qanopus Linux - Networking 6 01-04-2009 09:10 PM

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

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