From 4b8dab523e2ff3c39722af99fb2a9d057fcf6764 Mon Sep 17 00:00:00 2001 From: Ayoma Wijethunga Date: Sun, 24 Jan 2021 23:09:52 +0530 Subject: [PATCH 1/3] Add PostgreSQL Check if Current User is Supperuser --- SQL Injection/PostgreSQL Injection.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SQL Injection/PostgreSQL Injection.md b/SQL Injection/PostgreSQL Injection.md index 18a5b90..b1e7acc 100644 --- a/SQL Injection/PostgreSQL Injection.md +++ b/SQL Injection/PostgreSQL Injection.md @@ -9,6 +9,7 @@ * [PostgreSQL List Password Hashes](#postgresql-list-password-hashes) * [PostgreSQL List Database Administrator Accounts](#postgresql-list-database-administrator-accounts) * [PostgreSQL List Privileges](#postgresql-list-privileges) +* [PostgreSQL Check if Current User is Supperuser](#postgresql-check-if-current-user-is-supperuser) * [PostgreSQL database name](#postgresql-database-name) * [PostgreSQL List databases](#postgresql-list-database) * [PostgreSQL List tables](#postgresql-list-tables) @@ -70,6 +71,14 @@ SELECT usename FROM pg_user WHERE usesuper IS TRUE SELECT usename, usecreatedb, usesuper, usecatupd FROM pg_user ``` +## PostgreSQL Check if Current User is Supperuser + +```sql +SHOW is_superuser; +SELECT current_setting('is_superuser'); +SELECT usesuper FROM pg_user WHERE usename = CURRENT_USER; +``` + ## PostgreSQL Database Name ```sql From cd6f5493b304e4461dd607a8c3db90e61623bc59 Mon Sep 17 00:00:00 2001 From: Swissky <12152583+swisskyrepo@users.noreply.github.com> Date: Sun, 24 Jan 2021 18:43:28 +0100 Subject: [PATCH 2/3] Update PostgreSQL Injection.md --- SQL Injection/PostgreSQL Injection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SQL Injection/PostgreSQL Injection.md b/SQL Injection/PostgreSQL Injection.md index b1e7acc..b919a8e 100644 --- a/SQL Injection/PostgreSQL Injection.md +++ b/SQL Injection/PostgreSQL Injection.md @@ -9,7 +9,7 @@ * [PostgreSQL List Password Hashes](#postgresql-list-password-hashes) * [PostgreSQL List Database Administrator Accounts](#postgresql-list-database-administrator-accounts) * [PostgreSQL List Privileges](#postgresql-list-privileges) -* [PostgreSQL Check if Current User is Supperuser](#postgresql-check-if-current-user-is-supperuser) +* [PostgreSQL Check if Current User is Superuser](#postgresql-check-if-current-user-is-superuser) * [PostgreSQL database name](#postgresql-database-name) * [PostgreSQL List databases](#postgresql-list-database) * [PostgreSQL List tables](#postgresql-list-tables) From 4e17d6c2b3d8fb7c206b032aa0c34bf35968301d Mon Sep 17 00:00:00 2001 From: Swissky <12152583+swisskyrepo@users.noreply.github.com> Date: Sun, 24 Jan 2021 18:43:58 +0100 Subject: [PATCH 3/3] Update PostgreSQL Injection.md --- SQL Injection/PostgreSQL Injection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SQL Injection/PostgreSQL Injection.md b/SQL Injection/PostgreSQL Injection.md index b919a8e..dbf7d24 100644 --- a/SQL Injection/PostgreSQL Injection.md +++ b/SQL Injection/PostgreSQL Injection.md @@ -71,7 +71,7 @@ SELECT usename FROM pg_user WHERE usesuper IS TRUE SELECT usename, usecreatedb, usesuper, usecatupd FROM pg_user ``` -## PostgreSQL Check if Current User is Supperuser +## PostgreSQL Check if Current User is Superuser ```sql SHOW is_superuser;