Simple application of SQL Server extended stored procedure xp_cmdshell
Source: Internet
Author: User
xp_cmdshell stored procedure is the execution of the local cmd command, requiring the system to log in with the SA permission, that is, if you get the SA command of SQL Server, you can do whatever the target machine, the well-known software "streamer" use should also be this stored procedure to achieve the operation on the target machine.
Here is a simple application page (ASP) that I wrote, and the code is as follows.
Cmd. Asp
<t ' >% @LANGUAGE = "VBSCRIPT" codepage= "936"%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title>sqlserver_xp_cmdshell Example _ Magician Liu </title>
<style type= "Text/css" >
<!--
body{
font-size:13px;
line-height:20px;
width:760;
Scrollbar-face-color: #2896e1;
Scrollbar-shadow-color: #6cb4d8;
Scrollbar-arrow-color: #f0f0f0;
Scrollbar-darkshadow-color: #2896e1;
Scrollbar-base-color: #2896e1;
Background-image:url (images/bg.gif);
}
. lbr{
border-top:0px solid #336699;
border-left:1px solid #336699;
border-right:1px solid #336699;
border-bottom:1px solid #336699;
}
. all_h {
border:1px solid #336699;
}
. Input {
border:1px solid #336699;
Background-color: #ECEAFD;
}
. lb{
border-top:0px solid #336699;
border-left:1px solid #336699;
border-right:0px solid #336699;
border-bottom:1px solid #336699;
}
. N1 {font-weight:bold;color: #339933; font-size:13px;}
. N2 {font-weight:bold;color: #ff0000; font-size:13px;}
-->
</style>
<body>
<%if request ("cmd") <> "then%>
<table width=400 border=0 align=center cellpadding=5 cellspacing=0>
<tr align=center>
<TD height=30 class=all_h bgcolor= #B3E0FF ><span Class=n1>xp_cmdshell Request Results </span></td>
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