* Hiểm họa: Hacker sẽ có thể đăng nhập dưới quyền Admin Kloxo và... sẽ ko làm gì hết?
Lỗi SQL Injection này giúp attacker login dưới quyền admin
Thôi kệ nó, giờ đi khắc phục nhé!
Mở: /usr/local/lxlabs/kloxo/httpdocs/htmllib/phplib/lxlib.php
Tìm hàm:
function check_raw_password($class, $client, $pass) { //return true; if (!$class || !$client || !$pass) { return false; } $rawdb = new Sqlite(null, $class); $password = $rawdb->rawquery("select password from $class where nname = '$client'"); $enp = $password[0]['password']; if ($enp && check_password($pass, $enp)) { return true; } return false; //$rawdb->close(); }
Trong hàm này, thêm vào ngay đằng trước $rawdb = new Sqlite(null, $class); nội dung sau:
$client = addslashes($client); $class = addslashes($class);
Tìm tiếp tới: /usr/local/lxlabs/kloxo/httpdocs/htmllib/lib/objectactionlib.php
Tìm tới hàm:
function webcommandline_main()
Ngay bên dưới nó vài dòng bạn sẽ thấy dòng sau:
if ($opt['login-class'] !== 'client' && $opt['login-class'] !== 'auxiliary') {
Sửa nó thành:
if ($opt['login-class'] !== 'client' || $opt['login-class'] !== 'auxiliary') {
* Thông tin được tham khảo từ LxCenter Forum.
Nguồn: theo DuyK.net.