All Projects → webarx-security → Wpbullet

webarx-security / Wpbullet

Licence: gpl-2.0
A static code analysis for WordPress (and PHP)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Wpbullet

Theme
Tonik is a WordPress Starter Theme which aims to modernize, organize and enhance some aspects of WordPress theme development.
Stars: ✭ 1,197 (+708.78%)
Mutual labels:  wordpress, wordpress-development
Imposter Plugin
Composer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins.
Stars: ✭ 90 (-39.19%)
Mutual labels:  wordpress, wordpress-development
Instantwp
InstantWP is a complete standalone, portable WordPress development environment.
Stars: ✭ 83 (-43.92%)
Mutual labels:  wordpress, wordpress-development
Framework
Assely is a PHP framework which brings a little joy to the WordPress development. Develop structured, easily scalable and complex WordPress websites and web applications with true pleasure.
Stars: ✭ 53 (-64.19%)
Mutual labels:  wordpress, wordpress-development
Wordup Cli
Wordup is a fully integrated development platform for WordPress. Develop plugins and themes locally. Preview in the cloud. Automatic updates in WP.
Stars: ✭ 116 (-21.62%)
Mutual labels:  wordpress, wordpress-development
Assely
Assely introduces some standarized and comfortable ways for creating WordPress powered applications.
Stars: ✭ 59 (-60.14%)
Mutual labels:  wordpress, wordpress-development
Tj
Create local WordPress dev sites, manage existing sites, and deploy them, all from the command line.
Stars: ✭ 88 (-40.54%)
Mutual labels:  wordpress, wordpress-development
Wordpress Starter
📦 A starter template for WordPress websites
Stars: ✭ 26 (-82.43%)
Mutual labels:  wordpress, wordpress-development
Live Composer Page Builder
Free page builder plugin for WordPress http://livecomposerplugin.com
Stars: ✭ 143 (-3.38%)
Mutual labels:  wordpress, wordpress-development
Login Designer
Official repository of the Login Designer WordPress Plugin
Stars: ✭ 97 (-34.46%)
Mutual labels:  wordpress, wordpress-development
Wp Functions
A compilation of function snippets for WordPress developers who create their own themes.
Stars: ✭ 1,055 (+612.84%)
Mutual labels:  wordpress, wordpress-development
React With Wordpress
🔥 Example of react application to access WordPress REST API
Stars: ✭ 137 (-7.43%)
Mutual labels:  wordpress, wordpress-development
Meta Box
The best plugin for WordPress custom fields and custom meta boxes
Stars: ✭ 1,039 (+602.03%)
Mutual labels:  wordpress, wordpress-development
Wpintel
Chrome extension designed for WordPress Vulnerability Scanning and information gathering!
Stars: ✭ 70 (-52.7%)
Mutual labels:  wordpress, wordpress-development
Composify
Turn WordPress plugin zip files into git repositories, so that composer version constraints work properly.
Stars: ✭ 36 (-75.68%)
Mutual labels:  wordpress, wordpress-development
Wp Functions List
This is a list of all WordPress functions from version 0 to version 4.8.1 along with the data of when they were first introduced and if they are deprecated or not
Stars: ✭ 88 (-40.54%)
Mutual labels:  wordpress, wordpress-development
Intervention
WordPress plugin to configure wp-admin and application state using a single config file.
Stars: ✭ 481 (+225%)
Mutual labels:  wordpress, wordpress-development
Raccoon Plugin
With Raccoon, use a JSON or YAML file to manage WordPress theme features
Stars: ✭ 18 (-87.84%)
Mutual labels:  wordpress, wordpress-development
Dynamic Featured Image
Dynamically adds multiple featured image (post thumbnail) functionality to posts, pages and custom post types
Stars: ✭ 96 (-35.14%)
Mutual labels:  wordpress, wordpress-development
Plugin Update Checker
A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.
Stars: ✭ 1,695 (+1045.27%)
Mutual labels:  wordpress, wordpress-development

alt text

wpBullet Build Status Python 2.x|3.x License

A static code analysis for WordPress Plugins/Themes (and PHP)

Installation

Simply clone the repository, install requirements and run the script

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

Usage

Available options:

--path (required) System path or download URL 
Examples:
--path="/path/to/plugin"
--path="https://wordpress.org/plugins/example-plugin"
--path="https://downloads.wordpress.org/plugin/example-plugin.1.5.zip"

--enabled (optional) Check only for given modules, ex. --enabled="SQLInjection,CrossSiteScripting"
--disabled (optional) Don't check for given modules, ex. --disabled="SQLInjection,CrossSiteScripting"
--cleanup (optional) Automatically remove content of .temp folder after scanning remotely downloaded plugin (boolean)
--report (optional) Saves result inside reports/ directory in JSON format (boolean)

$ python wpbullet.py --path="/var/www/wp-content/plugins/plugin-name"

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

Modules/ExampleVulnerability.py

from core.modules import BaseClass


class ExampleVulnerability(object):

    # Vulnerability name
    name = "Cross-site Scripting"

    # Vulnerability severity
    severity = "Low-Medium"

    # Functions causing vulnerability
    functions = [
        "print"
        "echo"
    ]

    # Functions/regex that prevent exploitation
    blacklist = [
        "htmlspecialchars",
        "esc_attr"
    ]

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

import copy


...
# Build dynamic regex pattern to locate vulnerabilities in given content
def build_pattern(self, content, file):
    user_input = copy.deepcopy(self.user_input)

    variables = self.get_input_variables(self, content)

    if variables:
        user_input.extend(variables)

    if self.blacklist:
        blacklist_pattern = r"(?!(\s?)+(.*(" + '|'.join(self.blacklist) + ")))"
    else:
        blacklist_pattern = ""

    self.functions = [self.functions_prefix + x for x in self.functions]

    pattern = r"((" + '|'.join(self.functions) + ")\s{0,}\(?\s{0,1}" + blacklist_pattern + ".*(" + '|'.join(user_input) + ").*)"
    return pattern

Testing

Running unit tests: $ python3 -m unittest

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].