Blog Archives

display cronjob of all users

for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done

Posted in Scripts

Drop Sync/DDOS Attack

1. Find.. to which IP address in the server is targeted by the ddos attack netstat -plan  | grep  :80 | awk ‘{print $4}’ | cut -d: -f1 |sort |uniq -c 2. Find… from which IPs, the attack is coming

Posted in Issues, linux, Scripts, Server Security

Script for replacing a string in multiple files

for y in `ls | grep .html`; do sed “s/abc/xyz/g” $y > temp; mv -f temp $y; done

Posted in Issues, linux, Scripts

Hiding redirect url

Create an index.html file : <frameset rows=”100%”> <frame src=”http://linuxstuffs.wordpress.com/”&gt; </frameset> <noframes> <body>Please follow <a href=”http://linuxstuffs.wordpress.com/”>link</a&gt;!</body> </noframes>

Posted in General discussions, Issues, Scripts

Script used to transfer account from cpanel server

#!/bin/bash ls -1 /var/cpanel/users > /root/user_list PORT=”22″ ssh-keygen -t dsa KEY=`cat /root/.ssh/id_dsa.pub` ssh $1 -p$PORT “mkdir -p /root/.ssh;echo ${KEY} >> /root/.ssh/authorized_keys” 2>&1 scp /var/cpanel/packages/* $1:/var/cpanel/packages/ for user in $(cat /root/user_list);do /scripts/pkgacct $user;done scp /home/user_list $1:/home scp /home/cpmove* $1:/home

Posted in Cpanel, Scripts, Server Setup

Script used to correct permission of files after suphp

#!/bin/bash # For some stupid reason, cPanel screws up the directory permissions. chmod 755 /opt/suphp find /opt/suphp -type d -exec chmod 755 {} \; # Ensure that the permissions are sane and won’t cause a 500 error. for user in

Posted in Cpanel, Issues, Scripts, Server Security

Script used to find vulnerable php files

#!/bin/bash shellpattern=’r0nin|m0rtix|upl0ad|r57|c99|shellbot|phpshell|void\.ru|phpremoteview|directmail|bash_history|vulnscan|spymeta|raslan58′ for user in `/bin/ls /var/cpanel/users` do find /home/$user/public_html \( -name ‘*.php’ -o -name ‘*.cgi’ -o -name ‘*.inc’ \) -exec \ egrep -il “$shellpattern” {} \; done

Posted in Issues, Scripts, Server Security

Stats not working in Plesk

Create the following cron: ———————————————————————————————— 9,24,39,54  * * * * /usr/local/psa/admin/sbin/backupmng >/dev/null 2>&1 10 1 * * * /usr/local/psa/admin/sbin/statistics >/dev/null 2>&1 10 1 * * * /usr/local/psa/admin/sbin/statistics –calculate-one –domain-name=xxx.com ———————————————————————————————— and run the script for checking : /usr/local/psa/admin/sbin/statistics –calculate-one –domain-name=xxx.com

Posted in Issues, Plesk, Scripts, Third party softwares

Red5 installation

cd /root vi red5install copy paste the below script echo ” ” echo “Hello ,Please choose the RED5 version : (1,2,3 or 4)” echo ” ” echo “1. RED5 0.7.0″ echo “2. RED5 0.6.3″ echo “3. RED5 0.5 ” echo

Posted in General discussions, Scripts, Server Setup, Third party softwares

Run CGI scripts anywhere in the server + Plesk

Server wide : cd /etc/httpd/conf/ cp -p httpd.conf httpd.conf.bak vi httpd.conf uncomment AddHandler cgi-script .cgi service httpd restart or 1. create an .htaccess file in your cgi-bin directory, that file should have the following AddType text/x-server-parsed-html .html AddType application/x-httpd-cgi .cgi

Posted in Apache, Issues, Plesk, Scripts
Blog Stats
  • 111,609 hits
Follow

Get every new post delivered to your Inbox.

Join 209 other followers