Commit Graph

23 Commits

Author SHA1 Message Date
adfoster-r7 bbd881f999 Fix crashes on timeouts 2022-05-04 09:43:00 +01:00
Ashley Donaldson 9d8193150f Allow running a shell command separately to the currently interactive shell 2021-09-21 19:12:49 +10:00
Ashley Donaldson 5dceb48553 Fixed rubocop issues 2021-09-13 11:40:03 +10:00
Ashley Donaldson 44455fd165 Added some comments for clarity 2021-09-12 19:38:16 +10:00
Ashley Donaldson 16af8ad028 Honour the timeout parameter for reading from the shell 2021-09-10 22:39:27 +10:00
Ashley Donaldson 12546865de Support Ctrl+C now we're using Command Shell rather than Powershell 2021-09-10 18:15:43 +10:00
Ashley Donaldson 50e31917da Emulate a stream to make the base command shell happy 2021-09-10 17:45:08 +10:00
Ashley Donaldson 0927737948 Adapted WinRM module logging to MSF logging
Separated WinRM module into separate files
2021-09-10 15:54:50 +10:00
Ashley Donaldson 9ea3be903d Just use cmd, as powershell <= 3.0 doesn't actually use stdout/stderr 2021-09-09 22:40:43 +10:00
Ashley Donaldson c33b850ff8 Support terminating processes early by sending a Ctrl+C signal 2021-09-09 22:08:33 +10:00
Ashley Donaldson 51a8c834c3 Support Windows 2012 and earlier 2021-09-09 18:05:29 +10:00
Ashley Donaldson 2f0509f2b5 Modified shell to a PowerShell shell
This also resolves a bug with the session not upgrading to meterpreter
2021-09-08 08:19:43 +10:00
Ashley Donaldson 3acddf75b4 Suggested changes from code review
* Report socket info
* Use existing Event class
* Remove debugging prints
* Comment obscure constant
2021-09-08 07:36:59 +10:00
Ashley Donaldson b8e98ca99c Increase responsiveness of WinRM shell, while also reducing number of requests sent.
Achieved by either waiting N seconds, or immediately after stdin is sent.
While we were sending them every 2 seconds, we could sometimes be held up
waiting for a stdout response before we could even send our stdin message.
2021-09-07 14:59:12 +10:00
Ashley Donaldson 7a75a91dc6 Request stdout on a separate thread, so we are alerted when the shell dies. 2021-09-06 09:33:44 +10:00
Ashley Donaldson fdfac2212f Cleanup up old socket-based approach 2021-09-02 16:58:07 +10:00
Ashley Donaldson f16d91f8b4 Coerce failure immediately on bad password when setting up a session 2021-09-02 15:00:48 +10:00
Ashley Donaldson 6648a47ce7 Check stdin repeatedly 2021-09-02 13:23:26 +10:00
Ashley Donaldson b78b7413ef Use stdin rather than separate commands 2021-09-01 17:05:42 +10:00
Ashley Donaldson 3192f9b4f7 Neatness improvements 2021-08-31 22:30:31 +10:00
Ashley Donaldson 3839bc5dea Use rex sockets for WinRM transport 2021-08-31 21:36:25 +10:00
Ashley Donaldson 8d047dca59 Basic command shell operational. Does not yet utilise Rex sockets. 2021-08-31 15:34:04 +10:00
Ashley Donaldson 3dc1b22cdc Created WinRM command shell type 2021-08-31 11:00:53 +10:00