Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Host in hosts.allow that are set to DENY can still access
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
durty_nacho
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jul 2004
Posts: 128
Location: Dallas

PostPosted: Thu Nov 29, 2007 1:23 am    Post subject: Host in hosts.allow that are set to DENY can still access Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23103

PostPosted: Thu Nov 29, 2007 3:26 am    Post subject: Reply with quote

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
View user's profile Send private message
durty_nacho
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jul 2004
Posts: 128
Location: Dallas

PostPosted: Thu Nov 29, 2007 3:34 am    Post subject: Reply with quote

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
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Thu Nov 29, 2007 8:34 am    Post subject: Reply with quote

Erm.. did you mean hosts.deny...?
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5947

PostPosted: Thu Nov 29, 2007 9:58 am    Post subject: Reply with quote

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. :wink:

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
View user's profile Send private message
durty_nacho
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jul 2004
Posts: 128
Location: Dallas

PostPosted: Fri Nov 30, 2007 5:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum