Not sure what to choose?

Describe your task and we will help you find a solution.

All services — 6 areas · 25 servicesNavigation ↑ ↓ · Close Esc
All articles — Development, support and security from our team's experienceNavigation ↑ ↓ · Close Esc
Security

Three hacked Bitrix websites: 100,000 spam pages in Google

Case study: three hacked Bitrix websites, over 100,000 spam pages in Google's index and lost rankings. Recovery, account isolation and spam removal from search.

RIVERIT · · 5 min read

A Ukrainian service company contacted RIVERIT: one of its three websites had stopped loading and was returning an error. Our investigation revealed that all three websites had been hacked and that more than 100,000 Korean-language spam pages were in Google’s index. This case study describes our findings, how the websites were recovered and how the impact of the hack on Google search was cleaned up.

Background

  • Three websites on Bitrix (Business edition). The platform and modules had not been updated for about four years.
  • All three websites were hosted on one server under a single user account, so each website had access to the files of the other two.

Detection of the hack

A mistake the attackers made in the code of one of the websites took it offline. The other two websites continued to operate with no visible changes.

Since all the websites were hosted under a single server user account, we checked all three. All of them were infected. Before the hack was detected, the websites had been compromised for 5–7 days.

What the attackers did

  • Injected malicious code that generated Korean-language pages listing consumer electronics (doorway pages) on the websites. Page URLs: /index.php?view/…, /view/…, /collections/….
  • Created a Bitrix agent that restored the malicious code after it was removed. Bitrix agents are a built-in platform mechanism: they are functions stored in the database and run on a schedule, so deleting the malicious files does not stop such an agent.
  • Distributed links to these pages through social media.
  • Within a few days, the spam pages were indexed by Google. For one of the websites, Search Console reported more than 100,000 such URLs.
  • Google lowered the rankings of all three websites.
Search Console Pages report: 114,000 non-indexed pages and reasons
Search Console Pages report for one of the websites: 114,000 non-indexed URLs and their breakdown by reason. Nearly all of them are spam pages from the hack.

It was not possible to determine how the attackers gained access to the websites.

Website recovery

Manual removal of the malicious code was ineffective: the Bitrix agent restored the deleted code, and the number of modified files made it impossible to guarantee complete removal. We therefore carried out the following work:

  1. Restored all three websites from backups made before the hack.
  2. Placed each website under a separate server user account. A hack of one website no longer gives access to the files of the others.
  3. Blocked changes to the website files: the files are owned by a different server user account, and the website has read-only access to them. Malicious code and agents injected through a vulnerability cannot modify the website files.

After the recovery, there are no spam pages on the websites, but Google keeps them in its index until it recrawls them. This stage took the most time.

Analysis of Search Console reports

We exported reports for the three websites from Search Console: non-indexed pages and crawl issues (404, 403, 5xx, redirects). The server response for each URL in the exports was checked with a script: more than 13,000 URLs in total. Nearly all of them were spam pages created by the hack.

410 response for spam URLs

  • A 410 response (“page permanently removed”) is configured for all types of spam URLs.
  • Spam URLs with parameters that returned a 404 error or redirected to the home page were also switched to a 410 response. Google treats redirecting spam URLs to the home page as a soft 404.
  • The spam URLs are not blocked in robots.txt. Blocking crawling would prevent Google from receiving the 410 response, and the URLs already indexed would remain in the index.

Temporary removal from search results

Temporary removal requests were submitted in Search Console for the spam URL prefixes: /view/, /index.php?view/, /collections/. A temporary removal hides pages from search results for about 6 months. During this period, Google recrawls the URLs and receives the 410 response.

Search Console treats a prefix that starts with “?” immediately after the domain (for example, /?view/) as the entire website. Such a request would have hidden all pages of the website from search results, so we did not submit it.

Revalidation in Search Console

  • Fix validation (Validate Fix) was started for the 5xx, 403 and robots.txt issues.
  • The Manual actions and Security issues reports were checked: no issues found.

Speeding up recrawling

  • Sitemaps with the live pages were submitted in Search Console.
  • Indexing requests were submitted for key pages.
  • All pages of the websites were submitted via the IndexNow protocol to Bing and other search engines that support it.

Monitoring

  • We use the server logs to confirm that Googlebot receives a 410 response for the spam URLs and no server errors.
  • We monitor the Search Console reports. If the spam URLs still appear in the reports after 6 months, the temporary removal requests will be resubmitted.

Factors that increase the risk of hacking

  • No updates to the platform and modules: updates close known vulnerabilities.
  • Hosting several websites under one server user account: a hack of one website opens access to the files of the others.
  • No backups: without them, recovery requires checking every modified file.
  • No monitoring of the website and Search Console: 5–7 days is enough for spam pages to get indexed, and removing them from search takes months.

RIVERIT provides hacked website recovery: we remove malicious code, close the routes attackers could use to get back in and bring the website back online. To reduce the risk of hacking, we conduct a website security audit.

02

Related articles

03Contact

Tell us
about your task

Describe your project or a problem with your website. We will contact you during business hours, clarify the details and prepare a proposal with stages, timeline and cost.

  1. 01We contact you
  2. 02We discuss the task
  3. 03We prepare a proposal

Project request

Mon–Fri 9 AM–6 PM
What you need

By clicking the button, you agree to the privacy policy

Prefer Telegram? Message us