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
A Galway
81a86379d7
handles unverified shells & warns db/mingw not installed
2021-09-10 17:56:08 +01: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
A Galway
4a3fb6920e
adds cmd_shell initial output reading to bootstrap
2021-09-09 16:34:21 +01: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
adfoster-r7
f3ad3e8292
Re-renamespace error handling, and validate rhost schemas
2021-09-02 13:00:05 +01:00
adfoster-r7
13a5d314de
Add test for payload option validation
2021-09-02 13:00:03 +01:00
Alan Foster
112f43f798
Consolidate module argument parsing for ensuring consistency
2021-09-02 13:00:02 +01:00
Alan Foster
134fef21c4
Improve validation rhosts validation
2021-09-02 13:00:01 +01: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
dwelch-r7
8f51663545
Default simplify_module to not load_saved_config and update all references
2021-08-19 13:04:26 +01:00
Christophe De La Fuente
07c9350733
Land #15430 , Support for SSH pivoting
2021-08-09 18:34:08 +02:00
Spencer McIntyre
0314569e3d
Fix rubocop issues in session files
2021-07-23 10:58:13 -04:00
pingport80
ea09b035ea
Merge branch 'master' into powershell_session_type_improvements
2021-07-15 23:24:45 +05:30
Spencer McIntyre
0251dff80b
Add more descriptive error messages and logging
2021-07-14 14:38:33 -04:00
Spencer McIntyre
7aa44a9a80
Add a couple more socket methods
2021-07-14 11:00:34 -04:00
Spencer McIntyre
06b592cfa1
Update the session initialization method
2021-07-13 17:25:19 -04:00
Spencer McIntyre
15268366e1
Fix a bug in how sockets are closed
2021-07-13 17:10:54 -04:00
Spencer McIntyre
8ab78da7b5
Raise more descriptive exceptions
2021-07-09 17:14:54 -04:00
pingport80
a166afd958
change powershell platform to windows from win
2021-07-08 22:37:14 +05:30
Spencer McIntyre
46a877678d
Refactor some channel related Meterpreter code
...
This makes some of the channel related Meterpreter code accessible to
other locations in the framework which enables other sessions to also
support pivoting capabilities.
2021-06-30 09:25:25 -04:00
Spencer McIntyre
7bddaeb74f
Add documentation for the new session
2021-06-30 09:00:13 -04:00
Spencer McIntyre
208ab470e7
Switch from stderr to proper logging
2021-06-29 18:29:14 -04:00
Spencer McIntyre
4c925ce686
Add the channel's #read method
2021-06-29 13:40:21 -04:00
Spencer McIntyre
a6b5c89b1d
Cleanup channels when the session is closed
2021-06-29 09:55:35 -04:00
Spencer McIntyre
2c2ae2581a
Make the session a channel container
2021-06-28 17:43:57 -04:00
Spencer McIntyre
1aef1658b0
Handle ssh channel failures and timeouts
2021-06-28 16:47:14 -04:00
Spencer McIntyre
233d353403
Fix how the address of forwarded connections
...
The rstream is the command shell stream which is not the same as the
underlying network transport. In order for the session's connection
information to be reported properly (as represented by the output of
`sessions`) the SSH connection socket needs to be set as #sock.
2021-06-25 21:59:27 -04:00
Spencer McIntyre
a6afac608b
Squash some unnecessary code
2021-06-25 21:19:05 -04:00
Spencer McIntyre
f01e4a4408
More work on SSH pivoting
2021-06-25 21:19:05 -04:00
Spencer McIntyre
10ad84434c
Initial support for pivoting over SSH
2021-06-25 21:19:05 -04:00
Spencer McIntyre
b85031ff6a
Fallback to Python3 in sshexec when it's available
2021-06-18 13:35:23 -04:00
Gaurav Purswani
379b0825b3
Merge branch 'master' into separate_session_history
2021-05-27 20:20:01 +05:30