Commit Graph

34 Commits (64bf6910e2ac4c94b9e10abcfcc5235f4ba8c8b1)

Author SHA1 Message Date
Brent Cook 807a27e73d clarify error handling when a channel cannot be opened 2017-02-17 16:59:09 -06:00
Artem 9db2cdb33a Fix close session
Fix close session if remote file is permission deined
2017-02-05 02:00:05 +03:00
Brent Cook bb684bb3b1 tcp channel fixes 2016-12-30 14:59:10 -06:00
OJ d136844d3b Add error handling around double-bind of ports 2016-05-03 10:42:41 +10:00
Brent Cook c250740a81 Fixup finalizers to not double-close Meterpreter objects
We add finalizers to an assortment of Meterpreter-managed objects in order to
clean things up in the event that a post module crashes and does not clean
things up. However, this also means that even a properly-written post module
can lead to an object getting double-closed on the Meterpreter session when the
garbage collector kicks in. This can lead to quite non-deterministic behavior
and crashes.

This change modifies the instance close methods to unregister the finalizer on
close, ensuring we cannot do a double-close automatically if one is requested
explicitly first. As an additional measure, we check an instance variable to
see if we called close directly twice as well. This is not sufficient in
itself, since we do not have a reference to 'self' in the finalizer proc to
check the close state.

This also removes a couple of references to 'self' in the finalizer proc
itself, which may cure some memory leaks as well due to circular references.
2016-03-02 21:43:51 -06:00
Jonathan 575072585f removed shebangs from files within rex 2013-11-07 18:51:59 -05:00
Tab Assassin 7e5e0f7fc8 Retab lib 2013-08-30 16:28:33 -05:00
HD Moore d656e3185f Mark all libraries as defaulting to 8-bit strings 2012-06-29 00:18:28 -05:00
HD Moore 9220506ba2 Merge in recent meterpreter work. These are not the commits you are looking for (more info on what all this is later this week).
git-svn-id: file:///home/svn/framework3/trunk@13053 4d416f70-5f16-0410-b530-b9f4589650da
2011-06-28 21:26:43 +00:00
HD Moore fba2cb6d2d Remove the response wait for close calls triggered by the finalizer, should help in a few corner cases that currently result in a timeout or hang.
git-svn-id: file:///home/svn/framework3/trunk@10876 4d416f70-5f16-0410-b530-b9f4589650da
2010-11-03 03:03:29 +00:00
HD Moore 3e09fc30ae Fixes #2070 by adding finalizers to process, event, thread, registry, and channels.
git-svn-id: file:///home/svn/framework3/trunk@10711 4d416f70-5f16-0410-b530-b9f4589650da
2010-10-16 19:39:11 +00:00
Stephen Fewer 4b4b2d62b1 Commit the Ruby side for channel/TLV compression.
git-svn-id: file:///home/svn/framework3/trunk@8516 4d416f70-5f16-0410-b530-b9f4589650da
2010-02-16 14:58:23 +00:00
HD Moore e731426666 Fixes #662. The socket pivoting is still not perfect, but this goes a long way
git-svn-id: file:///home/svn/framework3/trunk@7792 4d416f70-5f16-0410-b530-b9f4589650da
2009-12-10 05:40:26 +00:00
HD Moore 54c10c0c3d Fixes #623 and fixes #622, implements a number of changes to the core channel dispatch code, sets timeouts on unmatched responses, and handles tcp relay writes with a threaded/timeout wrapper to avoid delays.
git-svn-id: file:///home/svn/framework3/trunk@7753 4d416f70-5f16-0410-b530-b9f4589650da
2009-12-08 18:32:26 +00:00
HD Moore 2c92856612 Fixes #604. This fixes a long-standing race condition with meterpreter channels that received data as soon as they were open (TCP).
git-svn-id: file:///home/svn/framework3/trunk@7708 4d416f70-5f16-0410-b530-b9f4589650da
2009-12-04 21:08:34 +00:00
HD Moore 8cadfe66cf Mostly cosmetic
git-svn-id: file:///home/svn/framework3/trunk@7530 4d416f70-5f16-0410-b530-b9f4589650da
2009-11-16 15:16:08 +00:00
Ramon de C Valle f124597a56 Code cleanups
git-svn-id: file:///home/svn/framework3/trunk@5773 4d416f70-5f16-0410-b530-b9f4589650da
2008-10-19 21:03:39 +00:00
HD Moore 88658064df /usr/bin/ruby vs /usr/bin/env ruby
git-svn-id: file:///home/svn/incoming/trunk@3242 4d416f70-5f16-0410-b530-b9f4589650da
2005-12-17 06:46:23 +00:00
Matt Miller 95f8210853 major doc update
git-svn-id: file:///home/svn/incoming/trunk@3029 4d416f70-5f16-0410-b530-b9f4589650da
2005-11-15 05:22:13 +00:00
Matt Miller 0a67ecab42 a few things I needed to commit
git-svn-id: file:///home/svn/incoming/trunk@2839 4d416f70-5f16-0410-b530-b9f4589650da
2005-08-12 14:45:54 +00:00
Matt Miller 2173ba8fc8 channel listing foo
git-svn-id: file:///home/svn/incoming/trunk@2836 4d416f70-5f16-0410-b530-b9f4589650da
2005-07-26 05:15:46 +00:00
Matt Miller 7eb2c68d58 fix interactive channels
git-svn-id: file:///home/svn/incoming/trunk@2833 4d416f70-5f16-0410-b530-b9f4589650da
2005-07-26 04:08:01 +00:00
Matt Miller f07ae8dcb0 more foo
git-svn-id: file:///home/svn/incoming/trunk@2832 4d416f70-5f16-0410-b530-b9f4589650da
2005-07-26 02:01:27 +00:00
Matt Miller 632a97823f moved some code around for interactive channels, still not functional yet, boohoo
git-svn-id: file:///home/svn/incoming/trunk@2797 4d416f70-5f16-0410-b530-b9f4589650da
2005-07-19 04:21:15 +00:00
Spoon M 7bbae355d6 mass require moving of /lib
git-svn-id: file:///home/svn/incoming/trunk@2690 4d416f70-5f16-0410-b530-b9f4589650da
2005-07-09 21:18:49 +00:00
Matt Miller 42e9b0945e added shutdown, tcp seems to work like a chizzamp
git-svn-id: file:///home/svn/incoming/trunk@2441 4d416f70-5f16-0410-b530-b9f4589650da
2005-04-22 03:42:23 +00:00
Matt Miller aeb885372d worked on the socket api some more, tcp client connections working
git-svn-id: file:///home/svn/incoming/trunk@2437 4d416f70-5f16-0410-b530-b9f4589650da
2005-04-21 06:32:01 +00:00
Matt Miller f4264ed7d5 moved registry/process around to be under sys, implemented process.memory and process attaching
git-svn-id: file:///home/svn/incoming/trunk@2377 4d416f70-5f16-0410-b530-b9f4589650da
2005-04-15 06:23:59 +00:00
Matt Miller 3338ebb82c more channel foo
git-svn-id: file:///home/svn/incoming/trunk@2376 4d416f70-5f16-0410-b530-b9f4589650da
2005-04-13 08:19:22 +00:00
Matt Miller f43c076313 added eof
git-svn-id: file:///home/svn/incoming/trunk@2373 4d416f70-5f16-0410-b530-b9f4589650da
2005-04-12 06:39:33 +00:00
Matt Miller 6c1a8e51e5 improving channel support, File is now backed against a File Pool instance rather than directly against a channel
git-svn-id: file:///home/svn/incoming/trunk@2371 4d416f70-5f16-0410-b530-b9f4589650da
2005-04-12 05:37:11 +00:00
Matt Miller b18593c4eb fixed dword set
git-svn-id: file:///home/svn/incoming/trunk@2369 4d416f70-5f16-0410-b530-b9f4589650da
2005-04-11 15:45:33 +00:00
Matt Miller 593bc26ff2 pimptastic
git-svn-id: file:///home/svn/incoming/trunk@2367 4d416f70-5f16-0410-b530-b9f4589650da
2005-04-11 05:50:10 +00:00
Matt Miller 7556674686 file i/o working
git-svn-id: file:///home/svn/incoming/trunk@2365 4d416f70-5f16-0410-b530-b9f4589650da
2005-04-11 04:56:24 +00:00