Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-07-2003, 01:59 AM
|
#1
|
|
LQ Newbie
Registered: Nov 2003
Distribution: redhat
Posts: 17
Rep:
|
iptables string match
i have a linux box which i use as a gateway/router firewall for other PC's on my LAN. I tried setting the following iptable rule
iptables -A FORWARD -p tcp --dport 80 -m string --string "cmd.exe" -j REJECT --reject-with tcp-reset
then using a puter on my LAN I google cmd.exe and opened a site ...page loaded in my browser...shoot no luck!!
so again..
iptables -A INPUT -p tcp --dport 80 -m string --string "cmd.exe" -j DROP
again page loaded successfully
so..
iptables -I INPUT 1 -m string --string "cmd.exe" -j DROP (this had got to work!!!)
whoopee worked like a charm
anyone know why the first 2 rules didnt work???
oh and btw ....-m string --string "KazaaClient" doesnt work...dammit....anyone used p2pwall before??
|
|
|
|
11-08-2003, 04:20 PM
|
#2
|
|
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802
Rep:
|
It would depend on the other rules. For instance if you have a rule that allows ESTABLISHED, RELATED (which is very common) and it is before the string match and it is set to ACCEPT then the packet would probably not hit the string rule. Because the google search was initiated by you so it became an ESTABLISHED connection and the page was loaded.
Thats my guess.
I've never used Kazaa.
|
|
|
|
11-09-2003, 02:16 AM
|
#3
|
|
Member
Registered: Apr 2003
Location: Australia
Distribution: Debian 3, 31r0, 4, slackware, DSL, RH8.0/7, MDK9/10, et al. Vista is cute but not Linux - I tried
Posts: 70
Rep:
|
You had the destination port in the rule for the INPUT not the source. As the data is coming from the other ends port 80 it is actually a source. If it where being requested from your computer then it would be a destination.
Got the convolluted picture?
|
|
|
|
11-09-2003, 06:36 PM
|
#4
|
|
LQ Newbie
Registered: Nov 2003
Distribution: redhat
Posts: 17
Original Poster
Rep:
|
only rule i have preceeding this is to DROP all connections (to make this a mostly closed rule) and to log all SYN, FIN, ACK, RST and NULL packets before dropping
will try to change --dport to --sport and see if it works
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:05 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|