Evil-Winrm Error On Connection To Host - Off-Topic - Hack The Box - Forums
Evil-Winrm Error On Connection To Host - Off-Topic - Hack The Box - Forums
Hi, I am receiving an error that i have been unable to fix and find a solution for online.
I am running on OS: Ubuntu 22.04 LTS x86_64.
I am able to connect if i run the same command via kali or the docker file supplied in the evil-winrm git repo.
Any solution to this issue would be greatly appreciated!
4 Likes
Yes it is related to this issue Lab Access Openvpn certificate verify failed
https://forum.hackthebox.com/t/evil-winrm-error-on-connection-to-host/257342/print 1/10
4/16/24, 3:13 PM Evil-winrm error on connection to host - Off-topic - Hack The Box :: Forums
Strange. I’m using the starting machines, and it looks like tls-cipher "DEFAULT:@SECLEVEL=0" is
already there. Don’t think it matters, but tried without quotes as well.
client
dev tun
proto udp
remote edge-us-starting-point-1-dhcp.hackthebox.eu 1337
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
comp-lzo
verb 3
cipher AES-128-CBC
tls-cipher "DEFAULT:@SECLEVEL=0"
auth SHA256
key-direction 1
1 Like
Sadly, that didn’t work either. I’ll have to try a few other things.
I gave up and just used a docker image. Spent way too much time trying to solve this, so found a workaround.
https://forum.hackthebox.com/t/evil-winrm-error-on-connection-to-host/257342/print 2/10
4/16/24, 3:13 PM Evil-winrm error on connection to host - Off-topic - Hack The Box :: Forums
after infinite frustration, scouring the web, noting the addition to .ovpn file == no positive results…
I jumped into Discord and asked, a user ended up responding, explaining its a known issue and suggested a full
update on Kali. Upon updating, winrm worked smoothly, just as the write-up.
import winrm
session = winrm.Session('10.129.67.232', auth=('administrator','badminton'), tran
session.run_ps("whoami").std_out
Then simply re-run the final line replacing “whoami” with your command (You can also change run_ps to
run_cmd to execute cmd commands instead of ps ones)
session.run_cmd("type C:\\Users\\mike\Desktop\\flag.txt").std_out
1 Like
In my case issue was evil-winrm was using ruby 2.7 but mine ruby path was set to ruby 3.0
so go to and change ruby3 to ruby2.7 temporarily
https://forum.hackthebox.com/t/evil-winrm-error-on-connection-to-host/257342/print 3/10
4/16/24, 3:13 PM Evil-winrm error on connection to host - Off-topic - Hack The Box :: Forums
cd /usr/bin/
cp ruby ruby.bk
cp -f ruby2.7 ruby
cd /usr/bin/
cp -f ruby.bk ruby
In my case evil-winrm was using ruby2.7 but my default path for ruby was set to 3.0 so temporarily change it.
cd /usr/bin
cp ruby ruby.bk
cp -f ruby2.7 ruby
cp -f ruby.bk ruby
1 Like
[provider_sect]
default = default_sect
legacy = legacy_sect
[default_sect]
activate = 1
[legacy_sect]
activate = 1
15 Likes
https://forum.hackthebox.com/t/evil-winrm-error-on-connection-to-host/257342/print 4/10
4/16/24, 3:13 PM Evil-winrm error on connection to host - Off-topic - Hack The Box :: Forums
1 Like
mickdec:
[legacy_sect]
activate = 1
1 Like
I’m using ubuntu, not kali. I gave up on making evil-winrm work on ubuntu. I used docker instead.
1 Like
https://gist.github.com/pich4ya/002ae2d844315f4338f5586ba3dcbfbd
openssl3_no_md4.txt
Workaround: edit /etc/ssl/openssl.cnf by adding legacy = legacy_sect under default = default_sect in order to
appear as:
[openssl_init]
providers = provider_sect
and by uncommenting #activate = 1 under [default_sect] and adding [legacy_sect] and activate = 1 under them
in order to appear as:
[default_sect]
activate = 1
[legacy_sect]
activate = 1
6 Likes
Evil-winrm is a popular tool used to perform remote Windows exploitation and privilege escalation. When you
encounter an error while connecting to a host using evil-winrm, there are several things you can do to
troubleshoot the issue. Here are some tips to help you fix evil-winrm error on connection to host:
https://forum.hackthebox.com/t/evil-winrm-error-on-connection-to-host/257342/print 6/10
4/16/24, 3:13 PM Evil-winrm error on connection to host - Off-topic - Hack The Box :: Forums
Verify the connection details: Ensure that you are using the correct IP address or hostname, port number, and
credentials for the target system. Double-check the spelling and formatting of the connection details, as even a
small error can prevent you from connecting.
Check network connectivity: Make sure that the target system is reachable from your machine. Check the
firewall settings on the target system and any intermediate devices such as routers or firewalls that may be
blocking the connection.
Verify credentials: Ensure that the credentials you are using to connect to the target system are correct and have
sufficient privileges to perform the desired actions. Try using different credentials if you have them available.
Regards,
Rachel Gomez
I had the same issue with Ubuntu 22.04. Use ruby 2.7.0. This fixed my issue:
2 Likes
thanks
https://forum.hackthebox.com/t/evil-winrm-error-on-connection-to-host/257342/print 7/10
4/16/24, 3:13 PM Evil-winrm error on connection to host - Off-topic - Hack The Box :: Forums
Same here, so I tried to run evil-winrm in Docker instead. The Digest-related error is gone, but I get another
one:
Update
Changing the VPN protocol type from UDP to TCP resolved the connection error.
# If you add a section explicitly activating any other provider(s), you most
# probably need to explicitly activate the default provider, otherwise it
# becomes unavailable in openssl. As a consequence applications depending on
# OpenSSL may not work correctly which could lead to significant system
# problems including inability to remotely access the system.
So if activate = 1 is commented out in your [default_sect] you definitly want to uncomment this!
That would have saved me an extra hour of troubleshooting…
For search engines: The evil-winrm error message without that additional activate was
https://forum.hackthebox.com/t/evil-winrm-error-on-connection-to-host/257342/print 8/10
4/16/24, 3:13 PM Evil-winrm error on connection to host - Off-topic - Hack The Box :: Forums
Thank you so much, buddy! I can’t tell you how many hours I spent trying to fix this problem, and it was
driving me crazy!
I’m using Debian 12 with Ruby version 3.1.2. After trying all the solutions offered by the community, I just
couldn’t get it to work.
But thanks to your advice, I was able to downgrade to version “ruby 2.7.0p0 (2019-12-25 revision
647ee6f091)” and complete the machine.
Thank u so much.
thanks
thanks!
str4code:
thank you so much for this. for others, if you wanna do this solution you have to source ~/.rvm/scripts/rvm
every time you wanna use evil-winrm. it might also ask you to install a specific version of nori, just do that and
https://forum.hackthebox.com/t/evil-winrm-error-on-connection-to-host/257342/print 9/10
4/16/24, 3:13 PM Evil-winrm error on connection to host - Off-topic - Hack The Box :: Forums
youll be gucci
https://forum.hackthebox.com/t/evil-winrm-error-on-connection-to-host/257342/print 10/10