From 72bddca3143f6f6a414ccb51cab4bb927ce73b5c Mon Sep 17 00:00:00 2001 From: erwanlr Date: Wed, 20 Mar 2019 21:08:50 +0000 Subject: [PATCH] Adds profiling binary for dev [WIP] - Ref #1321 --- bin/wpscan-stackprof | 24 ++++++++++++++++++++++++ wpscan.gemspec | 1 + 2 files changed, 25 insertions(+) create mode 100755 bin/wpscan-stackprof diff --git a/bin/wpscan-stackprof b/bin/wpscan-stackprof new file mode 100755 index 00000000..8e25adc6 --- /dev/null +++ b/bin/wpscan-stackprof @@ -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 diff --git a/wpscan.gemspec b/wpscan.gemspec index 8c1ec265..c137d7fd 100644 --- a/wpscan.gemspec +++ b/wpscan.gemspec @@ -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