Adds profiling binary for dev [WIP] - Ref #1321

This commit is contained in:
erwanlr
2019-03-20 21:08:50 +00:00
parent 496fc4ebee
commit 72bddca314
2 changed files with 25 additions and 0 deletions

24
bin/wpscan-stackprof Executable file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env ruby
require 'stackprof' # https://github.com/tmm1/stackprof
require 'wpscan'
# The object mode produces a segfault currently: https://github.com/jfelchner/ruby-progressbar/issues/153
# StackProf.run(mode: :object, out: '/tmp/stackprof-object.dump') do
# StackProf.run(mode: :wall, out: '/tmp/stackprof-wall.dump') do
StackProf.run(mode: :cpu, out: '/tmp/stackprof-cpu.dump', interval: 500) 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

View File

@@ -30,5 +30,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rspec-its', '~> 1.2.0'
s.add_development_dependency 'rubocop', '~> 0.66.0'
s.add_development_dependency 'simplecov', '~> 0.16.1'
s.add_development_dependency 'stackprof', '~> 0.2.12'
s.add_development_dependency 'webmock', '~> 3.5.1'
end