{"action":"closed","issue":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/5922","labels_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/5922/labels{/name}","comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/5922/comments","events_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/5922/events","html_url":"https://github.com/rapid7/metasploit-framework/issues/5922","id":104542888,"number":5922,"title":"exiting cleanly from a shell spawned in a meterpreter session","user":{"login":"kernelsmith","id":620129,"avatar_url":"https://avatars.githubusercontent.com/u/620129?v=3","gravatar_id":"","url":"https://api.github.com/users/kernelsmith","html_url":"https://github.com/kernelsmith","followers_url":"https://api.github.com/users/kernelsmith/followers","following_url":"https://api.github.com/users/kernelsmith/following{/other_user}","gists_url":"https://api.github.com/users/kernelsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/kernelsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kernelsmith/subscriptions","organizations_url":"https://api.github.com/users/kernelsmith/orgs","repos_url":"https://api.github.com/users/kernelsmith/repos","events_url":"https://api.github.com/users/kernelsmith/events{/privacy}","received_events_url":"https://api.github.com/users/kernelsmith/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rapid7/metasploit-framework/labels/meterpreter","name":"meterpreter","color":"5319e7"},{"url":"https://api.github.com/repos/rapid7/metasploit-framework/labels/msfconsole","name":"msfconsole","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-02T18:21:56Z","updated_at":"2015-09-03T00:57:25Z","closed_at":"2015-09-03T00:57:25Z","body":"I'm not sure this is a bug vs operator error, but thought I would bring it up nonetheless.  It doesn't hurt the active meterpreter session, but the errors seem handleable.  Interestingly, this only happens the first time.  If I drop to a shell again and just run exit, I don't get the errors.  Maybe the errors are actually not related to running exit, but rather the output just woven in there to make it look this way.\r\n\r\nMeterp session was created w/an msfvenom-created binary and run from a vmshare drive.  User is an admin, but the payload was not run with \"Run as administrator\".  Payload is windows/meterpreter/reverse_tcp (x86) and run on Win7_x86\r\n\r\n```\r\nmeterpreter > shell\r\nProcess 3004 created.\r\nChannel 1 created.\r\nMicrosoft Windows [Version 6.1.7601]\r\nCopyright (c) 2009 Microsoft Corporation.  All rights reserved.\r\n\r\nC:\\>exit\r\nexit\r\n[-] Failed to spawn shell with thread impersonation. Retrying without it.\r\nProcess 2420 created.\r\nChannel 2 created.\r\nMicrosoft Windows [Version 6.1.7601]\r\nCopyright (c) 2009 Microsoft Corporation.  All rights reserved.\r\n\r\nC:\\>exit\r\nexit\r\n[-] core_channel_interact: Operation failed: The handle is invalid.\r\nmeterpreter >\r\n```\r\n\r\n```\r\nmsf exploit(handler) > version\r\nFramework: 4.11.4-dev-bde504f8\r\nConsole  : 4.11.4-dev-bde504f8.15168\r\nmsf exploit(handler) > ruby -v\r\n[*] exec: ruby -v\r\n\r\nruby 2.1.6p336 (2015-04-13 revision 50298)\r\n```\r\n"}}