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

291 Commits

Author SHA1 Message Date
adfoster-r7
dc14eada5d
Land #499, Add support for updating terminal size dynamically 2021-09-14 12:37:11 +01:00
dwelch-r7
798e15d346 Adhere to SYS_PROCESS naming convention 2021-09-01 13:00:08 +01:00
dwelch-r7
308ef8abff Use terminal rows/column TLVs 2021-08-31 18:53:48 +01:00
Spencer McIntyre
2067d7267e Cleanup the process object
When a child process exits, the corresponding object should be closed
and cleanup all of it's streams and threads as necessary.
2021-08-26 18:44:49 -04:00
dwelch-r7
9a06fb9ff8 Handle missing command ids 2021-08-24 13:47:03 +01:00
dwelch-r7
63eefdaa3f Return an error if channel id is not valid 2021-08-23 13:39:17 +01:00
dwelch-r7
28794127c9 Add support for updating terminal size dynamically 2021-08-18 15:14:42 +01:00
dwelch-r7
4d0640f7fc Respect the PROCESS_EXECUTE_FLAG_SUBSHELL flag 2021-07-30 16:44:02 +01:00
dwelch-r7
7ad6667189 Replace start_new_session with preexec_fn to maintain python compatability 2021-07-28 14:40:24 +01:00
dwelch-r7
ee44802a8a Fix sudo prompt 2021-07-28 13:30:10 +01:00
Spencer McIntyre
a4dc937eff Fix the HTTP transport comm timeout 2021-04-30 15:46:12 -04:00
Spencer McIntyre
57c6f10314 Use the first entry returned by getaddrinfo
Fixes #479
2021-03-29 17:31:28 -04:00
Tim W
adb7ee62af fix route parsing on macOS 10.13 and lower 2021-03-19 20:04:32 +00:00
Spencer McIntyre
a612d32da4 Add get_routes support for OS X via netstat 2021-03-17 17:09:54 -04:00
Spencer McIntyre
d3a0840792 Add a get_routes implementation for Windows XP 2021-03-17 11:56:43 -04:00
Spencer McIntyre
5ca9d02004 Refactor some Windows ctypes code, Always use GetAdaptersAddresses
GetAdaptersAddresses was added in Windows XP / Server 2003 which since
Metasploit v6 is the oldest version of Windows that Meterpreter
supports. There is now no need to fail back to the older GetIfEntry
function.
2021-03-17 11:24:40 -04:00
Spencer McIntyre
85ba357364 Fix a Python 2.x compatibility bug in netlink_request 2021-03-17 10:37:21 -04:00
Spencer McIntyre
b911574baf Update log messages to use a consistent case 2021-03-17 10:26:42 -04:00
Spencer McIntyre
a155cb8cea Fix a ctype error and catch exceptions when deleting things 2021-03-17 10:26:42 -04:00
Spencer McIntyre
bdc9c648d6 Add the interface names to the routes for Windows 2021-03-17 10:26:42 -04:00
Spencer McIntyre
604b546db8 Initial windows route support via GetIpForwardTable2 2021-03-17 10:26:42 -04:00
Spencer McIntyre
966db5f616 Consolidate libc definitions for OSX and Linux 2021-03-17 10:26:42 -04:00
Spencer McIntyre
f0b37fad91 Add get_routes via netlink for Python 2021-03-17 10:26:42 -04:00
Spencer McIntyre
826b13e184 Skip command IDs that can't be resolved
The channel_open functions are registered in the same ways as functions,
yet are not typical commands so they need to be skipped.
2021-02-11 19:29:16 -05:00
Spencer McIntyre
f3b6d5ae51 Use the proper bytes type when building search response TLVs 2020-10-27 09:27:47 -04:00
William Vu
8e3933bed7 Revert "Undo commit for #441"
This reverts commit 8361d5367a, reversing
changes made to db3d5f0896.
2020-10-11 20:49:06 -05:00
William Vu
8c5ab95cd2 Revert "Land #441 - Fix missing TLV migration from string to int"
This reverts commit eb1d51b94e, reversing
changes made to b6ce0dff18.
2020-10-11 20:08:15 -05:00
Spencer McIntyre
dc2d8026d0 Remove the timeout parameter when running < Python 2.6
The timeout parameter was added to urlopen in Python 2.6, in order for
the reverse_http(s) stagers to work at all on 2.5, this parameter needs
to be omitted.
2020-08-10 14:47:47 -04:00
Spencer McIntyre
52ef30b0fd Add authentication support to the Python Meterpreter 2020-08-09 19:32:19 -04:00
Spencer McIntyre
3a3003724d Extract the extension name for logging purposes 2020-06-18 15:06:38 -04:00
Spencer McIntyre
7d672ce7bf Use DER instead of PEM encoding for RSA keys in Python 2020-06-18 14:34:30 -04:00
Spencer McIntyre
538381ba08
Land #399, Add TLV encryption support to the Python Meterpreter 2020-06-11 11:38:25 -04:00
Spencer McIntyre
dee9e10d7e Fix a NameError in _core_enumextcmd 2020-06-09 17:21:56 -04:00
OJ
b37ebe0666
Merge remote-tracking branch 'zs/wip/pr/399' into python-tlv-enc 2020-06-07 09:07:43 +10:00
Spencer McIntyre
2165857599 Make some change for Python version compatibility 2020-06-05 12:05:42 -04:00
OJ
2c8ca18d2d
Updated with some more comments 2020-06-05 08:41:24 +10:00
OJ
42a785b33f
Add RSA encryption support 2020-05-11 19:09:23 +10:00
OJ
bfd6e9af0d
Enable encryption of TLV packges with AES
Still need to support RSA encryption of the generated key
2020-05-07 19:37:22 +10:00
OJ
fc0079e98a
Update enumeration commands to support the id range 2020-05-01 15:55:43 +10:00
OJ
d3f3a513de
Update command id maps for php, java and python 2020-05-01 15:42:45 +10:00
OJ
dc40ddc38d
Rename the tcp channel open command in python 2020-04-30 15:57:43 +10:00
OJ
409e6cce6d
Update python meterpreter to use UINT command ids
This is based heavily off the work that zeroSteiner did last year.
2020-04-29 16:59:51 +10:00
Spencer McIntyre
c635d41b8c Send addrinfo when opening a channel in Python 2020-02-19 23:29:40 -05:00
Tim W
08633f4cc4 fix python 3 stdapi_sys_process_close 2019-06-03 02:44:40 +08:00
bwatters
03e3e2066f
Replace StopIteration with return per PEP 479 2019-02-11 15:01:41 -06:00
bwatters
74ed8ee5b7
Typecast values to prevent incompatibilities in packing them 2019-02-11 10:48:59 -06:00
Brent Cook
7e2181700a update stat struct sizes 2019-02-06 17:51:21 -06:00
Tim W
2386ce2ca9 fix python meterpreter ls of 4gb files 2019-01-02 19:20:50 +08:00
Spencer McIntyre
d90b8327dd Close proc_h io streams 2018-12-12 19:09:05 -05:00
William Vu
2b26c69e20 Force Unicode on chmod path 2018-09-24 15:42:20 -05:00
Tim W
dce10d9c9e python meterpreter chmod command 2018-09-12 19:27:46 +08:00
Spencer McIntyre
6a24c38e2b Fix unbound UDP sockets by not requiring the peer 2018-04-22 19:45:43 -04:00
Spencer McIntyre
e4b2e7f812 Use the proto field from getaddrinfo 2018-04-08 14:27:46 -04:00
Spencer McIntyre
408d0ff212 Use getaddrinfo for udp channels too 2018-04-08 12:29:16 -04:00
Spencer McIntyre
c9905cd177 Fix IPv6 support by using getaddrinfo 2018-04-08 12:29:16 -04:00
Spencer McIntyre
1f953580b1 Fix a bug when accepting a connection 2018-03-29 17:28:34 -04:00
Spencer McIntyre
d8d97e55e8 Process channel events with a higher priority 2018-03-19 11:15:23 -04:00
Spencer McIntyre
76168ba186 Add and use a new tlv_pack_request function 2018-03-19 10:36:21 -04:00
Spencer McIntyre
99aac30459 Add UDP channel support to the python meterpreter 2018-03-18 19:22:08 -04:00
Spencer McIntyre
7a3da787b1 Fix bugs introduced by the channel refactoring 2018-03-18 18:13:54 -04:00
Spencer McIntyre
38db1218dd Major refactoring for channel objects 2018-03-18 17:31:23 -04:00
Spencer McIntyre
8153648aab Refactor socket class names with the family 2018-03-17 19:02:05 -04:00
Spencer McIntyre
0e06102549 Add debug statements for channel open dispatching 2018-03-17 18:29:40 -04:00
Tim W
c373b2fafe fix tabs to spaces 2018-03-09 00:45:42 +08:00
Tim W
9db18dc8a3 catch termios exceptions 2018-03-09 00:45:01 +08:00
bwatters
16b82ed9cc
Add the attrib to all file deletes 2018-01-18 12:08:01 -06:00
Brent Cook
d9ed8004d8 remove readonly attributes for python meterpreter 2018-01-16 10:35:09 -06:00
Brent Cook
39277d10bc
switch to pythonic whitespace 2018-01-09 15:44:54 -05:00
Jonas Lieb
cd433fb2cf Fix meterpreter.py indentation
Commit b5372d2a98 messed up the indentation
(mixing spaces and tabs) for some parts of the code. This commit fixes it.
2018-01-09 10:43:26 +01:00
Jeffrey Martin
b9ecf579ef
fix scope when a transport has headers 2017-12-20 13:09:23 -06:00
Brent Cook
b5372d2a98 on exception from URLLib, don't spin 100% cpu 2017-12-10 11:55:35 -06:00
OJ
e88cb61839
Small python http header fix 2017-09-11 17:20:22 +10:00
OJ
e1efa94b06
Transport creation for headers, and starting on python support 2017-09-11 14:39:15 +10:00
OJ
b363584648
Merge branch 'upstream/master' into transport-agnostic-packet-encryption 2017-08-08 17:37:25 +10:00
OJ
03a88ff4ad
Land #215 - Fix python meterpreter sleep
Fixes #202
2017-07-13 07:53:20 +10:00
William Webb
cbe6f7783c
Land #212, Add OSX Railgun support to Python Meterpreter 2017-07-11 15:51:32 -05:00
Spencer McIntyre
cb8c2fd009 Adjust how trasnport sleep is handled 2017-07-10 20:32:59 -04:00
OJ
afdd75a25c
Update python meterpreter to support 32 bit enc flags
Both python3 and python2 tested.
2017-07-03 17:33:08 +10:00
Spencer McIntyre
8c9c38ba4b Add export and use a debug_traceback function 2017-06-28 19:44:49 -04:00
OJ
eeeecd7234
Fix python3 support for the session GUID header
Updates the code so that the GUID is handled as a hex-encoded value,
just like the payload UUID. This avoids what appeared to be encoding
issues when the value was packed into the header, resulting in more than
16 bytes appearing and hence screwing it all up!
2017-06-28 17:57:07 +10:00
OJ
60c751c27d
Fix py meterp to support python3 when generating raw headers
Thanks to @zeroSteiner for this.
2017-06-28 12:54:41 +10:00
Spencer McIntyre
1a0f47603b Add debgging around get and send packet for pymet 2017-06-27 20:15:04 -04:00
OJ
445db818be
Update Python meterpreter's packet header handling
This doesn't add AES encryption, just adds support for the new packet
header. AES encryption will come later.
2017-06-26 15:26:27 +10:00
Spencer McIntyre
9538e2d03f Add an option to disable forking in pymet 2017-06-22 10:55:59 -05:00
Spencer McIntyre
c320233e86 Try to use find_library for OSX railgun_api 2017-06-21 08:50:57 -04:00
Spencer McIntyre
d48b48df94 Implement pymet osx rg api and api_multi 2017-06-19 11:13:42 -04:00
OJ
813760a9e2
Remove support for the crypto context
Crypto context stuff appears to have only ever been supported in
Meterpreter on Windows. The only thing it allowed for is XOR, which is
redundant given that we have packet level XOR in place. Also, it would
appear that MSF didn't have support for it anyway!

With the move torwards packet-level encryption, this is unnecessary so
it needs to go bye bye.
2017-06-19 16:51:54 +10:00
Spencer McIntyre
e0c26186c1 Implement pymet osx rg memread and memwrite 2017-06-15 10:56:47 -04:00
OJ
cf575a05dd
Add session GUID support to Meterpreter payloads 2017-06-06 17:24:36 +10:00
Spencer McIntyre
9aac25b522 Fix some more pymet backwards compat issues 2017-04-25 17:05:15 -04:00
Spencer McIntyre
7e06057ca9 Add linux railgun support to the pymet 2017-04-20 13:52:59 -04:00
Spencer McIntyre
b9b7545be0 Improve pymet helper functions 2017-04-19 14:59:53 -04:00
Spencer McIntyre
71132cc00c Refactor pymet wreg functions and reg decorator 2017-04-19 14:25:07 -04:00
Spencer McIntyre
974fcda43e Add railgun memread and memwrite for Linux 3.2+ 2017-04-19 13:31:14 -04:00
ouahib-el-hanchi
6401c6ae03 Fixed stdapi_fs_mount_show to show full mapped drive path for Windows in Python meterpreter 2017-04-15 02:49:59 +01:00
ouahib-el-hanchi
32faaf5549 Added stdapi_net_config_get_proxy for Windows in Python meterpreter 2017-04-14 07:52:25 +01:00
Ouahib El Hanchi
7db0847d87 Fixed whitespace, can't seem to get them right 2017-04-14 06:44:28 +01:00
ouahib-el-hanchi
dae985f66f Fixed whitespace and replaced string buffers with unicode buffers for unicode functions 2017-04-14 06:40:45 +01:00
ouahib-el-hanchi
242d2bf936 Added stdapi_sys_eventlog_* functions for Windows 2017-03-25 22:25:13 +00:00
ouahib-el-hanchi
0d58e33f74 Added stdapi_fs_mount_show for Windows 2017-03-19 02:32:45 +00:00