ugly fix for logging
This commit is contained in:
parent
67de8e72fd
commit
f6f4f3bb9a
67
run.sh
67
run.sh
@ -1,43 +1,44 @@
|
|||||||
#bin/sh!
|
#bin/sh!
|
||||||
|
|
||||||
# checking for unrelated
|
# checking for unrelated
|
||||||
echo '[*] Checking for Unrelated Data';
|
echo '[*] Checking for Unrelated Data'; >> $(whoami).txt
|
||||||
echo
|
echo >> $(whoami)
|
||||||
echo '[*] Directories with more than 1GB size:';
|
echo '[*] Directories with more than 1GB size:'; >> $(whoami).txt
|
||||||
du -h ./ | grep '[0-9]G\>'
|
du -h ./ | grep '[0-9]G\>' >> $(whoami).txt
|
||||||
echo
|
echo >> $(whoami)
|
||||||
echo '[*] Files with more than 10M size:';
|
echo '[*] Files with more than 10M size:'; >> $(whoami).txt
|
||||||
find ./ -size +10000k -exec du -sh {} \;
|
find ./ -size +10000k -exec du -sh {} \; >> $(whoami).txt
|
||||||
echo '[*]Fixing file and folder permissions:';
|
echo '[*]Fixing file and folder permissions:'; >> $(whoami).txt
|
||||||
#directories
|
#directories
|
||||||
find public_html/ -perm 0000 -follow -type d -print -exec chmod 755 {} \;
|
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 {} \;
|
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 {} \;
|
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 {} \;
|
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 {} \;
|
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 {} \;
|
find public_html/ -perm 0444 -follow -type f -print -exec chmod 644 {} \; >> $(whoami).txt
|
||||||
find public_html/ -perm +og+w -follow -type f -print -exec chmod 644 {} \;
|
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 {} \;
|
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 {} \;
|
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:'; >> $(whoami).txt
|
||||||
find public_html/ -type f -name "error_log" -exec rm -rfv {} \;
|
echo >> $(whoami).txt
|
||||||
|
find public_html/ -type f -name "error_log" -exec rm -rfv {} \; >> $(whoami).txt
|
||||||
|
|
||||||
echo '[*] Running the malware cleaner:'
|
echo '[*] Running the malware cleaner:' >> $(whoami).txt
|
||||||
perl /home/$(whoami)/public_html/LP-MSH-Scanner/malwaresh.pl $(whoami)
|
perl /home/$(whoami)/public_html/LP-MSH-Scanner/malwaresh.pl $(whoami) >> $(whoami).txt
|
||||||
echo
|
echo >> $(whoami).txt
|
||||||
echo '[*] Running the Python scanner :'
|
echo '[*] Running the Python scanner :' >> $(whoami).txt
|
||||||
python /home/$(whoami)/public_html/LP-MSH-Scanner/scan.py --minscore=10 /home/$(whoami) | grep filename
|
python /home/$(whoami)/public_html/LP-MSH-Scanner/scan.py --minscore=10 /home/$(whoami) | grep filename >> $(whoami).txt
|
||||||
echo
|
echo >> $(whoami).txt
|
||||||
echo '[*] Running the CMS Version Scanner:'
|
echo '[*] Running the CMS Version Scanner:' >> $(whoami).txt
|
||||||
php -d memory_limit=512M /home/$(whoami)/public_html/LP-MSH-Scanner/cms-vss.php $(whoami)
|
php -d memory_limit=512M /home/$(whoami)/public_html/LP-MSH-Scanner/cms-vss.php $(whoami) >> $(whoami).txt
|
||||||
echo
|
echo >> $(whoami).txt
|
||||||
echo '[*] Running the PHP Scanner:'
|
echo '[*] Running the PHP Scanner:' >> $(whoami).txt
|
||||||
cd /home/$(whoami)/public_html/LP-MSH-Scanner && php -d memory_limit=512M scan.php
|
cd /home/$(whoami)/public_html/LP-MSH-Scanner && php -d memory_limit=512M scan.php >> $(whoami).txt
|
||||||
echo
|
echo >> $(whoami).txt
|
||||||
cat $(whoami).txt | mail -s 'MSH Scan of $(whoami)' malin.cenusa@lunarpages.com
|
cat $(whoami).txt | mail -s 'MSH Scan of $(whoami)' malin.cenusa@lunarpages.com
|
||||||
echo '[*] Job done... removing the scanner'
|
echo '[*] Job done... removing the scanner'
|
||||||
rm -rf /home/$(whoami)/public_html/LP-MSH-Scanner
|
rm -rf /home/$(whoami)/public_html/LP-MSH-Scanner
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user