LWP perl module (libwww-perl) cPanel csf issue.

September 24, 2009 on 3:16 pm | In APF, Cpanel | No Comments

You may face issue with the perl module LWP libwww-perl .
Just do the following

check whether the following file exist

ls -alh /root/.gnupg
cd /usr/local/src/
wget 

http://perlmirror.indialinks.com/authors/id/G/GA/GAAS/libwww-perl-5.806.tar.gz

or download the available version from http://perlmirror.indialinks.com/authors/id/G/GA/GAAS/
tar zxvf libwww-perl-5.806.tar.gz
cd libwww-perl-5.806
perl Makefile.PL
make
make install
cd ../

Also do the following

wget  http://perlmirror.indialinks.com/authors/id/A/AN/ANDK/CPAN-1.93.tar.gz
tar zxvf CPAN-1.93.tar.gz
Or download the latest from http://perlmirror.indialinks.com/authors/id/A/AN/ANDK/
cd CPAN-1.93
perl Makefile.PL
make
make install

/usr/local/cpanel/bin/checkperlmodules
/scripts/rrdtoolinstall

Now try installing csf.
It should work fine.

How to install BFD

October 11, 2008 on 9:36 am | In APF, Centos, Linux | No Comments

What is BFD (Brute Force Detection)?


BFD is a modular shell script for parsing applicable logs and checking for authentication failures. There is not much complexity or detail to BFD yet and likewise it is very straight-forward in its installation, configuration and usage. The reason behind BFD is very simple; the fact there is little to no authentication and brute force auditing programs in the linux community that work in conjunction with a firewall or real-time facility to place bans. BFD is available at: http://www.rfxnetworks.com/bfd.php

This guide will show you how to install and configure BFD to protect your system from brute force hack attempts.

Requirements:
- You MUST have APF Firewall Installed before installing BFD – it works with APF and requires some APF files to operate.
- Root SSH access to your server


Login to your server through SSH and su to the root user.

1. cd /usr/local/src/.

Article provided by WebHostGear.com

2. wget http://www.rfxnetworks.com/downloads/bfd-current.tar.gz

3. tar -xvzf bfd-current.tar.gz

4. cd bfd-*

5. Run the install file: ./install.sh
You will receive a message saying it has been installed

.: BFD installed
Install path:    /usr/local/bfd
Config path:     /usr/local/bfd/conf.bfd
Executable path: /usr/local/sbin/bfd

6. Edit the configuration file: vi /usr/local/bfd/conf.bfd

7. Enable brute force hack attempt alerts:

Find: EMAIL_USR=”root” CHANGE TO: EMAIL_USR=”your@yourdomain.com”

Save the changes

8. Prevent locking yourself out!
vi /usr/local/bfd/ignore.hosts and add your own trusted IPs
Save the changes

9. Run the program!
/usr/local/sbin/bfd -s

10. Customize your applicatoins brute force configuration
Check out the rules directory in your /usr/local/bfd

Here you’ll find all kinds of pre-made rules for popular services such as Apache, and ProFTPD w00t!
If you have any clue about shell scripting you can customize them or create new rules for enhanced brute force detection and prevent attacks.

Uninstall APF

May 14, 2008 on 2:11 am | In APF | No Comments

rm -rf /etc/apf
rm -f /etc/cron.daily/fw
rm -f /etc/init.d/apf
rm -f /usr/local/sbin/apf

Unable to load iptables module (ipt_state), aborting. APF Error

April 24, 2008 on 1:09 pm | In APF, Linux | No Comments

root@server[/etc/apf]# apf -s
Unable to load iptables module (ipt_state), aborting.
root@server[/etc/apf]#

Here is the fix

Edit /etc/apf/internals/functions.apf

vi /etc/apf/internals/functions.apf

Replace the lines

====================
ml ipt_state 1
ml ipt_multiport 1
====================

With

====================
ml xt_state
ml xt_multiport
====================

Restart apf.

APF Installation and configuration

April 9, 2008 on 9:06 pm | In APF | No Comments

1. cd /usr/local/src or another temporary folder where you store your files.

2. wget http://www.rfxnetworks.com/downloads/apf-current.tar.gz

3. tar -xvzf apf-current.tar.gz

4. cd apf-0.9.5-1/ or whatever the latest version is.

5. Run the install file: ./install.sh
You will receive a message saying it has been installed

Installing APF 0.9.5-1: Completed.

Other Details:
Listening TCP ports: 1,21,22,25,53,80,110,111,143,443,465,993,995,2082, 2083,2086,2087,2095,2096,3306
Listening UDP ports: 53,55880
Note: These ports are not auto-configured; they are simply presented for information purposes. You must manually configure all port options.

6. Configure the firewall: pico /etc/apf/conf.apf
We will go over the general configuration to get your firewall running. This isn’t a complete detailed guide of every feature the firewall has. Look through the README and the configuration for an explanation of each feature.

We like to use DShield.org’s “block” list of top networks that have exhibited
suspicious activity.
FIND: USE_DS=”0?
CHANGE TO: USE_DS=”1?

7. Configuring Firewall Ports:

Cpanel Servers
We like to use the following on our Cpanel Servers

Common ingress (inbound) ports
# Common ingress (inbound) TCP ports -3000_3500 = passive port range for Pure FTPD
IG_TCP_CPORTS=”21,22,25,53,80,110,143,443,2082,208 3, 2086,2087, 2095, 2096,3000_3500?
#
# Common ingress (inbound) UDP ports
IG_UDP_CPORTS=”53?

Common egress (outbound) ports
# Egress filtering [0 = Disabled / 1 = Enabled]
EGF=”1?

# Common egress (outbound) TCP ports
EG_TCP_CPORTS=”21,25,80,443,43,2089?
#
# Common egress (outbound) UDP ports
EG_UDP_CPORTS=”20,21,53?

8. Starting the firewall
/usr/local/sbin/apf -s

9. After everything is fine, change the DEV option
Stop the firewall from automatically clearing itself every 5 minutes from cron.
We recommend changing this back to “0? after you’ve had a chance to ensure everything is working well and tested the server out.

pico /etc/apf/conf.apf

FIND: DEVM=”1?
CHANGE TO: DEVM=”0?

10. Configure AntiDOS for APF
Relatively new to APF is the new AntiDOS feature which can be found in: /etc/apf/ad
The log file will be located at /var/log/apfados_log so you might want to make note of it and watch it!

pico /etc/apf/ad/conf.antidos

11. Checking the APF Log

tail -f /var/log/apf_log

12. New – Make APF Start automatically at boot time

chkconfig –level 2345 apf on

To remove it from autostart, run this:

chkconfig –del apf

13. Denying IPs with APF Firewall (Blocking)

Pico /etc/apf/deny_hosts.rules

You can then just add a new line and enter the IP you wish to block. Before this becomes active though you’ll need to reload the APF ruleset.

/etc/apf/apf -r

14. Allowing IPs with APF Firewall (Unblocking)

I know I know, you added an IP now you need it removed right away! You need to manually remove IPs that are blocked from deny_hosts.rules.

pico /etc/apf/deny_hosts.rules

Find where the IP is listed and remove the line that has the IP.
After this is done save the file and reload apf to make the new changes active.

/etc/apf/apf -r

pico /etc/apf/allow_hosts.rules

# added 185.14.157.123 on 08/23/05 01:39:43
# UNBLOCKING
185.14.157.123

What is APF (Advanced Policy Firewall)? APF Firewall

April 9, 2008 on 9:04 pm | In APF | No Comments

APF is a policy based iptables firewall system designed for ease of use and configuration. It employs a subset of features to satisfy the veteran Linux user and the novice alike. Packaged in tar.gz format and RPM formats, make APF ideal for deployment in many server environments based on Linux. APF is developed and maintained by R-fx Networks: http://www.rfxnetworks.com/apf.php