Skip to content

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

Notifications You must be signed in to change notification settings

mkopec3/postgres-pth

 
 

Repository files navigation

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

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 86.4%
  • PLpgSQL 5.7%
  • C++ 2.7%
  • Yacc 1.6%
  • Perl 0.9%
  • Makefile 0.8%
  • Other 1.9%