|
||
Title: Detecting brute forcing listener password Post by Pete Finnigan on Dec 9th, 2005, 2:32pm Hi, Pete and others have talked about the listener security. It has no features like lock out after x failures, no password aging/management, etc. So the password can be brute forced. I have written a perl script that continuously scans the listener log file for tns-01169 errors. Tns-01169 is not necessarily a synonym for a bad password but IMHO it is a valid assumption that a tns-01169 error will follow after a wrong password. A hacker would try a password and then (eg.) a status command to see if he has guessed the correct password. In case he chooses a wrong password this would generate the tns-01169 error. In case he guesses the correct password we are in trouble :( My perl script checks the listener log for the tns-01169 every minute and email the administrator in case it founds an tns-01169 in the log for the scan period. Tns-01169 previously found are not emaild again. The scan period is one minute. It is a very simple script that can be easily converted to a Shell script. It can be easily improved: for example instead of emailing an alert it could be programmed to stop the listener after x attempts (=tns-01169). Anyway I'm posting the script and use it at your own risk. You have to enable the listener logging. Ivan -------------------- perl script -------------------- Code:
|
||
Title: Re: Detecting brute forcing listener password Post by Pete Finnigan on Dec 10th, 2005, 9:53pm Hi Ivan, Thanks very much for this script. It will prove useful as a starting point for people who want to monitor their listener logs. Great! cheers Pete |
||
Title: Re: Detecting brute forcing listener password Post by Pete Finnigan on Dec 12th, 2005, 5:53pm Hey, I have a smiliar script I use to monitor my listener log file. The only caveat is if you rotate your logs then you'll have to restart it. I keep a file pointer open to the logfile and just scan what has changed since the last round. I have a similiar script I use to monitor the alert log. Code:
|
||
Title: Re: Detecting brute forcing listener password Post by Pete Finnigan on Dec 14th, 2005, 6:26pm Thanks a lot for this script. cheers Pete |
||
Title: Re: Detecting brute forcing listener password Post by Pete Finnigan on Dec 15th, 2005, 11:45pm Pete, I use swatch (http://swatch.sourceforge.net/) for the listeners at my site. I have a config file which I use to notify us when there are issues: watchfor /TNS\-01169:.* not recognized the password/ mail=it-help@here,subject=TNS password failure throttle 01:00:00 Fortunately, I have had not atttempts to hack the listener. It does present an issue for log rotation, but I have overcome this by stopping the listener and then the swatch process, move the log file, and then restart the processes. I could have rolled my own Perl solution, but this looked interesting and we use swatch now for many other log file watching. Ron Reidy |
||
Title: Re: Detecting brute forcing listener password Post by Pete Finnigan on Dec 16th, 2005, 9:30pm Thanks very much for this Ron, this is a very simple solution to the issue of monitoring the listener log. This method as can be seen would be very easy to apply to other logs and easy to configure to watch for anything in them. I recommend the use of swatch in the SANS course and the book. This is a great, simple example. thanks Pete |
||
Powered by YaBB 1 Gold - SP 1.4! Forum software copyright © 2000-2004 Yet another Bulletin Board |