Skip to main content

WPSniffer

WPSniffer is a command-line malware scanner for WordPress and PHP sites that uses free, community-maintained YARA rules, scanned with a YARA-X engine.

It has a multi-process scanner, file filters, several report formats (CSV, TSV, line-delimited, null-delimited and human-readable), email reports and a progress display. It needs no license key or account.

Website: https://wpsniffer.com

See NOTICE for the project's origin and licensing details.

Installation

Requires Python 3.8 or later. Install from PyPI into a virtual environment:

python3 -m venv ~/wpsniffer
~/wpsniffer/bin/pip install wpsniffer
~/wpsniffer/bin/wpsniffer version

Every release is also published as a wheel and source archive on the GitHub releases page. Bug reports and feature requests go to the issue tracker there.

From a checkout of this repository:

python3 -m venv .venv
.venv/bin/pip install .
.venv/bin/wpsniffer version

Rules

By default, WPSniffer downloads the YARA Forge core package (about 5,000 rules, including the signature-base PHP webshell rules), caches it in ~/.cache/wpsniffer, and checks for a new release once a day. If the download fails, the cached copy is used.

Option Effect
--yara-forge core|extended|full|none Choose the YARA Forge package. core has the fewest false positives; extended and full add more rules and more noise.
--yara-forge-release 20261018 Pin a specific YARA Forge release instead of latest.
--rules PATH Add your own .yar/.yara file or directory (repeatable). When --rules is given, YARA Forge is only used if --yara-forge is also set.
--refresh-rules Download the YARA Forge package even if the cache is current.
-e, --exclude-signatures Ignore rules by name; wildcards work, e.g. -e 'SIGNATURE_BASE_SUSP_*'.
-i, --include-signatures Only report the named rules (wildcards work).

Rules from --rules files are compiled in a namespace named after the file, so they are reported as filename:RULE_NAME. Rules that fail to compile are skipped with a warning (--debug shows the errors); the rest are still used.

Compiled rules are cached, so later scans skip compilation. Use --pre-compile to download and compile rules without scanning, for example right after an update in a cron job.

Usage

Scan a WordPress install:

wpsniffer malware-scan /var/www/html

Report every matching rule, with rule metadata, to a CSV file:

wpsniffer malware-scan --match-all --output-path results.csv \
    --output-columns filename,signature_id,signature_description,rule_score,rule_author,rule_reference,matched_text \
    /var/www/html

Use your own rules together with YARA Forge:

wpsniffer malware-scan --rules /etc/wpsniffer/rules --yara-forge core /var/www/html

Scan files changed in the last hour:

find /var/www -cmin -60 -type f -print0 | wpsniffer malware-scan

Run wpsniffer malware-scan --help for all options.

Report columns

filename, signature_id (rule name), signature_name, signature_description, matched_text (first matched string, up to 256 bytes), rule_author, rule_reference, rule_score, rule_tags.

Scheduled scans

malware-scan reads extra paths from standard input when it is not a terminal. Under schedulers or CI systems that leave standard input open, pass --no-read-stdin (or redirect < /dev/null) so the scan does not wait for input.

Scanning behavior

  • Rules come from YARA Forge and/or local files.
  • Each file is scanned as a whole (up to --scanned-content-limit, 50 MiB by default), so YARA conditions such as filesize work and matches are not missed at chunk boundaries.
  • --scan-timeout limits the time per file (default 10 seconds).
  • Available subcommands: malware-scan, count-sites, configure, help and version.
  • Configuration lives in ~/.config/wpsniffer/wpsniffer.ini (or /etc/wpsniffer/wpsniffer.ini) and the cache in ~/.cache/wpsniffer.

Development

.venv/bin/pip install -e . pytest flake8
.venv/bin/python -m pytest wpsniffer
.venv/bin/python -m flake8 wpsniffer

License

GPLv3. See LICENSE and NOTICE.

Metadata

Release files for wpsniffer 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wpsniffer 0.1.1
File Size Uploaded Provenance Actions
wpsniffer-0.1.1.tar.gz 113.2 kB With provenance Details for wpsniffer-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wpsniffer 0.1.1
File Interpreter ABI Platform Actions
wpsniffer-0.1.1-py3-none-any.whl Python 3 none any Details for wpsniffer-0.1.1-py3-none-any.whl

Total release size: 251.5 kB

Release files / wpsniffer-0.1.1.tar.gz

Download URL wpsniffer-0.1.1.tar.gz
Size 113.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8164e35de0bafc351a7cbdb645e1aeefb7bde8c1a8b6306b8cd4ece153361d48
BLAKE2b-256 checksum
How to use checksums
e797d49c8ec7dd63fd73ae8d3fdf5f544898c34c2a3da198e2c0a68a0f9eaa4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Release files / wpsniffer-0.1.1-py3-none-any.whl

Download URL wpsniffer-0.1.1-py3-none-any.whl
Size 138.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
804eea1ceab44c3e34b09c53e1c0ed707d8828f3026f4e4fc6c0d6a1803de31d
BLAKE2b-256 checksum
How to use checksums
b6a4d3cdd10b9683874b656746de395d3270fe064f509e4a87282537f105ae85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Security for wpsniffer 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wpsniffer-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page