fixed bugz
This commit is contained in:
58
run.sh
58
run.sh
@@ -1,41 +1,37 @@
|
|||||||
#bin/sh!
|
#bin/sh!
|
||||||
|
|
||||||
# defines
|
|
||||||
user = $(whoami)
|
|
||||||
log_file = $(whoami).txt
|
|
||||||
|
|
||||||
echo '[*] Fixing file and folder permissions:';
|
echo '[*] Fixing file and folder permissions:';
|
||||||
# Directories
|
# Directories
|
||||||
find public_html/ -perm 0000 -follow -type d -print -exec chmod 755 {} \; >> $log_file
|
find public_html/ -perm 0000 -follow -type d -print -exec chmod 755 {} \; >> $(whoami).txt
|
||||||
find public_html/ -perm +og+w -follow -type d -print -exec chmod 755 {} \; >> $log_file
|
find public_html/ -perm +og+w -follow -type d -print -exec chmod 755 {} \; >> $(whoami).txt
|
||||||
# Files
|
# Files
|
||||||
find public_html/ -perm 0000 -follow -type f -print -exec chmod 644 {} \; >> $log_file
|
find public_html/ -perm 0000 -follow -type f -print -exec chmod 644 {} \; >> $(whoami).txt
|
||||||
find public_html/ -perm 0400 -follow -type f -print -exec chmod 644 {} \; >> $log_file
|
find public_html/ -perm 0400 -follow -type f -print -exec chmod 644 {} \; >> $(whoami).txt
|
||||||
find public_html/ -perm 0440 -follow -type f -print -exec chmod 644 {} \; >> $log_file
|
find public_html/ -perm 0440 -follow -type f -print -exec chmod 644 {} \; >> $(whoami).txt
|
||||||
find public_html/ -perm 0444 -follow -type f -print -exec chmod 644 {} \; >> $log_file
|
find public_html/ -perm 0444 -follow -type f -print -exec chmod 644 {} \; >> $(whoami).txt
|
||||||
find public_html/ -perm 0555 -follow -type f -print -exec chmod 644 {} \; >> $log_file
|
find public_html/ -perm 0555 -follow -type f -print -exec chmod 644 {} \; >> $(whoami).txt
|
||||||
find public_html/ -perm +og+w -follow -type f -print -exec chmod 644 {} \; >> $log_file
|
find public_html/ -perm +og+w -follow -type f -print -exec chmod 644 {} \; >> $(whoami).txt
|
||||||
# Perl/CGI
|
# Perl/CGI
|
||||||
find public_html/ -perm +og+w -follow -type f -name "*.cgi" -print -exec chmod 755 {} \; >> $log_file
|
find public_html/ -perm +og+w -follow -type f -name "*.cgi" -print -exec chmod 755 {} \; >> $(whoami).txt
|
||||||
find public_html/ -perm +og+w -follow -type f -name "*.pl" -print -exec chmod 755 {} \; >> $log_file
|
find public_html/ -perm +og+w -follow -type f -name "*.pl" -print -exec chmod 755 {} \; >> $(whoami).txt
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo '[*] Removing data garbage like error logs:';
|
echo '[*] Removing data garbage like error logs:';
|
||||||
|
|
||||||
echo >> $log_file
|
echo >> $(whoami).txt
|
||||||
find public_html/ -type f -name "error_log" -exec rm -rfv {} \; >> $log_file
|
find public_html/ -type f -name "error_log" -exec rm -rfv {} \; >> $(whoami).txt
|
||||||
|
|
||||||
echo '[*] Running the malware cleaner:';
|
echo '[*] Running the malware cleaner:';
|
||||||
perl public_html/LP-MSH-Scanner/malwaresh.pl $user >> $log_file
|
perl public_html/LP-MSH-Scanner/malwaresh.pl $(whoami) >> $(whoami).txt
|
||||||
echo >> $log_file
|
echo >> $(whoami).txt
|
||||||
echo '[*] Running the Python scanner :';
|
echo '[*] Running the Python scanner :';
|
||||||
python public_html/LP-MSH-Scanner/scan.py --minscore=10 /home/$user | grep filename >> $log_file
|
python public_html/LP-MSH-Scanner/scan.py --minscore=10 /home/$(whoami) | grep filename >> $(whoami).txt
|
||||||
echo >> $log_file
|
echo >> $(whoami).txt
|
||||||
echo '[*] Running the CMS Version Scanner:';
|
echo '[*] Running the CMS Version Scanner:';
|
||||||
php -d memory_limit=512M public_html/LP-MSH-Scanner/cms-vss.php $user >> $log_file
|
php -d memory_limit=512M public_html/LP-MSH-Scanner/cms-vss.php $(whoami) >> $(whoami).txt
|
||||||
echo >> $log_file
|
echo >> $(whoami).txt
|
||||||
echo '[*] Running the PHP Scanner:';
|
echo '[*] Running the PHP Scanner:';
|
||||||
cd /home/$user/public_html/LP-MSH-Scanner && php -d memory_limit=512M scan.php >> /home/$user/$log_file
|
cd /home/$(whoami)/public_html/LP-MSH-Scanner && php -d memory_limit=512M scan.php >> /home/$(whoami)/$(whoami).txt
|
||||||
echo >>
|
echo >>
|
||||||
# SOP
|
# SOP
|
||||||
# Fix .htaccess
|
# Fix .htaccess
|
||||||
@@ -53,20 +49,20 @@ echo >>
|
|||||||
#
|
#
|
||||||
# checking for unrelated
|
# checking for unrelated
|
||||||
echo '[*] Suspicious files in /tmp?';
|
echo '[*] Suspicious files in /tmp?';
|
||||||
ls -al /tmp/ | grep $user | grep -v sess_
|
ls -al /tmp/ | grep $(whoami) | grep -v sess_
|
||||||
echo
|
echo
|
||||||
echo '[*] Processes running:';
|
echo '[*] Processes running:';
|
||||||
ps -eo pid,user,cmd | grep $user
|
ps -eo pid,user,cmd | grep $(whoami)
|
||||||
echo '[*] Checking for Unrelated Data';
|
echo '[*] Checking for Unrelated Data';
|
||||||
echo >> $log_file
|
echo >> $(whoami).txt
|
||||||
echo '[*] Directories with more than 1GB size:';
|
echo '[*] Directories with more than 1GB size:';
|
||||||
du -h ./ | grep '[0-9]G\>' >> $log_file
|
du -h ./ | grep '[0-9]G\>' >> $(whoami).txt
|
||||||
echo >> $log_file
|
echo >> $(whoami).txt
|
||||||
echo '[*] Files with more than 10M size:';
|
echo '[*] Files with more than 10M size:';
|
||||||
find ./ -size +10000k -exec du -sh {} \; >> $log_file
|
find ./ -size +10000k -exec du -sh {} \; >> $(whoami).txt
|
||||||
|
|
||||||
echo "Results available in: /home/$user/$log_file" | mail -s 'MSH Scan of `whoami`' mshteam@lunarpages.com
|
echo "Results available in: /home/$(whoami)/$(whoami).txt" | mail -s 'MSH Scan of `whoami`' mshteam@lunarpages.com
|
||||||
|
|
||||||
echo '[*] Job done... removing the scanner';
|
echo '[*] Job done... removing the scanner';
|
||||||
rm -rf /home/$user/public_html/LP-MSH-Scanner
|
rm -rf /home/$(whoami)/public_html/LP-MSH-Scanner
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user