View previous topic :: View next topic |
Author |
Message |
durty_nacho Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/995075954755175a67b0e.jpg)
Joined: 22 Jul 2004 Posts: 128 Location: Dallas
|
Posted: Thu Nov 29, 2007 1:23 am Post subject: Host in hosts.allow that are set to DENY can still access |
|
|
I run VSFTPD and get dictionary attacks a lot, so I have a cron job that runs blockhosts every 5 minutes and scans my vsftpd.log file for failed login attempts, and adds the culprits who attack me to my hosts.allow file as a DENY. This has always worked, but today I found an IP that keeps attacking me even though he has been successfully added to the hosts.allow file as a DENY. The cron job is running fine, it definitely added the IP to the hosts.allow file and it is set to DENY, so why does this host still access me? I have him blocked with an iptables rule for the moment but I am very curious why this host is not being blocked with my hosts.allow file. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hu Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
Joined: 06 Mar 2007 Posts: 23103
|
Posted: Thu Nov 29, 2007 3:26 am Post subject: |
|
|
Blocking with an iptables rule is a better choice anyway. Is your hosts.allow file written in such a way that an earlier entry is matching the attacking machine? As I read the manpage, hosts.allow is a first-match-wins design, so if something higher up has whitelisted the host, your blacklist entry will have no effect. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
durty_nacho Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/995075954755175a67b0e.jpg)
Joined: 22 Jul 2004 Posts: 128 Location: Dallas
|
Posted: Thu Nov 29, 2007 3:34 am Post subject: |
|
|
Yeah I thought about that, I have nothing whitelisted at all. The reason I use blockhosts instead of iptables is I want an automated and dynamic process to temporarily ban an IP. This seems to work best for what I need. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Cyker Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 15 Jun 2006 Posts: 1746
|
Posted: Thu Nov 29, 2007 8:34 am Post subject: |
|
|
Erm.. did you mean hosts.deny...? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
bunder Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
Joined: 10 Apr 2004 Posts: 5947
|
Posted: Thu Nov 29, 2007 9:58 am Post subject: |
|
|
last i checked hosts.allow/deny only works with things built with tcp-wrappers, do you have the tcpd flag set?
cheers
ps: if you don't want to install it, go the iptables route instead.
pps: iptables can be automated with fail2ban. _________________
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
banned from #gentoo since sept 2017 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
durty_nacho Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/995075954755175a67b0e.jpg)
Joined: 22 Jul 2004 Posts: 128 Location: Dallas
|
Posted: Fri Nov 30, 2007 5:22 pm Post subject: |
|
|
I dont want to use fail2ban because it only works for sshd and proftp, not vsftpd (from what i read). vsftpd has its tcp_wrappers=YES option enabled. It is working again, not sure what the heck was wrong. Maybe the cron job was failing without errors. Thanks for the replies. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|