Created
March 15, 2022 21:37
-
-
Save TobiasS1402/63b070cedb76598461fc3cf8a6eb2f4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (str_contains($file_content, '<?')) { | |
// If found write this to the log for later reporting | |
error_log("Some hackers tried to upload code to our server. Pls check if we were compromised"); | |
// Overwrite the offending file with a warning to the hackers. | |
$uploaded_file = fopen($target_file, "w"); | |
fwrite($uploaded_file, "Nice try hackers!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment