|
|

06-26-2009, 04:15 PM
|
|
Senior Member
|
|
Join Date: Nov 2007
Location: New York
Posts: 729
|
|
|
Just a word of caution...the user agent can easily be spoofed, many botnets do this.
|

06-28-2009, 07:20 PM
|
|
Senior Member
|
|
Join Date: Jan 2009
Posts: 52
|
|
|
Sasha, good mod_security rules will help with a large percentage of what you are getting hit with, and reduce the load on your server quite a bit. Due to the size of the forums you're running you'd be better with:
Static req/sec: 15
Dynamic req/sec: 5
|

06-29-2009, 10:33 PM
|
|
Member
|
|
Join Date: Jun 2009
Posts: 26
|
|
Thank you all for your responses. Ty Ant.
I have installed ClamAV and ModClamAV on my DA
Also installed Mod Security2 and have put the rules as given by Ant on the other thread.
http://www.litespeedtech.com/support...ead.php?t=2982
When i restart httpd i get this error...
LiteSpeed Administrator i get these in Error Log..
Code:
2009-06-30 00:16:25.543 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: XML:/*
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: RESPONSE_BODY
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: REQUEST_PROTOCOL
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: RESPONSE_HEADERS:Content-Encoding
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: GLOBAL:alerted_960903_compression
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: REQUEST_PROTOCOL
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: RESPONSE_STATUS
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: WEBSERVER_ERROR_LOG
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: Transfer-Encoding)/'
2009-06-30 00:16:25.546 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: REQBODY_PROCESSOR_ERROR
2009-06-30 00:16:25.546 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: REQUEST_URI_RAW
UPDATED
Last edited by -KaaL-; 06-30-2009 at 12:19 AM..
Reason: fix some errors.. but some are still there..
|

06-30-2009, 12:03 PM
|
|
Senior Member
|
|
Join Date: Jan 2009
Posts: 52
|
|
Quote:
Originally Posted by -KaaL-
Thank you all for your responses. Ty Ant.
I have installed ClamAV and ModClamAV on my DA
Also installed Mod Security2 and have put the rules as given by Ant on the other thread.
http://www.litespeedtech.com/support...ead.php?t=2982
When i restart httpd i get this error...
LiteSpeed Administrator i get these in Error Log..
Code:
2009-06-30 00:16:25.543 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: XML:/*
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: RESPONSE_BODY
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: REQUEST_PROTOCOL
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: RESPONSE_HEADERS:Content-Encoding
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: GLOBAL:alerted_960903_compression
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: REQUEST_PROTOCOL
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: RESPONSE_STATUS
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: WEBSERVER_ERROR_LOG
2009-06-30 00:16:25.545 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: Transfer-Encoding)/'
2009-06-30 00:16:25.546 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: REQBODY_PROCESSOR_ERROR
2009-06-30 00:16:25.546 ERROR [[HTAccess]] rewrite: unknown server variable while parsing: REQUEST_URI_RAW
UPDATED
|
I get some of the same errors, and I asked about them in an email to LS Support, and they responded that they don't mean anything, because if you wait a few minutes and refresh the page the errors are all gone. They are mod_security alerts, so technically you could go through the mod_security log and find out what it triggering it, but I never have and everything works fine.
Last edited by grniyce; 06-30-2009 at 12:05 PM..
|

06-30-2009, 12:08 PM
|
|
Senior Member
|
|
Join Date: Jan 2009
Posts: 52
|
|
Another good tool to install and configure is MailScanner. You can protect yourself from the HTML:Iframe injections, and it works perfectly with ClamAV. Just configure everything, start it, and it scans incoming and outgoing mail for spam to protect your server from rogue spam scripts, as well as from people trying to use your server as a mail bomber / spammer / etc.
http://www.mailscanner.info/
Make sure you have all the php.ini disable_functions set in the default /usr/local/lib/php.ini
Make sure you have safe mode cgi so cgi scripts CANNOT override the default php.ini permissions (as that is what the latest crackers are using to root boxes).
I have SuPHP, Suhosin, Safe Mode, Safe CGI Mode, mod_perl, mod_security, mod_bandwidth, and when setting up packages choose for users to NOT have cgi access unless you know that person and can trust them. It's what puts you at risk for more sql injections and so forth.
I learned the hard way. Then once all that is recompiled, build matching php in LSWS.
Last edited by grniyce; 06-30-2009 at 12:14 PM..
|

06-30-2009, 02:05 PM
|
|
Senior Member
|
|
Join Date: Nov 2007
Location: New York
Posts: 729
|
|
Quote:
Originally Posted by grniyce
Make sure you have safe mode cgi so cgi scripts CANNOT override the default php.ini permissions (as that is what the latest crackers are using to root boxes)
|
How to do this?
|

06-30-2009, 05:33 PM
|
|
Senior Member
|
|
Join Date: Jan 2009
Posts: 52
|
|
|
Last edited by grniyce; 06-30-2009 at 05:36 PM..
|

06-30-2009, 06:08 PM
|
|
Senior Member
|
|
Join Date: Jan 2009
Posts: 52
|
|
Sasha a few other things you should do are these:
In your /usr/local/lib/php.ini put these where it says disable_functions:
Code:
disable_functions = "fpassthru, crack_check, crack_closedict, crack_getlastmessage, crack_opendict, psockopen, php_ini_scanned_files, hell-exec, system, dl, ctrl_dir, phpini, tmp, safe_mode, systemroot, server_software, get_current_user, HTTP_HOST, php_uname, ini_restore, popen, pclose, exec, shell_exec, suExec, passthru, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, pfsockopen, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, posix_ctermid, posix_getcwd, posix_getegid, posix_geteuid, posix_getgid, posix_getgrgid, posix_getgrnam, posix_getgroups, posix_getlogin, posix_getpgid, posix_getpgrp, posix_getpid, posix_getppid, posix_getpwnam, posix_getpwuid, posix_getrlimit, posix_getsid, posix_getuid, posix_isatty, posix_setegid, posix_seteuid, posix_setgid, posix_times, posix_ttyname, posix_uname, posix_access, posix_get_last_error, posix_mknod, posix_strerror, posix_initgroups, posix_setsidposix_setuid, show_source, apache_setenv, define_syslog_variables, eval, fp, fput, ftp_connect, ftp_exec, ftp_get, ftp_login, ftp_nb_fput, ftp_put, ftp_raw, ftp_rawlist, highlight_file, ini_alter, ini_get_all, inject_code, openlog, phpAds_remoteInfo, phpAds_XmlRpc, phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, syslog, xmlrpc_entity_decode, ini_set"
now in /etc/my.cnf (this is just mine, which is on a dual Xeon 3.0ghz 4gb ram) Raghav or whomever may need to tweak yours for your specific hardware, but even applying this if you have nothing in your my.cnf will help reduce load averages and (d)dos effects
Code:
[mysqld]
datadir=/var/lib/mysql
local-infile = 0
skip-locking
skip-innodb
skip-bdb
safe-show-database
max_connections = 800
key_buffer = 64M
myisam_sort_buffer_size = 64M
join_buffer_size = 1M
read_buffer_size = 2M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M
table_cache = 1024
record_buffer = 1M
thread_cache_size = 128
wait_timeout = 30
connect_timeout = 10
interactive_timeout = 10
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_limit = 1M
query_cache_size = 64M
query_cache_type = 1
thread_concurrency = 4
default-storage-engine = MyISAM
[mysqld_safe]
open_files_limit = 8192
[mysqldump]
quick
max_allowed_packet = 100M
[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
Also, in LSWS Admin / Configuration change the Keep Alive requests to like 100 and make the timeout 3 seconds.
As for CSF, after many many attempts to get the configuration set appropriately I found these settings work the best:
Config Server CSF Settings Word Document
Last edited by grniyce; 06-30-2009 at 06:11 PM..
|

06-30-2009, 11:01 PM
|
|
Member
|
|
Join Date: Jan 2009
Posts: 40
|
|
Quote:
Originally Posted by -KaaL-
Hello,
I am planning to buy LiteSpeed Enterprise for my server.
But i would just like to make sure it would be worth the price.
I am currently using the Trial Version ..
Linux CentOS 32bit with DA
I just want to get the right setting..
I have followed most of the threads.. including http://www.litespeedtech.com/how-tos.html#qa_dos
But just didnt know how to mitigate attacks from different IPs.
I read the last point there about General Context. But i didnt understand that part..
I have posted an image of a log of an attack i experience..
Thank you,
Arvind.
|
wow KaaL , amazing log , i'm using DA , how can i access this log for my server ?!
|

06-30-2009, 11:57 PM
|
|
Member
|
|
Join Date: Jun 2009
Posts: 26
|
|
I have done all what has been said by Ant. Appreciate it.
But the Mod Security rules you posted on the other thread forbids members to post reply or post a new thread ... i think some settings has to be lowered..
Thank you again..
Quote:
Originally Posted by Cyber-DL
wow KaaL , amazing log , i'm using DA , how can i access this log for my server ?!
|
APACHE 1.x
http://httpd.apache.org/docs/1.3/mod/mod_status.html
APACHE 2.x
http://httpd.apache.org/docs/2.2/mod/mod_status.html
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 01:44 AM.
|
|