当前位置:Gxlcms > 数据库问题 > SQL学习

SQL学习

时间:2021-07-01 10:21:17 帮助过:24人阅读

cmd.exe dir c: EXEC master.dbo.xp_cmdshell ping

分别为通过数据库master,利用xp_cmdshell 来执行cmd 和 ping。

 

开启方式:

1、使用sql语句开启

  通过查询分析器,选择Master数据库,然后执行以下SQL内容:

sp_configure show advanced options,1
reconfigure
go
sp_configure xp_cmdshell,1
reconfigure
go

 执行后结果:

  配置选项 ‘show advanced options‘ 已从 0 更改为 1。请运行 RECONFIGURE 语句进行安装。
  配置选项 ‘xp_cmdshell‘ 已从 0 更改为 1。请运行 RECONFIGURE 语句进行安装。

 注:如需关闭只需将“sp_configure ‘xp_cmdshell‘,1”改为“sp_configure ‘xp_cmdshell‘,0”即可。

2、SQL SERVER "外围应用配置器"开启:https://www.cnblogs.com/TBW-Superhero/p/6871982.html。

除了xp_cmdshell外,还有一些其他的存储过程也可以利用,例如xp_regread可以操作注册表,xp_servicecontrol(允许用用户,启动、停止服务)。

3、存储过程本身也可能存在注入漏洞,加入参数由外部传入,并且没有经过任何处理,进有可能造成注入。

 

SQL学习

标签:.com   可谓   分析   用户   分析器   web   shel   cti   lib   

人气教程排行