Write an ASP code executor

Source: Internet
Author: User
Tags define exit chr error code split trim

Save As Runasp.asp run. Account password Admin, login after the input code can be implemented!!

<% @ 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 script running ASP code!" > ")
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 "Did not enter the code to run!"
Response.Write "<br><br><a href=" "Javascript:window.history.back ();" " > Back to run Page </a><br><br> "
Response.Write "<a href=" "Action=exit" "> Exit Login </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")
Todo
Tempsql2=replace (TEMPSQL2,VBCRLF&AMP;VBCRLF,VBCRLF)
Loop while InStr (TEMPSQL2,VBCRLF&AMP;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 > Code completed!</font>")
End If
Else
%>
Enter the ASP code to run:
<form method=post action= "? Action=runcode" style= "margin:0px;" >
<textarea name= "sqlmutistr" wrap= ' off ' rows= "style=" Width:100%;height:100%;table-layout:fixed;word-break: Break-all; " ><%=server.htmlencode (SQLMUTISTR)%></textarea>
<br>
<input type= "button" value= "Louout" >
<input type= "Reset" value= "clear" >
<input type= "Submit" value= "Run ASPCode" >
</FORM>
<% End If
Else
Call Loginmain ()
End If
Response.Write ("</BODY></HTML>")
End IF '-------TOT

SUB Loginmain ()
%>

<form method=post action= "? Action=chkpass" > Username:<input type= "text" name= "UserName" ><br>
Password:<input type= "PassWord" name= "Runpassword" ><br>
Checkcode:<input type= "GetCode" name= "GetCode" > "><br>
<br><input type= "Submit" value= "Login" ></FORM>
<%
End SUB

function Checkpass ()
Dim Username,runpassword,getcode
Dim errinfo
Checkpass= ""
Username=trim (Request.Form ("UserName"))
Runpassword=trim (Request.Form ("Runpassword"))
Getcode=request.form ("GetCode")
If Username= "" or runpassword= "" Then
errinfo=errinfo& "<li> username and password input cannot be blank"
End If
If not IsNumeric (GetCode) Then
errinfo=errinfo& "<li> Please enter a digital check code"
End If
If errinfo<> "" Then
Call Loginmain ()
Endproc Errinfo
End If
If action= "Chkpass" and Session ("GetCode") =int (GetCode) and Username=susername and Runpassword=spassword then
Session ("GetCode") =0
checkpass= "1"
Else
Call Loginmain ()
Endproc "Login failed!" Please reconfirm the correct input "
End If
End Function

SUB Executeit (exstring)
On Error Resume Next
Execute (exstring)
If Err.number<>0 Then
Response.Write "<div style=" "Background-color: #ffeedd;p adding:6px;" " > "
Response.Write "Response.Write "error message: <li><font color= #ff0000 >" &err.description& "</font>"
Response.Write "Response.Write "Error code: <li><font color= #0000ff >" &htmlencode (exstring) & "</font>"
Response.Write "End If
On Error Goto 0
End SUB

function HTMLEncode (restring)
Dim str:str=restring
If not IsNull (STR) Then
str = replace (str, ">", ">")
str = replace (str, "<", "<")
str = Replace (str, CHR (32), "")
str = Replace (str, CHR (9), "")
str = Replace (str, CHR (34), "") ""
str = Replace (str, CHR (39), "'") "
str = Replace (str, CHR (13), "")
str = Replace (str, CHR (a) & CHR (a), "</P><P>")
str = Replace (str, CHR (Ten), "<BR>")
HTMLEncode = Str
Else
Htmlencode= ""
End If
End Function

' Breakpoint Debug num=0 Interrupt
Sub Response_write (Str,num)
Dim istr:istr=str
Dim inum:inum=num
Response.Write str& "<br>"
If Inum=0 then Response.End
End Sub

SUB Endproc (Info)
Response.Write "Response.Write Info
Response.Write "Response.Write "<a href=" "Action=exit" "> Exit Login </a>"
Response.End
End SUB
%>
<script language= "JScript" runat= "Server" >
function Getno (num) {
var numarray=[
["0", "0", "0", "3c", "a", "", "", "", "", "", "" "," "," "," "," "," "3c", "0", "0", "0"],
["0", "0", "0", "30", "38", "30", "30", "30", "30", "30", "30", "30", "30", "0", "0", "0"],
["0", "0", "0", "3c", "June", "a", "a", "" "," "," C "," 6 "," 6 "," 7e "," 0 "," 0 "," 0 "],
["0", "0", "0", "3c", "a", "", "", "", "", "", "", "", "", "" 3c "," 0 "," 0 "," 0 "],
["0", "0", "0", "", "", "" "," "," "," "," "," "7e", "30", "78", "0", "0", "0"],
["0", "0", "0", "7e", "6", "6", "6", "3e", "a", "a", "a", "a", "3c", "0", "0", "0"],
["0", "0", "0", "" "," C "," 6 "," 6 "," 3e "," a "," a "," a "," the "," 3c "," 0 "," 0 "," 0 "],
["0", "0", "0", 7e "," June "," C "," a "," "", "", "", "", "" C "," C. "," 0 "," 0 "," 0 "],
["0", "0", "0", "3c", "the" "," "," "," "", "" "," "", "" "," "", "", "", "" "," "3c", "0", "0", "0"],
["0", "0", "0", "3c", "a", "a", "a", "the", "7c", "," "," "," "," 1c "," 0 "," 0 "," 0 "]
];
var str=[];
Num=string (num). Split ("");
for (Var i=0;i<numarray[0].length;i++)
for (Var j=0;j<num.length;j++)
Str[str.length]= ("0x" +numarray[num[j]][i]);
var str1= "#define Counter_width" +J*8;
var str2= "#define Counter_height 16";
Return Str1+string.fromcharcode (13,10) +str2+string.fromcharcode (13,10) + "static unsigned char counter_bits[]={" +str +"}";
}
function Getrnd (Num) {
Return Math.floor (Math.random () *math.pow (10,num));
}
function Numcodejs ()
{
Response.buffer=true
var znum;
var znum=getrnd (4);
if (znum<1000) znum+=999;
Session ("GetCode") = Znum;
Response.contenttype= "Image/x-xbitmap";
Session ("GetCode") = Znum;
Response.Write (Getno (Znum));
}
</script>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.