This commit is contained in:
ethicalhack3r
2014-12-15 16:00:30 +01:00
parent 3a3376ec41
commit 85971e0e91
3 changed files with 13 additions and 7 deletions

View File

@@ -243,3 +243,11 @@ end
def directory_listing_enabled?(url)
Browser.get(url.to_s).body[%r{<title>Index of}] ? true : false
end
def log
@log
end
def log=(log)
@log = log
end

View File

@@ -49,11 +49,9 @@ end
# Override for puts to enable logging
def puts(o = '')
if @log
if o.respond_to?(:gsub)
temp = o.gsub(/\e\[\d+m/, '') # remove color for logging
File.open(LOG_FILE, 'a+') { |f| f.puts(temp) }
end
if $log && o.respond_to?(:gsub)
temp = o.gsub(/\e\[\d+m/, '') # remove color for logging
File.open(LOG_FILE, 'a+') { |f| f.puts(temp) }
end
super(o)

View File

@@ -11,9 +11,9 @@ def main
begin
wpscan_options = WpscanOptions.load_from_arguments
@log = wpscan_options.log
$log = wpscan_options.log
banner() # called after @log instance variable set
banner() # called after $log set
unless wpscan_options.has_options?
# first parameter only url?