2019-02-09 10:09:34 +01:00
|
|
|
#bin/sh!
|
|
|
|
|
|
|
|
|
|
# checking for unrelated
|
|
|
|
|
echo '[*] Checking for Unrelated Data';
|
|
|
|
|
echo
|
|
|
|
|
echo '[*] Directories with more than 1GB size:';
|
|
|
|
|
du -h ./ | grep '[0-9]G\>'
|
|
|
|
|
echo
|
2019-02-09 10:22:28 +01:00
|
|
|
echo '[*] Files with more than 10M size:';
|
|
|
|
|
find ./ -size +10000k -exec du -sh {} \;
|
2019-02-09 10:09:34 +01:00
|
|
|
echo '[*]Fixing file and folder permissions:';
|
|
|
|
|
#directories
|
|
|
|
|
find public_html/ -perm 0000 -follow -type d -print -exec chmod 755 {} \;
|
|
|
|
|
find public_html/ -perm +og+w -follow -type d -print -exec chmod 755 {} \;
|
|
|
|
|
# files
|
|
|
|
|
find public_html/ -perm 0000 -follow -type f -print -exec chmod 644 {} \;
|
|
|
|
|
find public_html/ -perm 0400 -follow -type f -print -exec chmod 644 {} \;
|
|
|
|
|
find public_html/ -perm 0440 -follow -type f -print -exec chmod 644 {} \;
|
|
|
|
|
find public_html/ -perm 0444 -follow -type f -print -exec chmod 644 {} \;
|
|
|
|
|
find public_html/ -perm +og+w -follow -type f -print -exec chmod 644 {} \;
|
|
|
|
|
# Perl/CGI
|
|
|
|
|
find public_html/ -perm +og+w -follow -type f -name "*.cgi" -print -exec chmod 755 {} \;
|
|
|
|
|
find public_html/ -perm +og+w -follow -type f -name "*.pl" -print -exec chmod 755 {} \;
|
|
|
|
|
echo
|
2019-02-09 10:22:28 +01:00
|
|
|
echo '[*] Removing data garbage like error logs:'
|
|
|
|
|
find public_html/ -type f -name "error_log" -exec rm -rfv {} \;
|
|
|
|
|
|
2019-02-09 10:09:34 +01:00
|
|
|
echo '[*] Running the malware cleaner:'
|
|
|
|
|
perl /home/$(whoami)/public_html/LP-MSH-Scanner/malwaresh.pl $(whoami)
|
|
|
|
|
echo
|
|
|
|
|
echo '[*] Running the Python scanner :'
|
|
|
|
|
python /home/$(whoami)/public_html/LP-MSH-Scanner/scan.py --minscore=10 /home/$(whoami) | grep filename
|
|
|
|
|
echo
|
|
|
|
|
echo '[*] Running the CMS Version Scanner:'
|
|
|
|
|
php -d memory_limit=512M /home/$(whoami)/public_html/LP-MSH-Scanner/cms-vss.php $(whoami)
|
|
|
|
|
echo
|
|
|
|
|
echo '[*] Running the PHP Scanner:'
|
|
|
|
|
cd /home/$(whoami)/public_html/LP-MSH-Scanner && php -d memory_limit=512M scan.php
|
2019-02-09 10:22:28 +01:00
|
|
|
echo
|
|
|
|
|
echo '[*] Job done... removing the scanner'
|
|
|
|
|
rm -rf /home/$(whoami)/public_html/LP-MSH-Scanner
|