Coder Social home page Coder Social logo

zeropress's Introduction

zeropress

A dumb script for finding dumb coding errors and web shells in PHP.

Essentially this is a list of grep statements that I frequently use for code reviewing PHP applications, wrapped in a bunch of python. The main use case for this script is to find vulnerable WordPress plugins, and there is a mode which will automatically scrape and download from the official popular plugins site, scanning each plugin that it downloads. You can also just point the script at any directory and it will simply scan that directory, which works well for a first pass in a code review or for hunting web shells in incident response.

This is not a code analyser. It doesn't parse any PHP and will produce a lot of false positives. This is intended just to find easy to spot errors which you can then investigate further.

Examples

  1. Start downloading and analysing WordPress plugins:

    python zeropress.py -p

  2. Take the output from wpscan and analyse all the themes and plugins that it identified.

    First collect the scan in a file, wpscan.log:

    wpscan http://yourtargetsite.com | tee wpscan.log

    then

    python zeropress.py -w wpscan.log

  3. Just analyse a folder already on disk, reporting only severity 1 issues (critical such as RCE, SQLi):

    python zeropress.py -a /var/www -s 1

Usage

usage: zeropress.py [-h] [-d PLUGINDIR] [-o OUTPUTDIR] [-l LOGFILE] [-L]
                    [-w WPSCAN] [-p] [-n] [-a ANALYSE] [-b] [-s {1,2,3,4}]
                    [--debug DEBUG]

Grab the most popular wordpress plugins, unpack them and look for dangerous
code use

optional arguments:
  -h, --help            show this help message and exit
  -d PLUGINDIR, --plugindir PLUGINDIR
                        Base URL for scraping plugins
  -o OUTPUTDIR, --outputdir OUTPUTDIR
                        Output dir for saving downloaded files
  -l LOGFILE, --logfile LOGFILE
                        Log file to write to
  -L, --nologfile       Disable writing a log file
  -w WPSCAN, --wpscan WPSCAN
                        Download all plugins mentioned in the supplied output
                        file from wpscan
  -p, --plugins         WordPress plugins mode. Scrape and analyse all top
                        plugins on wordpress.org/plugins
  -n, --nodownload      Don't do any scraping, just analyse any code already
                        present
  -a ANALYSE, --analyse ANALYSE
                        Just analyse a folder without doing anything else
  -b, --binaries        Search within binary files as if they were text
  -s {1,2,3,4}, --severity {1,2,3,4}
                        Report only issues of this severity level and up
                        (1=critical, 4=medium)
  --debug DEBUG         Output search commands

zeropress's People

Contributors

strawp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.