exploit 및 windows/meterpreter/reverse_tcp와 같은 staged 페이로드 선택
이 단계에서는 Metasploit Framework 콘솔을 실행하고 일반적인 exploit 핸들러를 선택합니다. 그런 다음 일반적인 staged 페이로드를 사용하도록 구성합니다. exploit/multi/handler 모듈을 사용하는 이유는 특정 취약한 대상이 필요 없이 페이로드를 시연하는 데 완벽한 범용 리스너이기 때문입니다.
먼저 터미널을 열고 Metasploit 콘솔을 시작합니다. 시작 배너를 건너뛰기 위해 -q (quiet) 플래그를 사용합니다.
msfconsole -q
Metasploit 프롬프트 (msf6 >) 가 표시되면 exploit 핸들러를 선택해야 합니다.
use exploit/multi/handler
다음으로 페이로드를 설정합니다. staged 페이로드의 이름은 일반적으로 platform/stage/stager 형식으로 지정됩니다. 예를 들어, windows/meterpreter/reverse_tcp는 플랫폼이 Windows 이고, 최종 페이로드 (stage) 는 Meterpreter 이며, 초기 연결 방법 (stager) 은 reverse TCP 쉘임을 의미합니다.
다음 명령으로 staged 페이로드를 설정합니다.
set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp라는 확인 메시지가 표시됩니다. 확실히 하기 위해 현재 구성을 볼 수 있습니다.
show options
옵션에 페이로드가 나열된 것을 볼 수 있습니다. 실제로 exploit 을 실행하는 것이 아니라 페이로드의 속성을 검사하는 것이므로 LHOST 또는 LPORT를 설정할 필요가 없습니다.
msf6 exploit(multi/handler) > show options
Module options (exploit/multi/handler):
Name Current Setting Required Description
---- --------------- -------- -----------
Payload options (windows/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none)
LHOST yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Wildcard Target