Skip to content

Commit

Permalink
Adds memprof binary - Ref #1321
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanlr committed Mar 21, 2019
1 parent 72bddca commit c15ff4e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ doc/
# Old files from v2
cache/
data/

# Profiling reports
bin/memprof*.report
23 changes: 23 additions & 0 deletions bin/wpscan-memprof
Original file line number Diff line number Diff line change
@@ -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')
1 change: 1 addition & 0 deletions wpscan.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit c15ff4e

Please sign in to comment.