Skip to content
mrpcPublic

About

Open-source exploit/malware scanner + firewall-integration layer for Linux web hosting - drop-in replacement for cxs (ConfigServer eXploit Scanner)

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

OpenXS

CI CodeQL

See CHANGELOG.md for what changed in each release, and MIGRATION.md for a step-by-step guide to moving from cxs.

An open-source exploit/malware scanner and firewall-integration layer for Linux web hosting servers — built as a drop-in replacement for cxs (ConfigServer eXploit Scanner), which was discontinued along with the rest of Way to the Web Ltd. on 2025-08-31.

Why

cxs combined three things: heuristic exploit scanning, ClamAV-backed virus scanning, and a CSF firewall hook that auto-blocks IPs behind malicious uploads. It was proprietary, obfuscated, and is now unmaintained with its license-check infrastructure offline. CSF itself — the firewall most of these servers also depend on — was open-sourced under GPLv3 in its final release (v15.00) before the company shut down, but the official repo is gone and the cPanel fork that followed dropped support for anything that isn't cPanel/WHM.

OpenXS rebuilds cxs's role entirely from actively-maintained, open components, with nothing vendored or reverse-engineered from the original product.

What it does

  • Exploit detection: php-malware-finder (YARA, LGPL-3.0) — detects obfuscated PHP, webshells, and known exploit patterns. Upstream (nbs-system) has had no activity since 2022, so OpenXS pins and extends this fork instead.
  • Virus scanning: ClamAV, as a second detector alongside YARA.
  • Known-exploit database (maldet): Linux Malware Detect as a third, independent detector (its own MD5/HEX/YARA signature set) - optional, one-click installer from the dashboard, report-only (its own auto-quarantine is disabled for scans OpenXS triggers).
  • Version checks: WordPress core (against WordPress.org's own API) and Composer packages (against Packagist - no built-in knowledge of any specific package needed) for outdated versions, plus pending apt security updates - an initial, narrower sversionscan equivalent.
  • Unknown WordPress core files: flags any file under wp-admin/ wp-includes that isn't part of that install's own official release - distinguishing likely update leftovers (content still matches some other bundled WordPress release) from genuinely unexpected files (matches no known release at all) - same idea as Wordfence's own "unknown core file" check, deliberately scoped away from wp-content where extra files (uploads, cache, ...) are completely normal.
  • File integrity monitoring: SHA-256 baseline of a configured list of important files (configs, this scanner's own whitelist/rules), reports drift against it - pre-seeded with a reasoned default list on install.
  • Mailbox virus scanning: opt-in ClamAV scan of every account's Maildir - cxs's separate virusscan feature, which had no equivalent before this.
  • Real-time upload blocking: a mod_security @inspectFile hook runs both detectors on every file upload, before it's ever accepted by the web app.
  • Firewall auto-block: a CSF regex.custom.pm integration watches for blocked uploads and bans the source IP, using CSF's own documented custom-trigger mechanism (no changes to lfd itself).
  • Scheduled + on-demand scanning: a daily cron job plus a manual "scan this directory" action.
  • Quarantine: optional, opt-in — moves flagged files out of the webroot on scan (not on the real-time hook, which already blocks the request), with restore/delete from the UI.
  • Database content scan: scans WordPress (wp_posts/wp_comments), Joomla/Mambo (#__content/#__modules — column names adapt to whatever the installed version actually has, from classic Mambo/ Joomla 1.0 through current) and Drupal 7 (field_data_body/ block_custom) for malicious content injected directly into the database — a real 2+ year compromise found on a site in our own fleet (2026-10-25) lived entirely in wp_posts as a published "WPCode"/Insert Headers and Footers snippet (cookie-gated admin-user creation, C2-proxied content injection for logged-out visitors) and never touched the filesystem at all, so no amount of YARA/ClamAV coverage could ever have caught it. Reuses the exact same compiled YARA ruleset the file scan already uses, matched against raw DB content instead of a file. Connects using each site's own DB credentials (wp-config.php/configuration.php/settings.php), or Webmin's own stored MySQL root login when available (one credential per server instead of one per site) — every query is a read-only SELECT. A site whose database shouldn't be touched at all can be listed in /etc/openxs/db_scan_exclude (Settings), same plain- substring style as the main Ignore file. Idea and approach informed by studying Wordfence's own (GPLv3) database-scan code.
  • Repair (restore to pristine): one-click action from the findings browser for a modified, named Composer package, Drupal 7 core file, WordPress core file, or wordpress.org-hosted WordPress plugin file — backs the current content up to quarantine first, then writes back the exact bytes from that package/version's own official release. Modeled after Wordfence's own restoreFile action. Revive/Roundcube/phpMyAdmin (the other recognized platforms) aren't wired up yet.
  • Scan history: a small local SQLite database, so results survive past the next scan - including per-scan duration (broken down by detector) and system load, for answering "is it optimized", not just "is it working".
  • Statistics: daily aggregate counters (scans, hits, quarantined, avg. duration - mirrors cxs's own daily counter tables) with a simple chart, no external JS/CDN required.
  • Migration from cxs: tools/migrate_from_cxs.py reads an existing cxs install's settings, custom ignore/exploit rules, quarantine, and historical scan logs, and imports what it can into OpenXS - reporting clearly (never silently) anything it can't translate - plus disable-cxs to retire cxs entirely (every cron entry, its Watch daemon) once OpenXS covers what it did. Dry-run by default throughout, install.sh previews and asks before applying anything.
  • MCP server: a minimal, read-only MCP server (tools/openxs_mcp_server.py) exposes status/logs/findings as structured tool calls instead of SSH + grep - meant to run over SSH stdio from an operator's own machine, no public exposure.
  • Webmin module: dashboard (per-component install status, with one-click installers for ClamAV/maldet/mod_security/the CSF hook), daemon control, settings (its own page, separate from the dashboard), scan history, statistics, and quarantine management.

A known limitation of Composer/Packagist checksum suppression

WordPress/Drupal/Revive/Roundcube/phpMyAdmin core and any wordpress.org plugin all go through those projects' own reviewed release directories, so a checksum match there is a strong signal. Packagist is different: it does no review of what gets published under a package name - it's a pure auto-index of whatever a package's own GitHub repo publishes as a release, so a checksum match there only verifies "this matches what Packagist/GitHub say is official" - not "this is safe". If that channel itself is compromised (a maintainer's account taken over, a malicious release published under a legitimate name), the malicious code matches the checksum too.

Mitigated (not eliminated) by composer_trust.py: a package also needs to be trusted - via tools/composer_trusted_packages (common ecosystem prefixes, auto-trusted; add your own in /etc/openxs/composer_trusted_packages) or Packagist's own age/downloads reputation stats (configurable thresholds) - before a checksum match suppresses anything for it. OPENXS_YARA_PARANOIA_LEVEL controls how strict that bar is, up to disabling Composer-checksum suppression entirely at level 3 - see its docstring.

What still applies regardless of any of this: ClamAV and OpenXS's own custom MD5/SHA256/regex rules run on every file no matter what the checksum/trust check says - a known-bad signature or hash still gets caught. What doesn't: a brand-new supply-chain payload with no existing signature, published through an otherwise-trusted package, has no other layer here to catch it. Known, accepted tradeoff, not a bug.

Architecture

A small Python daemon (openxs-scand) keeps the compiled YARA ruleset in memory and answers scan requests over a Unix socket, so uploads aren't paying the cost of recompiling the ruleset on every request. Everything else — the cron script, the manual scan button, the mod_security hook — is a thin client around that engine plus ClamAV.

upload ──> mod_security (@inspectFile) ──> openxs-scand (YARA) ──┬─> clean: pass
                                                                   └─> malware: 403 + CSF ban

Installing

On a real Debian/Ubuntu server:

git clone https://github.com/mrpc/OpenXS.git
cd OpenXS
sudo ./install.sh

Installs the detection engine, the scan daemon (systemd service), ClamAV, the cron job, and the Webmin module (if Webmin is present). mod_security and the CSF firewall hook are not installed automatically — enable them later from the Webmin dashboard once you're ready for real-time upload blocking.

Sandbox (Docker), for trying it out or development:

docker build -t openxs .
docker run -d --cap-add=NET_ADMIN --cap-add=NET_RAW \
  -p 18080:80 -p 18443:443 -p 10000:10000 openxs

Gives you a self-contained environment with Apache + mod_security + CSF + Webmin + the full OpenXS stack, built fresh from source on every build (nothing vendored).

Configuration

Settings live in /etc/openxs/openxs.conf:

EMAIL=you@example.com
SCAN_PATH=/var/www
QUARANTINE_ENABLED=0

Editable from the Webmin dashboard, or by hand.

Compromised mail account watch (sasl_watch.py, runs every 5 minutes from the collector cron; on the Settings page when Postfix is installed): reads Postfix's mail.log and e-mails when a SASL user logs in from more than SASL_WATCH_MAX_IPS (10) IPs in 24h, submits more than SASL_WATCH_MAX_MSGS_PER_HOUR (100) messages in an hour, or has over SASL_WATCH_MAX_BOUNCE_PCT (30) % of its mail bounce - plus when a milter refuses connections. SASL_WATCH_EXEMPT_HOSTS (default mail-*.google.com, for Gmail "send mail as") lists reverse hostnames whose IPs don't count. SASL_WATCH_AUTOBLOCK=1 (off by default) also adds the user to SASL_WATCH_MAP (/etc/postfix/sasl_blocked) - list it as check_sasl_access hash:/etc/postfix/sasl_blocked first in smtpd_sender_restrictions (and the submission/smtps restriction class) for that to take effect. A blocked account gets a short notice (itself plus its Virtualmin domain's contact address, local sendmail; template /etc/openxs/sasl_blocked_notice.txt, SASL_WATCH_NOTIFY=0 to turn off) and stays blocked until unblocked by hand (SASL_WATCH_UNBLOCK_ON_PWCHANGE=1 releases it once its /etc/shadow password changes - off by default, the thief can usually change it too). x and x@domain logins of the same Unix user (saslauthd -r) count, block and unblock as one account. By hand: sasl_watch.py list, block <user>, unblock <user> [--hours N]. The Webmin Mail accounts page shows the same plus the last 24h per account (messages, distinct/top IPs, bounces, last alert), the login names most targeted by failed AUTH, and milter status, with Block/Unblock buttons. MAIL_LOG overrides /var/log/mail.log.

Testing

pip install pytest
pytest tests/

Unit tests for the pure logic (ignore/path-override parsing, archive scanning, the filesystem checks, the decode utility) - no YARA ruleset, ClamAV, or Docker sandbox required. They're not a substitute for actually exercising the Webmin dashboard and the mod_security/CSF integration by hand, which has no automated coverage yet.

Status

This is an early-stage project. What's implemented is listed above and has been tested end-to-end (including on a vanilla, from-scratch install), and is now running on several production servers. install.sh has been verified on Debian 12 (bookworm), Debian 13 (trixie) - including a fresh install on a virgin trixie box (2026-11-03) with no changes needed to the script itself - and Ubuntu 24.04 (noble, also in production); it explicitly refuses to run on non-apt systems rather than failing halfway through.

Still on the roadmap, deliberately incremental rather than all-at-once:

  • Full sversionscan coverage — WordPress core and Composer packages are covered; the other ~200 CMSs/plugins (and any vulnerable-version database beyond "what's the latest release") cxs covered are not.
  • Support for hosting control panels beyond Webmin/Virtualmin (our own fleet's panel, and all of OpenXS's UI/accounts-mode assumptions so far) — CyberPanel, HestiaCP, CloudPanel. Each has its own account layout and plugin/module system; needs its own investigation per panel before any code.
  • Testing install.sh against more environments: Debian 12/13 and Ubuntu 24.04 are verified (all three in production); other Debian/Ubuntu releases and RHEL/CentOS-family systems (would need a yum/dnf code path) are not. Also against the actual CSF version (v14.24, pre-GPLv3) still running on most of our own servers — the CSF-hook installer has only been verified against the v15.00 GPLv3 release so far.
  • WordPress database-content scan coverage beyond wp_posts/ wp_comments (see "What it does" below) — wp_options and wp_postmeta/wp_usermeta deliberately deferred until the current, narrower scope has been run against the real fleet.

Credits

  • php-malware-finder (nbs-system, LGPL-3.0) — the original detection ruleset this builds on; see our fork, which OpenXS actually pins and extends.
  • signature-base (Florian Roth/Nextron Systems and contributors, Detection Rule License 1.1) — the webshell detection rules vendored into our php-malware-finder fork, since it's still actively maintained where upstream php-malware-finder isn't.
  • CSF (Jonathan Michaelson, GPLv3) — the firewall OpenXS integrates with.
  • Webmin — the management UI framework.

OpenXS builds against its own forks of the first two, pinned to a specific reviewed commit rather than upstream HEAD — the forks auto-sync with upstream daily, but OpenXS only moves to a new commit deliberately. Pass --build-arg PMF_COMMIT=master/CSF_COMMIT=main (or the equivalent install.sh/Webmin options) to track the fork's latest instead.

License

MIT (see LICENSE) for OpenXS's own code. php-malware-finder and CSF are fetched at install/build time under their own licenses (LGPL-3.0 and GPLv3 respectively) and are not redistributed as part of this repo.

About

Open-source exploit/malware scanner + firewall-integration layer for Linux web hosting - drop-in replacement for cxs (ConfigServer eXploit Scanner)

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages