Commit Graph

81 Commits

Author SHA1 Message Date
adfoster-r7 7dcf65d7c3 Fix python reverse http stager crash 2022-11-18 14:32:36 +00:00
Spencer McIntyre d8dfee5864 Move the python code into python files 2022-10-31 10:35:28 -04:00
Spencer McIntyre 69f0f3aebc Fix Python Meterpreter for v3.1-v3.3 2022-10-31 10:35:28 -04:00
llamasoft d61656c591 Use generator instead of list 2022-10-22 17:08:32 -04:00
llamasoft 42b7c7f69a Use range instead of xrange 2022-10-22 17:07:50 -04:00
llamasoft 9ddc05a464 Consolidate encrypt/decrypt functions
The only differences between the encrypt and decrypt functions are which
lookup tables they use and which order the bytes are sampled from rows.
Consolidating the functions like this also results in a consistent
10-15% performance improvement over the previous implementation.
2022-10-20 20:54:10 -04:00
llamasoft d3a72cac84 Generate AES constants at runtime
Unfortunately, the constants have to be calculated using utility functions
because Python 3 changes how list comprehensions work during class creation.
However, the current implementation is Python 2/3 compatible.
2022-10-20 20:54:02 -04:00
llamasoft 6c95a5543c Remove unused function 2022-10-19 22:22:31 -04:00
Spencer McIntyre a8a9b4bbe1 Update the #generate signature to take opts 2022-05-19 16:30:54 -04:00
adfoster-r7 e7db0aec99 Update meterpreter encryptor loader to support python 3.4 2022-05-05 19:18:20 +01:00
sjanusz fc73498919 Add debug option to Python Meterpreter 2022-04-12 10:54:26 +01:00
Spencer McIntyre 683d4ac471 Add support for staged python command payloads 2022-02-13 12:03:08 -05:00
Justin Steven 821fd177bb Fix Python HTTP stage when LURI is mis-slashed 2021-04-14 12:28:18 +10:00
dwelch-r7 bad5ccbc49 Remove msf/base requires 2021-01-05 14:59:46 +00:00
dwelch-r7 1617b3ec9b Use zeitwerk for lib/msf/core folder 2020-12-07 10:31:45 +00:00
Spencer McIntyre 7ffbecefa6 The HttpProxyType option is not support for Python so deregister it 2020-08-10 14:52:18 -04:00
Spencer McIntyre 48e0610bae Add authentication support to the Python Meterpreter 2020-08-10 13:24:55 -04:00
Spencer McIntyre 6c5a8b8f14 Fix double encoding for unstaged Python meterpreter 2020-06-11 16:48:49 -04:00
Spencer McIntyre d2fa21a1ee Make some change for Python version compatibility 2020-06-05 12:04:04 -04:00
OJ fee523f6cf Remove some unnecessary bytes 2020-05-12 15:22:56 +10:00
OJ d39ca5c47f Remove ref to base64 where not needed, more code golf 2020-05-12 15:08:43 +10:00
OJ 905ee564ee Add zlib/base64 support to python stagers
This forces python to use zlib and base64 when transferring the stages
around. In my testing this dropped the stage for reverse_tcp from 111801
bytes to 36200 bytes (while still including the encryption libs).
2020-05-12 14:54:08 +10:00
OJ 0df2cfd5a1 Little bit of code golf 2020-05-11 20:49:39 +10:00
OJ 1c0d76e482 Include a horrible custom DER/RSA implementation
I'm sorry, but I'm also not sorry.
2020-05-11 19:08:37 +10:00
OJ 97fc253077 Last effort at payload size reduction 2020-05-07 18:52:01 +10:00
OJ c0f32e59d0 Another interim commit while reducing the payload size 2020-05-07 18:38:07 +10:00
OJ 9d4ef13a84 First pass of python TLV encryption support
More info to come, but this does a few things with magic!~
2020-05-07 18:28:13 +10:00
Spencer McIntyre 85a39f75d8 Use a larger payload size to include the UUID 2019-10-10 22:08:26 -04:00
Jeffrey Martin b509c14851 detect the whitespace needed when patching meterpreter 2018-03-27 13:24:44 -05:00
Brent Cook b4bb1b5ed1 fix whitespace patchups for current python meterpreter 2018-01-18 00:28:04 -06:00
Brent Cook f7dfba6bae deduplicate code from python meterpreter 2017-12-12 03:12:36 -06:00
Brent Cook b7c231bb93 further normalize transport config 2017-12-12 03:12:36 -06:00
Brent Cook 528a423fc0 fix python override scheme 2017-12-12 03:12:36 -06:00
Brent Cook 636b93b026 minor simplification 2017-12-12 03:12:36 -06:00
Brent Cook ea37196614 use cooler names c/o @timwr, make options easier to grep 2017-11-21 13:47:19 -06:00
Brent Cook 37ab771ca9 uri is not always defined, fix python stager generation 2017-11-21 13:47:19 -06:00
Brent Cook 2076db2d61 DRY up common stager and payload http and retry options 2017-11-21 13:47:19 -06:00
Brent Cook 1fd7f7c8bc prefix MeterpreterUserAgent and PayloadProxy* with Http for consistency,
this also adds aliases where needed
2017-11-21 13:47:19 -06:00
OJ f6e9b12b43 Make sure stageless is supported 2017-11-21 13:47:18 -06:00
OJ 656babe9f4 Custom host header support in python meterp 2017-11-21 13:47:18 -06:00
Brent Cook 5e8c2200ac Merge branch 'master' into land-8625-crypttlv2 2017-08-20 18:54:51 -05:00
Brent Cook 4ca68a178b switch reverse_tcp stagers to all prefer StagerRetryCount
This leaves ReverseConnectRetries as an alternate spelling.
2017-08-08 19:27:00 -05:00
OJ d7e8b32312 Merge branch 'upstream/master' into transport-agnostic-packet-encryption 2017-08-08 17:30:51 +10:00
William Webb aa0fca9dd1 Land #8631, Add railgun support to Python Meterpreter for the OSX
platform
2017-07-11 16:05:16 -05:00
OJ 3f99306370 Fix issue with python3 meterp
Due to the way python3 does things differently, the escaped char string
for the session guid didn't work in the way it was expected. Instead,
we're going to do what we did with the payload UUID and hex encode, and
use binascii to handling the translation for us.
2017-06-28 17:55:27 +10:00
Spencer McIntyre feb8d14fe6 Make the TryToFork option generic 2017-06-23 21:08:49 -05:00
Spencer McIntyre 549ebb4ff6 Patch in the new PythonMeterpreterTryToFork option 2017-06-22 10:55:08 -05:00
OJ 2c0f41ee8f Fix session guid handling in python 3
I made the mistake of using str.decode() which isn't a thing in python3
(works fine in 2). So this commit fixes it so that the GUID string
itself is generated directly as a byte string, so that the call to
decode() isn't needed at all.
2017-06-16 09:01:29 +10:00
OJ c4288fb35a Update branch to include chances from upstream/master 2017-06-09 17:18:57 +10:00
Spencer McIntyre a052ee4064 Use the opts hash not the datastore 2017-06-06 20:02:06 -04:00