1
mirror of https://github.com/rapid7/metasploit-payloads synced 2024-12-21 05:35:54 +01:00
Commit Graph

846 Commits

Author SHA1 Message Date
OJ
3c32f762a7 More transport refactor work for POSIX
The transport refactor appears to be working, but the transport swtching
requires more work on the side of stageless posix before it will work.
At the moment, the POSIX implementation of the transport switching is
commented out so that it can't be used or built into the binaries.

This should mean we can move forward on other friends without this
holding us back.
2015-04-01 12:10:49 +10:00
OJ
e2338709aa POSIX transport refactoring
Still more to do here to support transport switching, but progress being
made.
2015-03-30 22:54:52 +10:00
OJ
4758a31f5b Source rejig, refactor POSIX to support changes 2015-03-30 20:14:16 +10:00
OJ
6ba59b87b3 Merge 'upstream/master' 2015-03-30 19:29:21 +10:00
OJ
30330459d9 Land #141 : Update PCAP, SSL, move to deps repo 2015-03-27 14:07:44 +10:00
Brent Cook
c0ca7ff80f bump to latest deps 2015-03-26 22:39:49 -05:00
Brent Cook
5132b8d176 disable linker debug 2015-03-26 11:04:03 -05:00
Brent Cook
9a71a575b7 use OpenSSL with Windows builds for now
LibreSSL does not yet work well with Windows meterpreter for 2 reasons:
  1. because its built with mingw/gcc, it does not have SAFESEH, requiring that
	 protection to be disabled for the whole stack. It could, it just needs a
	 way to be built with MSVS instead.
  2. OpenSSL 1.0.1 and Libressl both make metsrv about 50% larger.

When transports are more abstracted and LibreSSL can build with MSVS, we will
revisit this.
2015-03-25 09:12:11 -05:00
OJ
a2f74d99d6 Transport switch v0.0.1-preAlpha
Switching works, but doesn't do anything nice with session management. Still need to get things wired into posix, and probably rip out the wininet stuff as well given that I probably won't refactor it to support this.
2015-03-25 12:59:50 +10:00
Brent Cook
4ec9205eb0 update openssl refs 2015-03-24 10:56:33 -05:00
Brent Cook
95271e4345 update copyrights 2015-03-24 10:29:50 -05:00
Brent Cook
26effa7328 fix include path 2015-03-24 10:29:50 -05:00
Brent Cook
6cb8061e8e Fix build issues using OpenSSL APIs >= 1.0
There are duplicate defines between the Windows crypto API and OpenSSL.
2015-03-24 10:29:50 -05:00
Brent Cook
f45756e37b update SSL libs to libressl 2.1.4 2015-03-24 10:28:58 -05:00
Brent Cook
b30d2df4ad update and integrate libpcap for POSIX meterpreter
I am working on automating POSIX meterpreter builds, and one step is
removing the requirement to download files from external sites during
the build process. So, this incorporates the latest stable libpcap
source and updates the patches as needed.

The Makefile also moves (@wvu-r7 was amused that Makefile.pcap wasn't
actually a pcap file :) and simplifies a little build foo.

I updated and got the 64-bit kernel + 32-bit userspace TPACKET v1 patch
merged upstream, but its not in a release yet, so the patch is still
needed. See https://github.com/the-tcpdump-group/libpcap/pull/421
2015-03-24 10:28:58 -05:00
Brent Cook
d3fe4fc0ff Land #140: OJ adds winhttp support to meterpreter 2015-03-23 16:51:40 -05:00
OJ
5cf9ae53ea Update from winhttp branch after proxy fixes 2015-03-23 12:47:03 +10:00
OJ
97398e0c07 Adjust length to include NULL terminator 2015-03-23 12:43:10 +10:00
OJ
15a151fce6 Add separate check for proxy user and pass 2015-03-23 12:39:31 +10:00
OJ
91a8bce4b6 Implement first pass of transport refactoring
* Transports are now defined by a set of callbacks that are bound to the Remote.
* Transport initialisation and dispatching is seprated.
* The context of the transport should be switchable depending on new transport requirements.

More to do, but it has begun.
2015-03-23 12:35:45 +10:00
OJ
5f6a7d84aa Change type definition to keep posix happy 2015-03-20 13:49:50 +10:00
OJ
97cd32524b Doubled meterpreter UI length to 512 2015-03-20 13:10:57 +10:00
OJ
b7d6eba46b Merge branch 'master' into winhttp 2015-03-20 11:59:28 +10:00
OJ
33d7c55429 Land #138 : short file names, file list fixes 2015-03-19 13:03:27 +10:00
Brent Cook
c7c673138f Land #139, OJ does the posix symbol shuffle (and fixes it up) 2015-03-18 21:26:39 -05:00
OJ
c93ba9608c Fix bad POSIX support for stageless meterpreter
* Make sure POSIX has the new extension command enumeration function.
* Add support for deinit of extensions.
* Make sure extensions are tracked like they in Windows.
* Fix up a few export definitions.
* Stop using strncpy_s in POSIX code.
2015-03-19 11:07:22 +10:00
Brent Cook
eba69cf20e add short name support to filesystem listing.
Also, fix path builder order for stat.
2015-03-18 16:05:30 -05:00
OJ
85783773d5 Land #137 : filesystem refactor and initial unicode support 2015-03-18 18:01:05 +10:00
Brent Cook
e8318f8c5b correct various issues listing files
* bury common _snprintf that snuck in while testing the Windows version back
   into the platform-specific code.
 * remove now-unneeded separator defines
 * don't free a stack variable on windows
2015-03-18 02:11:13 -05:00
Brent Cook
8944ca5156 modify fs_getwd so it allocates the path 2015-03-17 15:28:27 -05:00
Brent Cook
95e102a90c cast size_t on read/write to proper result for the TLV 2015-03-17 15:27:48 -05:00
Brent Cook
7c8b723c15 convert windows filesystem operations to unicode 2015-03-17 14:32:20 -05:00
Brent Cook
f0eac5877a Refactor filesystem operations
Separate the stdapi handling code from the OS-dependent code. This makes
testing and maintaining the code easier.

This also happens to fix a number of bugs as a side-effect, because it is
clearer what is happening now.
2015-03-17 14:32:20 -05:00
OJ
46ab7a02e8 Fix typo, bomb out on invalid cert
When the server cert checking fails, meterpreter now exits.
2015-03-17 14:39:41 +10:00
OJ
0739cbc0f3 Add support for SSL cert validation
Tweak the SSL implemention so that for https meterpreters the SSL certificate is validated against a hash that is specified in the payload. If the hash isn't specified, then certificate validation isn't attempted.
2015-03-17 13:27:33 +10:00
Brent Cook
47fc1b81bd Land #135, @OJ's support for stageless meterpreter 2015-03-16 14:27:27 -05:00
OJ
f44b44f2ce Implement https communications via winhttp
First pass, some instability still. Migration doesn't play nice.
2015-03-16 21:51:44 +10:00
OJ
5e8f9ff090 Land format and posix fixes from @bcook-r7 2015-03-16 10:01:55 +10:00
Brent Cook
f5fecb4b68 fix spelling 2015-03-13 13:24:10 -05:00
Brent Cook
038477f90d initial split server_setup into windows/posix variants 2015-03-13 13:05:35 -05:00
OJ
aaa384b51d Remove compiler warning, set warnings as errors 2015-03-13 20:47:30 +10:00
OJ
b6ec617fd7 Add support for IPv6
Add more work to the URI scheme handling, add functionality that works with IPv6. Tested on XP SP3, Windows 7.
2015-03-13 20:10:30 +10:00
OJ
6ffa34aedc Add support for stageless payloads
metsrv now makes use of the METERRPETER_URL for stageless payloads. This value is checked when Meterpreter starts to determine what should be done with communications. If the URL indicates that the payload is stageless, it then establishes communications appropriately, depending on the configuration.
2015-03-12 10:47:19 +10:00
OJ
0393927159 Add extension names, enuemrators, etc
This commit contains a bunch of code tidying (formatting, spaces, naming, etc) as well as new exports for each of the modules so that the extension can be identified. The plan is for the loader to know which modules are loaded so that when stageless meterpreter fires up MSF can query the existing extensions and load the appropriate functionality on the client side.
2015-03-09 21:28:27 +10:00
OJ
9c7f320301 Code formatting and tidying up
This is in preparation for diving into how to make Meterpreter work
nicely as a fully stageless entity.
2015-03-09 10:26:44 +10:00
OJ
aab29f8605 Land #129 : real_printf rework 2015-02-26 07:21:57 +10:00
Brent Cook
a4f81a51b5 make real_dprintf available even if DEBUGTRACE is not set
By making this a static _inline, it is not necessary to guard it, since
an inline is only instantiated if it is used. This also allows adding
one-off debug message for use during debugging sessions, without turning
on DEBUGTRACE all over the place.

Convert a few of the extensions to also do this as well, making them perhaps
slightly smaller.

I am curious why Windows builds define debug this way, vs posix that
just includes it in common.c. Could I just do that instead, assuming
there's no historical reason.

Finally, correct the docs in the posix version of real_dprintf.
2015-02-25 13:03:18 -06:00
William Vu
8906b29559 Land #128, rm dup OpenSSL headers 2015-02-25 12:41:16 -06:00
Brent Cook
d4f1af0900 remove duplicate openssl headers
prepping for an upgrade later, this just cleans up some unused headers
2015-02-25 12:18:45 -06:00
Brent Cook
4ad58d65b4 Land #127 - @wvu-r7 adds per-process arch detection to ps on linux 2015-02-12 13:35:23 -06:00