----------------------------------------
This article is provided free by
Stealth IT Solutions Limited
It is free for non-distribution only.
Due to the nature of this data it may
not be edited, no data may be removed
including this text.
With thanks to admin0
myshashi2010@yahoo.com
------http://www.stealthhosts.com-------
CGI Security
first, we backup our apache.conf file in CPanel.
In SSH:
ok.. that is done.
Now, let's start the configurations:
edit your httpd.conf and add the following lines:
Create: /etc/mod_security
----------------------------TBC-------------------------
This article is provided free by
Stealth IT Solutions Limited
It is free for non-distribution only.
Due to the nature of this data it may
not be edited, no data may be removed
including this text.
With thanks to admin0
myshashi2010@yahoo.com
------http://www.stealthhosts.com-------
CGI Security
first, we backup our apache.conf file in CPanel.
In SSH:
Code:
cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd-backup.conf
Code:
wget http://www.modsecurity.org/download/mod_security-1.7.6.tar.gz
tar zxvf mod_security-1.7.6.tar.gz
cd mod_security-1.7.6
cd apache1/ (or apache2/)
/usr/local/apache/bin/apxs -cia mod_security.c
ok.. that is done.
Now, let's start the configurations:
edit your httpd.conf and add the following lines:
Code:
Include /etc/mod_security.conf
Create: /etc/mod_security
Code:
IfModule mod_security.c>
# Turn the filtering engine On or Off
SecFilterEngine On
# Change Server: string
SecServerSignature " "
# Make sure that URL encoding is valid
SecFilterCheckURLEncoding On
# This setting should be set to On only if the Web site is
# using the Unicode encoding. Otherwise it may interfere with
# the normal Web site operation.
SecFilterCheckUnicodeEncoding Off
# Only allow bytes from this range
SecFilterForceByteRange 1 255
# The audit engine works independently and
# can be turned On of Off on the per-server or
# on the per-directory basis. "On" will log everything,
# "DynamicOrRelevant" will log dynamic requests or violations,
# and "RelevantOnly" will only log policy violations
SecAuditEngine RelevantOnly
# The name of the audit log file
SecAuditLog /var/log/httpd/audit_log
# Should mod_security inspect POST payloads
SecFilterScanPOST On
# Action to take by default
SecFilterDefaultAction "deny,log,status:500"
# Require HTTP_USER_AGENT and HTTP_HOST in all requests
SecFilterSelective "HTTP_USER_AGENT|HTTP_HOST" "^$"
#Allow CPanel/WHM
SecFilterSelective REMOTE_ADDR "^127.0.0.1$" nolog,allow
# Weaker XSS protection but allows common HTML tags
SecFilter "<[[:space:]]*script"
# Very crude filters to prevent SQL injection attacks
SecFilter "delete[[:space:]]+from"
SecFilter "insert[[:space:]]+into"
# Protecting from XSS attacks through the PHP session cookie
SecFilterSelective ARG_PHPSESSID "!^[0-9a-z]*$"
SecFilterSelective COOKIE_PHPSESSID "!^[0-9a-z]*$"
# Import our snort converted modsec rules
Include /etc/mod_security_snort.conf
</IfModule>
----------------------------TBC-------------------------