1. Halo Guest, pastikan Anda selalu menaati peraturan forum sebelum mengirimkan post atau thread baru.

Awas Blog WP anda Kena DEFACE

Discussion in 'Wordpress' started by aminhidayat, Jul 19, 2011.

Tags:
  1. aminhidayat

    aminhidayat Super Hero

    Joined:
    Jul 24, 2008
    Messages:
    1,678
    Likes Received:
    76
    Location:
    tokopedia
    Maaf ada yang tahu mengatasi ulah hacker ini gak. beberapa blog di deface. Saya cari dari htaccess , index.php , index dan file lainnya gak ada yang dirubah di template. Tapi dia bisa merubah user dan pass wp-admin. Saya upgrade wp saya tetep gak mau ilang deface nya.. saya cari dihalaman custom page juga gak ada.

    Yang saya bisa lakukan adalah cuma restore dari server backup saya itu saya harus terminate dulu acc lama saya.... tapi pegel juga satu satu.

    Terimakasih jika ada solusi yang membantu memecahkannya lebih cepat

    View attachment 9536
     
  2. adepane

    adepane Hero

    Joined:
    Mar 7, 2011
    Messages:
    653
    Likes Received:
    43
    Location:
    Pinggiran Trotoar
    function.php tadi seharusnya di cekmasbro, karena
    index.php ngambil dari function. untuk konek ke yang lain juga sama
     
  3. aminhidayat

    aminhidayat Super Hero

    Joined:
    Jul 24, 2008
    Messages:
    1,678
    Likes Received:
    76
    Location:
    tokopedia
    klo wp nya di upgrade apa function.php nya gak berubah?
     
  4. denaya

    denaya Super Hero

    Joined:
    Aug 13, 2010
    Messages:
    1,381
    Likes Received:
    172
    - Cek Error_log
    biasanya ada keterangan error / encode file yang ter-inject
    - Backup restore
    bisa di lakukan dengan download WP terbaru trus upload lagi. kalau ada file manager lebih mudah. upload master nya dan timpa file lama dengan file WP baru tersebut.
    - Install Plugins security
    wp-firewall2 / block bad queries dsb .. banyak pilihan


    cek satu2 aja mas bro file error_log nya. kalau pass nya di ganti. contact YM saya aja nanti ane kasih php buat ubah pass
     
    yumichan and dNoxs like this.
  5. aminhidayat

    aminhidayat Super Hero

    Joined:
    Jul 24, 2008
    Messages:
    1,678
    Likes Received:
    76
    Location:
    tokopedia
    ubah pass saya lakukan masuk phpmyadmin dan ganti email nya kemudian lakukan forgot password di wp-admin (karena pass telah diubah sama hackernya)
    ada cara lebih cepat?
    .
     
  6. geblek

    geblek Super Hero

    Joined:
    Nov 17, 2006
    Messages:
    1,640
    Likes Received:
    116
    sudah di cek di rootnya ? biasanya di kasih index.html
    atau juga cek wp-config, punya ane pernah di ubah file tsb
     
    aminhidayat likes this.
  7. denaya

    denaya Super Hero

    Joined:
    Aug 13, 2010
    Messages:
    1,381
    Likes Received:
    172
    source w-shadow.com
    PHP:
    <?php

    require('./wp-blog-header.php');

    function 
    meh() {
    global 
    $wpdb;
        
    $answer '';
        
            if (isset(
    $_POST['update']))
            {
                
    $user_login = ( empty( $_POST['e-name'] ) ? '' sanitize_user$_POST['e-name'] ) );
                
    $user_pass  = ( empty( $_POST'e-pass' ] ) ? '' $_POST['e-pass'] );
                
    $answer = ( empty( $user_login ) ? '<div id="message" class="updated fade"><p><strong>The user name field is empty.</strong></p></div>' '' );
                
    $answer .= ( empty( $user_pass ) ? '<div id="message" class="updated fade"><p><strong>The password field is empty.</strong></p></div>' '' );
                
    /* 
                //Why ask the user for the "correct" admin username? Let them change whatever password they want.
                //It's not like this script is secure anyway. 
                if ( $user_login != $wpdb->get_var("SELECT user_login FROM $wpdb->users WHERE ID = '1' LIMIT 1") )
                {
                    $answer .="<div id='message' class='updated fade'><p><strong>That is not the correct administrator username.</strong></p></div>";
                }
                //*/
                
    if( empty( $answer ) )
                {
                    
    $result $wpdb->query("UPDATE $wpdb->users SET user_pass = MD5('$user_pass'), user_activation_key = '' WHERE user_login = '$user_login'");

                    if (
    $result !== false ){
                        
    //Password was changed successfuly.
                        
    $plaintext_pass $user_pass;
                        
    $message __('Someone, hopefully you, has reset the Administrator password for your WordPress blog. Details follow:'). "\r\n";
                        
    $message  .= sprintf(__('Username: %s'), $user_login) . "\r\n";
                        
    $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
                        @
    wp_mail(get_option('admin_email'), sprintf(__('[%s] Your WordPress administrator password has been changed!'), get_option('blogname')), $message);
                        
    $answer="<div id='message' class='updated fade'><p>
                            <strong>Your password has been successfully changed</strong></p>
                            <p><strong>An e-mail with this information has been dispatched to the 
                            WordPress blog administrator</strong></p>
                            <p><strong>You should now delete this file off your server. 
                            DO NOT LEAVE IT UP FOR SOMEONE ELSE TO FIND!</strong></p></div>"
    ;

                        
    //Delete this file if required.
                        
    if (!empty($_POST['selfdestruct'])){
                            
    $short_filename preg_split('/[\/\\\]+/'__FILE__);
                            
    $short_filename array_pop($short_filename);
                            
    //copy(__FILE__, 'emergency.php.bak'); //uncomment for debugging 
                            
    if (unlink(__FILE__)){
                                
    $answer .= "<div id='message' class='updated fade'><p><strong>$short_filename was deleted successfuly.</strong></p></div>";
                            } else {
                                
    $answer="<div id='message' class='updated fade'><p>
                                    <strong>Couldn't automatically delete 
    $short_filename
                                    You should now delete this file manually.</strong></p></div>"
    ;
                            };
                        }
                    } else {
                        
    $answer .= "<div id='message' class='error fade'><p><strong>
                            Database error : 
    $wpdb->last_error 
                        </strong></p></div>"
    ;
                    }
                }
            }

            return 
    $answer;
    }

    $answer meh();

    //gather existing WP usernames (no more than 50 - the admin username is very likely among them)
    $usernames $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users ORDER BY ID ASC LIMIT 50"ARRAY_A);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>WordPress Emergency PassWord Reset</title>
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
        <link rel="stylesheet" href="<?php bloginfo('wpurl'); ?>/wp-admin/css/global.css?version=<?php bloginfo('version'); ?>" type="text/css" />
        <link rel="stylesheet" href="<?php bloginfo('wpurl'); ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" />
        <link rel="stylesheet" href="<?php bloginfo('wpurl'); ?>/wp-admin/css/colors-fresh.css?version=<?php bloginfo('version'); ?>" type="text/css" />
    </head>
    <body class="wp-admin">

    <div id="wpcontent">
    <div id='wpbody'>

    <div class="wrap">
          <form method="post" action="">
    <h2>WordPress Emergency PassWord Reset</h2>
    <p><strong>Your use of this script is at your sole risk. All code is provided "as -is", without any warranty, whether express or implied, of its accuracy, completeness. Further, I shall not be liable for any damages you may sustain by using this script, whether direct, indirect, special, incidental or consequential.</strong></p>
    <p>This script is intended to be used as <strong>a last resort</strong> by WordPress administrators that are unable to access the database.
    Usage of this script requires that you know the Administrator's user name for the WordPress install. (For most installs, that is going to be "admin" without the quotes.)</p>
    <?php
    echo $answer;
    ?>
    <table class="form-table">
        <tr>
            <th align='left'>Administrator Username</th>
            <td>
            <select name='e-name'> 
    <?php
            
    foreach ($usernames as $user){
                echo 
    "\t<option value='$user[user_login]'";
                if (isset(
    $_POST['e-name']) && ($_POST['e-name']==$user['user_login']) )
                    echo 
    " selected";
                echo 
    ">$user[user_login]</option>\n";
            }
    ?>        </select>
            </td>
        </tr>
        <tr>
            <th align='left'>New Password</th>
            <td><input type='text' name='e-pass' size="20" value=""  /> </td>
        </tr>
    <?php 
        
    //check if this file can be deleted by PHP
        
    if (is_writable(__FILE__)){
    ?>    
        <tr>
            <th align='left' colspan='2'>
                <label for="selfdestruct">
                    <input name="selfdestruct" type="checkbox" id="selfdestruct" checked />
                    Automatically delete <?php 
                        
    echo substr(__FILE__strrpos(str_replace('\\','/',__FILE__), '/')+1); 
                        
    ?> after successfuly changing the password.
                </label>
            </th>
        </tr>
    <?php ?>
    </table>

        <p class="submit"><input type="submit" name="update" value="Update Options" /></p>
          </form>
        </div>
        
    </div></div>

    </body></html>
    [/spoiler]
    Simpan dengan nama bebas extension .php upload ke root
    tinggal execute ajah http://www.domain.com/namascripts.php

    kalau udah tinggal delete, setahu ane auto delete :)
     
    dNoxs and aminhidayat like this.
  8. aminhidayat

    aminhidayat Super Hero

    Joined:
    Jul 24, 2008
    Messages:
    1,678
    Likes Received:
    76
    Location:
    tokopedia
    klo wp-config mungkin mysqlnya
    tapi bagaimana ngecheck nya mysqlnya di inject?

    index.html .... hmm gak kepikiran nich..... lain kali saya check disitu (mungkin deface nya disitu)

    ---------- Post added at 01:36 PM ---------- Previous post was at 01:33 PM ----------

    klo wp-config mungkin mysqlnya
    tapi bagaimana ngecheck nya mysqlnya di inject?

    index.html .... hmm gak kepikiran nich..... lain kali saya check disitu (mungkin deface nya disitu)

    ---------- Post added at 01:41 PM ---------- Previous post was at 01:36 PM ----------

    terima kasih
     
  9. aminhidayat

    aminhidayat Super Hero

    Joined:
    Jul 24, 2008
    Messages:
    1,678
    Likes Received:
    76
    Location:
    tokopedia
    terima kasih

    ---------- Post added at 01:49 PM ---------- Previous post was at 01:42 PM ----------

    klo mencegah inject mysql nya?
     
  10. dNoxs

    dNoxs Ads.id Pro

    Joined:
    Dec 3, 2008
    Messages:
    441
    Likes Received:
    23
    memang akhir2 banyak defacer yang cari tempat untuk berkreasi.. lebih parahnya mereka tidak hanya deface blog, tapi ganti pub id adsense kita :(
     
  11. semprulll

    semprulll Super Hero

    Joined:
    Mar 21, 2007
    Messages:
    1,382
    Likes Received:
    38
    Location:
    Kota Baja
    Reset password saja bro, saya pernah kena deface juga dan reset password.
    Kemudian ganti user name dan passwordnya.
     
  12. aminhidayat

    aminhidayat Super Hero

    Joined:
    Jul 24, 2008
    Messages:
    1,678
    Likes Received:
    76
    Location:
    tokopedia
    takutnya dia tidak hanya mengganti user dan pass saja... melainkan hidden link juga
     
  13. GentZu AoZora

    GentZu AoZora Forbidden

    Joined:
    Nov 28, 2010
    Messages:
    2,932
    Likes Received:
    275
    Location:
    Bandung City
    coba liat juga function.php pada tema.
     
  14. denaya

    denaya Super Hero

    Joined:
    Aug 13, 2010
    Messages:
    1,381
    Likes Received:
    172
    - Selalu UP2DATE
    - Pasang Plugins Security
    banyak pilihannya bro .. jaga2 .. repot dikit tapi kan lumayan daripada lumanyun ?
     
  15. kowek

    kowek Hero

    Joined:
    Nov 25, 2009
    Messages:
    629
    Likes Received:
    15
    pake wp versi berapa nih om?
     
  16. aminhidayat

    aminhidayat Super Hero

    Joined:
    Jul 24, 2008
    Messages:
    1,678
    Likes Received:
    76
    Location:
    tokopedia
    dari wp 2.6 s/d 3.1 kena semua .... niat nich hacker ..
     
  17. JhezeR

    JhezeR Super Hero

    Joined:
    Dec 14, 2009
    Messages:
    1,356
    Likes Received:
    59
    Location:
    Universe
    kalo banyk minta tlg ama CS hosting aja mas, biar di scan dari file backdoor.
    kalo cek satu², makan waktu jg..lagian gak tahu dimana di injek
     
  18. teguhaditya

    teguhaditya Super Hero

    Joined:
    Jan 23, 2008
    Messages:
    7,503
    Likes Received:
    1,418
    Location:
    _ ▂ ▃ ▅ ▆ █
    saran ane, udah pindah aja ke hoster lain.

    berdasarkan pengalaman, kalau dalam satu hosting ada satu web terinfeksi, maka web lain juga kemungkinan besar akan kena, dan menjadi sasaran berikutnya. sampai semuanya benar-benar terkuasai.

    kalau ada backup, mending restorenya di hostingan baru. atau jika di vps, terminate akun, terus create lagi.
     
  19. blackarch

    blackarch Ads.id Starter

    Joined:
    Mar 18, 2011
    Messages:
    95
    Likes Received:
    104
    Location:
    Jakarta - Mataram - Seoul, South Korea All Years
    Kalau yang deface sudah megang ROOT hosting, mau bilang apa lagi :)
    Semua cara sakti untuk pengamanan bakal percuma, solusi extreem ya pindah ke tempat hosting yang tangguh.
     
  20. achmadku

    achmadku Super Hero

    Joined:
    Sep 26, 2008
    Messages:
    884
    Likes Received:
    49
    Location:
    Pojok Kamar
    setuju dengan bos nyang diatas ane. :) makanya saya pernah ngalami dicrack terpaksa ganti hosting aja... soalnya kok yang kena dari satu hosting itu-itu aja :)
     

Share This Page