1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-03-24 18:16:24 +01:00

298 Commits

Author SHA1 Message Date
OJ
22ae01fb50 Fix indenting problem 2013-12-20 08:18:56 +10:00
OJ
dffcb3ab4f Fix page size and max results 2013-12-11 01:02:06 +11:00
OJ
b7f1c2c538 Add support for page size 2013-12-09 00:30:08 +11:00
OJ
ad86ac5b5c Fix handling of numerics 2013-12-08 20:58:25 +10:00
OJ
4e01c9ef98 Refactor into generic query
Querying is now generic so that more flexibility is made available to
the attacker.
2013-12-08 20:30:51 +10:00
OJ
3ba9b0549b Small code refactor 2013-12-08 14:47:52 +10:00
OJ
7b19766f3c Add support for computer and user enum via ADSI 2013-12-07 00:15:19 +10:00
James Lee
911aa47275 Land , getenv 2013-11-26 23:28:23 -06:00
OJ
df82feedac Add support for getting environment variable values
This is a new command in the stdapi which allows the caller to pass in a set of
environment variable names and retrieve a hash of the names and values.
2013-11-26 09:37:56 +10:00
OJ
db764771a2 Add check_key_exists registry function
MSF side has been attempting to open keys to see if they exist, which isn't
fantastic as it results in an error. This change adds a function which indicates
to the caller if the given reg key exists.
2013-11-25 16:17:32 +10:00
James Lee
3fd2153027 Land , extapi 2013-11-21 11:35:26 -06:00
jvazquez-r7
a1130e76e1 Land @OJ's fix for something which recover clean builds 2013-11-14 09:02:44 -06:00
jvazquez-r7
fb7a00ec35 Land , @OJ deletion of kitrap0d from getsystem 2013-11-14 08:41:31 -06:00
OJ
8ef0a425f1 Make builds 100% clean 2013-11-14 19:45:09 +10:00
OJ
35fad79cf0 Merge branch 'warning_removal' into ext_server_extapi 2013-11-14 19:34:44 +10:00
OJ
70d958b729 Remove last of the warnings/errors after merging 2013-11-14 19:33:20 +10:00
OJ
1c09ac08d5 Merge branch 'master' into warning_removal 2013-11-14 19:20:27 +10:00
James Lee
454e56adb3 Land , fix webcam crashes 2013-11-14 02:50:28 -06:00
James Lee
b391792bd1 Land , scheduler and channel refactor 2013-11-14 01:04:45 -06:00
kernelsmith
3662795176 fix typo in comment 2013-11-14 10:23:42 +09:00
OJ
f5090d6697 Fix POSIX crash on unsupported command and channel term
Crashes were occuring when the underlying channel had no more output
because the value of the `bytesRead` variable was not set to zero.
Consumers of the function assumed that bytesRead was value if non-zero.

POSIX would also hang when unsupported commands are executed, this
commit changes this so that a response is returned when the command
isn't supported.
2013-11-13 14:05:08 +10:00
OJ
a9abe738a1 Remove evidence of kitrap0d
This exploit has been causing crashes and BSODs on various systems and
hence is deemed too unstable to be included in the default deployment of
Meterpreter. `getsystem` should only contain code which attempts to get
SYSTEM privileges via safe means; it should not have exploits in it.

This commit removes kitrap0d from `getsystem`. The code will be moved to a
windows local exploit in MSF instead.
2013-11-08 11:34:46 +10:00
OJ
016d24aec0 Fix double-free issue resulting crash
Note: webcam stuff doesn't work on Windows 2012. Work needs to be done to
make it work on this platform because the DX classes used to do the webcam
capture are not present on the system.
2013-11-08 08:49:21 +10:00
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 , fix for ipv6 ipconfig 2013-11-07 14:44:27 -06:00
OJ
d93a78e305 Merge branch 'upstream/master' into channel_refactor_2
Conflicts:
	source/common/arch/posix/scheduler.c
	source/common/arch/win/scheduler.c
2013-11-07 08:09:51 +10:00
James Lee
3cbf7486d4 Land , command refactor 2013-11-06 15:33:52 -06:00
OJ
6bd447a5fe Update bare extension to VS2013 and no warnings 2013-11-06 19:58:09 +10:00
OJ
7702724fd2 Remove all warnings resulting in totally clean builds
Does as it says on the tin. Various tweaks made to source and to project
files to make the builds come out with ZERO warnings.

Let's keep it clean from here!
2013-11-06 19:02:50 +10:00
Tod Beardsley
ca20beb447 Post V2013, Land , getproxy
See also 
2013-11-05 20:00:29 -06:00
Tod Beardsley
8f3dfc575d Post V2013, Land , update incognito
See also 
2013-11-05 19:59:56 -06: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
OJ
b5a6bc9e80 Proper DIB offset calculation
This fixes the issue where the calculation for the offset of the image
data was incorrect. Instead of just looking at the first byte past the end
of the BITMAPINFOHEADER we now correctly calculate the offset past the
color palette and begin reading the image there. This stops the problems
where sometimes the image looked like it had been shifted, or other cases
where the image colors went retro.
2013-11-03 11:09:51 +10:00
OJ
6b1209b147 Add support for optional image download
Change includes fixes which allow for images to be downloaded optionally.
The user can specify -d to get the image. Image dimensions are shown as
well.
2013-11-02 23:05:02 +10:00
OJ
89685df6c8 Add Doxygen documnetation to extapi 2013-11-02 21:35:46 +10: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
026447d011 Merge branch 'upstream/master' into command_refactor
Conflicts:
	make.bat
2013-10-30 13:38:41 +10:00
OJ
1108917ae6 Adjust format to fit with default VS 2013 rules
VS 2013 appears to have built-in formatting for C++, so this commit tidies
up the code a bit to fit within those rules.

It also removes a few warnings which the new compiler has shown.
2013-10-29 20:36:31 +10:00
OJ
ae71841817 Merge branch 'vs2013' into ext_server_extapi 2013-10-29 20:05:18 +10: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
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
OJ
aef7d7bd6a Re-add closing of handles on destroy 2013-10-28 11:55:12 +10:00
Tod Beardsley
6a446637b5 Land , strcpy cleanup
Housekeeping against potential BOFs.
2013-10-24 14:07:38 -05:00
OJ
065e990e72 Final Windows changes to match POSIX requirements
This changeset brings windows into line with the last set of POSIX
changes. With this changeset we are now in a position where both POSIX and
Windows are able to create and open interactive channels, put them in the
background, and terminate them without crashing, hanging or leaving
processes running behind the scenes.
2013-10-22 17:26:22 +10:00
OJ
2f200d4fa1 Fix up POSIX to match channel changes
POSIX was out of whack with Windows as a result of the changes made
around channels. The schedular in posix was very different, and this
commit brings it into line.

Other than the obvious issues, a non-obvious issue with the changes
was that the channel was being freed up on close prior to the thread
terminating. This doesn't appear to be an issue on Windows, but was
causing crashes on close in POSIX.

The changes go quite deep. This changeset requires a lot of testing.
2013-10-22 16:43:22 +10:00
OJ
a89d79d139 Interactive channel refactor
The goals of this work are:

* To fix issue where backgrounding and re-interacting with channels wasn't
  working.
* To fix issue where closing of meterpreter was not closing off background
  prcoesses (such as cmd.exe).

The two things preventing this stuff from working were:

* When interactive channels are backgrounded their handles were destroyed
  along with the context that wraps them up. Making them interactive again
  had no impact because the handle and context were invalid. If anything,
  this made meterpreter unstable. Sometimes the session would die when
  attempting to interact with the channel again.
* When closing channels, there was no way of terminating the process that
  sat behind the scenes because no reference to the process was retained.
  Channels would close and handles would close, but no process termination
  was done.

To fix these problems:

* The interactive thread no longer terminates when backgrounded. Instead
  its put in a suspended state where it's waiting a signal from a resume
  handle that's associated with the channel's context. This means that the
  destruction of the context doesn't happen at all until the termination
  of the channel, which is exactly when it should happen anyway.
* Process handles are stored alongside the input/output handles so that
  when the time comes, the process can be terminated if required. This
  means that when the channels are closed, the code has a reference to the
  associated process which can be terminated. This is only done for
  interactive processes, non-interactive processes do not have this
  problem because meterpreter doesn't have to keep track of them.
2013-10-21 22:13:59 +10:00
OJ
aca306f8ce Implement CF_DIB support
The clipboard code now supports the `CF_DIB` format on the clipboard. When
found, it takes the data and uses GDI+ to convert it into a JPEG. GDI+ was
used because:

* It's on every Windows machine from XP SP0 onwards (Win2k doesn't work).
* It requires linking to a small gdiplus.lib instead of a massive jpeg
  library.
* It's a really easy interface to use that interops easily with the
  Windows bitmap header information structures.

I think it'd be worth considering this approach for the other screenshot
applications as well, as it'd reduce the jpeg lib dependency and simplify
the codebase.
2013-10-21 00:02:16 +10:00