LinuxQuestions.org
Visit Jeremy's Blog.
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 10-15-2020, 12:02 PM   #1
seamore
Member
 
Registered: Sep 2009
Posts: 83

Rep: Reputation: 1
Blocking an IP after multiple attempts


Recently in reviewing http access log I discovered a hack attempt where a script was trying to access random xxx.php files that do not exist on my server. There were up to 4 attempts per second.

I realize that it is not very effective to block an IP because many times hackers use a proxy server.

Is it possible to configure or write a script that would temporarily block an IP address for say an hour it there are http requests coming in a second or less apart?
 
Old 10-15-2020, 12:06 PM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,308
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
You can write an NFtables rule for that or, with legacy tools, make one in IPtables instead.

But first you might look at both SSHguard and Fail2ban. Those are quite tunable and already do much of what you ask.
 
Old 10-15-2020, 12:17 PM   #3
seamore
Member
 
Registered: Sep 2009
Posts: 83

Original Poster
Rep: Reputation: 1
Great!
Will look into the apps you suggest.
Thanks
 
Old 10-15-2020, 02:49 PM   #4
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Hi,

I use fail2ban exactly for that.
So, I do accept to affect legitimate and good users that share a proxy with a rogue user.
 
  


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
firewall keeps blocking connection attempts (from router?) ondoho Linux - Networking 3 07-12-2016 07:55 AM
Account locked after multiple authentication attempts using plink nickg123 AIX 1 08-08-2013 04:31 AM
[SOLVED] iptables not blocking ssh attempts padeen Linux - Networking 1 04-17-2013 11:46 PM
[SOLVED] C - What's the difference between a blocking and a non-blocking call? golmschenk Programming 5 03-06-2010 06:45 PM
fail2ban best method of blocking brute force attempts? mrtwice Linux - Security 3 12-09-2008 10:52 AM

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

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