Wpbullet – A Static Code Analysis From alphabanklog

Wpbullet – A Static Code Analysis From alphabanklog


Wpbullet – A Static Code Analysis
A static code analysis for WordPress Plugins/Themes (and PHP)
Installation
Simply clone the repository, install requirements and run the script

Code:
git clone https://github.com/webarx-security/wpbullet wpbullet
cd wpbullet
pip install -r requirements.txt
python wpbullet.py

Usage
Available options:

Creating modules

Creating a module is flexible and allows for override of the BaseClass methods for each module as well as creating their own methods
Each module in Modules directory is implementing properties and methods from core.modules.BaseClass, thus each module’s required parameter is BaseClass
Once created, module needs to be imported in modules/__init__.py. Module and class name must be consistent in order to module to be loaded.
If you are opening pull request to add new module, please provide unit tests for your module as well.
Module template

Overriding regex match pattern
Regex pattern is being generated in core.modules.BaseClass.build_pattern and therefore can be overwritten in each module class.
Modules/ExampleVulnerability.py

Testing
Running unit tests:

Code:
python3 -m unittest

Leave a Reply