@@ -141,8 +141,12 @@ exploit.init_ui(
141
141
mode = ARGV . pop || 'h'
142
142
143
143
# Import options
144
- exploit . datastore . import_options_from_s ( ARGV . join ( '_|_' ) , '_|_' )
145
-
144
+ begin
145
+ exploit . datastore . import_options_from_s ( ARGV . join ( '_|_' ) , '_|_' )
146
+ rescue Rex ::ArgumentParseError => e
147
+ puts "[!] Error: #{ e . message } \n \n "
148
+ exit
149
+ end
146
150
147
151
# Initialize associated modules
148
152
payload = nil
@@ -152,21 +156,21 @@ nop = nil
152
156
if ( exploit . datastore [ 'PAYLOAD' ] )
153
157
payload = $framework. payloads . create ( exploit . datastore [ 'PAYLOAD' ] )
154
158
if ( payload != nil )
155
- payload . datastore . import_options_from_s ( ARGV . join ( '_|_' ) , '_|_' )
159
+ payload . datastore . import_options_from_s ( ARGV . join ( '_|_' ) , '_|_' )
156
160
end
157
161
end
158
162
159
163
if ( exploit . datastore [ 'ENCODER' ] )
160
164
encoder = $framework. encoders . create ( exploit . datastore [ 'ENCODER' ] )
161
165
if ( encoder != nil )
162
- encoder . datastore . import_options_from_s ( ARGV . join ( '_|_' ) , '_|_' )
166
+ encoder . datastore . import_options_from_s ( ARGV . join ( '_|_' ) , '_|_' )
163
167
end
164
168
end
165
169
166
170
if ( exploit . datastore [ 'NOP' ] )
167
171
nop = $framework. nops . create ( exploit . datastore [ 'NOP' ] )
168
172
if ( nop != nil )
169
- nop . datastore . import_options_from_s ( ARGV . join ( '_|_' ) , '_|_' )
173
+ nop . datastore . import_options_from_s ( ARGV . join ( '_|_' ) , '_|_' )
170
174
end
171
175
end
172
176
@@ -178,7 +182,6 @@ case mode.downcase
178
182
$stdout. puts ( "\n " + Msf ::Serializer ::ReadableText . dump_module ( payload , Indent ) ) if payload
179
183
$stdout. puts ( "\n " + Msf ::Serializer ::ReadableText . dump_module ( encoder , Indent ) ) if encoder
180
184
$stdout. puts ( "\n " + Msf ::Serializer ::ReadableText . dump_module ( nop , Indent ) ) if nop
181
-
182
185
when "o"
183
186
$stdout. puts ( "\n " + Msf ::Serializer ::ReadableText . dump_options ( exploit , Indent ) )
184
187
$stdout. puts ( "\n " + Msf ::Serializer ::ReadableText . dump_options ( payload , Indent ) ) if payload
0 commit comments