Có cách nào để phát hiện quá trình xâm nhập không nhỉ?

Thảo luận trong 'Source code' bắt đầu bởi viethung_9x, 25 Tháng một 2011.

  1. Offline

    viethung_9x

    • Windows XP

    Số bài viết:
    613
    Đã được thích:
    735
    Điểm thành tích:
    560
    Có cách nào để phát hiện quá trình xâm nhập không nhỉ?
    Câu trả lời rằng bạn hoàn toàn có thể biết trước được quá trình xâm nhập vào admincp hoặc modcp do member của diễn đàn bạn hoặc một kẻ phá hoại nào đó. Quá trình xâm nhập có thể là đoán pass.
    Điều gì bạn muốn biết về quá trình xâm nhập?
    Đó là nickname đang cố xâm nhập, ip của hắn, số lần cố gắn xâm nhập, thời gian diễn ra quá trình xâm nhập.
    Bước 1: edit file login.php
    Bạn tìm:
    Mã:
    $strikes = verify_strike_status($vbulletin->GPC['vb_login_username']);
    Và add sau nó:
    Mã:
    $username = $vbulletin->GPC['vb_login_username'];
        $fdate = date('l, F jS, Y');
        $ftime = date('g:i:s a');
        $fdatetime = "Date/Time: $fdate at $ftime \r\n";
        $fscriptpath = "Script: http://$_SERVER[HTTP_HOST]" . SCRIPTPATH . "\r\n";
        $freferer = 'Referrer: ' . REFERRER . "\r\n";
        $fusername = "Username tried: $username \r\n";
        $fipaddress = 'IP Address: ' . IPADDRESS . "\r\n";
        $iphostname = "Host: " . @gethostbyaddr(IPADDRESS) . "\r\n";
        if ($vbulletin->userinfo['userid'] > 0)
        {
            $realname = "\nUSER ATTEMPT: " . $vbulletin->options['bbtitle'] . " has identified this registered user as: " . $vbulletin->userinfo['username'] . "\r\n";
        }
    Bước 2: vẫn ở file login.php
    Bạn tìm:
    Mã:
    // log this error if attempting to access the control panel
                require_once(DIR . '/includes/functions_log_error.php');
    Thêm sau nó:
    Mã:
    [COLOR=#000000][COLOR=#0000BB]   $fstrk [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"Strikes: $GLOBALS[strikes] out of 5 \r\n"[/COLOR][COLOR=#007700];
                if ([/COLOR][COLOR=#0000BB]$vbulletin[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]GPC[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'logintype'[/COLOR][COLOR=#007700]] === [/COLOR][COLOR=#DD0000]'cplogin'[/COLOR][COLOR=#007700])
                {
                    [/COLOR][COLOR=#0000BB]$subject[/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]'WARNING: Failed Admin CP logon in ' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$vbulletin[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]db[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]appname [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#DD0000]' ' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$vbulletin[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]options[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'templateversion'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"\r\n\r\n"[/COLOR][COLOR=#007700];
                    [/COLOR][COLOR=#0000BB]$message[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"Someone is trying to login to your " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$vbulletin[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]options[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'bbtitle'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]" Admin CP!\n\n$fusername$fipaddress$iphostname$fstrk$freferer$fscriptpath$fdatetime$realname"[/COLOR][COLOR=#007700];
                }
                else
                {
                    [/COLOR][COLOR=#0000BB]$subject[/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]'WARNING: Failed Mod CP logon in ' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$vbulletin[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]db[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]appname [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#DD0000]' ' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$vbulletin[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]options[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'templateversion'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]"\r\n\r\n"[/COLOR][COLOR=#007700];
                    [/COLOR][COLOR=#0000BB]$message[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"Someone is trying to login to your " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$vbulletin[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]options[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'bbtitle'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#DD0000]" Mod CP!\n\n$fusername$fipaddress$iphostname$fstrk$freferer$fscriptpath$fdatetime$realname"[/COLOR][COLOR=#007700];
                }
                [/COLOR][COLOR=#0000BB]vbmail[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$vbulletin[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]options[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'webmasteremail'[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000BB]$subject[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]$message[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]true[/COLOR][COLOR=#007700]);  [/COLOR][/COLOR]
    webmasteremail các bạn chỉnh trongvb options nhé code sẽ tự động gởi mail thông báo quá trình xâm nhập cho bạn.
  2. Offline

    sunboy

    • Thành viên sáng lập

    • No thing
    Số bài viết:
    1.616
    Đã được thích:
    1.340
    Điểm thành tích:
    1.000
    Cũng tương tự. Chip cũng có viết một đoạn code tự động banned IP khi khai báo sai mật khẩu quá 5 lần (IP sẽ được lưu lại). Nếu bạn nào cần thì liên hệ Chip..

Chia sẻ trang này

Advertising: Linux system admin | nukeviet | nukeviet 4 | Upload ảnh miễn phí