LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-13-2008, 04:37 PM   #1
andy1974
Member
 
Registered: Jun 2007
Posts: 85

Rep: Reputation: 15
ip scanning and ftp probing


ok i need some help blocking certain ips from trying to access my ftp server. i have like 3 ips that keep trying to access my ftp server, using a script trying diffrent username and password combanations. is there a way of just blocking those ips from accesssing the server at all ?
 
Old 03-13-2008, 05:09 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
may i suggest a slightly more comprehensive approach?
http://www.fail2ban.org/wiki/index.php/Vsftpd
http://www.fail2ban.org/wiki/index.php/ProFTPd
 
Old 03-14-2008, 06:18 AM   #3
andy1974
Member
 
Registered: Jun 2007
Posts: 85

Original Poster
Rep: Reputation: 15
Unhappy

OK.......ummmm what exactly am i looking for in that link? and Yes i have ProFTP
 
Old 03-14-2008, 06:22 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you're looking to install fail2ban.
 
Old 03-14-2008, 06:24 AM   #5
andy1974
Member
 
Registered: Jun 2007
Posts: 85

Original Poster
Rep: Reputation: 15
OK.......ummmm what exactly am i looking for in that link? and Yes i have ProFTP

# Fail2Ban configuration file
#
# Author: Yaroslav Halchenko
#
# $Revision: 510 $
#

[Definition]

# Option: failregex
# Notes.: regex to match the password failures messages in the logfile. The
# host must be matched by a group named "host". The tag "<HOST>" can
# be used for standard IP/hostname matching and is only an alias for
# (?:::f{4,6}?(?P<host>\S+)
# Values: TEXT
#
failregex = USER \S+: no such user found from \S* ?\[<HOST>\] to \S+\s*$

# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
 
Old 03-14-2008, 06:27 AM   #6
andy1974
Member
 
Registered: Jun 2007
Posts: 85

Original Poster
Rep: Reputation: 15
ok i see, looking at fail2ban.org now
 
Old 03-14-2008, 06:34 AM   #7
andy1974
Member
 
Registered: Jun 2007
Posts: 85

Original Poster
Rep: Reputation: 15
ok ....installed the rpm , now just need to find out how to work it
 
Old 03-14-2008, 06:39 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
TBH, looking at those links, they aren't *actually* that useful are they? Are you clear on what fail2ban will do for you? should just take all the specifics like ip addresses away from attackers, and continualy block attackers as and when they come in from wherever.
 
Old 03-14-2008, 08:53 AM   #9
andy1974
Member
 
Registered: Jun 2007
Posts: 85

Original Poster
Rep: Reputation: 15
Wink

its ok ...yea i see what is does now , i am looking at the docs for it now, making sure i have it set up correctly
 
Old 03-14-2008, 10:26 AM   #10
CarLost
Member
 
Registered: Jun 2004
Location: Sentado en mi trasero en Chile
Distribution: ArchLinux
Posts: 47

Rep: Reputation: 16
Wink

I use this
Code:
iptables -A INPUT -p tcp -i eth1.15 --dport 21 -m state --state NEW,INVALID -m recent --name BadGuy --set
iptables -A INPUT -p tcp -i eth1.15 --dport 21 -m state --state NEW,INVALID -m recent --seconds 60 --hitcount 3 --name BadGuy --update -j DROP
BEFORE the STABLISH,RELATED accept rule

and work just OK

Last edited by CarLost; 03-14-2008 at 10:32 AM.
 
Old 03-24-2008, 08:43 PM   #11
andy1974
Member
 
Registered: Jun 2007
Posts: 85

Original Poster
Rep: Reputation: 15
well i download and install the fail2ban, how ever i need some help configing it properly. whould there be anyone willing to help assist me ?
 
Old 03-25-2008, 05:01 AM   #12
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
Brute force...Install blockhosts, configure it and run it. Then you should be good against those attacks.
 
Old 03-25-2008, 06:16 AM   #13
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well we're already heading down one valid path, wouldn't change that for no reason... not seen blockhosts myself, doesn't look nearly as versatile as fail2ban. what problems are you actually having with fail2ban?
 
Old 03-26-2008, 08:06 AM   #14
andy1974
Member
 
Registered: Jun 2007
Posts: 85

Original Poster
Rep: Reputation: 15
Smile working

well i did finnaly got it configed correctly and seems to be working at this time. i did get a email saying that it did ban a ip for unsecsessfull login attemps. I did change the allowed attempt times. Next question i have. i take it it will unban the ip after a certain amount of time, so i am looking for that.
 
Old 03-27-2008, 08:36 AM   #15
andy1974
Member
 
Registered: Jun 2007
Posts: 85

Original Poster
Rep: Reputation: 15
Talking Working great

OK, wanted to give an update. Fail2ban has been working great for a few days now jailing threat ips. Thanks for your help Great script!!
 
  


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
Active Scanning or Passive Scanning Paris Heng Linux - Networking 2 02-15-2008 09:37 AM
Iptables rule for ftp scanning stefaandk Linux - Security 4 02-25-2007 05:19 PM
Probing disk gsrikanth Linux - Hardware 3 11-25-2004 11:39 PM
Install SUSE 8.0 (ftp) fails on Probing Hard Disks Magz Linux - Newbie 1 03-02-2004 02:57 PM
probing Joey.Dale Linux - General 2 08-28-2003 10:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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