File tree Expand file tree Collapse file tree 6 files changed +44
-100
lines changed Expand file tree Collapse file tree 6 files changed +44
-100
lines changed Original file line number Diff line number Diff line change @@ -44,16 +44,6 @@ def initialize(info = {})
44
44
self . queue = Array . new
45
45
end
46
46
47
- #
48
- # Checks to see if the target is vulnerable, returning unsupported if it's
49
- # not supported.
50
- #
51
- # This method is designed to be overriden by exploit modules.
52
- #
53
- def check
54
- Msf ::Exploit ::CheckCode ::Unsupported
55
- end
56
-
57
47
#
58
48
# Creates a singleton instance of this auxiliary class
59
49
#
Original file line number Diff line number Diff line change @@ -415,16 +415,6 @@ def initialize(info = {})
415
415
#
416
416
##
417
417
418
- #
419
- # Checks to see if the target is vulnerable, returning unsupported if it's
420
- # not supported.
421
- #
422
- # This method is designed to be overriden by exploit modules.
423
- #
424
- def check
425
- CheckCode ::Unsupported
426
- end
427
-
428
418
#
429
419
# Kicks off the actual exploit. Prior to this call, the framework will
430
420
# have validated the data store using the options associated with this
Original file line number Diff line number Diff line change @@ -355,6 +355,16 @@ def disclosure_date
355
355
date_str = Date . parse ( module_info [ 'DisclosureDate' ] . to_s ) rescue nil
356
356
end
357
357
358
+ #
359
+ # Checks to see if the target is vulnerable, returning unsupported if it's
360
+ # not supported.
361
+ #
362
+ # This method is designed to be overriden by exploit modules.
363
+ #
364
+ def check
365
+ Msf ::Exploit ::CheckCode ::Unsupported
366
+ end
367
+
358
368
#
359
369
# Returns the hash that describes this module's compatibilities.
360
370
#
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ class Auxiliary
27
27
#
28
28
def commands
29
29
super . update ( {
30
- "check" => "Check to see if a target is vulnerable" ,
31
30
"run" => "Launches the auxiliary module" ,
32
31
"rerun" => "Reloads and launches the auxiliary module" ,
33
32
"exploit" => "This is an alias for the run command" ,
@@ -58,45 +57,6 @@ def name
58
57
"Auxiliary"
59
58
end
60
59
61
- #
62
- # Checks to see if a target is vulnerable.
63
- #
64
- def cmd_check ( *args )
65
- defanged?
66
-
67
- begin
68
-
69
- code = mod . check_simple (
70
- 'LocalInput' => driver . input ,
71
- 'LocalOutput' => driver . output )
72
-
73
- if ( code and code . kind_of? ( Array ) and code . length > 1 )
74
-
75
- if ( code == Msf ::Exploit ::CheckCode ::Vulnerable )
76
- print_good ( code [ 1 ] )
77
- else
78
- print_status ( code [ 1 ] )
79
- end
80
-
81
- else
82
- print_error ( "Check failed: The state could not be determined." )
83
- end
84
-
85
- rescue ::Interrupt
86
- raise $!
87
- rescue ::Exception => e
88
- print_error ( "Module check failed: #{ e . class } #{ e } " )
89
- if ( e . class . to_s != 'Msf::OptionValidateError' )
90
- print_error ( "Call stack:" )
91
- e . backtrace . each do |line |
92
- break if line =~ /lib.msf.base.simple/
93
- print_error ( " #{ line } " )
94
- end
95
- end
96
- end
97
- end
98
-
99
-
100
60
#
101
61
# Reloads an auxiliary module and executes it
102
62
#
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ class Exploit
29
29
#
30
30
def commands
31
31
super . update ( {
32
- "check" => "Check to see if a target is vulnerable" ,
33
32
"exploit" => "Launch an exploit attempt" ,
34
33
"rcheck" => "Reloads the module and checks if the target is vulnerable" ,
35
34
"rexploit" => "Reloads the module and launches an exploit attempt" ,
@@ -46,44 +45,6 @@ def name
46
45
"Exploit"
47
46
end
48
47
49
- #
50
- # Checks to see if a target is vulnerable.
51
- #
52
- def cmd_check ( *args )
53
- defanged?
54
-
55
- begin
56
-
57
- code = mod . check_simple (
58
- 'LocalInput' => driver . input ,
59
- 'LocalOutput' => driver . output )
60
-
61
- if ( code and code . kind_of? ( Array ) and code . length > 1 )
62
-
63
- if ( code == Msf ::Exploit ::CheckCode ::Vulnerable )
64
- print_good ( code [ 1 ] )
65
- else
66
- print_status ( code [ 1 ] )
67
- end
68
-
69
- else
70
- print_error ( "Check failed: The state could not be determined." )
71
- end
72
-
73
- rescue ::Interrupt
74
- raise $!
75
- rescue ::Exception => e
76
- print_error ( "Exploit check failed: #{ e . class } #{ e } " )
77
- if ( e . class . to_s != 'Msf::OptionValidateError' )
78
- print_error ( "Call stack:" )
79
- e . backtrace . each do |line |
80
- break if line =~ /lib.msf.base.simple/
81
- print_error ( " #{ line } " )
82
- end
83
- end
84
- end
85
- end
86
-
87
48
#
88
49
# Launches an exploitation attempt.
89
50
#
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ module ModuleCommandDispatcher
17
17
def commands
18
18
{
19
19
"pry" => "Open a Pry session on the current module" ,
20
- "reload" => "Reload the current module from disk"
20
+ "reload" => "Reload the current module from disk" ,
21
+ "check" => "Check to see if a target is vulnerable"
21
22
}
22
23
end
23
24
@@ -35,6 +36,38 @@ def mod=(m)
35
36
self . driver . active_module = m
36
37
end
37
38
39
+ #
40
+ # Checks to see if a target is vulnerable.
41
+ #
42
+ def cmd_check ( *args )
43
+ defanged?
44
+ begin
45
+ code = mod . check_simple (
46
+ 'LocalInput' => driver . input ,
47
+ 'LocalOutput' => driver . output )
48
+ if ( code and code . kind_of? ( Array ) and code . length > 1 )
49
+ if ( code == Msf ::Exploit ::CheckCode ::Vulnerable )
50
+ print_good ( code [ 1 ] )
51
+ else
52
+ print_status ( code [ 1 ] )
53
+ end
54
+ else
55
+ print_error ( "Check failed: The state could not be determined." )
56
+ end
57
+ rescue ::Interrupt
58
+ raise $!
59
+ rescue ::Exception => e
60
+ print_error ( "Exploit check failed: #{ e . class } #{ e } " )
61
+ if ( e . class . to_s != 'Msf::OptionValidateError' )
62
+ print_error ( "Call stack:" )
63
+ e . backtrace . each do |line |
64
+ break if line =~ /lib.msf.base.simple/
65
+ print_error ( " #{ line } " )
66
+ end
67
+ end
68
+ end
69
+ end
70
+
38
71
def cmd_pry_help
39
72
print_line "Usage: pry"
40
73
print_line
You can’t perform that action at this time.
0 commit comments