-
Notifications
You must be signed in to change notification settings - Fork 29
/
console
executable file
·145 lines (116 loc) · 3.72 KB
/
console
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/usr/bin/env ruby
#################################################################################
# Web Exploitation Framework was developed by Ken Johnson (cktricky).
# Copyright (C) 2010 Ken Johnson,
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#================================================================================
#
# The Web Exploitation Framework is provided under the GPL license above.
#
# Questions and suggestions can be sent to:
# wXfdev[at]gmail.com
#
#################################################################################
oldverb = $VERBOSE; $VERBOSE = nil
require 'iconv'
$VERBOSE = oldverb
class OptsParse
def self.java?
RUBY_PLATFORM == 'java' ? true : false
end
def self.parse(cmds)
options = {}
OptionParser.new do |opt|
if (java?)
opt.on("-b", "-b <burp.jar>", "Load the specified burp jar file") do |b|
options['Burp'] = b
end
opt.on("-r", "-r <save_state>", "Load the specified save state file") do |r|
options['Restore'] = r
end
else
end
opt.on_tail("-h", "--help", "Show this message") do
puts opt
exit
end
begin
opt.parse!(cmds)
rescue OptionParser::InvalidOption
puts "\e[1;31m[wXf error]\e[0m Invalid option, try -h for usage"
exit
rescue OptionParser::MissingArgument
puts "\e[1;31m[wXf error]\e[0m You are missing an argument"
exit
end
end
return options
end
end
case RUBY_PLATFORM
when 'java'
wXfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
WXFDIR = File.join(File.expand_path(File.dirname(wXfbase)))
$:.unshift(File.join(File.expand_path(File.dirname(wXfbase)), 'jlib'))
require 'rubygems'
require 'optparse'
begin
require 'openssl'
rescue LoadError
print("\e[1;31m[wXf error]\e[0m Please run: $ sudo gem install jruby-openssl\n")
exit
end
options = OptsParse.parse(ARGV)
begin
require 'buby'
rescue LoadError
print("\e[1;31m[wXf error]\e[0m Please install buby: sudo jruby -S gem install buby\n")
exit
end
require 'wXf/wXfassists'
require 'wXf/wXfconductors'
require 'wXf/wXfdb'
require 'wXf/wXfconstants'
require 'wXf/wXflog'
require 'wXf/wXfmod_factory'
require 'wXf/wXfui'
require 'wXf/wXfwebserver'
begin
WXf::WXfui::Console::Operations::Control.new("wXf", "//>", options).start
rescue Interrupt
end
else
require 'rubygems'
require 'optparse'
#require 'celluloid'
options = OptsParse.parse(ARGV)
wXfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
WXFDIR = File.join(File.expand_path(File.dirname(wXfbase)))
$:.unshift(File.join(File.expand_path(File.dirname(wXfbase)), 'lib'))
require 'wXf/wXfassists'
require 'wXf/wXfconductors'
require 'wXf/wXfdb'
require 'wXf/wXfconstants'
require 'wXf/wXflog'
require 'wXf/wXfmod_factory'
require 'wXf/wXfui'
require 'wXf/wXfwebserver'
require 'wXf/wXfxmlrpc'
begin
WXf::WXfui::Console::Operations::Control.new("wXf", "//>", options ).start
rescue Interrupt
end
end