1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-01-08 14:36:22 +01:00
Commit Graph

500 Commits

Author SHA1 Message Date
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
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
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
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
OJ
7f2fc483dc New ext docs, remove boiler from solution
Documentation now includes how to create a new extension using the bare
extension as a sample.
2013-10-09 15:26:19 +10:00
OJ
a10ee71e1c Remove boiler extension and create 'bare' extension
The boiler extension wasn't used and was old so it was removed. I've added
a new "bare" extension which is, as it says, just bare and doesn't do
anything. This can be used to create new extension projets just by copying
and pasting, then editing a couple of small things.

This will be added to the documentation.
2013-10-09 15:08:09 +10:00
OJ
827aa064e2 Add webcam thread to avoid COM-related crash
Webcam code was sometimes causing crashes in Meterpreter when attempting
to stop the camera after a frame had been captured. This appeared to be
because the thread that started the capture was not the same thread that
ended it.

CoInitialize() and CoUninitialize() need to be called on the same thread
and objects created on one thread need to be released on the same thread.
This change results in a new worker thread that is used for the lifetime
of the capture, and the callers have to interact with this thread via
basic threading events.

This is currently "proof of concept" code, rather than production-ready
code. The goal is to see if it solves the issue on the known targets
before tidying it up and locking it down for release.
2013-10-05 18:18:26 +10:00
OJ
ebf13ffaa7 Even more docs 2013-10-04 18:03:35 +10:00
OJ
a143c274e6 More documnetation work 2013-10-04 14:41:00 +10:00
OJ
ea3b9155b2 Fix railgun multi functionality
The main issue with things being broken was because the calling
convention was not defaulting to "stdapi" and hence the call would
fail. Adding the default fixed it.

While fixing this, I brought the mulit-call functionality up to speed
with the error message functionality, so the calls all return the
properly formatted error message.
2013-10-04 12:01:59 +10:00
James Lee
50b7557290 Land #26, Railgun error messages
See rapid7/metasploit-framework#2443 and rapid7/metasploit-framework#740
2013-10-01 16:39:01 -05:00
Tod Beardsley
adbb8ad2ce Don't lie in the README.md 2013-09-30 16:18:57 -05:00
Tod Beardsley
f629cc4b89 Land #22, more doc and proj updates
Again, tested with a successful run of the build.
2013-09-30 16:16:39 -05:00
Tod Beardsley
0406a2f336 Land #20, update docs and project files.
Tested by merging and running a build, as proscribed by the README.md.
12 succeeded, 0 dailed, 2 skipped.
2013-09-30 16:15:31 -05:00
jvazquez-r7
864917b32d Land #24, @OJ's patch to add posix depends .gitignore 2013-09-26 18:22:40 -05:00
jvazquez-r7
07a45634bb Land #21, @OJ's fix for PIP_ADAPTER_PREFIX Length check 2013-09-26 17:46:32 -05:00
OJ
60b4a5778d Better fix for the XP SP0 problem
Thanks to @jvazquez-r7 doing some investigation we have a better solution
to this crash. This commit implements this fix and removes the need to
check the status of the memory that's being read.
2013-09-27 08:32:31 +10:00
OJ
78d4dc0c7b Add posix temp folder to gitignore 2013-09-26 15:29:33 +10:00
OJ
08793782d1 Add doxygen, begin documenting, kitrap0d tidy
* Added the doxygen binaries and configuration.
* Added a `make docs` which generates documentation to the `docs` folder.
* Added some documentation to various areas of the source that I was
  working with. Over time I'll be adding more and more rather than trying
  to do it all in one hit.
* Refactored the kitrap0d code a bit to try to reduce code size.
2013-09-26 14:29:46 +10:00
OJ
895a580cb5 Last code tidy for the kitrap0d fix
Tidies up the API to be more intuitive, including conversion of the
first parameter to a char pointer (removing MAX_PATH) and renaming
the second parameter to be more indicative of what it means.

Thanks to @jvazquez-r7 for the great discussion!
2013-09-26 11:35:05 +10:00
OJ
54cf92ff6d Updated fix to work properly with _snprintf_s
* Modified first and second parameters to use `dwOutputLength` which
  is given to the function as an indicator of buffer size in bytes
  anyway.
* Check the return value of the function call to see if the result
  was a truncation, and if so, break from the current loop.

Realistically, truncation will not happen because the default windows
installation location folder name is very short.

Thanks @jvazquez-r7 for prodding me to validate this.
2013-09-26 09:07:15 +10:00
OJ
05388502cc Fix issue with kitrap0d crashing meterpreter
Calling getsystem or getsystem -t 4 was resulting in crashes due to
an incorrect usage of sizes in a call to _sprintf_s in the kitrap0d
code. This might have come about as a result of a move to the new
compiler which is C++11.

This code forces the size check to be correct and results in the
exploit functioning correctly on all platforms.
2013-09-24 20:00:26 +10:00
OJ
ef4175156f Build status and documnetation update
* Added the build status notification to the top of the README.
* Updated the order of details in the docs (put Linux build after Windows).
* Updated the details about where this repo came from.

Note: this PR should be merged AFTER #20 for ease of merging.
2013-09-24 10:49:29 +10:00
Meatballs
1ed1fa6e94 Fix indent and nitpick 2013-09-19 20:22:45 +01:00
OJ
361aba7f4c Updated build documentation
Added more detail around using the appropriate configurations depending on
whether you have access to the appropriate SDKs.
2013-09-18 18:14:36 +10:00
OJ
1c07b8650b Remove unused sniffer config, add PssdkVersion setting
* Rather than having various places where the PSSDK path is set scattered
  through the solution I created a property which contains the version.
  This means we can update that version property in the project and it'll
  take effect everywhere it's required.
* Removed debug and release configurations from ext_server_sniffer.
2013-09-18 18:09:32 +10:00
Meatballs
2182a891b6 Correct indent 2013-09-17 19:24:39 +01:00
Meatballs
4090e197aa Merge branch 'master' of github.com:rapid7/meterpreter into ip_resolv 2013-09-17 19:19:51 +01:00
Meatballs
4f1c2fe1ed Dont build in nix 2013-09-17 19:18:44 +01:00
James Lee
e031cc37f1 Land #19, add 'x86' to output filenames
Conflicts:
	workspace/ext_server_mimikatz/ext_server_mimikatz.vcxproj
	workspace/ext_server_sniffer/ext_server_sniffer.vcxproj
2013-09-16 23:56:52 -05:00
James Lee
51fa8f3b7d Land #18, sniffer fixes 2013-09-16 23:46:44 -05:00
James Lee
dacc03bd10 Land #15, add a LICENSE file 2013-09-16 23:36:48 -05:00
OJ
7b3d45f1fd Remove redundant entries in makefile 2013-09-17 09:29:10 +10:00
OJ
b442d17082 Change output file names
As per @jlee-r7's request I've changed the output of both 32 and 64 bit
components so that the platform is included in the file name.

I also added "make clean" to the make script.
2013-09-17 07:24:27 +10:00
OJ
8070ff7771 Possible fix for XP SP0 System process exploit crash
Exploitation of the System process on Windows XP SP0 resulted in crashes
when metepreter was enumerating network interfaces. It appears that the
System process isn't able to read from the address that contains prefixes
(stored in pPrefix in interfaces.c). In other cases, such as exploitation
of svchost.exe or via an msfpayload-generated exe, there was no such
crash. This is not an issue on later versions of Windows.

This crash happens in the current "production" version of Meterpreter that
was deployed with MSF v4.7.

The MS08-067 exploit targets the System process, and hence crashes.
The MS03-26 exploit targets svchost, and hence does not crash.

Checking the protection of the memory in each of those cases showed that
the MEM_COMMIT was set when not the System process, and was MEM_RESERVED
when it was. Sample runs can be seen here: http://pastebin.com/2WHqJ90A

This commit is an attempt to avoid this crash down the track, and it just
does a simple check to see if querying the area of memory for the current
process shows a state of MEM_COMMIT. If so, it carries on as per normal,
if not it uses the other legacy code path to traverse the network
interfaces.

With this "fix" in place I have not seen a crash at all on Windows XP,
Windows 7, Windows 8 and Windows 2012.
2013-09-16 23:14:10 +10:00
OJ
b9e58daa96 Remove unused project
* Accidentally added a project to the FS, this commit removes it.
2013-09-16 16:05:33 +10:00
OJ
99771d367e Removal of more warnings in compilation 2013-09-15 00:06:49 +10:00
OJ
73c3a2cfcd Support Rapid7 internal builds, fix sniffer ext
* r7_debug and r7_release configurations added.
* Make now detects if the appropriate libraries are on disk and will build
  whatever it can. If PSSDK is present in the appropriate location then it
  will attempt to build ext_server_sniffer.
* ext_server_sniffer is now buildable with VS 2012 with all the settings
  correct.
* ext_server_sniffer was failing to load once built. The cause of this was
  that the hMetSrv handle wasn't being set to a valid value prior to the
  command_register calls happening, it was being set too late. I'm not
  sure why this results in a crash, but moving this one call to a location
  prior to the command_register calls does resolve that problem.
2013-09-15 00:00:20 +10:00
OJ
101788efa0 VS 2012 doc improvements
* Removed the old README.md from the `workspace` folder.
* Adjusted the build documentation in the main README.md.
* Added details of how to make sure VS2012 has beeen updated so that
  things are able to be build.
2013-09-14 16:21:10 +10:00
OJ
f0e7e0ec3c Add error message support to the railgun code
This code was lost in the transition when the meterpreter source was
removed from the metasploit-framework source. I'm pulling this in by
request of @dmaloney-r7 who originally requested this code be inculded
as part of https://github.com/rapid7/metasploit-framework/pull/740

I added an extra bit of code to free up memory that is allocated by the
call to FormatMessage and forced the ASCII-version (FormatMessageA) of
the call.
2013-09-13 06:15:48 +10:00
OJ
7c5e7e930c Fix typo in ReflectiveLoader comment 2013-09-12 07:25:18 +10:00
OJ
68c7202015 Specify Rapid7 in appropriate location in LICENSE 2013-09-12 06:41:33 +10:00
OJ
03706b842f Reflective DLL Injection update, bugfix and tidy
* Pulled source from Stephen Fewer which contains a few updates including
  support for Windows RT.
* Added Stephen Fewer's fix which includes a correct pointer size for the
  reflective DLL loader function.
* Added ENABLE_STOPAGING to allow toggling of VirtualLock() call (defined
  by default).
* Added ENABLE_OUTPUTDEBUG to allow toggling of calls to pOutputDebug
  (undefined by default).
* Remove more warnings in some areas of the code.
2013-09-10 17:36:49 +10:00
OJ
65caf757da Add 3-clause BSD license, plus dependency sub-licenses
* Include the 3-clause BSD license for Metepreter.
* Include licenses for dependencies as specified in the original Metasploit license file.
2013-09-10 16:15:19 +10:00
OJ
7ce3766b11 Updated readme, fix make
* Tweak to the make.bat file.
* Updated README to indicate how to build with VS express.
2013-09-04 00:05:08 +10:00
OJ
fbb84f4718 Basic command line builds 2013-09-03 22:31:38 +10:00
OJ
23c9f86241 Rebuild jpeg lib, bit of cleanup 2013-09-03 20:09:52 +10:00
OJ
35bef0be11 Post-build event changes
* Copy output to different locations for different builds
2013-09-03 17:22:18 +10:00
OJ
87031e0d00 Work towards a clean build
* Various code fixes to keep the compiler warnings down.
* Adjustments to project files.
2013-09-03 16:49:09 +10:00
OJ
8ae670cfaf Fix C++11 make_pair errors and U_CHAR problem
* make_pair() changed in C++11 so this change fixes the code so that the
  compiler doesn't complain any more.
* Compiler was also complaining about redefinition of U_CHAR. Undefining
  before redefining resolves the issue.
2013-09-02 12:07:50 +10:00
OJ
89d2326901 Fix winmm library inclusion issue
* ext_server_stdapi wasn't including winmm.lib, despite the pragma
  included in the source of audio.c. Adding the library as a link
  input resolves the problem.
2013-09-02 11:37:45 +10:00
OJ
30928305e9 Fix project platform settings
* Make all the debug builds use /MTd instead of /MT.
* Make all builds use v110_xp for the platform (allows XP support).
2013-09-02 10:28:21 +10:00
OJ
5c5e95eb73 Upgrade from VS2010 to VS 2012
* Perform the upgrade of the projects using the VS wizard.
* Exclude the ext_server_pivot project for now as it doesn't exist on
  disk.

Note: this changeset will not compile.
2013-09-02 09:49:50 +10:00
Rob Fuller
b5762507be fix spelling error via @Meatballs1 2013-07-24 17:30:29 -04:00
Alexandre Maloteaux
b749014367 enable proxy authentification 2013-07-15 15:47:58 +01:00
corelanc0d3r
cb3933c380 New meterpreter payload reverse_https_proxy 2013-07-12 16:46:58 -04:00
Meatballs
071ff00a38 IPv6 resolution and remove nix 2013-06-20 22:29:49 +01:00
James Lee
6b6860e33f Make 64-bit project compile
Fixes VS's inability to find psapi.lib for 64-bit builds
2013-04-29 14:47:46 -05:00
Meatballs
d5b8577d6a Fix warning 2013-04-27 12:52:38 +01:00
Meatballs
73a386f49c CSV escape quotes 2013-04-27 12:43:53 +01:00
Meatballs
f06807c4d5 Fix x64 2013-04-22 10:42:50 +01:00
Meatballs
da4c1fc650 Refactor to support custom commands 2013-04-22 10:06:35 +01:00
Meatballs
1899c7ca63 Add project to solution! 2013-04-21 14:59:11 +01:00
Meatballs
7ab128960b x64 release compilation 2013-04-21 14:52:34 +01:00
Meatballs
18a2760d38 Moved sekurlsa.cpp to top dir 2013-04-21 10:55:57 +01:00
Meatballs
19b1d95df8 Modify ssp output 2013-04-21 10:33:16 +01:00
Meatballs
997cbe64ce tidy and add notes 2013-04-21 00:28:39 +01:00
Meatballs
57f9217ccb More licence fixes 2013-04-21 00:21:10 +01:00
Meatballs
6c47be2163 Correct wcout 2013-04-21 00:08:38 +01:00
Meatballs
a6083f76fd Debug compile and doesnt crash! 2013-04-21 00:04:45 +01:00
Meatballs
817ebd0fc0 Fix debug compilation 2013-04-20 23:38:44 +01:00
Meatballs
37101896e9 Update licencing 2013-04-20 23:20:52 +01:00
Meatballs
ff8dbb3226 Refactoring 2013-04-20 18:12:37 +01:00
Meatballs
f061ceba31 Add all methods 2013-04-20 17:28:00 +01:00
Meatballs
c36f4c1c89 Add msv 2013-04-20 16:32:31 +01:00
Meatballs
0fd0f2b878 Prevents crashing on reattempts 2013-04-20 15:06:18 +01:00
Meatballs
36b0aeeeaa Tidy output 2013-04-20 12:21:48 +01:00
Meatballs
d0822e5f19 Working comms 2013-04-20 11:14:37 +01:00
Meatballs
fd7b6eadbb Normalized output 2013-04-20 10:31:13 +01:00
Meatballs
09f2085e97 Working output to file 2013-04-20 01:26:57 +01:00
Meatballs
39872d239b Working comms 2013-04-19 22:18:44 +01:00
Meatballs
21e2b1fecf Tidy 2013-04-19 21:45:33 +01:00
Meatballs
979e22f774 Compiles with Release 2013-04-19 19:36:40 +01:00
Meatballs
9b775f33d3 Add debug statements 2013-04-19 14:48:05 +02:00
Meatballs
b96062380c Use getaddrinfo 2013-04-19 11:06:52 +01:00
James Lee
7cafff29f5 Fix compilation on Linux
Doesn't work, but at least it compiles
2013-04-17 18:08:14 -05:00
James Lee
ee5efcfb58 whitespace 2013-04-17 17:43:33 -05:00
Meatballs
87dae3d449 Add file and project changes 2013-04-14 11:09:12 +01:00
Meatballs
85dc7cc96e Newline at EOF 2013-04-14 11:04:08 +01:00
Meatballs
aecf0b28d4 Final 2013-04-14 10:59:34 +01:00
Meatballs
0395a6cb3e correct indent 2013-04-11 21:10:55 +01:00
Meatballs
94de029ee2 Initial attempt 2013-04-07 23:04:54 +01:00
James Lee
d80547c656 Whitespace at EOL 2013-04-04 23:37:20 -05:00