Hello after days of frustration finally i discovered a rootkits that grant shell access to my sites on my Droplet. I discovered it because, spammer delete admin account on one of my sites. (all wordpress)
I deleted all file created but still file recreated few minutes after deletion
Please how i can stop this? Any help will be appreciate Thank you
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.
Click below to sign up and get $100 of credit to try our products over 60 days!
ok i try do it
@Stew
When it comes to WordPress, the majority of breaches are the result of:
…
The first step I would take is to make sure WordPress is updated to the latest release – then do the same for all plugins and themes. That should, at the very least, patch any known issues.
If after the above is done, you’re still seeing someone break through, then I would recommend taking a close look at directory and file permissions. All directories should have a
chmod
of 755 and all files achmod
of 644.If any files or directories are using a
chmod
of 777, that’s an issue as that allows for global read, write, and execute (i.e. if anyone can get a file in one of those directories, they could do exactly what the attacker is doing now – upload a file, execute it, download content, and perform any allowed commands using PHP’s built-insystem()
function, or one of many others).You can quickly change directory and file permissions by using something like:
and
Where
/path/to/wordpress
is the direct path to your WordPress installation (i.e. where index.php is).Note, this won’t stop that script from changing permissions, so ideally, I would stop Apache, which will prevent script execution since the website will not longer be available due to the web server being down – then clean up instances of that script, then run the commands above to change file and directory permissions, and then restart Apache to bring the site back up.
…
If it turns out that everything is updated (WordPress, plugins, and themes) and changing permissions did not help after a clean-up, then there may be a bigger issue, but the above will get you started.
I found this in auth log
before try make new droplet i want try remove all malware, just now i start a scan with clamscan, but i have not set password for access to droplet i just use a private ssh key
this is one of the script i found: https://code.google.com/archive/p/b374k-shell/
If it has given shell access, then it could have installed anything, anywhere on your server. It is possible to clean up, but probably easier just to go back to a previous backup or reinstall the server. Just removing the file, doesn’t fix the problem - you need to make sure everything is up-to-date and setup in a secure way. And be aware of bad/outdated plugins/themes in WordPress.