News

Backdoored PHP Obfuscator: How to Check and Recover Your Web Deployment

You sent a small PHP script to an online obfuscator, pasted its result into a deployment, and the page still did exactly what you expected.

A SANS Internet Storm Center report shows why that last check is not enough when an outside service has rewritten executable code for your site.

Film strip and inspection tongs, with one translucent layer raised

Overview

The affected output appeared to preserve the original behavior

SANS analyst Johannes Ullrich tested a service identified as obfuscator[.]tools and found that output from one tested mode included code the input did not contain.

The tiny program still performed its intended action, making the addition easy to miss if someone only watched what appeared in their browser.

Obfuscation makes code harder to read, but it does not give the service permission to make network requests or introduce another way to write files.

The issue continued after the first observation

The SANS diary’s November 30 update described a subsequent attempt against its own test page and the arrival of another PHP file on that system.

That observation shows what happened in a research environment, not how many businesses used the service or whether any particular production site was compromised.

Loading the site, sending source, and deploying the result are different

A visitor who did not send a script or deploy output does not have the same exposure as a team that published the generated file.

If you sent source code but stopped there, review what you gave the service before deciding which credentials or private details might need attention.

  • If you deployed generated PHP, trace every environment and copy that received it rather than trusting a clean-looking page.
  • If you only pasted source, check for secrets in the submitted text and do not assume the website itself was infected.

Why a normal page is not a clean bill of health

The expected response tells you that the original work still happens, not that only the original work happens each time a request arrives.

The reported addition could contact an outside service with information about the running page and made additional server-side activity possible without changing the visible result.

Neither long lines nor unreadable symbols settle the question, because legitimate obfuscation and harmful changes can look equally confusing after someone transforms the file.

A colleague can open the same page several times and see nothing unusual while its underlying file differs from the original in important ways.

For incident response, compare the code you intended to deploy with the file and release record that actually reached the running server.

Starting with PHP source you trust is more useful than trying to make someone else’s altered output readable enough to keep it in service.

A matching copy in your own repository cannot clear the deployment if the build replaces it with a generated file on its way to production.

Independent source, build, and server records make that question answerable without starting the suspicious PHP again or uploading it to another public service.

What reached the running server?: Check for unexpected downloads; Review what left your control; Preserve evidence before recovery

Work out which part of the process you used

You opened an online tool and closed it again

If you only visited the page, the report does not give you a reason to take your own server offline or rotate a database password.

Ask whether anyone in your deployment process used the tool, because your own decision to close it does not account for your team’s releases.

If a download appeared unexpectedly, check whether you opened it and use your organization’s process for handling an untrusted file.

You pasted PHP source but never used the output

Write down what source was submitted and whether it contained embedded credentials, private paths, internal addresses, or details about customers and payment services.

If the submitted text held a secret, replace that credential through the system that issued it, notify its owner, and check where it had access.

Sending a file to a third party and executing a modified file on your server are separate events, so do not label them the same.

If a colleague pasted part of a larger private project, preserve what was actually sent before expanding the review to the entire repository.

You deployed or distributed generated output

Find the affected commit, changed file, deployment timestamp, and every site or artifact that received it, including customers if someone distributed the build externally.

Treat the running copy as potentially compromised until a responder has assessed its exposure and the host it executes on.

A shared build artifact can reach multiple servers in one release, including a staging copy that uses production credentials despite having very little public traffic.

Record associated stores and services before rotating anything, because abruptly removing one credential may strand a payment job, backup, or deployment process.

What to Do If You Published PHP From the Suspect Obfuscator

  1. Stop promotion of the affected build and notify the people who operate the web server, hosting account, and associated service credentials.
  2. Record the version and deployment time, then preserve a protected copy of the affected artifact and relevant logs without executing the file again.
  3. Use your normal incident process to restrict unwanted access and decide how to keep the service available while evidence is preserved.
  4. Rebuild from known source and trusted dependencies, not from a copy of the obfuscated output that happens to pass a page test.
  5. Before reopening normal access, review accounts and server changes, verify the restored release, and close out any remaining credential or infrastructure work.

Restore the release without rebuilding from the same untrusted file

Step 1: Identify the affected artifact and where it ran

Begin with the repository or deployment dashboard where you can match the modification, date, and file to a specific release and responsible account.

Keep the original source separate from an altered artifact, since the responder may need both to establish what was added and when.

Ask your hosting operator which service or account executes the PHP and what other workloads, uploads, configurations, or stored credentials it could access.

Include temporary demos, test domains, older containers, and scheduled jobs if they received the same artifact, not just the primary site visitors can see.

Step 2: Preserve records and decide how to contain the risk

Ask the hosting provider or incident team to retain access, error, deployment, and administrative activity records for the period when the copy was exposed.

Use approved containment that protects the rest of the environment without needlessly wiping files or logging out everyone before their evidence can be preserved.

The NIST incident response guidance treats containment, recovery, and learning from the incident as parts of the same process, rather than a single cleanup action.

If the server processes orders or important records, plan any downtime with the service owner before removing the only live copy of the application.

Step 3: Replace code and investigate what the first copy could reach

Build a replacement in a trusted process with a version predating the untrusted transformation, then record the intended source and resulting release.

Check your deployment templates, cached assets, and automatic rollback slots so an older job cannot quietly put the suspect output back into rotation.

Ask the responder to look beyond the first changed script, because other unexpected files or accounts could remain after that script is replaced.

Rotate credentials exposed to the affected application according to the response plan, generating replacements on systems that are not still under investigation.

Step 4: Check ordinary behavior after the replacement goes live

Verify the actual version or release identifier on each host and exercise a normal login, data entry, or purchase flow using approved test accounts.

Review server error and access records for fresh irregularities after the replacement rather than treating a functional landing page as final proof.

If a worker or container still serves an older copy, keep that instance out of service until the responsible team can confirm the correct release.

Leave monitoring or a scheduled follow-up in place for signs of unauthorized access, including new administrative accounts or unexpected changes to deployed files.

Pick a safer way to ship code that is hard to read

If the code runs only on your own server, confirm what problem obfuscation was meant to solve before buying or introducing another external service.

Visitors ordinarily receive the rendered output rather than the server’s PHP source, so source protection often starts with correct hosting and repository access controls.

If you distribute a PHP product to customers, choose a predictable build process that can be reviewed and reproduced from verified source.

Use a supplier that can explain what gets submitted and retained, or keep the transformation inside an environment your organization can audit and control.

Never include secrets directly in a sample sent to any converter, because recipients see what you input before they return a transformed file.

Keep the source and artifact linked by a release record so a coworker can verify which transformation occurred without reopening the old service.

Keep the review focused on access, not visual clues

Do not treat slow page loads, long file lines, or a change in formatting as automatic evidence that someone installed a backdoor.

When the origin of a file is unclear, stop deploying that copy and ask the person who produced it to show the approved build history.

Use access review and clean deployment as different checks, since a code comparison cannot reveal whether someone previously used an administrative account.

Conversely, an unfamiliar server event needs investigation even if the suspect PHP file has already been removed or replaced with a trusted copy.

What to give the owner of another site that used the build

Tell the site owner which release was distributed, what you changed afterward, and which versions should no longer be installed on a new server.

Provide the identifier of the approved replacement and how to confirm it, without sending the original harmful file or directing anyone to reproduce the experiment.

If you do not know which customer servers received the build, use delivery records and a verified contact channel instead of making up a deployment list.

Keep a record of who was notified and what they confirmed, since a fixed download page does not update copies customers already installed.

Check the less obvious places where the output may still be used

Staging systems and temporary previews

A staging machine can be easier to overlook because it seldom gets a customer complaint when its copy of the application behaves strangely.

Ask whether its storage, mail, payment, or database credentials are separate, and check whether any preview environment still shares a production service.

If the host is no longer needed, preserve what the responder requests and let the owner decide how to retire it without losing incident records.

Make sure a new preview does not quietly rebuild from an unchanged artifact or a stale template that preserves the modified file.

Downloads sent to an agency, contractor, or customer

Use release and delivery records to decide who may need notice, rather than assigning everyone who touched the repository the same exposure.

Explain how recipients can check their release without opening suspect PHP, and provide a way to ask for recovery support privately.

If your company cannot verify that a customer replaced its own copy, record the recommendation and the contact rather than marking that installation resolved.

Scheduled work and shared hosting accounts

One hosting account can serve several projects, which makes the execution identity more informative than the name of the one page in the report.

Ask whether background jobs used the same files or credentials, and check who has authority to pause them while responders assess the server.

Keep the customer-facing site and those tasks in the recovery plan together, because normal page behavior tells you very little about scheduled work.

Stop using a shortcut that nobody can audit

Add a short written rule about which code transformation services are approved and which source material can leave the company at all.

If a team needs a sample to evaluate a future provider, choose purpose-built code with no private paths, secrets, customer data, or sensitive implementation.

For deliverables that customers install, retain an inventory of released copies and make sure recipients can verify where a legitimate replacement came from.

Frequently Asked Questions

Does this mean every online PHP obfuscator adds a backdoor?

The research concerned one service and a tested output mode, so it is not a finding about every service or every unrelated obfuscated script.

Did the research report the number of affected websites?

The published account describes findings from a controlled test rather than a tally of deployed websites or confirmed victims outside that environment.

Can I clear the risk by refreshing a working page?

A successful page load confirms a visible function, but it does not establish that the generated file never made an unauthorized change.

Should I upload suspected PHP to another online service?

Do not pass private source or suspected harmful output to another service unless your authorized responder approves the destination and method.

Can restoring the ordinary source be enough?

Restoring trusted code is part of recovery, but a team should also assess access, credentials, and unexpected files created while the altered copy ran.

Does PHP running on a server mean laptops need scanning?

Not by itself, because a suspected server deployment calls for server response unless there is separate evidence that the file ran on a workstation.

The Bottom Line

Stop using the tested service for executable PHP, and do not approve its output simply because your application still responds as expected.

If you deployed a suspect file, preserve relevant records and restore from trusted source, then verify the web server and its credentials before closing the incident.

Join the discussion

0 comments

Share your experience or ask a question about this article.

Discussion

Start the conversation

Have a question or something useful to share? Add the first comment.

Written by

Lapain Epuran

Lapain Epuran investigates product scams, from supplements sold with miracle-cure claims to gadgets pushed through misleading ads. She has more than 10 years of experience in investigations and checks each product's claims, seller and refund terms before giving a verdict.

5,871 articlesWriting since 2024
More from Lapain →

MalwareTips community · since 2010

Stuck on a step? 75,000+ members can help you for free.

Post your question on the forum and our volunteer malware removal experts will walk you through it, step by step.

75K+members
999K+forum messages
100K+forum topics
16+years online

Previous

DevGating PyPI Malware: Check the Python Environment Before Your Next Build

Next

Unmanaged VMs After a Migration: How to Find Gaps Before Closing the Move