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

This branch is 18 commits ahead of, 23231 commits behind postgres/postgres:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6fa9905 · Feb 1, 2019
Feb 10, 2015
Feb 21, 2015
Feb 27, 2015
Nov 6, 2018
Aug 14, 2013
Oct 1, 2014
Dec 18, 2014
Jan 6, 2015
Jan 20, 2019
Apr 15, 2014
Feb 12, 2014
Feb 15, 2011
Feb 11, 2014
Feb 11, 2014
Jan 20, 2019
Feb 1, 2019
Sep 20, 2010
Nov 5, 2018
Feb 10, 2015
Nov 8, 2018
Nov 15, 2018

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%