Advertisement
userpaste001

nano-meta framework

Jun 23rd, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.80 KB | None | 0 0
  1. !/usr/share/metasploit-framework/ruby
  2. # -*- coding: binary -*-
  3. #
  4. # This user interface provides users with a command console interface to the
  5. # framework.
  6. #
  7.  
  8. #
  9. # Standard Library
  10. #
  11.  
  12. require 'pathname'
  13.  
  14. if ENV['METASPLOIT_FRAMEWORK_PROFILE'] == 'true'
  15.   gem 'perftools.rb'
  16.   require 'perftools'
  17.  
  18.   formatted_time = Time.now.strftime('%Y%m%d%H%M%S')
  19.   root = Pathname.new(__FILE__).parent
  20.   profile_pathname = root.join('tmp', 'profiles', 'msfconsole', formatted_time)
  21.  
  22.   profile_pathname.parent.mkpath
  23.   PerfTools::CpuProfiler.start(profile_pathname.to_path)
  24.  
  25.   at_exit {
  26.     PerfTools::CpuProfiler.stop
  27.  
  28.     puts "Generating pdf"
  29.  
  30.     pdf_path = "#{profile_pathname}.pdf"
  31.  
  32.     if Bundler.clean_system("pprof.rb --pdf #{profile_pathname} > #{pdf_path}")
  33.       puts "PDF saved to #{pdf_path}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement