We are encountering a problem on our digital ocean droplet. we have a Laravel application running on the droplet but some malicious process is creating folders such as (wp-admin, wp-includes) and php files with obfuscated code inside. This process is also modifying .htaccess and index.php files as soon as we change the permission to www-data.
we used auditctl for monitoring the file changes and also used rkhunter for scanning rootkits.
so far we were not able to trace down the process.
It would be really helpful if we can find out which process is creating and modifying those files.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Heya,
This means there is a security breach somewhere either in your droplet or in your code from where access is granted. Given that files are being created, I would say it’s somehow getting access to your Droplet.
See if there are any accounts on the Droplet that have access to those files. See if you have any outdated software on your Droplet. Also if you don’t find the source of this even if you make changes now the access to your system will still be there.
You can also try to create a new droplet and migrate only your website there to see if this will resolve the issue. All in all, the best way would be to track down exactly what it’s doing this and stop it’s access but it’s tricky.
Heya, @61cada0754504c92b74676e29079ea
You can use
top
,htop
, orps
to look for processes running aswww-data
or any unexpected processes:Also you can use
inotifywait
to monitor changes in your directories:This will show live updates of which files are being modified or created.
Also look for unauthorized SSH keys or reverse shell scripts:
and check for suspicious files in
/tmp
,/var/tmp
, or/dev/shm
.Hope that this helps!