About

若世有仙魔二道,我必三跪九叩行万里,以求拜仙为师,若仙不收我,我必入魔,屠尽武林正道以明志。若魔已不收我,我必戮尽仙魔以雪耻。

By F4usT.

  • Aug

    18

    80After CMS V4 鸡肋上传漏洞 - 脚本漏洞

    • 2 Comments
    • 网络转载
    • 发布:admin
    • 引用:0
    • 浏览:

    By:小A

        官方网址:http://www.reaft.com/

        Cms下载地址:http://www.reaft.com/html/1/200.html

        界面做的还不错,搜索了一下好像用的人很少,开始。

        首先看目录下 UpLoad.html 文件上传,调用了的是 UpLoad.asp。

    UpLoad.asp:

    <!--#include file="UpLoad_Class.vbs.asp"-->
    <!--#include file="request.asp" -->
    <!--#include file="conn.asp" -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>文件上传</title>
    <link href="styles/iframe.css" rel="stylesheet" type="text/css" />
    <script src="scripts/admin.js"></script>
    </head>

    <body>
    <div class="iframeBody">
    <%
    dim upload
    set upload = new AnUpLoad
    upload.Exe = "*"
    upload.MaxSize = 4 * 1024 * 1024 '4M
    upload.GetData()
    if upload.ErrorID>0 then
            response.Write upload.Description
    else
            postMess("images/operate_02.jpg")
            dim savpath
            savepath = "/upload/"&year(date())&"/"&month(date())&"/"
            for each f in upload.files(-1)
                    dim file
                    set file = upload.files(f)
                    if not(file is nothing) then
                            if file.saveToFile(savepath,0,true) then
                                    postMess("images/operate_01.jpg")
                                    postValue = postValue&""&savepath&file.filename&"|"
                                    response.write ("<script>window.parent.document.getElementById("""&postName&""").value="""&postValue&""";</script>")
                            end if
                    end if
                    set file = nothing
            next
    end if
    set upload = nothing
    %>
    </div>
    </body>
    </html>

        然后在来看看:UpLoad_Class.vbs.asp。

    UpLoad_Class.vbs.asp:

    <!--#include file="admin.asp" -->
    <%
    '=========================================================
    '类名: AnUpLoad(艾恩无组件上传类)
    '=========================================================
    C省略N行代码
            Public Function GetWH()
                    '本函数代码参考网络
                    On Error Resume Next
                    mvarExtend = lcase(mvarExtend)
                    if instr("|jpg|jpeg|bmp|png|gif|asa|","|" & mvarExtend & "|")<=0 then exit function
                    Dim m_binItem
                    Set m_binItem =server.CreateObject("ADODB.Stream")
                    m_binItem.Mode = 3
                    m_binItem.Type = 1
                    m_binItem.Open
                    Dim Info
                    Set Info = server.CreateObject("ADODB.Recordset")
                    Info.Fields.Append "value", 205, -1
                    Info.Open
                    Info.AddNew
                    Info("value").AppendChunk (mvarValue)
                    m_binItem.Write (Info("value"))
                    Info("value").AppendChunk (Null)
                    Info.Update
                    Info.Close
                    Set Info = Nothing
                    select case lcase(mvarExtend)
                    case "jpg","jpeg"
                            m_binItem.Position=3
                            do while not m_binItem.EOS
                                    do
                                            intTemp = Ascb(m_binItem.Read(1))
                                    loop while intTemp = 255 and not m_binItem.EOS
                                    if intTemp < 192 or intTemp > 195 then
                                            m_binItem.read(Bin2Val(m_binItem.Read(2))-2)
                                    else
                                            Exit do
                                    end if
                                    do
                                            intTemp = Ascb(m_binItem.Read(1))
                                    loop while intTemp < 255 and not m_binItem.EOS
                            loop
                            m_binItem.Read(3)
                            mvarHeight = Bin2Val(m_binItem.Read(2))
                            mvarWidth = Bin2Val(m_binItem.Read(2))
                    case "gif"
                            if Lcase(strFext)<>"gif" then strFext="gif"
                            m_binItem.Position=6
                            mvarWidth = BinVal2(m_binItem.Read(2))
                            mvarHeight = BinVal2(m_binItem.Read(2))
                    case "png"
                            if Lcase(strFext)<>"png" then strFext="png"
                            m_binItem.Position=18
                            mvarWidth = Bin2Val(m_binItem.Read(2))
                            m_binItem.Read(2)
                            mvarHeight = Bin2Val(m_binItem.Read(2))
                    case "bmp"
                            if Lcase(strFext)<>"bmp" then strFext="bmp"
                            m_binItem.Position=18
                            mvarWidth = BinVal2(m_binItem.Read(4))
                            mvarHeight = BinVal2(m_binItem.Read(4))
                case "asa"
                            if Lcase(strFext)<>"asa" then strFext="asa"
                            m_binItem.Position=18
                            mvarWidth = BinVal2(m_binItem.Read(2))
                            mvarHeight = BinVal2(m_binItem.Read(2))
                    end select
                    m_binItem.Close
                    If err then
                            mException=Err.Description
                    End If
            End Function
     

        看红色部分,其他就不解释了。

        直接上传asa拿shell。

        还有就是上传可能会提示登录,直接伪造session就可以通过了。    验证代码在 admin.asp。

    admin.asp:

    <%
    if session("username")="" and session("password")="" then
    session("Errortxt")="登录超时,请重新登陆"
    response.Redirect("login.asp")
    response.end
    end if
    %>

        其他就不多说了!

        重新编辑了一下,第一次发贴,格式不对,请见谅。

        这个应该算是一个漏洞吧,不知道是不是作者故意加上的,在上传扩展名,检查那里,居然加了个asa,无意间发现的。

     

    结语:什么 session 可以伪造?求解,求方法!(可以作为一个后台拿shell的方法)

     

    总结:我下载了一套程序大概看了下 不知道怎么回事 暂时没发现什么注入 ,但是有个fck 可以利用iis解析漏洞获取shell

    额 弱弱的 说下 如果后台路径不改 本套系统有fck
    可以利用 admin/fckeditor/editor/filemanager/connectors/asp/connector.asp?Command=GetFoldersAndFiles&Type=File&CurrentFolder=%2Fhack.asp 建一个名为hack.asp文件夹,然后上传一个图片格式的asp木马 利用解析漏洞搞定。还是属于fck的漏洞。 这是官网最新的哦、


     

     

    • Tags:
    相关文章:
      Post Comment.

      发表评论