mkopec3 / postgres-pth

These sources, prepared based on this excellent write-up: https://hashcat.net/misc/postgres-pth/postgres-pth.pdf, might be used for quickly building Pass-The-Hash enabled PostgreSQL client software on recent versions of Linux & Windows

Home Page:https://hashcat.net/forum/thread-4148.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PostgreSQL Pass-The-Hash

These sources, prepared based on this excellent write-up: https://hashcat.net/misc/postgres-pth/postgres-pth.pdf, might be used for quickly building Pass-The-Hash enabled PostgreSQL client software on recent versions of Linux & Windows

psql-pth

Getting Started

Prerequisites

Kali Linux Rolling

# apt update && apt install libreadline-dev zlib1g-dev bison flex

Windows 10

Docker

  • Docker :)

Installing

Kali Linux Rolling

Quick mode:

$ wget -q -O- https://raw.githubusercontent.com/mkopec3/postgres-pth/master/kali_homedir_install.sh |sh

Review kali_homedir_install.sh for hints regarding manual installation

Windows 10

Make sure that GnuWin32, Perl and other required tools are visible in PATH. From VS2017 Developer Command Prompt:

\postgres-pth\src\tools\msvc> build psql

Copy \Release\libpq\libpq.dll, \Release\psqlpsql.exe, and vcruntime140.dll (you need to find it) files to the same selected directory

Docker

Refer to Usage section

Usage

Kali Linux Rolling

$ ~/psql-pth/bin/psql -h 127.0.0.1 -p 5432 -U username dbname
Hash for user username: md57bf07133****************1c058d18

Windows 10

$ psql.exe -h 127.0.0.1 -p 5432 -U username dbname
Hash for user username: md57bf07133****************1c058d18

Docker

$ docker run -it mkopec3/postgres-pth -h X.X.X.X -p 5432 -U username dbname
Hash for user username: md57bf07133****************1c058d18

Issues

Report here

Authors

PostgreSQL PTH concept comes from research work done by Jens Steube and Philipp Schmidt, which is well described here.

Thank you guys for your awesome work!

~99% of the code seen here comes from PostgreSQL project. Patches, and other small adjustments have been developed by other unknown or forgotten authors

License

See the COPYRIGHT file for details

About

These sources, prepared based on this excellent write-up: https://hashcat.net/misc/postgres-pth/postgres-pth.pdf, might be used for quickly building Pass-The-Hash enabled PostgreSQL client software on recent versions of Linux & Windows

https://hashcat.net/forum/thread-4148.html

License:Other


Languages

Language:C 86.3%Language:PLpgSQL 5.7%Language:C++ 2.7%Language:Yacc 1.6%Language:Perl 0.9%Language:Makefile 0.8%Language:SQLPL 0.6%Language:Lex 0.5%Language:Shell 0.3%Language:M4 0.2%Language:Objective-C 0.1%Language:Roff 0.1%Language:Ruby 0.1%Language:XS 0.0%Language:Batchfile 0.0%Language:Python 0.0%Language:PLSQL 0.0%Language:DTrace 0.0%Language:Emacs Lisp 0.0%Language:Assembly 0.0%Language:sed 0.0%Language:Perl 6 0.0%Language:Dockerfile 0.0%Language:Csound Score 0.0%