Skip to content

Commit 1eab4b3

Browse files
committed
Add an optional explicit triggeruri for phpmailer
1 parent 64037b0 commit 1eab4b3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

modules/exploits/multi/http/phpmailer_arg_injection.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ def initialize(info = {})
4848

4949
register_options(
5050
[
51-
OptString.new('TARGETURI', [true, 'Path to the application root', '/']),
52-
OptString.new('WEB_ROOT', [true, 'Path to the web root', '/var/www'])
51+
OptString.new('TARGETURI', [true, 'Path to the application root', '/']),
52+
OptString.new('TRIGGERURI', [false, 'Path to the uploaded payload', '']),
53+
OptString.new('WEB_ROOT', [true, 'Path to the web root', '/var/www'])
5354
], self.class)
5455
register_advanced_options(
5556
[
@@ -58,7 +59,7 @@ def initialize(info = {})
5859
end
5960

6061
def trigger(trigger_uri)
61-
print_status('Sleeping before requesting the written file')
62+
print_status("Sleeping before requesting the payload from: #{trigger_uri}")
6263

6364
page_found = false
6465
sleep_time = 10
@@ -117,6 +118,7 @@ def exploit
117118
)
118119

119120
register_files_for_cleanup(payload_file_path)
120-
trigger(normalize_uri(target_uri, payload_file_name))
121+
122+
trigger(normalize_uri(datastore['TRIGGERURI'].blank? ? target_uri : datastore['TRIGGERURI'], payload_file_name))
121123
end
122124
end

0 commit comments

Comments
 (0)