I'm currently working through the OSCP A practice lab and running into an issue with Evil-WinRM when downloading SYSTEM.save file, i also have issue with it on other machine too but i can usually use SMB to transfer the file over instead. Wondering if anyone has encountered this or knows a reliable fix.
My setup:
Initial access to machine1
Ligolo-ng agent running on machine1, proxy running on Kali.
Connected to machine 2 through Evil-WinRM over the Ligolo tunnel.
The problem:
I'm trying to download an approximately system file from machine2 using Evil-WinRM, but i can download the SAM file ok.
The error is when i ran download SYSTEM:
Error: Download failed. Check filenames or paths:
Could not decrypt NTLM message. ().
Error: Connection timeout or error occurred:
WinRM::WinRMHTTPTransportError -
Could not decrypt NTLM message. ().
Sometimes I also get an HTTP 400 error when the session terminates.
The download leaves a partially transferred file on Kali, usually around 5,242,877 bytes.
Why I haven't switched to SMB:
My Evil-WinRM session is on machine 2, which is only reachable from Kali through the Ligolo pivot.
Kali can initiate connections to machine 2 but machine cannot establish a direct connection back to Kali
I tried hosting an Impacket SMB share on Kali. The listener was running on port 445, but from machine 2:
Test-NetConnection x.x.x.x -Port 445
Warning: TCP connect to (x.x.x.x : 445) failed
Warning: Ping to x.x.x.x failed
with status: DestinationHostUnreachable
TcpTestSucceeded : False
I also tried a PowerShell SMB drive mapping. The drive was created, but accessing it returned:
Cannot find path '\\x.x.x.x\TEST\'
because it does not exist.
My understanding is that Ligolo provides Kali-initiated access to the internal network, but doesn't automatically provide reverse connectivity from machine 2 to Kali's VPN IP.
What I'm trying to figure out:
Has anyone encountered the Could not decrypt NTLM message error during larger Evil-WinRM downloads?
Is there a known fix or compatibility issue involving winrm, winrm-fs, or rubyntlm?
Is there a reliable alternative for transferring the system file?
Am I missing something about how Ligolo handles reverse connections or SMB traffic?
I'm trying to understand the underlying issue rather than blindly switching tools.
Any pointers would be appreciated.
EDIT: after some more digging, i found evil-winrm py , installed and tested it download fine. I might just use the python version instead for the test.
EDIT 2: I disabled Ruby Evil-WinRM’s keepalive thread and now it worked.
FILE=/usr/share/rubygems-integration/all/gems/evil-winrm-4.1/bin/evil-winrm
sudo sed -i '/stop_keepalive ||= decorate_shell_with_keepalive(shell)/s/^/# /' "$FILE"