$ show wpscanteam/wpscan
WPScan is a Ruby-based CLI security scanner for WordPress sites. It detects vulnerabilities in WordPress core, plugins, and themes, enumerates users and misconfigurations, and supports password brute-force attacks. The architecture follows a controller/finder pattern: controllers orchestrate scan phases (version detection, enumeration, password attack), and finders implement passive/aggressive detection strategies for specific items (plugins, themes, users, backups, etc.). HTTP client is a singleton wrapping Typhoeus with caching, throttling, and proxy support. Vulnerability data is retrieved from the WPScan API or local enterprise database dumps. The codebase is well-structured with clear separation of concerns, extensive test coverage, and support for multiple output formats (CLI, JSON, SARIF). It is actively maintained and regularly updated to keep pace with WordPress ecosystem changes.
The LLM identified 2 files worth highlighting for reuse:
Base class for the custom option parser (OptParseValidator). Defines a clean, composable pattern for CLI option validation: each option type (String, Boolean, Integer, URI, etc.) inherits from this base, implementing valid? and normalize methods. Supports aliases, defaults, required/optional, config file loading, and dependency validation (required_unless). The implementation is self-contained and could be extracted as a standalone gem for any Ruby CLI application needing robust option handling. Demonstrates non-obvious skill in handling edge cases like smart lists, credentials parsing, and cross-option validation.
Base class for dynamic version finders that extract version strings from HTML, CSS, JS, and response headers using configurable YAML patterns. Subclasses (BodyPattern, Comment, HeaderPattern, JavascriptVar, Xpath, QueryParameter) implement specific extraction strategies. The class dynamically creates child classes from YAML configs, enabling the scanner to detect thousands of plugin/themes versions without writing explicit detection code. This pattern is highly reusable for any project that needs to detect version information from web responses using regex, CSS selectors, or XPath, configured via external data files.