Add winrmexec on behalf of Ozelis (https://github.com/ozelis/winrmexec/blob/main/winrmexec.py)#2033
Add winrmexec on behalf of Ozelis (https://github.com/ozelis/winrmexec/blob/main/winrmexec.py)#2033Dfte wants to merge 10 commits into
Conversation
|
Hello @anadrianmanrique @gabrielg5, I really want to get back to that PR but I'm kinda stuck because of the size of the code. How would you handle that case ? Make a impacket/impacket/winrm.py class that is then used by impacket/example/winrmexec.py ? Or is it okay to have such a huge example directly ? |
|
Hi @Dfte, Let me shoot at it with AI if you want. Seems like something it could easily solve for us. |
|
Yes go for that! Then I'll start working on it :P thx mate! |
- add reusable WinRM transports, WSMan helpers, and WinRS client support - rewrite winrmexec as a thin Impacket-style example - reuse shared WinRM builders in relay code - centralize TLS server-end-point CBT helpers - add focused WinRM tests
24a64c6 to
eda6089
Compare
|
Ok, let's continue from here. Main changes:
|
|
Exceptional! I'll work on that PR this week end then :)! Hopefully we'll have this great feature fully tested soon!! Thanks dude! |
|
Alright so here is a few testings:
About ntlmrelay, I have set the winrms endpoint to None in order to allow ntlm relay, looks good as well!
Btw, once this PR is merged I'll move the CBT computing from TDS.py to the Tls.py library as well so that it can be reused as well as we mentionned before @anadrianmanrique :)! |








This PR adds the winrmexec.py example (written by Ozelis ozelis/winrmexec#2) to Impacket :
Full ReadMe available here https://github.com/ozelis/winrmexec/blob/main/README.md.
Note that the last comit I did switched datetime UTC to datetime.utc for retrocompatibility issue with python prior to 3.11. This is a WIP PR as few things will have to be modified.