Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit 513a1f5

Browse files
committed
Add ability to specify the file extension to use for the payload
1 parent 99ed86b commit 513a1f5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/wpxf/wordpress/shell_upload.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,19 @@ def upload_request_params
6565
nil
6666
end
6767

68+
# @return [String] the extension type to use when generating the payload name.
69+
def payload_name_extension
70+
'php'
71+
end
72+
6873
# Run the module.
6974
# @return [Boolean] true if successful.
7075
def run
7176
return false unless super
7277
return false unless before_upload
7378

7479
emit_info 'Preparing payload...'
75-
@payload_name = "#{Utility::Text.rand_alpha(payload_name_length)}.php"
80+
@payload_name = "#{Utility::Text.rand_alpha(payload_name_length)}.#{payload_name_extension}"
7681
builder = payload_body_builder
7782
return false unless builder
7883

0 commit comments

Comments
 (0)