forked from wpscanteam/wpscan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wpstools.rb
executable file
·45 lines (34 loc) · 927 Bytes
/
wpstools.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env ruby
# encoding: UTF-8
$: << '.'
require File.dirname(__FILE__) + '/lib/wpstools/wpstools_helper'
begin
# delete old logfile, check if it is a symlink first.
File.delete(LOG_FILE) if File.exist?(LOG_FILE) and !File.symlink?(LOG_FILE)
banner()
option_parser = CustomOptionParser.new('Usage: ./wpstools.rb [options]', 60)
option_parser.separator ''
option_parser.add(['-v', '--verbose', 'Verbose output'])
plugins = Plugins.new(option_parser)
plugins.register(
CheckerPlugin.new,
ListGeneratorPlugin.new,
StatsPlugin.new,
CheckerSpelling.new
)
options = option_parser.results
if options.empty?
raise "No option supplied\n\n#{option_parser}"
end
plugins.each do |plugin|
plugin.run(options)
end
exit(0)
rescue => e
puts "[ERROR] #{e.message}"
unless e.backtrace[0] =~ /main/
puts 'Trace :'
puts e.backtrace.join("\n")
end
exit(1)
end