PHP Spam Scripts

PHP Spam Scripts I finally decided this topic deserves its own page. To find the script sending spam Plesk Ver -11.0 cat /var/www/vhosts/domain.com/statistics/logs/access_log | grep POST > /tmp/post.log Ver 11.5+ cat /var/www/vhosts/system/domain.com/statistics/logs/access_log | grep POST > /tmp/post.log WHM cPanel cat /usr/local/apache/domlogs/domain.com | grep POST > /tmp/post.log View the results cat /etm/post.log 78.138.118.128 - - [02/Jan/2014:10:51:41 -0500] "POST /tmp/sys09725841.php HTTP/1.1" 200…

Zero Out Log File

> logfile or cat /dev/null > logfile if you want to be more eloquent, will empty logfile (actually they will truncate it to zero size). You can also use truncate logfile --size 0 to be perfectly explicit or, if you don't want to, rm logfile (applications usually do recreate a logfile if it doesn't exist already). However, since logfiles are…

Mysql Report

Another tool of a similar nature is the MySQLReport tool which can be found at http://hackmysql.com. Information can be found here about how to read and analyse the report that is produces from this link http://hackmysql.com/mysqlreportguide. You can load it up remotely and build it on your server in a similar way making use of an HTTP tool like CURL…

Using Mysqltuner

Download/Installation Simple wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl # chmod +x mysqltuner.pl # ./mysqltuner.pl You can download the entire repository by using 'git clone' followed by the cloning URL above. The simplest and shortest method is: wget mysqltuner.pl perl mysqltuner.pl Change the permissions you can execute it without calling perl directly. [root@austin ~]# chmod +x mysqltuner.pl [root@austin ~]# ./mysqltuner.pl >> MySQLTuner 1.2.0 - Major…

Mysql Check/Repair Database

Check a Specific Table in a Database If your application gives an error message saying that a specific table is corrupted, execute the mysqlcheck command to check that one table. The following are some of the key options that you can use along with mysqlcheck. -A, –all-databases Consider all the databases -a, –analyze Analyze tables -1, –all-in-1 Use one query per database with…

PHP Sessions causing Error

Currently your messages log is filling up with errors and the system is unstable. Check the message log: $ server# tail -f /var/log/messages Jul 28 08:57:30 mail kernel: EXT4-fs warning (device sda3): ext4_dx_add_entry: Directory index full! Check the sessions directory $ server# php -i | grep session.save_path session.save_path => /var/lib/php/session => /var/lib/php/session $ server# du -shcx /var/lib/php/session 1000.0M /var/lib/php/session 1000.0M…

rsync from one server to another

Basically, $ rsync options source destination Synchronize Files From Local to Remote (Plesk to cPanel) $ rsync -avz /var/www/vhosts/domain.com/httpdocs/ sshuser@192.168.200.99:/home/user/public_html/ Synchronize Files From Remote to Local )cPanel to Plesk) $ rsync -avz sshuser@198.50.162.99:/home/username/public_html/ /var/www/vhosts/domain.com/httpdocs/ Here is a short summary of the options available in rsync. Please refer to the detailed description below for a complete description. -v, --verbose increase verbosity…