Security Guidelines - Hướng dẫn bảo mật cho vbb

  • Thread starter Thread starter AdminAdmin is verified member.
  • Start date Start date
Admin

AdminAdmin is verified member.

Well-Known Member
Staff member
Administrator
+ ) Trong Hướng Dẫn Này Mình sẽ đề Cập tới phương pháp Chmod cho thư mục với Cpanel , Giấu File Config.php bằng phương pháp Hã Móa file , Đổi tên thư mục admincp , modcp . . . .

phương pháp làm :

- mở file config.php trong thư mục includes

tìm dòng :

PHP:
$config['Misc']['admincpdir'] = 'admincp'; 

$config['Misc']['modcpdir'] = 'modcp';

admincp đổi thành tên thư mục mới cho admincp ( vd: admincp --> quanlydiendan)

modcp đổi thành tên thư mục mới cho modcp (vd: quanlychomod)

tiếp theo đổi tên thư mục admincp thành tên bạn vừa đổi ở trong file config.php
( làm tương tự với modcp )

Vẫn tại file config.php

tìm dòng :

PHP:
$config['SpecialUsers']['undeletableusers'] = 'Ních của Admin trong database';

giải thích : là một phương pháp thiết lập ở config.php để ngăn chặn việc xóa, sửa hay thêm bớt thông tin tài khoản admin

- vào thư mục gốc của diễn đàn tạo một thư mục có tên đầu tiên bắt đầu bằng # ( vd : #baomat ) trong file này bạn để file config.php

bạn xóa toàn bộ dữ liệu trong file config.php này rồi ghi code sau:

PHP:
<?php include "#data/usercp.php" ?>

#data/usercp.php

bạn ghi file config.php thật của mình , mình khuyên các bạn nên đặt file config.php thật ở trong thư mục admincp hoặc
modcp nhớ là phải tạo thư mục có tên bắt đầu bằng # !

đổi tên cofig.php thật với những tên tương tự gần giống với các file ( ví dụ : config.php đổi tên thật thành usercp.php )

- tại file config.php bạn download về rồi sử dụng công cụ mã hóa file Zend ,
( tốt hơn bạn chỉ mã hóa file config.php có code )
PHP:
<?php include "#data/usercp.php" ?>
sau khi mã hóa xong bạn lại upload file config.php lên


( để đảm bảo an toàn hơn khi hacker có gắng đọc file class_core.php ta viết thêm .htaccess vào với code như sau )

và chmod cho nó 444
PHP:
<Files "class_core.php">
Order Allow,Deny
Deny from All
</Files>
- mở thư mục includes và tim file class_core.php
tìm code :

PHP:
include(CWD . '/includes/config.php');

if (file_exists(CWD. '/includes/config.php'))

die('<br /><br /><strong>Configuration</strong>: includes/config.php exists,

die('<br /><br /><strong>Configuration</strong>: includes/config.php does not exist.

includes/config.php

tại đây bạn ghi file config.php

có code :

PHP:
<?php include "[COLOR="#data/usercp.php" ?>

- chmod cho toàn bộ với những file và thư mục đã thực hiện ở trên
config.php chmod thành 400
class_core.php chmod thành 400
usercp.php chmod thành 400 ( file config.php thật )
chmod cho thư mục có chứa những file vừa thực hiện thành 100 ( ví dụ : includes )

-Phương pháp chống những kẻ tò mò tọc mạch
Bạn tạo một file index.html với nội dung tùy ý ở bất cứ folder nào trong host. (kể cả mục skin, imager, và những folder con trong folder , imager ..)

- Che dấu những folder nhạy cảm.
- Bạn có thể dùng .htaccess.
- Rename các folder nhạy cảm như data, databackup, mysqldumper...
- Tạo subdomain để vào VD: sql.yourdomain.com và trỏ tới mysqldumper

- cách phát hiện quá trình xâm nhập
-Để làm được bạn lần lượt làm theo hướng dẫn ở các bước sau :
Bước 1: edit file login.php ( nó nằng ngang hàng với admincp , index.php )
Bạn tìm:
PHP:
$strikes = verify_strike_status($vbulletin->GPC['vb_login_username']);

Và add sau nó:
PHP:
$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:

PHP:
// log this error if attempting to access the control panel require_once (DIR . '/includes/functions_log_error.php');

Thêm sau nó:

PHP:
$fstrk = "Strikes: $GLOBALS[strikes] out of 5 \r\n"; if ($vbulletin->GPC['logintype'] === 'cplogin') { $subject= 'WARNING: Failed Admin CP logon in ' . $vbulletin->db->appname . ' ' . $vbulletin->options['templateversion'] . "\r\n\r\n"; $message="Someone is trying to login to your " . $vbulletin->options['bbtitle'] . " Admin CP!\n\n$fusername$fipaddress$iphostname$fstrk$freferer$fscriptpath$fdatetime$realname"; } else { $subject= 'WARNING: Failed Mod CP logon in ' . $vbulletin->db->appname . ' ' . $vbulletin->options['templateversion'] . "\r\n\r\n"; $message="Someone is trying to login to your " . $vbulletin->options['bbtitle'] . " Mod CP!\n\n$fusername$fipaddress$iphostname$fstrk$freferer$fscriptpath$fdatetime$realname"; } vbmail($vbulletin->options['webmasteremail'], $subject, $message, true);

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.

+ ) Phương pháp chống up shell wa plugin và edit plugin
Bạn chèn đoạn code này vào file config.php (sau dòng <?php)

PHP:
define('DISABLE_HOOKS', true);

một số bạn quyên không xóa file validator.php đi nên bị lộ thông tin việc này chúng ta cũng nên chú ý nha !

Chú ý : phương pháp trên áp dụng cho Cpanel không áp dụng cho window .


Chúc Các Bạn Thành Công !
 

Facebook Comments

Similar threads

Admin
Replies
0
Views
5K
AdminAdmin is verified member.
Admin
V
Replies
0
Views
4K
vanvangit
V
Admin
Replies
0
Views
150K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
2K
AdminAdmin is verified member.
Admin
Admin
Replies
2
Views
1K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
801
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
862
AdminAdmin is verified member.
Admin
cuongpro9x
Replies
2
Views
3K
cuongpro9xcuongpro9x is verified member.
cuongpro9x
Back
Top