Reply
 
Thread Tools Display Modes
  #21  
Old 10-07-08, 03:51 PM
wardmundy wardmundy is offline
Nerd Uno
 
Join Date: Oct 2007
Posts: 3,881
Using the suggested setup with the current install of Fail2Ban will cause Fail2Ban to shut down abnormally which will leave you with NO PROTECTION so... hold off until we get a stable solution tested.
Reply With Quote
  #22  
Old 10-12-08, 01:45 PM
wardmundy wardmundy is offline
Nerd Uno
 
Join Date: Oct 2007
Posts: 3,881
Fail2Ban 0.8.3 Upgrade
OK. Here's a first cut at a script to upgrade your PBX in a Flash system (only) to Fail2Ban 0.8.3. It has been configured to protect against password attacks in SSH, Apache, and Asterisk SIP. Feedback appreciated.

Log into your server as root, and...
Code:
cd /root
mkdir fail2ban
cd fail2ban
wget http://pbxinaflash.net/source/fail2ban/fail2ban-update
chmod +x fail2ban-update
./fail2ban-update

Once the install finishes, be sure to check whether it's running. You should get two entries with this command:
Code:
ps aux | grep fail2ban-server

If not, restart the service and repeat the test again.
Code:
service fail2ban restart
We strongly recommend that you test all 3 password scenarios, i.e. log into your server 4 times with an incorrect SSH password; log into the FreePBX admin module 4 times with an incorrect maint password; use a softphone and log into a SIP extension on your server 4 times with an incorrect extension password. If you don't get blocked for 30 minutes in every case, there's a problem.
Reply With Quote
  #23  
Old 10-12-08, 05:16 PM
tel0p tel0p is offline
Guru
 
Join Date: Nov 2007
Location: Seattle, WA
Posts: 195
OK
First I ran 'yum install fail2ban' then Ward's instructions (above), then changed the email address(es) in /etc/fail2ban/jail.conf, then ran 'service fail2ban restart' . All seems well.

I'm guessing I need to go in and make sure every one of my extensions has a hard to guess password now otherwise this does no good at all. (Assuming a bot would first try the obvious and get in under the radar in < 5 tries on my SIP port). Am I right?
Reply With Quote
  #24  
Old 10-12-08, 05:52 PM
wardmundy wardmundy is offline
Nerd Uno
 
Join Date: Oct 2007
Posts: 3,881
Yep. I'd try extensions 201, 501, and 701. And, if your extension passwords match your extension numbers, you're probably S.O.L.
Reply With Quote
  #25  
Old 10-12-08, 07:06 PM
tel0p tel0p is offline
Guru
 
Join Date: Nov 2007
Location: Seattle, WA
Posts: 195
Well, I wouldn't really be out of luck, i'd just need to be diligent in editing some files in /tftp, some extensions 'secrets' in FreePBX and rebooting my endpoints
Reply With Quote
  #26  
Old 10-13-08, 06:18 AM
rapidnet rapidnet is offline
Member
 
Join Date: Jul 2008
Posts: 55
I followed your instructions, worked perfectly!

Thx!
Reply With Quote
  #27  
Old 10-13-08, 02:25 PM
tabbertmj tabbertmj is offline
Senior Member
 
Join Date: Jul 2008
Location: MN
Posts: 172
I followed the instructions, not when I log in to the server, it shows "Fail2Ban" offline. When I start the service , then log off, and log back in, it shows offline again. I went and tried the upgrade again, same thing.

Any thoughts?
Reply With Quote
  #28  
Old 10-13-08, 02:38 PM
wardmundy wardmundy is offline
Nerd Uno
 
Join Date: Oct 2007
Posts: 3,881
First, it wouldn't have let you install it again unless you did something horribly wrong the first time. Use the directions provided above for testing. Ignore the fail2ban status message which currently reports on the old version... which, of course, is gone.

Last edited by wardmundy : 10-13-08 at 03:33 PM.
Reply With Quote
  #29  
Old 10-13-08, 03:10 PM
tabbertmj tabbertmj is offline
Senior Member
 
Join Date: Jul 2008
Location: MN
Posts: 172
It did allow me to do it again. And it still shows offline when I log in.

Last edited by tabbertmj : 10-13-08 at 03:24 PM.
Reply With Quote
  #30  
Old 10-13-08, 03:33 PM
wardmundy wardmundy is offline
Nerd Uno
 
Join Date: Oct 2007
Posts: 3,881
Please read the second and third sentences above.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:00 PM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2007-2008, Ward Mundy & Associates