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 asfilesizework and matches are not missed at chunk boundaries. --scan-timeoutlimits the time per file (default 10 seconds).- Available subcommands:
malware-scan,count-sites,configure,helpandversion. - 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
Metadata
Release files for wpsniffer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wpsniffer-0.1.0.tar.gz | 109.8 kB | With provenance | Details for wpsniffer-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wpsniffer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for wpsniffer-0.1.0-py3-none-any.whl |
Total release size: 243.7 kB
Release files / wpsniffer-0.1.0.tar.gz
| Download URL | wpsniffer-0.1.0.tar.gz |
|---|---|
| Size | 109.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b6af5326524d1ce7065f957e2da0e4e15a8fc582b04d0077392ea5787ce9b0a
|
|
BLAKE2b-256 checksum How to use checksums |
1cdae4020dd6b67fc1fdd49514a104d07762c82ee7eaff5050ec3c6461d1bf6f
|
| 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 23, 2026.
Transparency logRelease files / wpsniffer-0.1.0-py3-none-any.whl
| Download URL | wpsniffer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 133.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
05db8527450df2a5fdb02bdc9984c312a0ec27cfe8a29c2fdc9ee41c6caf825f
|
|
BLAKE2b-256 checksum How to use checksums |
5d58d9ef741f7f68c510f7d2b259b55c24b65519ac84f1e21fe479a4ca6fe001
|
| 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 23, 2026.
Transparency logSecurity for wpsniffer 0.1.0
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.
Attestation for wpsniffer-0.1.0.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 23, 2026.
Transparency logA 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.