Where did utils.php come from, TinyMCE hack - wordpress

Last Wednesday a variety of the WordPress sites I manage got hacked, they were infected with a Viagra link (malware is so original).
I noticed in the wp-includes directory a file called utils.php (wp-includes/js/tinymce/utils/utils.php), also an addition to my general-template.php for the get_footer function.
This hack seems to only affect Google search results for sites, not the site when directly viewed by entering the URL, i.e your cached site will show a malware infested mess and lose ranking, meanwhile you will wonder why due to the site looking fine when viewed.
My host (TSO Host) have cleaned up the sites, didn't even need to ask, but I have no idea how the infection got there in the first place.
So my question is, does anyone know how the breach happens and what I can do to prevent it, other than the usual security tips?

This happened to a site that I spent weeks cleaning up. I can give you a few pointers:
Go through the Wordpress core files (under wp-admin and wp-includes) and delete all files that you don't see in the default wordpress instillation. I've never seen a plugin create a file in one of those 2 directories. After this, it'd be a good idea to re-install Wordpress, just in case they changed any of the existing files.
After that, change your Wordpress/FTP/SSH passwords as they've likly been cracked. Install WP Better Security. It seems a little annoying at first, but you can monitor everything with it, change the login slug, remove version info hackers can use to find security holes, black-list known hackers, and so much more.
Finally, this last one will take some time. Google your theme and each one of your plugins, and see if Wordpress has stopped using them because they were a security vulnerability. You'd be surprised at how many plugins haves holes. Try to avoid really new plugins, and try to use the same plugin for as many different sites as you can. If you're hosting more than one site on the same server and one of the sites gets hacked, they're all hacked.
It sounds like a pain, and it is a little bit, but after you're done you'll feel so much better knowing that you're in control of everything. Trust me.

Related

Wordpress site switched to displaying Posts for no apparent reason

I have a site with a static home page which is just one of the pages. Ive been working on the site for several weeks. Today, when I went to clear the cache to see if some links were updated, the home page switched to displaying Posts (which is the other setting under the Settings->Reading) I went to settings and sure enough display Posts is checked. No one else, that I know of has the password to this site. Does anyone know why this happened or how I can prevent it from happeneing again?
There are so many variables to consider, but it has to be a direct database manipulation. So:
Someone did in fact change it, but no one knows who
A plugin or theme changed it. Unlikely, but certainly possible. Search your plugins/theme changelog and/or support threads for similar reported issues
One thing you could do is install the plugin Stream. This logs all (well, nearly every) database manipulation and tells you when, where, and who. This way, if it happens again, you can immediately pinpoint it.

how can i remove weird links from my website

i have a website that was developed with wordpress
it was hacked ,I removed the malicious files that I've found on the server
and I got it back but when I search the website on google I found
strange links that I can't open them
photo
Remove url individually form google webmaster tools and it will take time remove it.
You should know that removing malicious files doesn't mean you cleaned up the site. There are many instances where a file will recreate all the malicious files again. Sometimes it can even be above the root of your website root folder. It's best to use a couple plugins to scan the whole site directory. And then check a couple days later if the malicious files return. (if this is the case you are best to actually just switch to a new server or reformat if you have the option as it will get quite expensive to pay someone to clean up your server)
First make sure you have completely cleaned up the hack. Then those pages in Google should get deindex as they won't exist anymore. It's probably not viable to remove every single hack page indexed in Google via webmaster tools as there could be 10s of thousands! (depending on the hack)
Below are a couple good scanners.
https://wordpress.org/plugins/quttera-web-malware-scanner
https://wordpress.org/plugins/sucuri-scanner
I would also recommend some plugins for enhanced security moving forward.
https://wordpress.org/plugins/ninjafirewall
https://wordpress.org/plugins/better-wp-security
https://wordpress.org/plugins/vulnerable-plugin-checker

wordpress menu includes different domain randomly

I'm using Wordpress 4.9.1–en_GB, and have a live site which has been up and live for some months without issue.
48 hours ago it suddenly (or rather I noticed suddenly) started displaying some pages as unformatted (no css) lists of links and text. The links on those pages were to another domain which directed to my site, but which has never been part of my site, and for which there is no direction within the site.
Loading and saving that one page fixed it on that page, and another page which was exhibiting the issue.
I redirected the external domain so that it would not point to my website.
Today it has exhibited the same behaviour, but with a subdomain which points to my site, but which again is not in use. Again saving the page without making any edits 'fixed' the behaviour.
I'm not asking for a fix - but whether anyone has ever experienced a similar problem, or has a pointer towards where to look, and will report back what I find, in the hope it helps someone else if it ever occurs to them.
I didn't originally build the site - it has a load of plugins, not all active and disabling and removing plugins is definitely an option - but not a great one, since the problem is not predictable, so I have no firm way of knowing whether my actions have fixed the issue, and in the meantime my commercial site will not be functioning as desired (which I appreciate is occasionally the case anyway it would seem).
It sits in Amazon EC2.
sorry for the lack of precision, but I am truly stumped.
this sounds like your website may have been breached. to address the conflict of web pages not formatting is usually the ssl not being installed correctly on the server. but if you have a lot of plugins installed it's a huge security issue and the plugins may be causing the domain issue
the plugins may be causing a conflict within each other I would recommend removing the plugins that generally don't get used.
deactivate the plugins in use and reactivate them.
use word fence security plugin to run to a scan on your website.
when I had this problem it was because the ssl was not installed on my server correctly if not that, a breach may be the cause. I hope this helps.
If the issue started within that time frame as stated that makes me more confident that this is an ssl issue. Sometimes an ssl doesn’t install correctly on a server this can cause a conflict with how the layout in css and HTML is affected. this is common in some cases, while it’s happening with the current theme your using, some WordPress themes can bypass the ssl error, I would recommend getting a new ssl from let’s encrypt and removing the one that was auto renewed through let’s encrypt. This could simply fix the problem. If not feel free to share your findings on the issue.

Stop Hacks to Wordpress Site - New User Added

My apologies in advance if I am posting it in the wrong forum.
I have a WordPress site. Every couple of days, a new user is added as an "Administrator" as shown below
I have changed my password many times using complex passwords but to no use. I even searched on Google and have read links like this one.
I have also unchecked the option "Anyone can register"
However, I am unable to stop them from registering.
Fortunately, no malicious activity has been noticed (Ex: Deletions/Unwanted posts etc)
Please advise me on what I can do to stop these?
You clearly have a more serious compromise, like an uploaded malicious script or an unpatched vulnerability. You need to rebuild your site from scratch (clean install of the current versions of WP and any plugins and themes, using a known-good database export) ASAP before something really bad happens.
Unfortunately, it's impossible to say what happened without digging through your server. My guess is that somebody exploited a vulnerability and uploaded a script. It could be anything - an hole in the WP core, a plugin, or a theme; a malicious plugin or theme; a stolen password; a breach of another site on the same server; or a number of other things.
Regardless of what happened, the only safe fix is to rebuild the site. If you have data backups, you can achieve this in a few hours.
I strongly recommend installing the security plugin WordFence to help prevent similar problems in the future. (I have no affiliation with WordFence, but use it on a number of sites.)
Finally, you might want to read this discussion on security.stackexchange.com. The consensus in this situation is "nuke it from orbit." Good luck!
Someone is making a SQL injection in your site.
If you want to prevent this in future, you should do some things.
Rebuild your website from scratch.
Install some of the security plugins, like Bulletproof Security, Wordfence, iThemes Security. I suggest you to buy the license of Bulletproof, or use the free version + one of the others. And be careful for the equal settings.
The most common attack are with SQL Injection XSS, Plugin exploits and of course brute-forcing the admin pass. You should upgrade every plugin and Wordpress every time when you see a new version.
Use less plugins. They are one of the main reason for hacked websites. If you use Linux, Ican tell you how to scan your website for vulnerabilities. Or just tell me the url, and I will tell you the results.
Also change your /wp-admin path, there are a lot of bots who search the web and make bruteforce attacks.
Also is important to use different admin username from admin or Admin. And use strong passwords. It's a good practice when you make a new Wordpress installation, to do two more users. The first will be an Author and will post everything in the site, the second you should make with Administration role. After that delete the first admin user and start the new one.
Hackers knows that almost every time the user with id:1 is the admin, so they can try to access again. So in this case your admin will be with id:3, and again don't use username like admin and etc.
Best regards and wish you luck.
Kasmetski
Check index.php, wp-admin/index.php to see if they have been modified. Usually the following line of code is added to the top of the index.php file. A code starting with 'required' is usually added.
The file being ‘required’/’included’ here contains malicious code which is executed along with each run of WordPress. Such code can generate fake pharma pages, Japanese SEO spam pages and other malware infections.
Delete the #require code from the file after comparing it with the contents of the core WP files from it’s GitHub repository.
Check if there are any new files in the root of the server or /wp-admin folder that were not created by you. Some of the files that you may find are:
Marvins.php
db_.php
8c18ee
83965
admin.php
buddy.zip
dm.php
If you find any of the above suspicious files, take a backup and delete them.
Source: https://www.getastra.com/blog/911/fix-wordpress-admin-dashboard-wp-admin-hack/

how to prevent hacking of a WP site

I have a WP install, and every few weeks some hackers keep adding some bunk script to the bottom of certain files, making the WP site not function. I've changed the user/pass to WP and this obviously isn't working. I'm thinking since they are effecting files that are not visible via the WP login files (which are just theme files) then does this mean they are getting access to the FTP and making their hacks there? If they are getting into FTP then why wouldn't they just remove all docs?
Any insight would be greatly appreciate it. While I appreciate the billable hours to find/remove this code every few days the client isn't as excited about it as I am.
then does this mean they are getting access to the FTP and making their hacks there?
Likely yes. There are a lot of automated hacks of sites to include scripts/iframes pointing at security hole exploits.
These exploits typically install a fake-antivirus program and other trojans, including, often, FTP password stealers. These compromised FTP accounts are then used to infect other sites in the same way.
So, you need to ensure any and every machine that is used to access the FTP site is totally clean. Don't trust one single anti-virus to say you're clean, because today's anti-virus is utterly useless at catching the wide range of trojans out there today.
Especially don't trust an antivirus that claims to have ‘cleaned’ an infection, because it is very likely it hasn't cleaned everything. If you find a trojan or have at some point recently had an AV find a trojan (that isn't a false positive, another huge problem of today's hopeless anti-virus software), it's time to reinstall the OS because that's the only way to be sure.
Then change the passwords again, worry about all the other passwords of yours it might have stolen, and finally migrate to SFTP for uploading your files. FTP is an insecure ancient relic that nobody should still be using for admin in this century.
(Another possibility would be that the host itself was hacked, if you're sharing a server. Check other sites on the same machine that aren't accessible through your FTP account and see if they're affected the same.)
If they are getting into FTP then why wouldn't they just remove all docs?
Where would be the profit in that?
The vast majority of exploits out there today are from criminal businessmen after users' cash, not hacker kids doing it for fun.
You can try installing...
"Akismet" Plug-in
WP-SpamFree
I am using 3 plugins together:
Akismet
Spam Free Wordpress
WP-SpamFree
I think you may try install even more and see if it help solving the problem.
Update to latest version.

Resources