@@ -12,6 +12,15 @@ class Metasploit3 < Msf::Post
12
12
include Msf ::Post ::Common
13
13
include Msf ::Post ::Windows ::ExtAPI
14
14
15
+ MSF_MODULES = {
16
+ 'KB977165' => "KB977165 - Possibly vulnerable to MS10-015 kitrap0d if Windows 2K SP4 - Windows 7 (x86)" ,
17
+ 'KB2305420' => "KB2305420 - Possibly vulnerable to MS10-092 schelevator if Vista, 7, and 2008" ,
18
+ 'KB2592799' => "KB2592799 - Possibly vulnerable to MS11-080 afdjoinleaf if XP SP2/SP3 Win 2k3 SP2" ,
19
+ 'KB2778930' => "KB2778930 - Possibly vulnerable to MS13-005 hwnd_broadcast, elevates from Low to Medium integrity" ,
20
+ 'KB2850851' => "KB2850851 - Possibly vulnerable to MS13-053 schlamperei if x86 Win7 SP0/SP1" ,
21
+ 'KB2870008' => "KB2870008 - Possibly vulnerable to MS13-081 track_popup_menu if x86 Windows 7 SP0/SP1"
22
+ }
23
+
15
24
def initialize ( info = { } )
16
25
super ( update_info ( info ,
17
26
'Name' => "Windows Enumerate Applied Patches" ,
@@ -38,21 +47,13 @@ def initialize(info={})
38
47
# The sauce starts here
39
48
def run
40
49
patches = [ ]
41
- msfmodules = [
42
- 'KB977165' , # MS10-015 kitrap0d
43
- 'KB2305420' , # MS10-092 schelevator
44
- 'KB2592799' , # MS11-080 afdjoinleaf
45
- 'KB2778930' , # MS13-005 hwnd_broadcast
46
- 'KB2850851' , # MS13-053 schlamperei
47
- 'KB2870008' # MS13-081 track_popup_menu
48
- ]
49
50
50
51
datastore [ 'KB' ] . split ( ',' ) . each do |kb |
51
52
patches << kb . strip
52
53
end
53
54
54
55
if datastore [ 'MSFLOCALS' ]
55
- patches = patches + msfmodules
56
+ patches = patches + MSF_MODULES . keys
56
57
end
57
58
58
59
extapi_loaded = load_extapi
@@ -64,30 +65,23 @@ def run
64
65
return
65
66
end
66
67
kb_ids = objects [ :values ] . map { |kb | kb [ 0 ] }
67
- patches . each do |kb |
68
- if kb_ids . include? ( kb )
69
- print_status ( "#{ kb } applied" )
68
+ report_info ( patches , kb_ids )
69
+ else
70
+ print_error "ExtAPI failed to load"
71
+ end
72
+ end
73
+
74
+ def report_info ( patches , kb_ids )
75
+ patches . each do |kb |
76
+ if kb_ids . include? ( kb )
77
+ print_status ( "#{ kb } applied" )
78
+ else
79
+ if MSF_MODULES . include? ( kb )
80
+ print_good ( MSF_MODULES [ kb ] )
70
81
else
71
- case kb
72
- when "KB977165"
73
- print_good ( "KB977165 - Possibly vulnerable to MS10-015 kitrap0d if Windows 2K SP4 - Windows 7 (x86)" )
74
- when "KB2305420"
75
- print_good ( "KB2305420 - Possibly vulnerable to MS10-092 schelevator if Vista, 7, and 2008" )
76
- when "KB2592799"
77
- print_good ( "KB2592799 - Possibly vulnerable to MS11-080 afdjoinleaf if XP SP2/SP3 Win 2k3 SP2" )
78
- when "KB2778930"
79
- print_good ( "KB2778930 - Possibly vulnerable to MS13-005 hwnd_broadcast, elevates from Low to Medium integrity" )
80
- when "KB2850851"
81
- print_good ( "KB2850851 - Possibly vulnerable to MS13-053 schlamperei if x86 Win7 SP0/SP1" )
82
- when "KB2870008"
83
- print_good ( "KB2870008 - Possibly vulnerable to MS13-081 track_popup_menu if x86 Windows 7 SP0/SP1" )
84
- else
85
- print_good ( "#{ kb } is missing" )
86
- end
82
+ print_good ( "#{ kb } is missing" )
87
83
end
88
84
end
89
- else
90
- print_error "ExtAPI failed to load"
91
85
end
92
86
end
93
87
end
0 commit comments