Coder Social home page Coder Social logo

rastating / pga4decrypt Goto Github PK

View Code? Open in Web Editor NEW
20.0 3.0 10.0 55 KB

A tool for recovering server credentials from a pgadmin4 database

License: GNU General Public License v3.0

Makefile 0.74% Python 99.26%
security postgres pgadmin4 pentesting pentest-tools

pga4decrypt's Introduction

What is pga4decrypt?

It is a Python3 script to recover the plain-text credentials of servers stored within a pgadmin4 database.

Quick Start

# Clone the source code and install the dependencies
git clone [email protected]:rastating/pga4decrypt.git
cd pga4decrypt
pip install -r requirements.txt

# Launch pga4decrypt against the sample database
./pga4decrypt test/pgadmin4.db

Usage

usage: pga4decrypt [-h] [-f {text,json}] [-o PATH] path

A tool for recovering server credentials from a pgadmin4 database

positional arguments:
  path            Path to the database (typically named pgadmin4.db)

optional arguments:
  -h, --help      show this help message and exit
  -f {text,json}  The output format for the -o option (default: text)
  -o PATH         Path to a file to save the credentials in

Examples

Run without an output file

$ ./pga4decrypt test/pgadmin4.db                          

Decrypted 3 sets of credentials

Name: Server 2
Host: 10.8.0.101
Port: 5432
Username: billy
Password: DespiteAllMyRageIAmStillJustARatInACage
-----------------------------------
Name: Server 3
Host: 10.8.0.102
Port: 5432
Username: billy
Password: iamone
-----------------------------------
Name: Server 1
Host: 10.8.0.100
Port: 5432
Username: alice
Password: GetOutOfMySwamp
-----------------------------------

Save to a JSON file

$ ./pga4decrypt test/pgadmin4.db -o ~/example.json -f json

Decrypted 3 sets of credentials

Name: Server 2
Host: 10.8.0.101
Port: 5432
Username: billy
Password: DespiteAllMyRageIAmStillJustARatInACage
-----------------------------------
Name: Server 3
Host: 10.8.0.102
Port: 5432
Username: billy
Password: iamone
-----------------------------------
Name: Server 1
Host: 10.8.0.100
Port: 5432
Username: alice
Password: GetOutOfMySwamp
-----------------------------------

$ cat ~/example.json| json_pp
[
   {
      "password" : "DespiteAllMyRageIAmStillJustARatInACage",
      "username" : "billy",
      "port" : 5432,
      "name" : "Server 2",
      "host" : "10.8.0.101"
   },
   {
      "password" : "iamone",
      "port" : 5432,
      "username" : "billy",
      "name" : "Server 3",
      "host" : "10.8.0.102"
   },
   {
      "host" : "10.8.0.100",
      "password" : "GetOutOfMySwamp",
      "username" : "alice",
      "name" : "Server 1",
      "port" : 5432
   }
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.