欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

编写一个asp代码执行器

程序员文章站 2022-06-10 16:28:30
保存为run.asp运行。账号密码admin,登陆后输入代码就可执行了!! <% @ language="vbscript" %><%option explicitresponse...

保存为run.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