A comprehensive guide to running ClamAV enterprise heuristic scans, isolating compromised files, terminating clandestine cryptocurrency mining loops, and enforcing sysctl kernel defenses in MASACP.
Post-Exploitation Defense and Host Integrity
Perimeter firewalls and WAF inspection engines intercept the majority of inbound exploitation attempts. However, if a website runs outdated third-party content management plugins or unpatched scripts, an adversary might successfully upload an obfuscated PHP webshell, backdoored file, or binary dropper.
To mitigate post-compromise risks, MASACP deploys an integrated host-level defense stack:
- ClamAV Enterprise Suite with Heuristics: Deep static and signature-based scanning backed by the Cisco Talos global intelligence network.
- Crypto-Miner Process Killer: Continuous process memory auditing targeting Monero miners (such as XMRig and Kinsing) and blocking outgoing Stratum/TCP network pools.
- Kernel & Privilege Escalation Shield: Enforced Linux kernel parameters (sysctl) and filesystem execution flags that prevent attackers from escaping PHP isolation or gaining root privileges.
1. Triggering On-Demand Malware Scans for Individual Websites
Administrators can audit individual virtual hosts without initiating a resource-intensive scan of the entire operating system. In the Websites view, each domain row features a quick actions toolbar.

Clicking the green bug icon (ClamAV & Webshell Malware Scan) triggers an isolated background audit of the website’s document root (/var/www/vhosts/domain.com/public_html), inspecting uploaded themes, plugins, and media uploads for known backdoors.
2. Server-Wide Antivirus, Webshell Detection & Anti-Miner Suite
For broader server diagnostics, navigate to the Anti-Trojan & Anti-Miner tab within the central Security modal.

Antivirus & Signature Engine Details
MASACP integrates the ClamAV Enterprise Suite + Heuristic Engine, maintained by an automated daily synchronization mechanism with Cisco Talos (tracking over 8.6 million active threat signatures).
Configuring Scan Scopes:
- Entire Server & All Sites: Performs a comprehensive filesystem audit across all user accounts, system paths, and application trees. Recommended during initial server auditing or monthly maintenance windows.
- Websites Only: Focuses exclusively on virtual host web directories, skipping operating system packages to complete the scan rapidly.
- System & Temp Dirs (/tmp): Specifically targets common dropper staging locations such as
/tmpand/var/tmp.
Real-Time Threat Telemetry Cards
Kernel Mining Virus & CPU Hijacking Protection
Cryptojacking bots typically compromise unpatched PHP scripts and download background mining software (such as Kinsing, XMRig, or sysupdate) that consumes 100% of host CPU cycles. MASACP provides dual-action automated protection against this threat:
Crypto Miner Process Killer (XMRig / kinsing)
A continuous background supervisor scans running processes every few seconds. If a process signature, thread behavior, or memory allocation matches known cryptocurrency mining binaries, the supervisor immediately terminates the PID using SIGKILL and alerts the administrator.
Mining Pool Network Block (Stratum/TCP)
Miners rely on outbound communication with mining pool servers to receive computational work and submit hashes. MASACP deploys firewall rules that drop all outbound Stratum protocol handshakes and block known mining pool IP lists, rendering rogue miners inert even before process termination occurs.
3. Linux Kernel Defense & Privilege Escalation Hardening
Privilege escalation occurs when an attacker exploits a local kernel vulnerability or unquoted file permission to transition from an unprivileged web user (e.g., www-data) to root. The Kernel Defense tab provides kernel-level mitigations to stop privilege escalation chains.

Filesystem & Memory Isolation Options
Enforce noexec on /tmp and /dev/shm
Standard exploit droppers download executable ELF binaries into world-writable directories such as /tmp or shared memory (/dev/shm) and execute them. Remounting these partitions with the noexec, nosuid, nodev flags prevents any binary from executing from these paths, stopping typical automated deployment scripts entirely.
Restrict Process Memory Peeking (ptrace_scope)
Enforces the Linux Yama LSM module parameter (kernel.yama.ptrace_scope = 2). This prevents unprivileged processes from using ptrace to attach to, read, or inject code into other processes owned by different users, thwarting cross-tenant data sniffing in shared hosting environments.
Active Kernel Sysctl Parameters Explained
MASACP enforces production-grade sysctl parameters designed to eliminate common kernel attack vectors:
| Parameter | Value | Defensive Purpose |
|---|---|---|
| kernel.yama.ptrace_scope | 2 | Restricts process tracing to administrative users with CAP_SYS_PTRACE. |
| fs.protected_regular | 2 | Prevents file creation race conditions in world-writable sticky directories. |
| fs.protected_fifos | 2 | Prohibits writing to FIFO pipelines in world-writable directories to prevent data spoofing. |
| kernel.kptr_restrict | 2 | Conceals kernel memory addresses in /proc and syslog, blocking kernel exploit development. |
| net.ipv4.tcp_syncookies | 1 | Mitigates TCP SYN Flood attacks by serving cryptographic SYN cookies when the backlog saturates. |
Incident Remediation Workflow
Recommended Steps if Malware is Detected
- Review Quarantined Paths: Verify the detected file path and signature classification in the ClamAV scan log.
- Audit Website Integrity: Check recently modified files in the target application directory using
find /var/www/vhosts/domain.com -mtime -2to locate additional web droppers. - Rotate Credentials: Immediately regenerate database passwords, CMS administrative account credentials, and FTP/SFTP access keys.
- Keep Kernel & WAF Protections Active: Ensure
noexec on /tmpand the Coraza OWASP CRS rules remain engaged to block repeat intrusion attempts.