From 253d6e292811f9970db4bced2fdcd4e990d31eb9 Mon Sep 17 00:00:00 2001 From: Christian Mehlmauer Date: Sun, 13 Jan 2013 22:02:13 +0100 Subject: [PATCH] added basic logging to wpscan --- .gitignore | 1 + lib/common_helper.rb | 10 ++++++++++ wpscan.rb | 3 +++ 3 files changed, 14 insertions(+) diff --git a/.gitignore b/.gitignore index 2f518eb6..4c39f419 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ coverage .idea .*.swp Gemfile.lock +log.txt diff --git a/lib/common_helper.rb b/lib/common_helper.rb index 2e169cd5..5713c41a 100644 --- a/lib/common_helper.rb +++ b/lib/common_helper.rb @@ -145,3 +145,13 @@ def get_metasploit_url(module_path) module_path = module_path.sub(/^\//, "") "http://www.metasploit.com/modules/#{module_path}" end + +# Override for puts to enable logging +def puts(o = "") + # remove color for logging + temp = o.gsub(/\[\d+m(?.*)?\[0m/, '\k') + #temp = o.inspect.gsub(/\\e\[\d+m(?.*)?\\e\[0m/, '\k') + File.open("log.txt", "a+") { |f| f.puts(temp) } + File.open("log2.txt", "a+") { |f| f.puts(o) } + super(o) +end \ No newline at end of file diff --git a/wpscan.rb b/wpscan.rb index 4a0bd989..9eb91d17 100755 --- a/wpscan.rb +++ b/wpscan.rb @@ -34,6 +34,9 @@ def output_vulnerabilities(vulns) end end +# delete old logfile +File.delete("log.txt") + banner() begin