MOON
Server: Apache
System: Linux server30c.hostingraja.org 3.10.0-962.3.2.lve1.5.63.el7.x86_64 #1 SMP Fri Oct 8 12:03:35 UTC 2021 x86_64
User: jibhires (1887)
PHP: 8.1.30
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open, allow_url_fopen, symlink, escapeshellcmd, pcntl_exec
Upload Files
File: //var/log/spamavoid/review_and_delete.sh
for f in `sort php_execution_block.log | uniq`
	do

	own=`echo $f | cut -d "/" -f3`
	echo "Owner is $own" ;

	if [ -f $f ];
	then
		fsize=$(wc -c "$f" | cut -f 1 -d ' ')
	else
		echo "File deleted $f" ;
	   continue ;
	fi

	echo "File size is $fsize" ;

	head -n 35 $f
	echo "-------------------------------------------------------------------------------------------------------------" ;
	echo "File name $f " ;
	read -p "1 - To repair first line: 2 - delete , 3 - change perm 000 , 4 - vim  " RESP

	case $RESP in 
		1) 
			sed -i '1d' $f ;
			echo "<?php " > /tmp/newtmp.txt
			cat $f >> /tmp/newtmp.txt
        	mv  /tmp/newtmp.txt $f
	        chown $own:$own $f
		;;

		2)
			grep -v $f php_execution_block.log > tmp.1
			mv tmp.1 php_execution_block.log
			rm -v $f
		;;

		3)
			chmod 000 $f
		;;
	
		4)
			/usr/bin/vim $f
			read -p "1 - To repair first line: 2 - delete , 3 - change perm 000 , 4 - vim , 5 - ls" RESP
		    case $RESP in
	        1)
    	        sed -i '1d' $f ;  echo "<?php " > /tmp/newtmp.txt ;  cat $f >> /tmp/newtmp.txt; mv  /tmp/newtmp.txt $f ; chown $own:$own $f ;   ;;

    	    2) rm -v $f ;;

	        3) chmod 000 $f   ;;
		
			5) ls -lh  $f ;;
			esac
		;;

	

		*) echo "doign nothing" ;
	esac

	clear
done