Adds memprof binary - Ref #1321

This commit is contained in:
erwanlr
2019-03-21 11:31:04 +00:00
parent 72bddca314
commit c15ff4e32e
3 changed files with 27 additions and 0 deletions

3
.gitignore vendored
View File

@@ -21,3 +21,6 @@ doc/
# Old files from v2
cache/
data/
# Profiling reports
bin/memprof*.report

23
bin/wpscan-memprof Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env ruby
require 'memory_profiler' # https://github.com/SamSaffron/memory_profiler
require 'wpscan'
report = MemoryProfiler.report(top: 10) do
# Couldn't we just load the ./wpscan here ?
# require_relative 'wpscan' doesn't work
WPScan::Scan.new do |s|
s.controllers <<
WPScan::Controller::CustomDirectories.new <<
WPScan::Controller::InterestingFindings.new <<
WPScan::Controller::WpVersion.new <<
WPScan::Controller::MainTheme.new <<
WPScan::Controller::Enumeration.new <<
WPScan::Controller::PasswordAttack.new <<
WPScan::Controller::Aliases.new
s.run
end
end
report.pretty_print(scale_bytes: true, detailed_report: true, to_file: 'memprof.report')

View File

@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'bundler', '>= 1.6'
s.add_development_dependency 'coveralls', '~> 0.8.0'
s.add_development_dependency 'memory_profiler', '~> 0.9.12'
s.add_development_dependency 'rake', '~> 12.3'
s.add_development_dependency 'rspec', '~> 3.8.0'
s.add_development_dependency 'rspec-its', '~> 1.2.0'