【0day】Artyboard 韩国论坛程序上传漏洞

    Artyboard 是韩国比较早期得一款 ASP 语言得论坛,广泛应用于韩国中小网站。

    一、漏洞存在于页面“editor/editor_flash.asp”中。

editor/editor_flash.asp:

<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr" />
<title>&#54540;&#47000;&#49772; &#47924;&#48708;</title>
<link rel="stylesheet" type="text/css" href="dialog.css" />
<script type="text/javascript" language="javascript">

var oEditor = parent.chutil.oname;

function DoReset(el)
{
    document.getElementById(el).value = '';
    document.getElementById(el).focus();
}

function DoPaste(el)
{
    document.getElementById(el).focus();
    document.getElementById(el).value = '';
    var pasteText = document.getElementById(el).createTextRange();
    pasteText.execCommand("Paste", false, false);
}

function DoSubmit(el)
{
        if (el == "file"){
                str = document.theForm.strFileName;
                if (str.value == ""){alert("&#54540;&#47000;&#49884; &#54028;&#51068;&#51012; &#49440;&#53469;&#54644; &#51452;&#49884;&#44592; &#48148;&#46989;&#45768;&#45796;.");str.focus();return false;}

                document.theForm.action = "editor_flash_ok.asp";
                document.theForm.submit();

        }else{
    var media = (el == 'embed') ? document.getElementById("fm_embed").value :
        "<embed src='"+document.getElementById("fm_linkurl").value+"'></embed>";
    eval("parent."+oEditor).doCmdPaste(media);
    popupClose();
        }
}

function popupClose() {
    eval('parent.'+oEditor).popupWinClose();
}
</script>
</head>
<body>
<%
        DIM filepath, sType
        filepath = REQUEST.QueryString("filepath")
        sType    = REQUEST.QueryString("sType")
        IF sType = "" THEN sType = "1"
%>
<form name="theForm" method="post" action="editor_flash_ok.asp" style="display:inline" enctype="multipart/form-data">
<input type="hidden" name="filepath" value="<%=filepath%>">
<span class="normal">- &#54200;&#51665; &#54868;&#47732;&#50640;&#49436; &#46041;&#50689;&#49345;&#51012; &#48372;&#49884;&#47140;&#47732; &#46041;&#50689;&#49345;&#51012; &#45908;&#48660; &#53364;&#47533;&#54616;&#49901;&#49884;&#50724;.
- &#54140;&#50724;&#44592; &#54620; &#45236;&#50857;&#51008; &#53412;&#48372;&#46300; 'Ctrl+V' &#46608;&#45716; '&#48537;&#51060;&#44592; &#48260;&#53948;'&#51012; &#53364;&#47533;&#54616;&#49901;&#49884;&#50724;.
- &#54028;&#51068; &#50629;&#47196;&#46300;&#45716; &#54540;&#47000;&#49884; &#54028;&#51068;&#47564; &#44032;&#45733;&#54616;&#47728;, &#49436;&#48260;&#50640; &#54540;&#47000;&#49884; &#54028;&#51068;&#51060; &#51200;&#51109;&#46121;&#45768;&#45796;.
</span>
<fieldset style="margin-top:10px;padding:5px"><legend><span class="normal">&#54540;&#47000;&#49884; &#49341;&#51077; &#54805;&#53468;</span></legend>
</textarea>

<div style="text-align:left">
<input type="radio" name="strType" id="strType0" value="0"<% IF sType = "1" THEN %> CHECKED<% END IF %> onClick="OnDisplay('1');"><span class="normal"><LABEL FOR="strType0" style="cursor:hand">HTML &#53468;&#44536;</LABEL></span>
<input type="radio" name="strType" id="strType1" value="1"<% IF sType = "2" THEN %> CHECKED<% END IF %> onClick="OnDisplay('2');"><span class="normal"><LABEL FOR="strType1" style="cursor:hand">&#47553;&#53356;&#51452;&#49548;</LABEL></span>
<input type="radio" name="strType" id="strType2" value="2"<% IF sType = "3" THEN %> CHECKED<% END IF %> onClick="OnDisplay('3');"><span class="normal"><LABEL FOR="strType2" style="cursor:hand">&#54028;&#51068; &#50629;&#47196;&#46300;</LABEL></span>
</div>
</fieldset>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr id="tr_1" style="display:<% IF sType = "1" THEN %>block<% ELSE %>none<% END IF %>">
                <td>
<fieldset style="margin-top:10px;padding:5px"><legend><span class="normal">HTML &#53468;&#44536; - &lt;EMBED&gt; &#46608;&#45716; &lt;OBJECT&gt;</span></legend>
<textarea name="embed" id="fm_embed" rows="3" style="width:460px;" /></textarea>
<div style="text-align:center"><button onClick="DoSubmit('embed')" class="button">&#54869;&#51064;</button>&#160;
<button onClick="DoPaste('fm_embed')" class="button">&#48537;&#51060;&#44592;</button>&#160;
<button onClick="DoReset('fm_embed')" class="button">&#45796;&#49884;&#51077;&#47141;</button></div>
</fieldset>
                </td>
        </tr>
        <tr id="tr_2" style="display:<% IF sType = "2" THEN %>block<% ELSE %>none<% END IF %>">
                <td>
<fieldset style="margin-top:5px;padding:5px"><legend><span class="normal">&#47553;&#53356; &#51452;&#49548; - HTTP</span></legend>
<textarea name="linkurl" id="fm_linkurl" rows="3" style="width:460px;" /></textarea>
<div style="text-align:center"><button onClick="DoSubmit('url')" class="button">&#54869;&#51064;</button>&#160;
<button onClick="DoPaste('fm_linkurl')" class="button">&#48537;&#51060;&#44592;</button>&#160;
<button onClick="DoReset('fm_linkurl')" class="button">&#45796;&#49884;&#51077;&#47141;</button></div>
</fieldset>
                </td>
        </tr>
        <tr id="tr_3" style="display:<% IF sType = "3" THEN %>block<% ELSE %>none<% END IF %>">
                <td>
                <fieldset style="margin-top:10px;padding:5px"><legend><span class="normal">&#54540;&#47000;&#49884; &#54028;&#51068; &#50629;&#47196;&#46300;</span></legend>
                <input type="file" name="strFileName" style="width:460px;" />
                <div style="text-align:center"><button onClick="DoSubmit('file')" class="button" style="width:100px">&#54028;&#51068;&#50629;&#47196;&#46300;</button></div>
                </fieldset>
                </td>
        </tr>
</table>
<div class="spacer"></div>
<div style="text-align:center">
<button onClick="popupClose()" class="button">&#52712;&#49548;</button>
</div>
</form>
<script language="javascript">

        function OnDisplay(str){

                document.all['tr_1'].style.display = "none";
                document.all['tr_2'].style.display = "none";
                document.all['tr_3'].style.display = "none";

                switch (str){
                        case "1" :
                                document.all['tr_1'].style.display = "block";
                                break;
                        case "2" :
                                document.all['tr_2'].style.display = "block";
                                break;
                        case "3" :
                                document.all['tr_3'].style.display = "block";
                                break;
                }
        }

</script>
</body>
</html>

    未经验证即可上传、且上传到根目录之后对文件的名字未作改变,在结合 IIS6 的解析漏洞之后形成了本漏洞。

利用方法:

    一、打开“editor/editor_flash.asp”页面,上传“X.asa;.swf”。

    二、WebShell 的地址:http://simple/X.asa;.swf