SQLSERVER擴充預存程序XP_CMDSHELL的簡單應用

來源:互聯網
上載者:User
XP_CMDSHELL預存程序是執行原生CMD命令,要求系統登陸有SA許可權,也就是說如果獲得SQLSERVER的SA命令,那就可以在目標機為所欲為了,知名軟體“流光”使用的應該也是這個預存程序來實現在目標機上的操作。
下面是我寫的一個簡單的應用頁面(ASP),代碼如下。
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">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>SQLSERVER_XP_CMDSHELL執行個體_魔術師·劉</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>
</head>
<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請求結果</span></td>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.