1
mirror of https://github.com/rapid7/metasploit-payloads synced 2024-12-08 23:33:07 +01:00
Commit Graph

508 Commits

Author SHA1 Message Date
OJ
407fce7ef8 Fix call to thread_create 2013-11-08 07:22:59 +10:00
OJ
49461c0382 Merge branch 'master' into webcam_crash_fix 2013-11-08 07:21:11 +10:00
James Lee
07aec8068b Land #40, fix for ipv6 ipconfig 2013-11-07 14:44:27 -06:00
James Lee
3cbf7486d4 Land #34, command refactor 2013-11-06 15:33:52 -06:00
James Lee
11d39347b4 Fix typo 2013-11-06 15:30:11 -06:00
Tod Beardsley
dcdbb4228e Land #48, containing #39, #42, and #43
This lands #39, #42, and #43. #34 still needs work.
2013-11-05 20:07:26 -06:00
Tod Beardsley
4d0bea22e9 Empty commit to close #46.
Closes #46. Now that these PRs are landed, no need to keep #46 open.
Discussion should continue on #34 and possibly #38.
2013-11-05 20:05:47 -06:00
Tod Beardsley
ca20beb447 Post V2013, Land #43, getproxy
See also #46
2013-11-05 20:00:29 -06:00
Tod Beardsley
8f3dfc575d Post V2013, Land #42, update incognito
See also #46
2013-11-05 19:59:56 -06:00
Tod Beardsley
48c61f2840 Post V2013, Land #39, sysinfo for 8.1/2012R2
See also #46
2013-11-05 19:58:22 -06:00
OJ
afc88f9437 Remove use of BREAK_ON_ERROR from posix code
POSIX no likey BREAK_ON_ERROR, it fails at runtime. Replaced with portable code.
2013-11-05 10:42:49 +10:00
OJ
fb4b6f6398 Remove unused forward declarations 2013-11-05 07:52:04 +10:00
OJ
227335c312 Clean, tidy and add documentation
This commit tidies up the webcam code, adds documentation and adds a
couple of small clean-ups and optimisations around resource usage.

`audio.h` is not included in `webcam.h` any more as it's not needed at all
by that code, however it has been added to `precomp.h` so that `stdapi.c`
can use and see it along with the other files.
2013-11-03 20:00:35 +10:00
OJ
e7f5764d14 Merge branch 'master' into webcam_crash_fix 2013-11-03 17:11:12 +10:00
Tod Beardsley
5a18e35499 Minor README update warning against VS2012. 2013-11-01 15:31:00 -05:00
OJ
5986ccf235 Add the getproxy command
This allows for system proxy setting to be pulled out. Windows-only at
this point.
2013-10-30 17:25:51 +10:00
OJ
103eedf550 Merge branch 'master' into ipconfig_ipv6 2013-10-30 13:42:54 +10:00
OJ
ca9c0006ee Merge branch 'master' into sysinfo_version 2013-10-30 13:42:08 +10:00
OJ
026447d011 Merge branch 'upstream/master' into command_refactor
Conflicts:
	make.bat
2013-10-30 13:38:41 +10:00
Brandon Turner
e44f8a6e85 Merge pull request #41 from OJ/vs2013
Upgrade to VS 2013
2013-10-29 20:15:57 -07:00
OJ
46f64a8f69 Update incognito to v2
Pulled the latest version of the incognito code from:
http://labs.mwrinfosecurity.com/blog/2012/07/18/incognito-v2-0-released/

This included a fix for Windows 2003 x64, which was reported as a bug in
RM 8281.
2013-10-29 19:48:40 +10:00
OJ
288b2bad41 Upgrade to VS 2013 2013-10-29 13:46:46 +10:00
OJ
8fe249dd52 Fix ipconfig command to show IPv6
This commit also contains fixes for proper extraction of subnet masks
based on operating system.
2013-10-29 10:21:09 +10:00
OJ
599b9ec1d8 Add Windows 8.1 and Windows 2012 R2
Checking version info now has support for the later versions of windows
based on the documentation available from MSDN.
2013-10-28 15:42:31 +10:00
Tod Beardsley
8409791deb Land #37, apt-get update before each build 2013-10-24 16:06:54 -05:00
Tod Beardsley
91f96cb394 Explicitly apt-get update every time?
Trying to fix the failing travis build,

https://travis-ci.org/rapid7/meterpreter/builds/13001986
2013-10-24 15:40:40 -05:00
Tod Beardsley
6a446637b5 Land #32, strcpy cleanup
Housekeeping against potential BOFs.
2013-10-24 14:07:38 -05:00
OJ
a0d01df0e0 Fix small issue with make
Make now correctly loads the environment automatically if it can find it.
2013-10-18 20:34:59 +10:00
Meatballs
ba93cec3f1 Land #35, FormatMessage may fail even when GetLastError is not 0. 2013-10-18 08:59:01 +01:00
OJ
750c7b718a Fix invalid thread_create calls on posix
I'm such a noob. My grep-fu was weak with this one.
2013-10-18 07:36:54 +10:00
OJ
6f8a2755f1 Better errors when formatmessage fails in railgun
Previous change stopped the session from crashing on NULL, but this change
actually has more realistic messages coming back intead of always
indicating that things happened correctly. It's still up to the caller to
check the return code to make sure it's ok
2013-10-18 07:23:50 +10:00
OJ
719dbe2b51 PR tidy based on feedback
* Updated `thread_create` so that it has 3 parameters, and removed
  `thread_create3`.
* Updated all calls to `thread_create` and added the extra parameter of
  `NULL`.
* Fixed comment typo.
* Removed assignment where value is not used.
* Checked for `NULL` prior to setting the result.
* Undefined `DEBUGTRACE`.
2013-10-18 06:30:31 +10:00
Meatballs
49fe53fef1 Land #33, Fix XP SP3 Railgun Crashes 2013-10-17 20:10:38 +01:00
OJ
3b40f1abd0 Command refactor for clean shutdown + inline calls
This work contains a bunch of changes around command dispatching. The
goals for this bit of work were to:

* Provide the ability for commands to be executed on the same thread as
  the server rather than always creating new threads and executing them on
  those threads.
* Have the means for _special_ commands, such as `exit` and `migrate` to
  shut down the server cleanly without having to rely on signalling across
  threads or by doing brutal thread termination via shared global handles.
  This should not only fix the dirty shutdown problem on Windows which
  leaves tasks dangling (or based on the prior attempt at fixing, crashing
  stuff as well), it should also help clean up the shutdown process in
  POSIX.

These changes hit a very important part of Meterpreter and so should be
reviewed with intense scrutnity. I expect this PR to garner a log of
critique and most likely a number of changes before being included in the
main line.

The `PacketDispatcher` was modified to include a new function pointer
called an `inline_handler`. This new member indicates that there's a
handler which should be invoked inline. While this sits alongside the
existing `handler`, they are actually mutually exclusive. If an
`inline_handler` is specified then the `handler` is ignored and it is
assumed that the command is intended to be handled inline. The signature
of the inline handler is different to the standard handler, and this is
why a new function pointer was added rather than a simple flag. Addition of
this parameter meant that the basic command structure changed, and that
obviously affects all of the extensions and their respective commands.
This changeset therefore updates each of those command declarations so
that they use the new macros that hide this detail.

Other things to be mindful of:

* This version of the code reads the command's `method` prior to invoking
  any other function, and after that the command itself is passed around to
  the threaded or non-threaded routes for invocation. An extra thread
  parameter was included as as result, and an overload for the
  `thread_create` function was added which supported this new parameter.
  This was named `thread_create3` because
  `thread_create_with_another_paramter` sounded a bit crap.
* The migration code, which originally had a `thread_kill` and an event
  wait once the new meterpreter session had been created, has been modified
  to not do any waiting at all. Instead it finishes execution as fast as
  possible and returns control to the server which should respond by
  shutting down in a clean way.
* Originally the code always attempted to call a command handler in the
  base command list and then, if found, would also call an "overload" in
  the extension commands list. From the investigation that I did, it
  appears that the overloaded methods did nothing in the base (they'd
  early out during invocation). As a result, the new way of doing things
  acts like a 'true' overload in that the extension commands are searched
  first, and if one is found this is the command that is executed. Any
  base commands with the same method name will not get executed. In the
  case where there is no extension command found, the base command list is
  then queried. If a command is found that command is instead invoked.
* The POSIX version still compiles cleanly, but I've never been able to
  build a version that runs on my machines. I'm not sure if there's a
  trick to getting POSIX builds to run, and if there is I don't know it.
  Whoever scrutinises this build should make sure that the POSIX version
  that they build can still run and (hopefully) exit cleanly.

I've added lots of documentation, but there's always room for improvement.

Hopefully this will fix the `*_tcp` side of Redmine 8438.

Bring on the feedback!
2013-10-17 22:36:49 +10:00
OJ
4a6661bd0a Fix railgun crash on XP SP3
Fix issue where the railgun API was relyling on FormatMessage returning a
valid pointer when the error is `ERROR_SUCCESS`. On some platforms, such
as XP SP3, the function would return a NULL pointer for this case. This
fix makes sure that in the case of a NULL pointer the error message is set
to a value that matches that found on other platforms.

[FixRM 8505]
2013-10-17 20:25:25 +10:00
James Lee
259545172f Whitespace 2013-10-16 20:03:47 -05:00
James Lee
648d341588 Land #29, new 'bare' extension
Replaces 'boiler'
2013-10-16 20:00:06 -05:00
James Lee
12140d10b4 Land #31, doxygen 2013-10-16 19:44:03 -05:00
OJ
29ffd4c1d1 Fix exclude config to ignore unnecessary content
Updated to use `EXCLUDE_PATTERNS` instead of `EXCLUDE_PATHS`. This
properly excludes the source of the libraries we use and also the
generated output on POSIX.

Thanks again to @jlee-r7 for the catch.
2013-10-17 10:39:13 +10:00
OJ
9b93518845 Merging https://github.com/OJ/meterpreter/pull/1 2013-10-17 08:07:04 +10:00
Tod Beardsley
1fc10a8664 Resolve PR #31 conflict
Conflicts:
	.gitignore
2013-10-16 09:39:47 -05:00
OJ
9feec64d96 Remove strcpy calls, proper use of strncpy/strcpy_s
Replaced all usages of `strcpy` with `strncpy` or `strcpy_s`.

Make sure that all usages of `strncpy` specified the correct buffer size.
2013-10-16 11:55:29 +10:00
OJ
4b0a6a5102 Update .gitignore to avoid conflict 2013-10-16 08:43:56 +10:00
Tod Beardsley
55fca617e2 Land #30, update README.md 2013-10-15 09:31:04 -05:00
Tod Beardsley
23019408d1 Correct links for source and framework 2013-10-15 09:29:56 -05:00
OJ
2c865a4a37 Documented base.* and core.*
Big job, this documentation lark. Also modified the prototype the
packet_is_tlv_null_terminated function, which used to take a Packet
instance as well as the TLV, but never used the packet in its
implementation.
2013-10-15 16:14:39 +10:00
OJ
a2407de59a Update the build icon URL
Now that @bturner-r7 has got the CI going on metasploit.com the build
icon needs to point to the new server.
2013-10-15 10:12:53 +10:00
kernelsmith
554a744a9e Land #28 OJ's Fix railgun multi call functionality 2013-10-10 00:59:12 -05:00
OJ
35aada915f Fix debug build of various components
No idea why they were broken, but they shouldn't have been. This fixes
them up and tidies a few other things up, especially the guts of the
stdapi project.
2013-10-09 17:20:58 +10:00
OJ
bab7340a3f Doc changes, project fixes 2013-10-09 15:54:39 +10:00