Compare commits

...

70 Commits
2.9.1 ... 2.9.2

Author SHA1 Message Date
ethicalhack3r
2bff063805 More changelog info 2016-11-15 20:51:38 +01:00
ethicalhack3r
53d9956829 Update data.zip 2016-11-15 20:37:54 +01:00
ethicalhack3r
6e98678c3c Bump wpscan version 2016-11-15 20:37:07 +01:00
ethicalhack3r
f0f21f5ac2 Add stats to changelog 2016-11-15 20:35:48 +01:00
ethicalhack3r
aa233b1c4d Add total vuln stats 2016-11-15 20:34:55 +01:00
ethicalhack3r
93f9123f45 Document missing options 2016-11-15 20:17:09 +01:00
ethicalhack3r
5c710d88e4 Update changelog 2016-11-15 20:00:54 +01:00
ethicalhack3r
ded70ff743 add R symbol 2016-11-08 14:03:33 +01:00
Christian Mehlmauer
9df7443aa4 color 2016-11-02 22:23:00 +01:00
Christian Mehlmauer
8362975691 apt tweak 2016-11-02 21:52:14 +01:00
Christian Mehlmauer
49771419ae Merge branch 'master' of github.com:wpscanteam/wpscan 2016-11-01 19:39:24 +01:00
Christian Mehlmauer
d344f84824 remove cloudflare error handling 2016-11-01 19:38:47 +01:00
Christian Mehlmauer
89c0b8d4d0 Merge pull request #1019 from wpscanteam/hash
remove scripts before calculating hashes
2016-10-26 11:48:13 +02:00
Christian Mehlmauer
3c74ee8d97 remove scripts before calculating hashes 2016-10-25 20:44:00 +02:00
ethicalhack3r
785c6efa5b Fix typo 2016-10-14 14:52:54 +02:00
ethicalhack3r
4e2bf5322e Markdown formating 2016-10-14 14:51:40 +02:00
ethicalhack3r
54ed148c87 Add passive detection of google-universal-analytics 2016-10-14 14:48:48 +02:00
Christian Mehlmauer
b08e298eba Merge branch 'master' of github.com:wpscanteam/wpscan 2016-10-06 20:35:44 +02:00
Christian Mehlmauer
89e2088357 fix #1008 2016-10-06 20:35:29 +02:00
ethicalhack3r
f3cc35bd74 trademark update 2016-09-08 09:39:52 +02:00
Christian Mehlmauer
a007d283e5 rspecs 2016-09-05 23:25:33 +02:00
Christian Mehlmauer
70902aa013 Merge branch 'master' of github.com:wpscanteam/wpscan 2016-09-05 22:59:14 +02:00
Christian Mehlmauer
91151fc53b check for ssl related errors. Fix #993 2016-09-05 22:58:56 +02:00
Christian Mehlmauer
d4ee82dac5 Update README.md 2016-08-17 18:31:35 +02:00
Christian Mehlmauer
88d3c26113 moar rspecs 2016-08-16 21:40:19 +02:00
Christian Mehlmauer
054a4ee6aa fix #984 2016-08-16 21:20:29 +02:00
ethicalhack3r
c291022753 Improve yoast seo pasive detection regex #984 2016-08-16 17:20:52 +02:00
Christian Mehlmauer
2fc488b602 rework readme 2016-08-15 00:25:46 +02:00
Christian Mehlmauer
009ddd690e verbose update 2016-08-13 12:52:33 +02:00
Christian Mehlmauer
88b5cd8751 readme 2016-08-13 10:30:06 +02:00
Christian Mehlmauer
cfd19d02b1 readme 2016-08-13 10:29:28 +02:00
Christian Mehlmauer
19ce30d862 trigger docker build 2016-08-13 10:27:52 +02:00
Christian Mehlmauer
c6df6e0e89 move docker stuff 2016-08-13 10:24:02 +02:00
Christian Mehlmauer
e942a5bcf6 Exit on exceptions 2016-08-12 23:56:36 +02:00
Christian Mehlmauer
c0f5163d07 handle null 2016-08-12 21:50:59 +02:00
Christian Mehlmauer
f5aa9f117f fix #968 2016-08-12 21:29:05 +02:00
Christian Mehlmauer
498d93377d rvm install instructions 2016-08-12 21:25:45 +02:00
Christian Mehlmauer
52242e706b Merge branch 'master' of github.com:wpscanteam/wpscan 2016-08-12 20:55:20 +02:00
Christian Mehlmauer
22d69a1bf9 more detailed update exception 2016-08-12 20:54:24 +02:00
Ryan Dewhurst
0b1fa13696 Merge pull request #973 from pierre-dargham/feature_option_cache
Enable --cache-dir option in command line parameters, which solves write permission issues when wpscan is installed in system or root-owned directories
2016-08-12 12:16:11 +02:00
Christian Mehlmauer
19b15b5327 travis 2016-08-08 22:35:20 +02:00
Christian Mehlmauer
e63e96f5ed travis 2016-08-08 22:04:42 +02:00
Christian Mehlmauer
e8ac8f26a7 travis 2016-08-08 22:00:52 +02:00
Christian Mehlmauer
13e4327de4 travis 2016-08-08 21:57:38 +02:00
Christian Mehlmauer
c22a1ed12a travis 2016-08-08 21:55:40 +02:00
Christian Mehlmauer
be5662b5f1 travis 2016-08-08 21:52:30 +02:00
Christian Mehlmauer
6e840ca920 fix #974 2016-08-08 21:40:36 +02:00
Pierre Dargham
8492190f4c Allow --cache-dir option in command line parameters 2016-08-05 10:56:40 +02:00
Christian Mehlmauer
93ab6ee2a0 fucking specs 2016-08-01 22:13:38 +02:00
Christian Mehlmauer
7075e01886 Merge branch 'master' of github.com:wpscanteam/wpscan 2016-08-01 22:07:47 +02:00
Christian Mehlmauer
436a83434c fix #972 2016-08-01 22:04:13 +02:00
pvdl
d270391b56 Fix for missing 'zlib.h' in Nokogiri 2016-07-26 19:43:45 +02:00
Christian Mehlmauer
7f2762eb6f new options 2016-07-21 21:27:21 +02:00
Christian Mehlmauer
2cc5bb0311 fix rspecs 2016-07-21 13:57:18 +02:00
Christian Mehlmauer
d697127261 set user agent globally 2016-07-21 13:21:07 +02:00
Christian Mehlmauer
825523a851 changelog 2016-06-27 16:07:40 +02:00
Christian Mehlmauer
0f3f9cac33 more info 2016-06-24 21:17:43 +02:00
ethicalhack3r
f9b545b100 Clearer instructions 2016-06-23 13:40:15 +02:00
Christian Mehlmauer
943bfc39b3 fix for #957 2016-06-14 03:30:17 +02:00
Ryan Dewhurst
b1a8f445c6 Merge pull request #950 from anthraxx/master
bump terminal-table to 1.6.0 and drop workaround
2016-06-07 09:54:42 +02:00
anthraxx
5435df4345 bump terminal-table to 1.6.0 and drop workaround 2016-06-06 19:28:40 +02:00
ethicalhack3r
8e9d29e94f Update dependencies #939 2016-06-02 11:21:07 +02:00
ethicalhack3r
1afa761f09 RandomStorm is no more 2016-06-02 11:09:10 +02:00
Ryan Dewhurst
d626913ce9 Merge pull request #949 from wpscanteam/finders
more advanced version detection
2016-06-02 11:04:38 +02:00
ethicalhack3r
9c52e4a5ee Update dependencies #939 2016-06-02 11:03:07 +02:00
Christian Mehlmauer
72c2c1992b rspec fixed 2016-05-31 15:23:34 +02:00
Christian Mehlmauer
e1b4b5e8e5 typo 2016-05-31 14:53:50 +02:00
Christian Mehlmauer
0243522854 more advanced version detection 2016-05-31 14:51:09 +02:00
Christian Mehlmauer
5118c68f45 fix #943 2016-05-13 21:23:22 +02:00
Christian Mehlmauer
442884b5c5 remove executable flags 2016-05-09 16:19:11 +02:00
93 changed files with 386 additions and 180 deletions

18
.dockerignore Normal file
View File

@@ -0,0 +1,18 @@
git/
bundle/
.idea/
.yardoc/
cache/
coverage/
spec/
dev/
.*
**/*.md
*.md
Dockerfile
**/*.orig
*.orig
CREDITS
data.zip
DISCLAIMER.txt
example.conf.json

View File

@@ -2,8 +2,7 @@ language: ruby
sudo: false sudo: false
cache: bundler cache: bundler
rvm: rvm:
# Still not in Travis :( - 2.1.9
# - 2.1.9
- 2.2.0 - 2.2.0
- 2.2.1 - 2.2.1
- 2.2.2 - 2.2.2
@@ -13,6 +12,8 @@ rvm:
- 2.3.1 - 2.3.1
before_install: before_install:
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" - "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
before_script:
- "unzip -o $TRAVIS_BUILD_DIR/data.zip -d $TRAVIS_BUILD_DIR"
script: bundle exec rspec script: bundle exec rspec
notifications: notifications:
email: email:

View File

@@ -1,6 +1,31 @@
# Changelog # Changelog
## Master ## Master
[Work in progress](https://github.com/wpscanteam/wpscan/compare/2.9.1...master) [Work in progress](https://github.com/wpscanteam/wpscan/compare/2.9.2...master)
## Version 2.9.2
Released: 2016-11-15
* Fixed error when detecting plugins with UTF-8 characters
* Use all possible finders to verify a detected version
* Fix error when detecting a WordPress version not in our database
* Added some additional clarification on error messages
* Upgrade terminal-table gem
* Add --cache-dir option
* Add --disable-tls-checks options
* Improve/add additional plugin passive detections
* Remove scripts when calculating page hashes
* Many other small bug fixes.
WPScan Database Statistics:
* Total tracked wordpresses: 194
* Total tracked plugins: 63703
* Total tracked themes: 13835
* Total vulnerable wordpresses: 177
* Total vulnerable plugins: 1382
* Total vulnerable themes: 379
* Total wordpress vulnerabilities: 2617
* Total plugin vulnerabilities: 2190
* Total theme vulnerabilities: 452
## Version 2.9.1 ## Version 2.9.1
Released: 2016-05-06 Released: 2016-05-06

24
Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
FROM ruby:2.3-slim
MAINTAINER WPScan Team <team@wpscan.org>
RUN DEBIAN_FRONTEND=noninteractive && \
rm -rf /var/lib/apt/lists/* && \
apt-get update && \
apt-get --no-install-recommends -qq -y install curl git ca-certificates openssl libcurl4-openssl-dev libxml2 libxml2-dev libxslt1-dev build-essential procps
RUN useradd -d /wpscan wpscan
RUN echo "gem: --no-ri --no-rdoc" > /etc/gemrc
RUN mkdir /wpscan
COPY . /wpscan
WORKDIR /wpscan
RUN bundle install --without test
RUN chown -R wpscan:wpscan /wpscan
USER wpscan
RUN /wpscan/wpscan.rb --update --verbose --no-color
ENTRYPOINT ["/wpscan/wpscan.rb"]
CMD ["--help"]

View File

@@ -1,13 +1,10 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'typhoeus', '>=0.8.0' gem 'typhoeus', '>=1.0.0'
gem 'nokogiri', '>=1.6.7.1' gem 'nokogiri', '>=1.6.7.2'
gem 'addressable' gem 'addressable'
gem 'yajl-ruby' # Better JSON parser regarding memory usage gem 'yajl-ruby' # Better JSON parser regarding memory usage
# TODO: update the below when terminal-table 1.5.3+ is released. gem 'terminal-table', '>=1.6.0'
# See issue #841 for details
# (and delete the Terminal module in lib/common/hacks.rb)
gem 'terminal-table', '~>1.4.5'
gem 'ruby-progressbar', '>=1.6.0' gem 'ruby-progressbar', '>=1.6.0'
group :test do group :test do

View File

@@ -68,3 +68,7 @@ To the extent permitted under Law, WPScan is provided under an AS-IS basis. The
10. Disclaimer 10. Disclaimer
Running WPScan against websites without prior mutual consent may be illegal in your country. The WPScan Team accept no liability and are not responsible for any misuse or damage caused by WPScan. Running WPScan against websites without prior mutual consent may be illegal in your country. The WPScan Team accept no liability and are not responsible for any misuse or damage caused by WPScan.
11. Trademark
The "wpscan" term is a registered trademark. This License does not grant the use of the "wpscan" trademark or the use of the WPScan logo.

133
README.md
View File

@@ -4,16 +4,17 @@
[![Build Status](https://travis-ci.org/wpscanteam/wpscan.svg?branch=master)](https://travis-ci.org/wpscanteam/wpscan) [![Build Status](https://travis-ci.org/wpscanteam/wpscan.svg?branch=master)](https://travis-ci.org/wpscanteam/wpscan)
[![Code Climate](https://img.shields.io/codeclimate/github/wpscanteam/wpscan.svg)](https://codeclimate.com/github/wpscanteam/wpscan) [![Code Climate](https://img.shields.io/codeclimate/github/wpscanteam/wpscan.svg)](https://codeclimate.com/github/wpscanteam/wpscan)
[![Dependency Status](https://img.shields.io/gemnasium/wpscanteam/wpscan.svg)](https://gemnasium.com/wpscanteam/wpscan) [![Dependency Status](https://img.shields.io/gemnasium/wpscanteam/wpscan.svg)](https://gemnasium.com/wpscanteam/wpscan)
[![Docker Pulls](https://img.shields.io/docker/pulls/wpscanteam/wpscan.svg)](https://hub.docker.com/r/wpscanteam/wpscan/)
#### LICENSE # LICENSE
#### WPScan Public Source License ## WPScan Public Source License
The WPScan software (henceforth referred to simply as "WPScan") is dual-licensed - Copyright 2011-2016 WPScan Team. The WPScan software (henceforth referred to simply as "WPScan") is dual-licensed - Copyright 2011-2016 WPScan Team.
Cases that include commercialization of WPScan require a commercial, non-free license. Otherwise, WPScan can be used without charge under the terms set out below. Cases that include commercialization of WPScan require a commercial, non-free license. Otherwise, WPScan can be used without charge under the terms set out below.
##### 1. Definitions ### 1. Definitions
1.1 "License" means this document. 1.1 "License" means this document.
@@ -21,7 +22,7 @@ Cases that include commercialization of WPScan require a commercial, non-free li
1.3 "WPScan Team" means WPScans core developers, an updated list of whom can be found within the CREDITS file. 1.3 "WPScan Team" means WPScans core developers, an updated list of whom can be found within the CREDITS file.
##### 2. Commercialization ### 2. Commercialization
A commercial use is one intended for commercial advantage or monetary compensation. A commercial use is one intended for commercial advantage or monetary compensation.
@@ -44,7 +45,7 @@ We may grant commercial licenses at no monetary cost at our own discretion if th
Free-use Terms and Conditions; Free-use Terms and Conditions;
##### 3. Redistribution ### 3. Redistribution
Redistribution is permitted under the following conditions: Redistribution is permitted under the following conditions:
@@ -52,35 +53,39 @@ Redistribution is permitted under the following conditions:
- Unmodified Copyright notices are provided with WPScan. - Unmodified Copyright notices are provided with WPScan.
- Does not conflict with the commercialization clause. - Does not conflict with the commercialization clause.
##### 4. Copying ### 4. Copying
Copying is permitted so long as it does not conflict with the Redistribution clause. Copying is permitted so long as it does not conflict with the Redistribution clause.
##### 5. Modification ### 5. Modification
Modification is permitted so long as it does not conflict with the Redistribution clause. Modification is permitted so long as it does not conflict with the Redistribution clause.
##### 6. Contributions ### 6. Contributions
Any Contributions assume the Contributor grants the WPScan Team the unlimited, non-exclusive right to reuse, modify and relicense the Contributor's content. Any Contributions assume the Contributor grants the WPScan Team the unlimited, non-exclusive right to reuse, modify and relicense the Contributor's content.
##### 7. Support ### 7. Support
WPScan is provided under an AS-IS basis and without any support, updates or maintenance. Support, updates and maintenance may be given according to the sole discretion of the WPScan Team. WPScan is provided under an AS-IS basis and without any support, updates or maintenance. Support, updates and maintenance may be given according to the sole discretion of the WPScan Team.
##### 8. Disclaimer of Warranty ### 8. Disclaimer of Warranty
WPScan is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the WPScan is free of defects, merchantable, fit for a particular purpose or non-infringing. WPScan is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the WPScan is free of defects, merchantable, fit for a particular purpose or non-infringing.
##### 9. Limitation of Liability ### 9. Limitation of Liability
To the extent permitted under Law, WPScan is provided under an AS-IS basis. The WPScan Team shall never, and without any limit, be liable for any damage, cost, expense or any other payment incurred as a result of WPScan's actions, failure, bugs and/or any other interaction between WPScan and end-equipment, computers, other software or any 3rd party, end-equipment, computer or services. To the extent permitted under Law, WPScan is provided under an AS-IS basis. The WPScan Team shall never, and without any limit, be liable for any damage, cost, expense or any other payment incurred as a result of WPScan's actions, failure, bugs and/or any other interaction between WPScan and end-equipment, computers, other software or any 3rd party, end-equipment, computer or services.
##### 10. Disclaimer ### 10. Disclaimer
Running WPScan against websites without prior mutual consent may be illegal in your country. The WPScan Team accept no liability and are not responsible for any misuse or damage caused by WPScan. Running WPScan against websites without prior mutual consent may be illegal in your country. The WPScan Team accept no liability and are not responsible for any misuse or damage caused by WPScan.
#### INSTALL ### 11. Trademark
The "wpscan" term is a registered trademark. This License does not grant the use of the "wpscan" trademark or the use of the WPScan logo.
# INSTALL
WPScan comes pre-installed on the following Linux distributions: WPScan comes pre-installed on the following Linux distributions:
@@ -90,69 +95,44 @@ WPScan comes pre-installed on the following Linux distributions:
- [SamuraiWTF](http://samurai.inguardians.com/) - [SamuraiWTF](http://samurai.inguardians.com/)
- [BlackArch](http://blackarch.org/) - [BlackArch](http://blackarch.org/)
Prerequisites: Windows is not supported
## Prerequisites
- Ruby >= 2.1.9 - Recommended: 2.3.1 - Ruby >= 2.1.9 - Recommended: 2.3.1
- Curl >= 7.21 - Recommended: latest - FYI the 7.29 has a segfault - Curl >= 7.21 - Recommended: latest - FYI the 7.29 has a segfault
- RubyGems - Recommended: latest - RubyGems - Recommended: latest
- Git - Git
Windows is not supported. ### Installing dependencies on Ubuntu
If installed from Github update the code base with ```git pull```. The databases are updated with ```wpscan.rb --update```.
####Installing on Ubuntu: sudo apt-get install libcurl4-openssl-dev libxml2 libxml2-dev libxslt1-dev ruby-dev build-essential libgmp-dev zlib1g-dev
Before Ubuntu 14.04: ### Installing dependencies on Debian
sudo apt-get install libcurl4-openssl-dev libopenssl-ruby libxml2 libxml2-dev libxslt1-dev ruby-dev
git clone https://github.com/wpscanteam/wpscan.git
cd wpscan
sudo gem install bundler && bundle install --without test
From Ubuntu 14.04:
sudo apt-get install libcurl4-openssl-dev libxml2 libxml2-dev libxslt1-dev ruby-dev build-essential libgmp-dev
git clone https://github.com/wpscanteam/wpscan.git
cd wpscan
sudo gem install bundler && bundle install --without test
####Installing on Debian:
sudo apt-get install git ruby ruby-dev libcurl4-openssl-dev make zlib1g-dev sudo apt-get install git ruby ruby-dev libcurl4-openssl-dev make zlib1g-dev
git clone https://github.com/wpscanteam/wpscan.git
cd wpscan
sudo gem install bundler
bundle install --without test --path vendor/bundle
####Installing on Fedora: ### Installing dependencies on Fedora
sudo dnf install gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel libcurl-devel patch rpm-build sudo dnf install gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel libcurl-devel patch rpm-build
git clone https://github.com/wpscanteam/wpscan.git
cd wpscan
sudo gem install bundler && bundle install --without test
####Installing on Archlinux: ### Installing dependencies on Arch Linux
pacman -Syu ruby pacman -Syu ruby
pacman -Syu libyaml pacman -Syu libyaml
git clone https://github.com/wpscanteam/wpscan.git
cd wpscan
sudo gem install bundler && bundle install --without test
gem install typhoeus
gem install nokogiri
####Installing on Mac OSX: ### Installing dependencies on Mac OSX
Apple Xcode, Command Line Tools and the libffi are needed (to be able to install the FFI gem), See [http://stackoverflow.com/questions/17775115/cant-setup-ruby-environment-installing-fii-gem-error](http://stackoverflow.com/questions/17775115/cant-setup-ruby-environment-installing-fii-gem-error) Apple Xcode, Command Line Tools and the libffi are needed (to be able to install the FFI gem), See [http://stackoverflow.com/questions/17775115/cant-setup-ruby-environment-installing-fii-gem-error](http://stackoverflow.com/questions/17775115/cant-setup-ruby-environment-installing-fii-gem-error)
git clone https://github.com/wpscanteam/wpscan.git ## Installing with RVM (recommended)
cd wpscan
sudo gem install bundler && sudo bundle install --without test
####Installing with RVM (recommended): If you are using GNOME Terminal, there are some steps required before executing the commands. See here for more information:
https://rvm.io/integration/gnome-terminal#integrating-rvm-with-gnome-terminal
# Install all prerequisites for your OS (look above) # Install all prerequisites for your OS (look above)
cd ~ cd ~
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -sSL https://get.rvm.io | bash -s stable curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
@@ -165,7 +145,26 @@ Apple Xcode, Command Line Tools and the libffi are needed (to be able to install
gem install bundler gem install bundler
bundle install --without test bundle install --without test
#### KNOWN ISSUES ## Installing manually (not recommended)
git clone https://github.com/wpscanteam/wpscan.git
cd wpscan
sudo gem install bundler && bundle install --without test
# DOCKER
Pull the repo with `docker pull wpscanteam/wpscan`
## Start WPScan
```
docker run --rm wpscanteam/wpscan -u http://yourblog.com [options]
```
For the available Options, please see https://github.com/wpscanteam/wpscan#wpscan-arguments
Published on https://hub.docker.com/r/wpscanteam/wpscan/
# KNOWN ISSUES
- Typhoeus segmentation fault - Typhoeus segmentation fault
@@ -208,7 +207,7 @@ Apple Xcode, Command Line Tools and the libffi are needed (to be able to install
See [https://github.com/wpscanteam/wpscan/issues/148](https://github.com/wpscanteam/wpscan/issues/148) See [https://github.com/wpscanteam/wpscan/issues/148](https://github.com/wpscanteam/wpscan/issues/148)
#### WPSCAN ARGUMENTS # WPSCAN ARGUMENTS
--update Update the database to the latest version. --update Update the database to the latest version.
--url | -u <target url> The WordPress URL/domain to scan. --url | -u <target url> The WordPress URL/domain to scan.
@@ -232,12 +231,17 @@ Apple Xcode, Command Line Tools and the libffi are needed (to be able to install
You do not need to provide the regexp delimiters, but you must write the quotes (simple or double). You do not need to provide the regexp delimiters, but you must write the quotes (simple or double).
--config-file | -c <config file> Use the specified config file, see the example.conf.json. --config-file | -c <config file> Use the specified config file, see the example.conf.json.
--user-agent | -a <User-Agent> Use the specified User-Agent. --user-agent | -a <User-Agent> Use the specified User-Agent.
--cookie <String> String to read cookies from. --cookie <string> String to read cookies from.
--random-agent | -r Use a random User-Agent. --random-agent | -r Use a random User-Agent.
--follow-redirection If the target url has a redirection, it will be followed without asking if you wanted to do so or not --follow-redirection If the target url has a redirection, it will be followed without asking if you wanted to do so or not
--batch Never ask for user input, use the default behaviour. --batch Never ask for user input, use the default behaviour.
--no-color Do not use colors in the output. --no-color Do not use colors in the output.
--wp-content-dir <wp content dir> WPScan try to find the content directory (ie wp-content) by scanning the index page, however you can specified it. --log Creates a log.txt file with WPScan's output.
--no-banner Prevents the WPScan banner from being displayed.
--disable-accept-header Prevents WPScan sending the Accept HTTP header.
--disable-referer Prevents setting the Referer header.
--disable-tls-checks Disables SSL/TLS certificate verification.
--wp-content-dir <wp content dir> WPScan try to find the content directory (ie wp-content) by scanning the index page, however you can specify it.
Subdirectories are allowed. Subdirectories are allowed.
--wp-plugins-dir <wp plugins dir> Same thing than --wp-content-dir but for the plugins directory. --wp-plugins-dir <wp plugins dir> Same thing than --wp-content-dir but for the plugins directory.
If not supplied, WPScan will use wp-content-dir/plugins. Subdirectories are allowed If not supplied, WPScan will use wp-content-dir/plugins. Subdirectories are allowed
@@ -248,17 +252,18 @@ Apple Xcode, Command Line Tools and the libffi are needed (to be able to install
--wordlist | -w <wordlist> Supply a wordlist for the password brute forcer. --wordlist | -w <wordlist> Supply a wordlist for the password brute forcer.
--username | -U <username> Only brute force the supplied username. --username | -U <username> Only brute force the supplied username.
--usernames <path-to-file> Only brute force the usernames from the file. --usernames <path-to-file> Only brute force the usernames from the file.
--threads | -t <number of threads> The number of threads to use when multi-threading requests. --cache-dir <cache-directory> Set the cache directory.
--cache-ttl <cache-ttl> Typhoeus cache TTL. --cache-ttl <cache-ttl> Typhoeus cache TTL.
--request-timeout <request-timeout> Request Timeout. --request-timeout <request-timeout> Request Timeout.
--connect-timeout <connect-timeout> Connect Timeout. --connect-timeout <connect-timeout> Connect Timeout.
--threads | -t <number of threads> The number of threads to use when multi-threading requests.
--max-threads <max-threads> Maximum Threads. --max-threads <max-threads> Maximum Threads.
--throttle <milliseconds> Milliseconds to wait before doing another web request. If used, the --threads should be set to 1. --throttle <milliseconds> Milliseconds to wait before doing another web request. If used, the --threads should be set to 1.
--help | -h This help screen. --help | -h This help screen.
--verbose | -v Verbose output. --verbose | -v Verbose output.
--version Output the current version and exit. --version Output the current version and exit.
#### WPSCAN EXAMPLES # WPSCAN EXAMPLES
Do 'non-intrusive' checks... Do 'non-intrusive' checks...
@@ -292,26 +297,22 @@ Debug output...
```ruby wpscan.rb --url www.example.com --debug-output 2>debug.log``` ```ruby wpscan.rb --url www.example.com --debug-output 2>debug.log```
#### PROJECT HOME # PROJECT HOME
[http://www.wpscan.org](http://www.wpscan.org) [http://www.wpscan.org](http://www.wpscan.org)
#### VULNERABILITY DATABASE # VULNERABILITY DATABASE
[https://wpvulndb.com](https://wpvulndb.com) [https://wpvulndb.com](https://wpvulndb.com)
#### GIT REPOSITORY # GIT REPOSITORY
[https://github.com/wpscanteam/wpscan](https://github.com/wpscanteam/wpscan) [https://github.com/wpscanteam/wpscan](https://github.com/wpscanteam/wpscan)
#### ISSUES # ISSUES
[https://github.com/wpscanteam/wpscan/issues](https://github.com/wpscanteam/wpscan/issues) [https://github.com/wpscanteam/wpscan/issues](https://github.com/wpscanteam/wpscan/issues)
#### DEVELOPER DOCUMENTATION # DEVELOPER DOCUMENTATION
[http://rdoc.info/github/wpscanteam/wpscan/frames](http://rdoc.info/github/wpscanteam/wpscan/frames) [http://rdoc.info/github/wpscanteam/wpscan/frames](http://rdoc.info/github/wpscanteam/wpscan/frames)
#### SPECIAL THANKS
[RandomStorm](https://www.randomstorm.com)

BIN
data.zip

Binary file not shown.

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# encoding: UTF-8 # encoding: UTF-8
require File.dirname(__FILE__) + '/../lib/wpscan/wpscan_helper' require File.expand_path(File.join(__dir__, '..', 'lib', 'wpscan', 'wpscan_helper'))
wordpress_json = json(WORDPRESSES_FILE) wordpress_json = json(WORDPRESSES_FILE)
plugins_json = json(PLUGINS_FILE) plugins_json = json(PLUGINS_FILE)
@@ -14,6 +14,6 @@ puts "* Total tracked themes: #{themes_json.count}"
puts "* Total vulnerable wordpresses: #{wordpress_json.select { |item| !wordpress_json[item]['vulnerabilities'].empty? }.count}" puts "* Total vulnerable wordpresses: #{wordpress_json.select { |item| !wordpress_json[item]['vulnerabilities'].empty? }.count}"
puts "* Total vulnerable plugins: #{plugins_json.select { |item| !plugins_json[item]['vulnerabilities'].empty? }.count}" puts "* Total vulnerable plugins: #{plugins_json.select { |item| !plugins_json[item]['vulnerabilities'].empty? }.count}"
puts "* Total vulnerable themes: #{themes_json.select { |item| !themes_json[item]['vulnerabilities'].empty? }.count}" puts "* Total vulnerable themes: #{themes_json.select { |item| !themes_json[item]['vulnerabilities'].empty? }.count}"
puts "* Total wordpress vulnerabilities: #{}" puts "* Total wordpress vulnerabilities: #{wordpress_json.map {|k,v| v['vulnerabilities'].count}.inject(:+)}"
puts "* Total plugin vulnerabilities: #{}" puts "* Total plugin vulnerabilities: #{plugins_json.map {|k,v| v['vulnerabilities'].count}.inject(:+)}"
puts "* Total theme vulnerabilities: #{}" puts "* Total theme vulnerabilities: #{themes_json.map {|k,v| v['vulnerabilities'].count}.inject(:+)}"

View File

@@ -2,8 +2,8 @@
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0",
/* Uncomment the "proxy" line to use the proxy /* Uncomment the "proxy" line to use the proxy
SOCKS proxies (4, 4A, 5) are supported, ie : "proxy": "socks5://127.0.0.1:9000" SOCKS proxies (4, 4A, 5) are supported, ie : "proxy": "socks5://127.0.0.1:9000"
If you do not specify the protocol, http will be used If you do not specify the protocol, http will be used
*/ */
//"proxy": "127.0.0.1:3128", //"proxy": "127.0.0.1:3128",
//"proxy_auth": "username:password", //"proxy_auth": "username:password",

View File

@@ -18,7 +18,10 @@ class Browser
:request_timeout, :request_timeout,
:connect_timeout, :connect_timeout,
:cookie, :cookie,
:throttle :throttle,
:disable_accept_header,
:disable_referer,
:disable_tls_checks
] ]
@@instance = nil @@instance = nil
@@ -67,17 +70,23 @@ class Browser
@@instance = nil @@instance = nil
end end
# Override for setting the User-Agent
# @param [ String ] user_agent
def user_agent=(user_agent)
Typhoeus::Config.user_agent = user_agent
end
# #
# sets browser default values # sets browser default values
# #
def browser_defaults def browser_defaults
Typhoeus::Config.user_agent = "WPScan v#{WPSCAN_VERSION} (http://wpscan.org)"
@max_threads = 20 @max_threads = 20
# 10 minutes, at this time the cache is cleaned before each scan. # 10 minutes, at this time the cache is cleaned before each scan.
# If this value is set to 0, the cache will be disabled # If this value is set to 0, the cache will be disabled
@cache_ttl = 600 @cache_ttl = 600
@request_timeout = 60 # 60s @request_timeout = 60 # 60s
@connect_timeout = 10 # 10s @connect_timeout = 10 # 10s
@user_agent = "WPScan v#{WPSCAN_VERSION} (http://wpscan.org)"
@throttle = 0 @throttle = 0
end end
@@ -115,12 +124,6 @@ class Browser
# #
# @return [ Hash ] # @return [ Hash ]
def merge_request_params(params = {}) def merge_request_params(params = {})
params = Browser.append_params_header_field(
params,
'User-Agent',
@user_agent
)
if @proxy if @proxy
params.merge!(proxy: @proxy) params.merge!(proxy: @proxy)
params.merge!(proxyauth: @proxy_auth) if @proxy_auth params.merge!(proxyauth: @proxy_auth) if @proxy_auth
@@ -153,12 +156,18 @@ class Browser
params.merge!(maxredirs: 3) unless params.key?(:maxredirs) params.merge!(maxredirs: 3) unless params.key?(:maxredirs)
# Disable SSL-Certificate checks # Disable SSL-Certificate checks
params.merge!(ssl_verifypeer: false) unless params.key?(:ssl_verifypeer) if @disable_tls_checks
params.merge!(ssl_verifyhost: 0) unless params.key?(:ssl_verifyhost) # Cert validity check
params.merge!(ssl_verifypeer: 0) unless params.key?(:ssl_verifypeer)
# Cert hostname check
params.merge!(ssl_verifyhost: 0) unless params.key?(:ssl_verifyhost)
end
params.merge!(cookiejar: @cache_dir + '/cookie-jar') params.merge!(cookiejar: @cache_dir + '/cookie-jar')
params.merge!(cookiefile: @cache_dir + '/cookie-jar') params.merge!(cookiefile: @cache_dir + '/cookie-jar')
params.merge!(cookie: @cookie) if @cookie params.merge!(cookie: @cookie) if @cookie
params = Browser.remove_params_header_field(params, 'Accept') if @disable_accept_header
params = Browser.remove_params_header_field(params, 'Referer') if @disable_referer
params params
end end
@@ -178,4 +187,18 @@ class Browser
end end
params params
end end
# @param [ Hash ] params
# @param [ String ] field
# @param [ Mixed ] field_value
#
# @return [ Array ]
def self.remove_params_header_field(params = {}, field)
if !params.has_key?(:headers)
params = params.merge(:headers => { field => nil })
elsif !params[:headers].has_key?(field)
params[:headers][field] = nil
end
params
end
end end

View File

@@ -3,9 +3,8 @@
class Browser class Browser
module Options module Options
attr_accessor :request_timeout, :connect_timeout attr_accessor :request_timeout, :connect_timeout, :user_agent, :disable_accept_header, :disable_referer, :disable_tls_checks
attr_reader :basic_auth, :cache_ttl, :proxy, :proxy_auth, :throttle attr_reader :basic_auth, :cache_ttl, :proxy, :proxy_auth, :throttle
attr_writer :user_agent
# Sets the Basic Authentification credentials # Sets the Basic Authentification credentials
# Accepted format: # Accepted format:

0
lib/common/collections/wp_items.rb Executable file → Normal file
View File

6
lib/common/collections/wp_items/detectable.rb Executable file → Normal file
View File

@@ -95,6 +95,10 @@ class WpItems < Array
code = tag.text.to_s code = tag.text.to_s
next if code.empty? next if code.empty?
if ! code.valid_encoding?
code = code.encode('UTF-16be', :invalid => :replace, :replace => '?').encode('UTF-8')
end
code.scan(code_pattern(wp_target)).flatten.uniq.each do |item_name| code.scan(code_pattern(wp_target)).flatten.uniq.each do |item_name|
names << item_name names << item_name
end end
@@ -116,7 +120,7 @@ class WpItems < Array
wp_content_dir = wp_target.wp_content_dir wp_content_dir = wp_target.wp_content_dir
wp_content_url = wp_target.uri.merge(wp_content_dir).to_s wp_content_url = wp_target.uri.merge(wp_content_dir).to_s
url = /#{wp_content_url.gsub(%r{\A(?:http|https)}, 'https?').gsub('/', '\\\\\?\/')}/i url = wp_content_url.gsub(%r{\A(?:http|https)://}, '(?:https?:)?//').gsub('/', '\\\\\?\/')
content_dir = %r{(?:#{url}|\\?\/\\?\/?#{wp_content_dir})}i content_dir = %r{(?:#{url}|\\?\/\\?\/?#{wp_content_dir})}i
%r{#{content_dir}\\?/#{type}\\?/} %r{#{content_dir}\\?/#{type}\\?/}

0
lib/common/collections/wp_plugins.rb Executable file → Normal file
View File

View File

@@ -62,10 +62,14 @@ class WpPlugins < WpItems
wp_plugins.add('all-in-one-seo-pack', version: $1) wp_plugins.add('all-in-one-seo-pack', version: $1)
end end
if body =~ /<!-- This site is optimized with the Yoast WordPress SEO plugin v([^\s]+) -/i if body =~ /<!-- This site is optimized with the Yoast (?:WordPress )?SEO plugin v([^\s]+) -/i
wp_plugins.add('wordpress-seo', version: $1) wp_plugins.add('wordpress-seo', version: $1)
end end
if body =~ /<!-- Google Universal Analytics for WordPress v([^\s]+) -/i
wp_plugins.add('google-universal-analytics', version: $1)
end
wp_plugins wp_plugins
end end

0
lib/common/collections/wp_themes.rb Executable file → Normal file
View File

0
lib/common/collections/wp_timthumbs.rb Executable file → Normal file
View File

View File

@@ -41,7 +41,7 @@ class WpTimthumbs < WpItems
%w{ %w{
timthumb.php lib/timthumb.php inc/timthumb.php includes/timthumb.php timthumb.php lib/timthumb.php inc/timthumb.php includes/timthumb.php
scripts/timthumb.php tools/timthumb.php functions/timthumb.php scripts/timthumb.php tools/timthumb.php functions/timthumb.php thumb.php
}.each do |path| }.each do |path|
wp_timthumb.path = "$wp-content$/themes/#{theme_name}/#{path}" wp_timthumb.path = "$wp-content$/themes/#{theme_name}/#{path}"

0
lib/common/collections/wp_users.rb Executable file → Normal file
View File

0
lib/common/collections/wp_users/detectable.rb Executable file → Normal file
View File

View File

@@ -1,6 +1,6 @@
# encoding: UTF-8 # encoding: UTF-8
LIB_DIR = File.expand_path(File.join(File.dirname(__FILE__), '..')) LIB_DIR = File.expand_path(File.join(__dir__, '..'))
ROOT_DIR = File.expand_path(File.join(LIB_DIR, '..')) # expand_path is used to get "wpscan/" instead of "wpscan/lib/../" ROOT_DIR = File.expand_path(File.join(LIB_DIR, '..')) # expand_path is used to get "wpscan/" instead of "wpscan/lib/../"
DATA_DIR = File.join(ROOT_DIR, 'data') DATA_DIR = File.join(ROOT_DIR, 'data')
CONF_DIR = File.join(ROOT_DIR, 'conf') CONF_DIR = File.join(ROOT_DIR, 'conf')
@@ -30,7 +30,7 @@ LAST_UPDATE_FILE = File.join(DATA_DIR, '.last_update')
MIN_RUBY_VERSION = '2.1.9' MIN_RUBY_VERSION = '2.1.9'
WPSCAN_VERSION = '2.9.1' WPSCAN_VERSION = '2.9.2'
$LOAD_PATH.unshift(LIB_DIR) $LOAD_PATH.unshift(LIB_DIR)
$LOAD_PATH.unshift(WPSCAN_LIB_DIR) $LOAD_PATH.unshift(WPSCAN_LIB_DIR)
@@ -151,7 +151,7 @@ def banner
puts '_______________________________________________________________' puts '_______________________________________________________________'
puts ' __ _______ _____ ' puts ' __ _______ _____ '
puts ' \\ \\ / / __ \\ / ____| ' puts ' \\ \\ / / __ \\ / ____| '
puts ' \\ \\ /\\ / /| |__) | (___ ___ __ _ _ __ ' puts ' \\ \\ /\\ / /| |__) | (___ ___ __ _ _ __ ®'
puts ' \\ \\/ \\/ / | ___/ \\___ \\ / __|/ _` | \'_ \\ ' puts ' \\ \\/ \\/ / | ___/ \\___ \\ / __|/ _` | \'_ \\ '
puts ' \\ /\\ / | | ____) | (__| (_| | | | |' puts ' \\ /\\ / | | ____) | (__| (_| | | | |'
puts ' \\/ \\/ |_| |_____/ \\___|\\__,_|_| |_|' puts ' \\/ \\/ |_| |_____/ \\___|\\__,_|_| |_|'

View File

@@ -101,7 +101,7 @@ class DbUpdater
puts " [i] Database File Checksum : #{db_checksum}" if verbose puts " [i] Database File Checksum : #{db_checksum}" if verbose
unless dl_checksum == db_checksum unless dl_checksum == db_checksum
fail "#{filename}: checksums do not match (local: #{dl_checksum} remote: #{db_checksum})" raise ChecksumError.new(File.read(local_file_path(filename))), "#{filename}: checksums do not match (local: #{dl_checksum} remote: #{db_checksum})"
end end
rescue => e rescue => e
puts ' [i] Restoring Backup due to error' if verbose puts ' [i] Restoring Backup due to error' if verbose

View File

@@ -31,3 +31,11 @@ class DownloadError < HttpError
"Unable to get #{failure_details}" "Unable to get #{failure_details}"
end end
end end
class ChecksumError < StandardError
attr_reader :file
def initialize(file)
@file = file
end
end

View File

@@ -27,47 +27,6 @@ def puts(o = '')
super(o) super(o)
end end
module Terminal
class Table
def render
separator = Separator.new(self)
buffer = [separator]
unless @title.nil?
buffer << Row.new(self, [title_cell_options])
buffer << separator
end
unless @headings.cells.empty?
buffer << @headings
buffer << separator
end
buffer += @rows
buffer << separator
buffer.map { |r| style.margin_left + r.render }.join("\n")
end
alias :to_s :render
class Style
@@defaults = {
:border_x => '-', :border_y => '|', :border_i => '+',
:padding_left => 1, :padding_right => 1,
:margin_left => '',
:width => nil, :alignment => nil
}
attr_accessor :margin_left
attr_accessor :border_x
attr_accessor :border_y
attr_accessor :border_i
attr_accessor :padding_left
attr_accessor :padding_right
attr_accessor :width
attr_accessor :alignment
end
end
end
class Numeric class Numeric
def bytes_to_human def bytes_to_human
units = %w{B KB MB GB TB} units = %w{B KB MB GB TB}

0
lib/common/models/vulnerability.rb Executable file → Normal file
View File

0
lib/common/models/wp_item.rb Executable file → Normal file
View File

0
lib/common/models/wp_item/existable.rb Executable file → Normal file
View File

3
lib/common/models/wp_item/findable.rb Executable file → Normal file
View File

@@ -9,8 +9,7 @@ class WpItem
# #
# @return [ void ] # @return [ void ]
def found_from=(method) def found_from=(method)
found = method[%r{find_from_(.*)}, 1] @found_from = method.to_s.gsub(/find_from_/, '').gsub(/_/, ' ')
@found_from = found.gsub('_', ' ') if found
end end
module Findable module Findable

0
lib/common/models/wp_item/versionable.rb Executable file → Normal file
View File

0
lib/common/models/wp_item/vulnerable.rb Executable file → Normal file
View File

0
lib/common/models/wp_plugin.rb Executable file → Normal file
View File

0
lib/common/models/wp_theme.rb Executable file → Normal file
View File

2
lib/common/models/wp_theme/findable.rb Executable file → Normal file
View File

@@ -11,7 +11,7 @@ class WpTheme < WpItem
def find(target_uri) def find(target_uri)
methods.grep(/^find_from_/).each do |method| methods.grep(/^find_from_/).each do |method|
if wp_theme = self.send(method, target_uri) if wp_theme = self.send(method, target_uri)
wp_theme.found_from = method wp_theme.found_from = method.to_s
return wp_theme return wp_theme
end end

0
lib/common/models/wp_theme/versionable.rb Executable file → Normal file
View File

0
lib/common/models/wp_timthumb.rb Executable file → Normal file
View File

0
lib/common/models/wp_timthumb/versionable.rb Executable file → Normal file
View File

0
lib/common/models/wp_user.rb Executable file → Normal file
View File

0
lib/common/models/wp_user/existable.rb Executable file → Normal file
View File

7
lib/common/models/wp_version.rb Executable file → Normal file
View File

@@ -41,8 +41,11 @@ class WpVersion < WpItem
json = json(db_file) json = json(db_file)
metadata = {} metadata = {}
metadata[:release_date] = json[version]['release_date'] temp = json[version]
metadata[:changelog_url] = json[version]['changelog_url'] if !temp.nil?
metadata[:release_date] = temp['release_date']
metadata[:changelog_url] = temp['changelog_url']
end
metadata metadata
end end
end end

22
lib/common/models/wp_version/findable.rb Executable file → Normal file
View File

@@ -12,6 +12,7 @@ class WpVersion < WpItem
# #
# @return [ WpVersion ] # @return [ WpVersion ]
def find(target_uri, wp_content_dir, wp_plugins_dir, versions_xml) def find(target_uri, wp_content_dir, wp_plugins_dir, versions_xml)
versions = {}
methods.grep(/^find_from_/).each do |method| methods.grep(/^find_from_/).each do |method|
if method === :find_from_advanced_fingerprinting if method === :find_from_advanced_fingerprinting
@@ -21,9 +22,21 @@ class WpVersion < WpItem
end end
if version if version
return new(target_uri, number: version, found_from: method) if versions.key?(version)
versions[version] << method.to_s
else
versions[version] = [ method.to_s ]
end
end end
end end
if versions.length > 0
determined_version = versions.max_by { |k, v| v.length }
if determined_version
return new(target_uri, number: determined_version[0], found_from: determined_version[1].join(', '))
end
end
nil nil
end end
@@ -199,7 +212,12 @@ class WpVersion < WpItem
next if attr_value.nil? || attr_value.empty? next if attr_value.nil? || attr_value.empty?
uri = Addressable::URI.parse(attr_value) begin
uri = Addressable::URI.parse(attr_value)
rescue Addressable::URI::InvalidURIError
next
end
next unless uri.query && uri.query.match(pattern) next unless uri.query && uri.query.match(pattern)
version = Regexp.last_match[1].to_s version = Regexp.last_match[1].to_s

View File

@@ -12,7 +12,7 @@ class WpVersion < WpItem
puts " | Released: #{metadata[:release_date]}" puts " | Released: #{metadata[:release_date]}"
puts " | Changelog: #{metadata[:changelog_url]}" puts " | Changelog: #{metadata[:changelog_url]}"
else else
puts info("WordPress version #{self.number} identified from #{self.found_from} #{"(Released on #{metadata[:release_date]})" if metadata[:release_date]}") puts info("WordPress version #{self.number} #{"(Released on #{metadata[:release_date]}) identified from #{self.found_from}" if metadata[:release_date]}")
end end
vulnerabilities = self.vulnerabilities vulnerabilities = self.vulnerabilities

View File

@@ -21,6 +21,29 @@ class WebSite
@uri.to_s @uri.to_s
end end
# Checks if the remote website has ssl errors
def ssl_error?
return false unless @uri.scheme == 'https'
c = get_root_path_return_code
# http://www.rubydoc.info/github/typhoeus/ethon/Ethon/Easy:return_code
return (
c == :ssl_connect_error ||
c == :peer_failed_verification ||
c == :ssl_certproblem ||
c == :ssl_cipher ||
c == :ssl_cacert ||
c == :ssl_cacert_badfile ||
c == :ssl_issuer_error ||
c == :ssl_crl_badfile ||
c == :ssl_engine_setfailed ||
c == :ssl_engine_notfound
)
end
def get_root_path_return_code
Browser.get(@uri.to_s).return_code
end
# Checks if the remote website is up. # Checks if the remote website is up.
def online? def online?
Browser.get(@uri.to_s).code != 0 Browser.get(@uri.to_s).code != 0
@@ -68,15 +91,18 @@ class WebSite
end end
# Compute the MD5 of the page # Compute the MD5 of the page
# Comments are deleted from the page to avoid cache generation details # Comments and scripts are deleted from the page to avoid cache generation details
# #
# @param [ String, Typhoeus::Response ] page The url of the response of the page # @param [ String, Typhoeus::Response ] page The url of the response of the page
# #
# @return [ String ] The MD5 hash of the page # @return [ String ] The MD5 hash of the page
def self.page_hash(page) def self.page_hash(page)
page = Browser.get(page, { followlocation: true, cache_ttl: 0 }) unless page.is_a?(Typhoeus::Response) page = Browser.get(page, { followlocation: true, cache_ttl: 0 }) unless page.is_a?(Typhoeus::Response)
# remove comments
Digest::MD5.hexdigest(page.body.gsub(/<!--.*?-->/m, '')) page = page.body.gsub(/<!--.*?-->/m, '')
# remove javascript stuff
page = page.gsub(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/m, '')
Digest::MD5.hexdigest(page)
end end
def homepage_hash def homepage_hash

View File

@@ -1,6 +1,6 @@
# encoding: UTF-8 # encoding: UTF-8
require File.expand_path(File.dirname(__FILE__) + '/../common/common_helper') require File.expand_path(File.join(__dir__, '..', 'common', 'common_helper'))
require_files_from_directory(WPSCAN_LIB_DIR, '**/*.rb') require_files_from_directory(WPSCAN_LIB_DIR, '**/*.rb')
@@ -84,12 +84,17 @@ def help
puts ' You do not need to provide the regexp delimiters, but you must write the quotes (simple or double).' puts ' You do not need to provide the regexp delimiters, but you must write the quotes (simple or double).'
puts '--config-file | -c <config file> Use the specified config file, see the example.conf.json.' puts '--config-file | -c <config file> Use the specified config file, see the example.conf.json.'
puts '--user-agent | -a <User-Agent> Use the specified User-Agent.' puts '--user-agent | -a <User-Agent> Use the specified User-Agent.'
puts '--cookie <String> String to read cookies from.' puts '--cookie <string> String to read cookies from.'
puts '--random-agent | -r Use a random User-Agent.' puts '--random-agent | -r Use a random User-Agent.'
puts '--follow-redirection If the target url has a redirection, it will be followed without asking if you wanted to do so or not' puts '--follow-redirection If the target url has a redirection, it will be followed without asking if you wanted to do so or not'
puts '--batch Never ask for user input, use the default behaviour.' puts '--batch Never ask for user input, use the default behaviour.'
puts '--no-color Do not use colors in the output.' puts '--no-color Do not use colors in the output.'
puts '--wp-content-dir <wp content dir> WPScan try to find the content directory (ie wp-content) by scanning the index page, however you can specified it.' puts '--log Creates a log.txt file with WPScan\'s output.'
puts '--no-banner Prevents the WPScan banner from being displayed.'
puts '--disable-accept-header Prevents WPScan sending the Accept HTTP header.'
puts '--disable-referer Prevents setting the Referer header.'
puts '--disable-tls-checks Disables SSL/TLS certificate verification.'
puts '--wp-content-dir <wp content dir> WPScan try to find the content directory (ie wp-content) by scanning the index page, however you can specify it.'
puts ' Subdirectories are allowed.' puts ' Subdirectories are allowed.'
puts '--wp-plugins-dir <wp plugins dir> Same thing than --wp-content-dir but for the plugins directory.' puts '--wp-plugins-dir <wp plugins dir> Same thing than --wp-content-dir but for the plugins directory.'
puts ' If not supplied, WPScan will use wp-content-dir/plugins. Subdirectories are allowed' puts ' If not supplied, WPScan will use wp-content-dir/plugins. Subdirectories are allowed'
@@ -100,10 +105,11 @@ def help
puts '--wordlist | -w <wordlist> Supply a wordlist for the password brute forcer.' puts '--wordlist | -w <wordlist> Supply a wordlist for the password brute forcer.'
puts '--username | -U <username> Only brute force the supplied username.' puts '--username | -U <username> Only brute force the supplied username.'
puts '--usernames <path-to-file> Only brute force the usernames from the file.' puts '--usernames <path-to-file> Only brute force the usernames from the file.'
puts '--threads | -t <number of threads> The number of threads to use when multi-threading requests.' puts '--cache-dir <cache-directory> Set the cache directory.'
puts '--cache-ttl <cache-ttl> Typhoeus cache TTL.' puts '--cache-ttl <cache-ttl> Typhoeus cache TTL.'
puts '--request-timeout <request-timeout> Request Timeout.' puts '--request-timeout <request-timeout> Request Timeout.'
puts '--connect-timeout <connect-timeout> Connect Timeout.' puts '--connect-timeout <connect-timeout> Connect Timeout.'
puts '--threads | -t <number of threads> The number of threads to use when multi-threading requests.'
puts '--max-threads <max-threads> Maximum Threads.' puts '--max-threads <max-threads> Maximum Threads.'
puts '--throttle <milliseconds> Milliseconds to wait before doing another web request. If used, the --threads should be set to 1.' puts '--throttle <milliseconds> Milliseconds to wait before doing another web request. If used, the --threads should be set to 1.'
puts '--help | -h This help screen.' puts '--help | -h This help screen.'

View File

@@ -43,7 +43,11 @@ class WpscanOptions
:connect_timeout, :connect_timeout,
:max_threads, :max_threads,
:no_banner, :no_banner,
:throttle :throttle,
:disable_accept_header,
:disable_referer,
:cache_dir,
:disable_tls_checks
] ]
attr_accessor *ACCESSOR_OPTIONS attr_accessor *ACCESSOR_OPTIONS
@@ -208,7 +212,9 @@ class WpscanOptions
enumerate_options_from_string(cli_value) enumerate_options_from_string(cli_value)
else else
raise "Unknow option : #{cli_option} with value #{cli_value}" text = "Unknown option : #{cli_option}"
text << " with value #{cli_value}" if (cli_value && !cli_value.empty?)
raise text
end end
end end
@@ -282,7 +288,11 @@ class WpscanOptions
['--cookie', GetoptLong::REQUIRED_ARGUMENT], ['--cookie', GetoptLong::REQUIRED_ARGUMENT],
['--log', GetoptLong::NO_ARGUMENT], ['--log', GetoptLong::NO_ARGUMENT],
['--no-banner', GetoptLong::NO_ARGUMENT], ['--no-banner', GetoptLong::NO_ARGUMENT],
['--throttle', GetoptLong::REQUIRED_ARGUMENT] ['--throttle', GetoptLong::REQUIRED_ARGUMENT],
['--disable-accept-header', GetoptLong::NO_ARGUMENT],
['--disable-referer', GetoptLong::NO_ARGUMENT],
['--cache-dir', GetoptLong::REQUIRED_ARGUMENT],
['--disable-tls-checks', GetoptLong::NO_ARGUMENT],
) )
end end

View File

@@ -124,11 +124,10 @@ describe Browser do
describe '#merge_request_params' do describe '#merge_request_params' do
let(:params) { {} } let(:params) { {} }
let(:cookie_jar) { CACHE_DIR + '/browser/cookie-jar' } let(:cookie_jar) { CACHE_DIR + '/browser/cookie-jar' }
let(:user_agent) { 'SomeUA' }
let(:default_expectation) { let(:default_expectation) {
{ {
cache_ttl: 250, cache_ttl: 250,
headers: { 'User-Agent' => 'SomeUA' },
ssl_verifypeer: false, ssl_verifyhost: 0,
cookiejar: cookie_jar, cookiefile: cookie_jar, cookiejar: cookie_jar, cookiefile: cookie_jar,
timeout: 60, connecttimeout: 10, timeout: 60, connecttimeout: 10,
maxredirs: 3, maxredirs: 3,
@@ -137,16 +136,25 @@ describe Browser do
} }
after :each do after :each do
browser.user_agent = 'SomeUA' browser.user_agent = user_agent
browser.cache_ttl = 250 browser.cache_ttl = 250
expect(browser.merge_request_params(params)).to eq @expected expect(browser.merge_request_params(params)).to eq @expected
expect(Typhoeus::Config.user_agent).to eq user_agent
end end
it 'sets the User-Agent header field and cache_ttl' do it 'sets the User-Agent header field and cache_ttl' do
@expected = default_expectation @expected = default_expectation
end end
context 'when @user_agent' do
let(:user_agent) { 'test' }
it 'sets the User-Agent' do
@expected = default_expectation
end
end
context 'when @proxy' do context 'when @proxy' do
let(:proxy) { '127.0.0.1:9050' } let(:proxy) { '127.0.0.1:9050' }
let(:proxy_expectation) { default_expectation.merge(proxy: proxy) } let(:proxy_expectation) { default_expectation.merge(proxy: proxy) }
@@ -177,7 +185,7 @@ describe Browser do
it 'appends the basic_auth' do it 'appends the basic_auth' do
browser.basic_auth = 'user:pass' browser.basic_auth = 'user:pass'
@expected = default_expectation.merge( @expected = default_expectation.merge(
headers: default_expectation[:headers].merge('Authorization' => 'Basic ' + Base64.encode64('user:pass').chomp) headers: { 'Authorization' => 'Basic ' + Base64.encode64('user:pass').chomp }
) )
end end
end end
@@ -206,6 +214,13 @@ describe Browser do
@expected = default_expectation.merge(cookie: cookie) @expected = default_expectation.merge(cookie: cookie)
end end
end end
context 'when @disable_tls_checks' do
it 'disables tls checks' do
browser.disable_tls_checks = true
@expected = default_expectation.merge(ssl_verifypeer: 0, ssl_verifyhost: 0)
end
end
end end
describe '#forge_request' do describe '#forge_request' do

View File

@@ -18,7 +18,7 @@ describe WpItems do
vulnerable_targets_items: [ WpItem.new(uri, name: 'mr-smith'), vulnerable_targets_items: [ WpItem.new(uri, name: 'mr-smith'),
WpItem.new(uri, name: 'neo')], WpItem.new(uri, name: 'neo')],
passive_detection: (1..13).reduce(WpItems.new) { |o, i| o << WpItem.new(uri, name: "detect-me-#{i}") } passive_detection: (1..15).reduce(WpItems.new) { |o, i| o << WpItem.new(uri, name: "detect-me-#{i}") }
} }
end end
end end

View File

@@ -100,6 +100,13 @@ describe 'WpPlugins::Detectable' do
expected.add('all-in-one-seo-pack', version: '2.0.3.1') expected.add('all-in-one-seo-pack', version: '2.0.3.1')
end end
end end
context 'when google-universal-analytics detected' do
it 'returns google-universal-analytics' do
@body = '<!-- Google Universal Analytics for WordPress v2.4.2 -->'
expected.add('google-universal-analytics', version: '2.4.2')
end
end
end end
end end

View File

@@ -28,7 +28,7 @@ describe 'WpTimthumbs::Detectable' do
expected = [] expected = []
%w( %w(
timthumb.php lib/timthumb.php inc/timthumb.php includes/timthumb.php timthumb.php lib/timthumb.php inc/timthumb.php includes/timthumb.php
scripts/timthumb.php tools/timthumb.php functions/timthumb.php scripts/timthumb.php tools/timthumb.php functions/timthumb.php thumb.php
).each do |file| ).each do |file|
path = "$wp-content$/themes/#{theme_name}/#{file}" path = "$wp-content$/themes/#{theme_name}/#{file}"
expected << WpTimthumb.new(uri, path: path) expected << WpTimthumb.new(uri, path: path)

View File

@@ -159,6 +159,22 @@ describe 'WpVersion::Findable' do
end end
end end
describe '::find_from_stylesheets_numbers' do
after do
fixture = fixtures_dir + 'stylesheet_numbers' + @fixture
stub_request_to_fixture(url: uri, fixture: fixture)
expect(WpVersion.send(:find_from_stylesheets_numbers, uri)).to eq @expected
end
context 'invalid url' do
it 'returns nil' do
@fixture = '/invalid_url.html'
@expected = nil
end
end
end
describe '::find' do describe '::find' do
# Stub all WpVersion::find_from_* to return nil # Stub all WpVersion::find_from_* to return nil
def stub_all_to_nil def stub_all_to_nil

View File

@@ -160,6 +160,11 @@ describe 'VersionCompare' do
@version1 = '.47' @version1 = '.47'
@version2 = '.50.3' @version2 = '.50.3'
end end
it 'returns true' do
@version1 = '2.5.9'
@version2 = '2.5.10'
end
end end
context 'version checked is older' do context 'version checked is older' do

View File

@@ -176,6 +176,17 @@ describe 'WebSite' do
@expected = "yolo\n\n\nworld!" @expected = "yolo\n\n\nworld!"
end end
end end
context 'when there are scripts' do
let(:page) {
body = "yolo\n\n<script type=\"text/javascript\">alert('Hi');</script>\nworld!"
Typhoeus::Response.new(body: body)
}
it 'removes them' do
@expected = "yolo\n\n\nworld!"
end
end
end end
describe '#homepage_hash' do describe '#homepage_hash' do

View File

@@ -1,6 +1,6 @@
# encoding: UTF-8 # encoding: UTF-8
require File.expand_path(File.dirname(__FILE__) + '/wpscan_helper') require File.expand_path(File.join(__dir__, 'wpscan_helper'))
describe WpTarget do describe WpTarget do
subject(:wp_target) { WpTarget.new(target_url, options) } subject(:wp_target) { WpTarget.new(target_url, options) }

View File

@@ -1,6 +1,6 @@
# encoding: UTF-8 # encoding: UTF-8
require File.expand_path(File.dirname(__FILE__) + '/wpscan_helper') require File.expand_path(File.join(__dir__, 'wpscan_helper'))
describe 'WpscanOptions' do describe 'WpscanOptions' do

View File

@@ -19,6 +19,8 @@
<script type='text/javascript' src='//wp-content/items/detect-me-5/main.js'></script> <script type='text/javascript' src='//wp-content/items/detect-me-5/main.js'></script>
<link rel='stylesheet' id='ai1ec_style-css' href='//example.com/wp-content/items/detect-me-15/test.css' type='text/css' media='all' />
<style type="text/css"> <style type="text/css">
#fancybox-loading.fancybox-ie div { #fancybox-loading.fancybox-ie div {
background: transparent; background: transparent;
@@ -32,6 +34,7 @@
@import url('/wp-content/items/detect-me-8/css/datatables.css?ver=1.9.4'); @import url('/wp-content/items/detect-me-8/css/datatables.css?ver=1.9.4');
@import url(/wp-content/items/detect-me-9/css/datatables.css?ver=1.9.4); @import url(/wp-content/items/detect-me-9/css/datatables.css?ver=1.9.4);
@import url(//wp-content/items/detect-me-10/css/datatables.css?ver=1.9.4); @import url(//wp-content/items/detect-me-10/css/datatables.css?ver=1.9.4);
@import url(//example.com/wp-content/items/detect-me-14/css/datatables.css?ver=1.9.4);
/* ]]> */ /* ]]> */
</style> </style>

0
spec/samples/common/models/wp_item/error_log Executable file → Normal file
View File

View File

View File

View File

View File

View File

@@ -0,0 +1,8 @@
<script src="//use.typekit.net/h3 {
font-family: &#039;Century Gothic&#039;, CenturyGothic, AppleGothic, sans-serif;
font-size: 14px;
font-style: normal;
font-variant: normal;
font-weight: 500;
line-height: 15px;.js"></script><script>try{Typekit.load();}catch(e){}</script>

0
spec/samples/wpscan/web_site/rss_url/wordpress-3.5.htm Executable file → Normal file
View File

0
spec/samples/wpscan/wp_target/wp-login.php Executable file → Normal file
View File

View File

View File

View File

View File

View File

View File

0
spec/samples/wpscan/wp_target/xmlrpc.php Executable file → Normal file
View File

View File

@@ -7,12 +7,6 @@ shared_examples 'WpItem::Findable#Found_From=' do
subject.found_from = @method subject.found_from = @method
expect(subject.found_from).to eq @expected expect(subject.found_from).to eq @expected
end end
context 'when the pattern is not found' do
it 'returns nil' do
@method = 'I_do_not_match'
@expected = nil
end
end
it 'replaces _ by space' do it 'replaces _ by space' do
@method = 'find_from_some_detection_method' @method = 'find_from_some_detection_method'

View File

@@ -7,7 +7,7 @@ require 'simplecov' if RUBY_VERSION >= '1.9'
RSpec::Expectations.configuration.warn_about_potential_false_positives = false RSpec::Expectations.configuration.warn_about_potential_false_positives = false
require File.expand_path(File.dirname(__FILE__) + '/../lib/common/common_helper') require File.expand_path(File.join(__dir__, '..', 'lib', 'common', 'common_helper'))
SPEC_DIR = ROOT_DIR + '/spec' SPEC_DIR = ROOT_DIR + '/spec'
SPEC_LIB_DIR = SPEC_DIR + '/lib' SPEC_LIB_DIR = SPEC_DIR + '/lib'

View File

@@ -4,7 +4,7 @@
# #
# Script based on http://seclists.org/fulldisclosure/2014/Feb/3 # Script based on http://seclists.org/fulldisclosure/2014/Feb/3
require File.join(File.dirname(__FILE__), 'lib/wpscan/wpscan_helper') require File.join(__dir__, 'lib', 'wpscan', 'wpscan_helper')
@opts = { @opts = {
ids: 1..10, ids: 1..10,

View File

@@ -5,7 +5,7 @@ $: << '.'
$exit_code = 0 $exit_code = 0
require File.dirname(__FILE__) + '/lib/wpscan/wpscan_helper' require File.join(__dir__, 'lib', 'wpscan', 'wpscan_helper')
def main def main
# delete old logfile, check if it is a symlink first. # delete old logfile, check if it is a symlink first.
@@ -62,7 +62,7 @@ def main
exit(1) exit(1)
else else
if missing_db_file? if missing_db_file?
puts critical('You can not run a scan without any databases.') puts critical('You can not run a scan without any databases. Extract the data.zip file.')
exit(1) exit(1)
end end
end end
@@ -86,9 +86,13 @@ def main
raise 'We do not support scanning *.wordpress.com hosted blogs' raise 'We do not support scanning *.wordpress.com hosted blogs'
end end
if wp_target.ssl_error?
raise "The target site returned an SSL/TLS error. You can try again using the --disable-tls-checks option.\nError: #{wp_target.get_root_path_return_code}\nSee here for a detailed explanation of the error: http://www.rubydoc.info/github/typhoeus/ethon/Ethon/Easy:return_code"
end
# Remote website up? # Remote website up?
unless wp_target.online? unless wp_target.online?
raise "The WordPress URL supplied '#{wp_target.uri}' seems to be down." raise "The WordPress URL supplied '#{wp_target.uri}' seems to be down. Maybe the site is blocking wpscan so you can try the --random-agent parameter."
end end
if wpscan_options.proxy if wpscan_options.proxy
@@ -372,7 +376,7 @@ def main
puts info('Enumerating usernames ...') puts info('Enumerating usernames ...')
if wp_target.has_plugin?('stop-user-enumeration') if wp_target.has_plugin?('stop-user-enumeration')
puts warning("Stop User Enumeration plugin detected, results might be empty. However a bypass exists for v1.2.8 and below, see stop_user_enumeration_bypass.rb in #{File.expand_path(File.dirname(__FILE__))}") puts warning("Stop User Enumeration plugin detected, results might be empty. However a bypass exists for v1.2.8 and below, see stop_user_enumeration_bypass.rb in #{__dir__}")
end end
wp_users = WpUsers.aggressive_detection(wp_target, wp_users = WpUsers.aggressive_detection(wp_target,
@@ -452,8 +456,22 @@ def main
puts info("Memory used: #{used_memory.bytes_to_human}") unless windows? puts info("Memory used: #{used_memory.bytes_to_human}") unless windows?
puts info("Elapsed time: #{Time.at(elapsed).utc.strftime('%H:%M:%S')}") puts info("Elapsed time: #{Time.at(elapsed).utc.strftime('%H:%M:%S')}")
# do nothing on interrupt
rescue Interrupt rescue Interrupt
# do nothing on interrupt exit(1)
# Error on Updating
rescue ChecksumError => e
puts critical(e.message)
if e.file
puts critical('Downloaded File Content:')
puts e.file[0..500]
puts '.........'
puts
end
puts critical('Please submit this info as an Github issue')
exit(1)
rescue => e rescue => e
puts puts
puts critical(e.message) puts critical(e.message)