编写一个asp代码执行器
作者:未知 来源:转载 发布时间:2005-7-20 11:34:38 发布人:acx
保存为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<br/> tempSQL2=""<br/> tempSQL=split(SQLMutiStr,vbcrlf)<br/> if inStr(lcase(tempSQL(0)),"language")>0 then<br/> tempSQL2=tempSQL(1)<br/> if ubound(tempSQL)>1 then<br/> for i=1 to ubound(tempSQL)<br/> tempSQL2=tempSQL2&tempSQL(i)<br/> next<br/> end if<br/> tempSQL2=trim(tempSQL2)<br/> else<br/> tempSQL2=SQLMutiStr<br/> end if<br/> tempSQL2=replace(tempSQL2,"<%"&"=","<"&"%response.write ")<br/> do <br/> tempSQL2=replace(tempSQL2,vbcrlf&vbcrlf,vbcrlf)<br/> loop while instr(tempSQL2,vbcrlf&vbcrlf)>0<br/> tempSQL2=trim(tempSQL2)<br/> tempSQL2="<"&"%%"&">"&tempSQL2&"<"&"%%"&">"<br/> scriptArr=split(tempSQL2,"%"&">")<br/> dim ub,kub<br/> ub=ubound(scriptArr)<br/> for i=0 to ub-1<br/> scriptSubArr=split(scriptArr(i),"<"&"%")<br/> if i>0 then response.write (scriptSubArr(0))<br/> ExeCuteIt(scriptSubArr(1))<br/> next<br/> call EndProc("<font color=#009900>代码运行完毕!</font>")<br/> end if<br/> else<br/> %><br/> 输入要运行的ASP代码:<br/> <FORM METHOD=POST ACTION="?action=RunCode" style="margin:0px;"><br/> <TEXTAREA NAME="SQLMutiStr" wrap='OFF' ROWS="20" style="width:100%;height:100%;table-layout:fixed;word-break:break-all;"><%=Server.Htmlencode(SQLMutiStr)%></TEXTAREA><br/> <br><br/> <INPUT TYPE="button" Value="LouOut"><br/> <INPUT TYPE="reset" Value="Clear"><br/> <INPUT TYPE="submit" value="Run AspCode"><br/> </FORM><br/> <% end if<br/> else<br/> call loginmain()<br/> end if<br/> Response.write ("</BODY></HTML>")<br/>END IF '-------TOT</P>
<P>SUB loginMain()<br/> %></P>
<P> <FORM METHOD=POST ACTION="?action=chkpass"> UserName:<INPUT TYPE="text" NAME="UserName"><br><br/> PassWord:<INPUT TYPE="password" NAME="Runpassword"><br><br/> CheckCode:<INPUT TYPE="GetCode" NAME="GetCode"><img src="runasp.asp?action=GetCode&Time=<%=timer()%>"><br><br/> <br><img width=125 height=0><INPUT TYPE="submit" value=" Login "></FORM><br/> <% <br/>End SUB</P>
<P>function checkPass()<br/> dim UserName,Runpassword,GetCode<br/> dim errinfo<br/> checkPass=""<br/> UserName=trim(request.form("UserName"))<br/> Runpassword=trim(request.form("Runpassword"))<br/> GetCode=request.form("GetCode")<br/> if UserName="" or Runpassword="" then<br/> errinfo=errinfo&"<li>用户名和密码输入不能为空"<br/> end if<br/> if Not isnumeric(GetCode) then<br/> errinfo=errinfo&"<li>请输入数字校验码"<br/> end if<br/> if errinfo<>"" then <br/> call loginmain() <br/> EndProc errinfo<br/> end if<br/> if action="chkpass" and Session("GetCode")=int(GetCode) and UserName=SUserName and Runpassword=Spassword then<br/> Session("GetCode")=0<br/> checkPass="1"<br/> else<br/> call loginmain()<br/> EndProc "登陆失败!请重新确认正确输入"<br/> end if<br/>End function</P>
<P>SUB ExeCuteIt(ExString)<br/> on error resume next<br/> Execute(ExString)<br/> if err.number<>0 then<br/> Response.write "<div style=""background-color: #ffeedd;padding: 6px;"">"<br/> Response.write "<hr size=1>"<br/> Response.write "出错信息:<li><font color=#ff0000>"&err.description&"</font>"<br/> Response.write "<hr size=1>"<br/> Response.write "出错代码:<li><font color=#0000ff>"&Htmlencode(ExString)&"</font>"<br/> Response.write "<hr size=1></div>"<br/> end if<br/> on error goto 0<br/>end SUB</P>
<P>function HTMLEncode(reString)<br/> dim Str:Str=reString<br/> if not isnull(Str) then<br/> Str = replace(Str, ">", ">")<br/> Str = replace(Str, "<", "<")<br/> Str = Replace(Str, CHR(32), " ")<br/> Str = Replace(Str, CHR(9), " ")<br/> Str = Replace(Str, CHR(34), """) ' "<br/> Str = Replace(Str, CHR(39), "'") ' '<br/> Str = Replace(Str, CHR(13), "")<br/> Str = Replace(Str, CHR(10) & CHR(10), "</P><P> ")<br/> Str = Replace(Str, CHR(10), "<BR> ")<br/> HTMLEncode = Str<br/> else<br/> HTMLEncode=""<br/> end if<br/>end function</P>
<P>'断点调试 num=0 中断<br/>Sub Response_write(str,num)<br/> dim istr:istr=str<br/> dim inum:inum=num<br/> response.write str&"<br>"<br/> if inum=0 then response.end<br/>end sub</P>
<P>SUB EndProc(info)<br/> Response.write "<hr size=1 color=#00aa00>"<br/> Response.write info<br/> Response.write "<hr size=1 color=#00aa00><a href=""javascript:window.history.back();"">返回运行页面</a><br><br>"<br/> Response.write "<a href=""?action=exit"">退出登陆</a>"<br/> response.end<br/>End SUB <br/>%><br/><script language="Jscript" runat="Server"><br/>function GetNO(num){<br/> var NumArray=[</p></div><p align="center"><b><font color="red">[1]</font> <a href="200507205611_2.html">[2]</a> <a href="200507205611_2.html">下一页</a></b></p>
<p><a href="javascript:window.open('http://shuqian.qq.com/post?from=3&title='+encodeURIComponent(document.title)+'&uri='+encodeURIComponent(document.location.href)+'&jumpback=2&noui=1','favit','width=930,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');void(0)" style="text-decoration:none;color:#155da5;display:block;background:url('http://shuqian.qq.com/img/add.gif') no-repeat 0px 0px;height:23px;width:300px;padding:2px 2px 0px 20px;font-size:14px;">将本文收藏到QQ书签与更多好友分享</a></p>
<p><script language=javascript src=/wz/sg.JS></script></p>
</div>
</div>
<div class="user_nav"><p>上一篇:<a href="/Article/10/130/2005/200507205610.html">XmlHttp异步获取网站数据的例子</a></p> <p>下一篇:<a href="/Article/10/130/2005/200507205612.html">ASP用JMail、CDO发送邮件</a> <script language=javascript src=/wz/wangzhai/wangzhai.js></script></p> </div>
<div class="list_menu_b">
<div class="left">
<h2>热门阅读 »</h2>
<ul>
<li class="showlist1">· <a href="/Article/10/138/2005/200507256912.html" title="注册码大全二">注册码大全二</a></li>
<li class="showlist2">· <a href="/Article/10/138/2005/200507256914.html" title="注册码大全四">注册码大全四</a></li>
<li class="showlist1">· <a href="/Article/10/138/2005/200507256911.html" title="注册码大全一">注册码大全一</a></li>
<li class="showlist2">· <a href="/Article/196/197/2005/2005081911736.html" title="要10G免费网络硬盘的请进来!">要10G免费网络硬盘的请进来!...</a></li>
<li class="showlist1">· <a href="/Article/206/2007/2007030319347.html" title="通过google 赶快来赚美金">通过google 赶快来赚美金</a></li>
<li class="showlist2">· <a href="/Article/10/138/2005/200507256919.html" title="注册码大全十">注册码大全十</a></li>
<li class="showlist1">· <a href="/Article/10/138/2005/200507256913.html" title="注册码大全三">注册码大全三</a></li>
<li class="showlist2">· <a href="/Article/14/253/2005/2005092114218.html" title="头像-qq头像(qq新头像)4">头像-qq头像(qq新头像)4</a></li>
<li class="showlist1">· <a href="/Article/13/150/2006/2006022316028.html" title="让你轻松架设FTP服务器1">让你轻松架设FTP服务器1</a></li>
<li class="showlist2">· <a href="/Article/14/244/2005/2005092014121.html" title="梦幻背景图片7">梦幻背景图片7</a></li>
</ul>
</div>
<div class="right">
<h2>相关阅读 »</h2>
<ul>
<li class="showlist11">· <a href="/Article/13/155/2007/2007091721924.html" target="_blank" title="端口列表详解">端口列表详解</a></li>
<li class="showlist12">· <a href="/Article/11/140/2005/200507181554.html" target="_blank" title="Flash MX2004入门与进阶实例(2)">Flash MX2004入门与进阶...</a></li>
<li class="showlist11">· <a href="/Article/10/137/2005/200507182087.html" target="_blank" title="SQL Server数据库技术(106)">SQL Server数据库技术(...</a></li>
<li class="showlist12">· <a href="/Article/11/143/2007/2007092622105.html" target="_blank" title="用Photoshop调整图层给冷酷MM黑白照片上色">用Photoshop调整图层给冷...</a></li>
<li class="showlist11">· <a href="/Article/10/135/2007/2007103122463.html" target="_blank" title="CSS在Dreamweaver中无效的解决方法">CSS在Dreamweaver中无效...</a></li>
<li class="showlist12">· <a href="/Article/13/150/2006/2006022316031.html" target="_blank" title="让你轻松架设FTP服务器4">让你轻松架设FTP服务器4...</a></li>
<li class="showlist11">· <a href="/Article/10/130/2005/200507256933.html" target="_blank" title="蛙蛙推荐:asp中的多条件组合查询实现">蛙蛙推荐:asp中的多条件...</a></li>
<li class="showlist12">· <a href="/Article/10/130/2005/2005110514751.html" target="_blank" title="关于执行IIS与设计ASP程序的小技巧">关于执行IIS与设计ASP程...</a></li>
<li class="showlist11">· <a href="/Article/11/140/2005/2005081611306.html" target="_blank" title="简单的鼠标跟随">简单的鼠标跟随</a></li>
<li class="showlist12">· <a href="/Article/11/143/2005/200507193613.html" target="_blank" title="用 Photoshop 合成的机械头像(13)">用 Photoshop 合成的机械...</a></li>
</ul>
</div>
</div>
</div>
<div id="footer">
<div class="link">
<A href="http://www.jz123.cn/support/about.asp" target="_blank">关于我们</A> |
<A href="http://www.jz123.cn/support/help.asp" target="_blank">网站帮助</A> |
<A href="http://www.jz123.cn/support/advertise.asp" target="_blank">广告合作</A> |
<A href="http://www.jz123.cn/" target="_blank">源码下载</A> |
<A href="http://www.jz123.cn/support/sitemap.asp" target="_blank">网站地图</A> |
<A href="http://www.jz123.cn/support/declare.asp" target="_blank">下载声明</A> |
<font color=red>文章源码投搞:</font>jz123cn@126.com</A>
</div>
<div class="copyright">
Copyright © 2002-2005 <b>jz123<font color=#ffffff>.cn</font></b></font></a>. All Rights Reserved .
<center><script src='http://s6.cnzz.com/stat.php?id=44148&web_id=44148&show=pic' language='JavaScript' charset='gb2312'></script>
</div>
</div>
</div>
</body>
</html>
<span id="naruco_ad_body" style="display:none;">
<script language=javascript src=/adfile/top1.js></script>
</span>
<script type="text/javascript">
var naruco_ad = document.getElementById('naruco_ad');
if (naruco_ad != null) {
naruco_ad.innerHTML=naruco_ad_body.innerHTML;
naruco_ad_body.innerHTML="";
}
</script>