https://github.com/darkcodersc/execute-shellcode-pgext
Postgres Extension to Execute Shellcodes
https://github.com/darkcodersc/execute-shellcode-pgext
postgresql postgresql-extension python shellcode
Last synced: 3 months ago
JSON representation
Postgres Extension to Execute Shellcodes
- Host: GitHub
- URL: https://github.com/darkcodersc/execute-shellcode-pgext
- Owner: DarkCoderSc
- Created: 2020-11-27T11:54:10.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-27T11:57:27.000Z (over 4 years ago)
- Last Synced: 2025-03-18T20:40:46.404Z (4 months ago)
- Topics: postgresql, postgresql-extension, python, shellcode
- Language: C
- Homepage:
- Size: 2.93 KB
- Stars: 14
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Postgres Shellcode Execute Extension
More information: https://www.phrozen.io/resources/paper/41df297b-cfe3-43ec-88e8-0686e5548dd5
## Compile Extension (Mingw 64bit / Microsoft Windows)
### Postgresql 13.1 (Adapt with your version)
`x86_64-w64-mingw32-gcc.exe PgShellcodeExt.c -c -o PgShellcodeExt.o -I "C:\Program Files\PostgreSQL\13\include" -I "C:\Program Files\PostgreSQL\13\include\server" -I "C:\Program Files\PostgreSQL\13\include\server\port\win32"`
`x86_64-w64-mingw32-gcc.exe -o PgShellcodeExt.dll -s -shared PgShellcodeExt.o -Wl,--subsystem,windows`
### Register and execute extension (Requires privileged postgres user)
```
-- Register new function
CREATE OR REPLACE FUNCTION shellcode() RETURNS void AS 'PgShellcodeExt.dll', 'shellcode' LANGUAGE C STRICT;-- Trigger function
SELECT shellcode();-- Delete function
DROP FUNCTION IF EXISTS shellcode;
```