LinuxQuestions.org
Visit Jeremy's Blog.
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 11-18-2010, 10:06 PM   #1
satish
Member
 
Registered: Jan 2006
Posts: 172

Rep: Reputation: 15
Spam Problem


We have a spam in our network and we installed antivirus in all our systems and cleaned the virus from all pc's after that i had removed my ip from the database of blocked ip's but still my ip is blocked for sending spam i don't know from which pc the spam is going on the internet.

so i have a question that my proxy server is redhat linux and as a newbie i don't know the command's to find out which pc is creating large bandwidth to the internet.

If you tell the command how to see which pc is sending spam then i will discard that pc.

Also i want a strong firewall to stop spam activities.

Regards

Satish
 
Old 11-18-2010, 10:20 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by satish View Post
i don't know the command's to find out which pc is creating large bandwidth to the internet.
You could use IPTraf.

Quote:
Also i want a strong firewall to stop spam activities.
FWIW, you already have iptables. That said, if your proxy server is the only way out from the LAN, then you'd probably want to address the problem there instead, and use the firewall as a second layer.

Last edited by win32sux; 11-18-2010 at 10:21 PM.
 
Old 11-18-2010, 10:38 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885
Quote:
Originally Posted by satish View Post
We have a spam in our network and we installed antivirus in all our systems and cleaned the virus from all pc's
If your system are infected, and you install antivirus after this, you can in no way get sure that your systems are clean. Only sure way to know is to reinstall your systems.
 
Old 11-23-2010, 02:55 AM   #4
satish
Member
 
Registered: Jan 2006
Posts: 172

Original Poster
Rep: Reputation: 15
Spam Problem

i had formatted all the systems for the spam issue, now i want only a iptables firewall with only ftp,smtp,pop3,web(80) ports opened and all other ports closed.

Regards

Satish
 
Old 11-23-2010, 03:51 AM   #5
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Are you saying that you need help with setting up iptables? Are you still having a problem that requires assistance?
 
Old 11-23-2010, 09:31 PM   #6
satish
Member
 
Registered: Jan 2006
Posts: 172

Original Poster
Rep: Reputation: 15
Spam Problem

Yes sir i need assistance for setting up the iptables for my internal network, i want to open only ftp, smtp, pop3 web(80) port only and all other ports closed.It means i need a stonge firewall for my network, as I am not familiar with the iptables i want assistance from you.

can u send me the iptables rules

Thanks for helping me and answering the post waiting for the reply

Regards

Satish
 
Old 11-24-2010, 04:14 AM   #7
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
There are two parts to what you need to do:
1 - create the IP tables filters and 2 - configure your system to restore them upon restart.

I would also REALLY suggest this blog. It is a very well written introduction to IP tables and it is where I finally began to understand how to use it. Having said that, I am also of the opinion that it is best to learn how to write the IP tables commands, but there are also simple front end tools for it, so you may want to look at what your distribution offers.

As far as writing the rules, you will simply add a set of filters to your input chain. The IPtables rules will work like a waterfall and if a given connection matches a rule, the process will terminate. If it does not match, it will go on to the next rule and try that one. You will want to set up a default policy or an ending rule that drops all traffic. Above this rule, you will whitelist the connections that you want to add. At the top of your filter, you will will want white list established connections and things like your loopback interface.

Here is an example to help get you started. You would add this to IPtables: iptables -A INPUT -i lo -j ACCEPT (you will likely need to run as root or use SUDO on the command). This command adds (-A), to the INPUT chain, the lo interface (-i lo) the accept action (-j ACCEPT). You will want similar commands for your established connections and then the services you want to use. Here is a small set of what you will want:

Code:
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp -0 eth1 --dport 22 -j ACCEPT
-A INPUT -j DROP
The above example adds the loopback, established connections and TCP on port 22 for SSH and then finally drops everything else.

Now as far as saving and restoring, the best way to do this is to first create your filters as above. Then use the command iptables-save to save the IP tables commands to a file. You can then add a section to your network interface configuration to iptables-restore these commands upon startup. This thread has a link to doing so, but here is the short version:
Code:
iface eth0 inet dhcp
pre-up iptables-restore < /etc/iptables.using
post-down iptables-save > /etc/iptables.using
 
  


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
postfix spam. someone is using my server to send spam and it's not open relay bob808 Linux - Server 6 03-23-2010 09:44 AM
spam filter that puts spam into spam folder? paul_mat Linux - Software 3 03-31-2009 04:18 AM
Spam Server Tips - Block Spam With Iptables tbeehler Linux - Software 2 08-24-2007 10:54 AM
Postfix, dovecot, spamassassin SPAM to a spam folder breitscott Linux - Server 30 02-17-2007 02:47 PM
procmail and spam -- do not send out of office auto replay to spam draix Linux - Software 0 12-30-2004 08:35 AM

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

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