Code Monkey home page Code Monkey logo

wordpress-exploit-framework's Introduction

WordPress Exploit Framework

Build Status Maintainability Coverage Status Gem Version

A Ruby framework designed to aid in the penetration testing of WordPress systems.


Installation

To install the latest stable build, run gem install wpxf.

After installation, you can launch the WordPress Exploit Framework console by running wpxf.

What do I need to run it?

Ruby >= 2.4.4 is required to run WordPress Exploit Framework.

Troubleshooting Installation

Debian Systems

If you have issues installing WPXF's dependencies (in particular, Nokogiri), first make sure you have all the tooling necessary to compile C extensions:

sudo apt-get install build-essential patch

It’s possible that you don’t have important development header files installed on your system. Here’s what you should do if you should find yourself in this situation:

sudo apt-get install ruby-dev zlib1g-dev liblzma-dev libsqlite3-dev

Windows Systems

If you are experiencing errors that indicate that libcurl.dll could not be loaded, you will need to ensure the latest libcurl binary is included in your Ruby bin folder, or any other folder that is in your environment's PATH variable.

The latest version can be downloaded from http://curl.haxx.se/download.html. As of 16/05/2016, the latest release is marked as Win32 2000/XP zip 7.40.0 libcurl SSL. After downloading the archive, extract the contents of the bin directory into your Ruby bin directory (if prompted, don't overwrite any existing DLLs).

How do I use it?

Start the WordPress Exploit Framework console by running wpxf.

Once loaded, you'll be presented with the wpxf prompt, from here you can search for modules using the search command or load a module using the use command.

Loading a module into your environment will allow you to set options with the set command and view information about the module using info.

Below is an example of how one would load the symposium_shell_upload exploit module, set the module and payload options and run the exploit against the target.

wpxf > use exploit/shell/symposium_shell_upload

[+] Loaded module: #<Wpxf::Exploit::SymposiumShellUpload:0x3916f20>

wpxf [exploit/shell/symposium_shell_upload] > set host wp-sandbox

[+] Set host => wp-sandbox

wpxf [exploit/shell/symposium_shell_upload] > set target_uri /wordpress/

[+] Set target_uri => /wordpress/

wpxf [exploit/shell/symposium_shell_upload] > set payload exec

[+] Loaded payload: #<Wpxf::Payloads::Exec:0x434d078>

wpxf [exploit/shell/symposium_shell_upload] > set cmd echo "Hello, world!"

[+] Set cmd => echo "Hello, world!"

wpxf [exploit/shell/symposium_shell_upload] > run

[-] Preparing payload...
[-] Uploading the payload...
[-] Executing the payload...
[+] Result: Hello, world!
[+] Execution finished successfully

For a full list of supported commands, take a look at This Wiki Page.

What is the difference between auxiliary and exploit modules?

Auxiliary modules do not allow you to run payloads on the target machine, but instead allow you to extract information from the target, escalate privileges or provide denial of service functionality.

Exploit modules require you to specify a payload which subsequently gets executed on the target machine, allowing you to run arbitrary code to extract information from the machine, establish a remote shell or anything else that you want to do within the context of the web server.

What payloads are available?

  • bind_php: uploads a script that will bind to a specific port and allow WPXF to establish a remote shell.
  • custom: uploads and executes a custom PHP script.
  • download_exec: downloads and runs a remote executable file.
  • meterpreter_bind_tcp: a Meterpreter bind TCP payload generated using msfvenom.
  • meterpreter_reverse_tcp: a Meterpreter reverse TCP payload generated using msfvenom.
  • exec: runs a shell command on the remote server and returns the output to the WPXF session.
  • reverse_tcp: uploads a script that will establish a reverse TCP shell.

All these payloads, with the exception of custom and the Meterpreter payloads, will delete themselves after they have been executed, to avoid leaving them lying around on the target machine after use or in the event that they are being used to establish a shell which fails.

How can I write my own modules and payloads?

Guides on writing modules and payloads can be found on The Wiki and full documentation of the API can be found at https://rastating.github.io/wordpress-exploit-framework

License

Copyright (C) 2015-2018 rastating

Running WordPress Exploit Framework against websites without prior mutual consent may be illegal in your country. The author and parties involved in its development accept no liability and are not responsible for any misuse or damage caused by WordPress Exploit Framework.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

wordpress-exploit-framework's People

Contributors

ipepe avatar phpsystems avatar phyushin avatar rastating avatar viniciusmarangoni2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordpress-exploit-framework's Issues

Usage

Is it possible to scan a website, parse the output and cross reference it with the exploits available in the database?

Otherwise the project looks promising.

Exploits need better separation

The exploits could do with sorting in to sub folders, e.g "contact-form" - This should allow people to find the modules more easily.

Can't install mime-types-data

Everytime i use "bundle install", it'll warn me that An error occurred while installing mime-types-data (3.2016.0221), and Bundler cannot continue.But when i use "gem install mime-types-data -v '3.2016.0221'",it works.Please help me solve it.

error on running ruby wpxf.rb

root@localhost:~/Downloads/wordpress-exploit-framework-master# ruby wpxf.rb
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- colorize (LoadError) from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /root/Downloads/wordpress-exploit-framework-master/env.rb:10:in <top (required)>' from wpxf.rb:4:inrequire_relative'
from wpxf.rb:4:in `

'

  • ihave follwed all the instrution on the readme file ,
    iam using kali rolling

Failed to load required dependency: typhoeus (Windows 7)

Hi rastating,

first thank for your work!

When I run the tool


Failed to load required dependency: typhoeus

You must run "bundle install" prior to using WordPress Exploit Framework.
If bundler is not present on your system, you can install it by running "gem ins
tall bundler"

E:\Ruby\wordpress-exploit-framework-master>bundle install
Using bundler 1.16.1
Using colorize 0.8.1
Using diff-lcs 1.3
Using ffi 1.9.18 (x64-mingw32)
Using ethon 0.11.0
Using mime-types-data 3.2016.0521
Using mime-types 3.1
Using mini_portile2 2.3.0
Using nokogiri 1.8.1 (x64-mingw32)
Using require_all 1.5.0
Using rspec-support 3.7.0
Using rspec-core 3.7.0
Using rspec-expectations 3.7.0
Using rspec-mocks 3.7.0
Using rspec 3.7.0
Using rubyzip 1.2.1
Using slop 4.6.1
Using typhoeus 1.3.0
Bundle complete! 8 Gemfile dependencies, 18 gems now installed.
Use bundle info [gemname] to see where a bundled gem is installed.

E:\Ruby\wordpress-exploit-framework-master>


Ruby installed

ruby 2.4.3p205 (2017-12-14 revision 61247) [x64-mingw32]

ruby wpxf.rb.

$ruby wpxf.rb
/usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require': /home/derento/Scrivania/wordpress-exploit-framework/lib/wpxf/net/http_server.rb:92: syntax error, unexpected '.' (SyntaxError) @http_server_thread&.exit ^ from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require'
from /home/derento/Scrivania/wordpress-exploit-framework/lib/wpxf/core.rb:58:in <top (required)>' from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require' from /home/derento/Scrivania/wordpress-exploit-framework/env.rb:43:in <top (required)>'
from wpxf.rb:4:in require_relative' from wpxf.rb:4:in

'

provide a "help" command

Currently, the only way to know available commands is to "tab-tab", which just gives a list of registered commands. For example, I try the show command, I'm told it's supposed to take an argument, but nothing tells me what arguments it expects, tried show modules and show exploits (like in metasploit), but both didn't work, and I still have no idea of what arguments I should give.

A help / help <command> would thus be really useful to know what each command does, and what arguments they expect.

Error

whenever i try to run your program .

ruby wpxf.rb

I get the following errors

/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- require_all (LoadError) from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /opt/wordpress-exploit-framework/env.rb:13:in <top (required)>' from wpxf.rb:4:inrequire_relative'
from wpxf.rb:4:in `

'

Fix Code Climate Issues

On Code Climate, a large number of issues are currently open for the WordPress Exploit Framework project. A large amount of these are regarding code duplication and complexity, and are slightly more difficult to fix , but there are also a number of style issues, which should be relatively easy to resolve.

The style issues can be found here: https://codeclimate.com/github/rastating/wordpress-exploit-framework/issues?category=style#

If looking into multiple issues, one pull request should be made per type of issue. For example, if you want to fix all the frozen string literal issues, and the empty method issues, you should create one pull request to resolve the frozen string literal issues, and another separate pull request to fix the empty method issues.

Splitting the issues up into separate pull requests will make the reviewing process easier and more manageable.

As always, read the Contributing Guidelines first before starting.

Good luck, have fun and happy Hacktoberfest :)

Platform native error on start

Hi, small issue while attempting to run the first time

uname -a

Linux kali 4.6.0-kali1-amd64 #1 SMP Debian 4.6.4-1kali1 (2016-07-21) x86_64 GNU/Linux

after apt-get update and installing required packages still get an error

ruby wpxf.rb error

/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- colorize (LoadError) from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /root/Code/wordpress-exploit-framework/env.rb:1:in <top (required)>' from wpxf.rb:4:in require_relative'
from wpxf.rb:4:in <main>' from wpxf.rb:4:in

'

Was a bug with ^D?

When I press ^D I received an error like this:

wpxf [exploit/alo_easymail_csrf_xss_shell_upload] >   [!] Uncaught error: undefined method `split' for nil:NilClass
  [!] /xxx/wordpress-exploit-framework/lib/cli/console.rb:117:in `block in
      start'
      /xxx/wordpress-exploit-framework/lib/cli/console.rb:114:in `loop'
      /xxx/wordpress-exploit-framework/lib/cli/console.rb:114:in `start'
      ./wpxf.rb:93:in `<main>'

It was expecting the shell to exit.

load error

root@kalih4ck:/home/sjodi442/wordpress-exploit-framework# ./wpxf.rb
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- colorize (LoadError) from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /home/sjodi442/wordpress-exploit-framework/env.rb:1:in <top (required)>' from ./wpxf.rb:4:in require_relative'
from ./wpxf.rb:4:in `

'
. how fixed it ?

Make it as a gem

Hello there!
Guys, is there a possibility to make wpx as a gem?

cant install some gems (

Hello,can you help me to fix this error ?:

`Installing nokogiri 1.6.7.2 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/bin/ruby2.2 -r ./siteconf20160307-23919-gfhnk5.rb extconf.rb

checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.0.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.2
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.2.0/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /var/lib/gems/2.2.0/extensions/x86-linux/2.2.0/nokogiri-1.6.7.2/gem_make.out
Using rspec-core 3.4.3
Using rspec-expectations 3.4.0
Using rspec-mocks 3.4.1
Using typhoeus 1.0.1
An error occurred while installing nokogiri (1.6.7.2), and Bundler cannot continue.
Make sure that gem install nokogiri -v '1.6.7.2' succeeds before bundling.`

Error when starting from a different working directory

The base path for the require calls in env.rb are all relative to the current working directory, it seems.

Which causes the below error if running wpxf.rb from a directory other than the one it is stored in:

/home/rastating/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- wpxf/core (LoadError)

There is some code in the first 8 lines of env.rb (see below) that is supposed to deal with this by adding the directory of the project to the load path, which needs fixing.

wpxfbase = __FILE__
while File.symlink?(wpxfbase)
  wpxfbase = File.expand_path(File.readlink(wpxfbase), File.dirname(wpxfbase))
end

app_path = File.expand_path(File.join(File.dirname(wpxfbase)))
$LOAD_PATH.unshift(app_path, 'lib')
$LOAD_PATH.unshift(app_path, 'modules')

error happend when try to install

ruby wpxf.rb
/usr/local/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- colorize (LoadError) from /usr/local/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:inrequire'
from /root/ruby-2.2.4/wordpress-exploit-framework/env.rb:10:in <top (required)>' from wpxf.rb:4:inrequire_relative'
from wpxf.rb:4:in `

'

custom upload path for "exploit/shell/revslider_shell_upload"

I am trying to do some experiment with my own website and whenever i try to run exploit/shell/revslider_shell_upload it upload the shell in
somewebsite.com/wp-content/plugins/revslider/temp/update_extract/revslider/KENcyLYEs.php
how i can change the upload path for payload from plugins/revslider/temp/update_extract/revslider/KENcyLYEs.php => /wp-content/uploads/2015/09/KENcyLYEs.php

please suggest as soon as possible

Search Exploit Modules using WPScan Vulnerability Database ID (WPVDB ID)

Exploit modules in WordPress Exploit Framework often have a name which is similar to what is recorded in the WPScan Vulnerability Database, but not exactly the same.

Here is an example:

class Wpxf::Exploit::CreativeContactFormShellUpload < Wpxf::Module
include Wpxf
def initialize
super
update_info(
name: 'Creative Contact Form Shell Upload',
desc: 'This module exploits a file upload vulnerability in all versions '\
'of the Creative Contact Form plugin prior to version 0.9.8 which '\
'allows unauthenticated users to upload and execute PHP scripts '\
'in the context of the web server.',
author: [
'Gianni Angelozzi', # Vulnerability discovery
'rastating' # WPXF module
],
references: [
['EDB', '35057'],
['WPVDB', '7652']
],
date: 'Oct 22 2014'
)
end

The name in the module is Creative Contact Form Shell Upload whereas the name in the WPScan Vulnerability Database is Creative Contact Form <= 0.9.7 Shell Upload. This makes searching by name difficult...

Every vulnerability recorded in the WPScan Vulnerability Database has a unique ID. The author of module in my example has included the ID under references:

references: [ 
         ['EDB', '35057'], 
         ['WPVDB', '7652'] 
], 

So what I'm proposing is the ability to search WordPress Exploit Framework using the WPScan Vulnerability Database ID (WPVDB ID).

Searching by ID has several advantages, such as:

  • IDs are immutable (they should never change) whereas a title might change, for example if a vulnerability is submitted with a typo/spelling mistake.
  • If a vulnerability includes punctuation in the name such as a hyphen, it is easy for this to be reproduced incorrectly (‒, –, —, ―). There's no such ambiguity with a numeric ID.
  • If in the future the WPScan Vulnerability Database decides to support multiple languages, the ID remains consistent across languages.

One or more required options not set: payload

wpxf > use exploit/aries_revslider_shell_upload

[+] Loaded module: #Wpxf::Exploit::AriesRevsliderShellUpload:0x00000002ca8968

wpxf [exploit/aries_revslider_shell_upload] > show options

Module options:

Name         Current Setting   Required   Description
----------   ---------------   --------   --------------------------------------
host                           true       Address of the target host.
port         80                true       Port the remote host is listening on
proxy                          false      Proxy address ([protocol://]host:port)
ssl          false             true       Use SSL/HTTPS for all requests
target_uri   /                 true       Base path to the WordPress application
verbose      false             true       Enable verbose output
vhost                          false      HTTP server virtual host

wpxf [exploit/aries_revslider_shell_upload] > set host http://xxx.de/

[+] Set host => http://xxx.de/

wpxf [exploit/aries_revslider_shell_upload] > run

[!] One or more required options not set: payload

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.