Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Email me when attack occurs
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
J_L
n00b
n00b


Joined: 11 Sep 2006
Posts: 68
Location: Gothenburg

PostPosted: Wed Dec 06, 2006 1:09 pm    Post subject: Email me when attack occurs Reply with quote

Hi all!

I've been googeling a while for an answer for my question but I only found very complex solutions to my problem...
I went trough my logfiles recently and discovered a signifficant increase in bruteforceattemts on my box, ssh that is.
I'm working on a script that will email me every time my sshd-server blocks an IP. But I don't know anything about MTA or qmail or stuff like that... How do I achive my goals EASILY?
Back to top
View user's profile Send private message
elgato319
Guru
Guru


Joined: 15 Sep 2005
Posts: 546

PostPosted: Wed Dec 06, 2006 2:11 pm    Post subject: Reply with quote

i use denyhosts (app-admin/denyhosts) to block bruteforce attempts. i works really well.

a nice feature is that you can recieve an email if a new ip has been blocked.

denyhosts.conf
Quote:

# ADMIN_EMAIL: if you would like to receive emails regarding newly
# restricted hosts and suspicious logins, set this address to
# match your email address. If you do not want to receive these reports
# leave this field blank (or run with the --noemail option)
Back to top
View user's profile Send private message
JeliJami
Veteran
Veteran


Joined: 17 Jan 2006
Posts: 1086
Location: Belgium

PostPosted: Wed Dec 06, 2006 2:48 pm    Post subject: Reply with quote

fail2ban can do something similar
Code:
emerge -s fail2ban denyhosts
Searching...
[ Results for search key : fail2ban ]
[ Applications found : 1 ]

*  net-analyzer/fail2ban
      Latest version available: 0.6.0
      Latest version installed: [ Not Installed ]
      Size of files: 20 kB
      Homepage:      http://fail2ban.sourceforge.net/
      Description:   Bans IP that make too many password failures
      License:       GPL-2


Searching...
[ Results for search key : denyhosts ]
[ Applications found : 1 ]

*  app-admin/denyhosts
      Latest version available: 2.5
      Latest version installed: [ Not Installed ]
      Size of files: 41 kB
      Homepage:      http://www.denyhosts.net
      Description:   DenyHosts is a utility to help sys admins thwart ssh hackers
      License:       GPL-2

_________________
Unanswered Post Initiative | Search | FAQ
Former username: davjel
Back to top
View user's profile Send private message
J_L
n00b
n00b


Joined: 11 Sep 2006
Posts: 68
Location: Gothenburg

PostPosted: Wed Dec 06, 2006 10:18 pm    Post subject: Reply with quote

i have installed it following the guide at http://gentoo-wiki.com/HOWTO_Protect_SSHD_with_DenyHosts
of course i tryed it,that means that i tryed to see if it worked(i connected with wrong usernames and it denyed my ip)
but now i can't connect anymore with my laptop locally(connected to my access point) because the ip of my laptop is blacklisted
i tryed to remove it from hosts.deny but it keeps adding it
i tryed to purge my list but it didn't work
what should i try now

That's actually a qoute from another guy but the same problem goes for me now :oops:
Back to top
View user's profile Send private message
pele_smk
Tux's lil' helper
Tux's lil' helper


Joined: 06 Mar 2004
Posts: 94
Location: Phoenix, AZ

PostPosted: Thu Dec 07, 2006 5:47 am    Post subject: Reply with quote

Hmm...first I have to chuckle; now I can be serious. I've been using denyhosts for a while and tested it in the same manner as you(test it with my own machine) I did just as you did and removed myself from the hosts.deny file and was back on.

The reason denyhosts is adding you back into the hosts.deny file is because the log file denyhosts is running against is still finding your ip. Go do some hacker clean up and remove your info from your logs and denyhosts "should" stop blacklisting you.
_________________
AMD64 3000+
Chaintech ZNF3-150
Chaintech ti4200 SE
WD 120gb && Maxtor 250gb && Maxtor 250gb,
Lite-On DVD+-RW
Coolermaster ATC-210
Thermalright slk & Tornado 92mm
It's still hot......
Back to top
View user's profile Send private message
J_L
n00b
n00b


Joined: 11 Sep 2006
Posts: 68
Location: Gothenburg

PostPosted: Thu Dec 07, 2006 8:19 am    Post subject: Reply with quote

"Go do some hacker clean up and remove your info from your logs and denyhosts "should" stop blacklisting you."

What log files would this be? I've already tried to remove my entire /var/log/messages and that did not work :(
Back to top
View user's profile Send private message
pele_smk
Tux's lil' helper
Tux's lil' helper


Joined: 06 Mar 2004
Posts: 94
Location: Phoenix, AZ

PostPosted: Thu Dec 07, 2006 4:06 pm    Post subject: Reply with quote

off the bat I was thinking var/log/messages is what denyhosts looks at, but look into what log file denyhosts is actually referring to.
_________________
AMD64 3000+
Chaintech ZNF3-150
Chaintech ti4200 SE
WD 120gb && Maxtor 250gb && Maxtor 250gb,
Lite-On DVD+-RW
Coolermaster ATC-210
Thermalright slk & Tornado 92mm
It's still hot......
Back to top
View user's profile Send private message
elgato319
Guru
Guru


Joined: 15 Sep 2005
Posts: 546

PostPosted: Mon Dec 11, 2006 12:34 pm    Post subject: Reply with quote

you can go to:

/var/lib/denyhosts

and add your ip/hostname to: allowed-hosts

maybe this will help too
Back to top
View user's profile Send private message
rockier
n00b
n00b


Joined: 01 Jan 2005
Posts: 19

PostPosted: Sat Sep 26, 2009 10:09 pm    Post subject: Reply with quote

The denyhosts enter has changed to this

http://en.gentoo-wiki.com/wiki/DenyHosts
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