Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evil-winrm: fix OpenSSL 3 error #3620

Closed
wants to merge 1 commit into from
Closed

evil-winrm: fix OpenSSL 3 error #3620

wants to merge 1 commit into from

Conversation

D3vil0p3r
Copy link
Contributor

Fixing the issue linked in #3593 by enabling legacy protocols that Evil-WinRM uses for attacking the target machine. The issue is solved by enabling the legacy protocols after the pkg installation that have been kept disabled by default by OpenSSL maintainers with the latest OpenSSL version.

Fixing the issue linked in #3593 by enabling legacy protocols that Evil-WinRM uses for attacking the target machine. The issue is solved by enabling the legacy protocols after the pkg installation that have been kept disabled by default by OpenSSL maintainers with the latest OpenSSL version.
@noraj noraj requested review from noraj and removed request for noptrix December 4, 2022 03:29
@noraj noraj closed this Dec 5, 2022
@noraj
Copy link
Contributor

noraj commented Dec 5, 2022

You could try adding openssl-1.1 in dependency but with both 1.1 and 3.0 installed, idk how it will behave.

@D3vil0p3r
Copy link
Contributor Author

You could try adding openssl-1.1 in dependency but with both 1.1 and 3.0 installed, idk how it will behave.

I tried to install openssl-1.1 package, but when I run evil-winrm we still get the famous error. So, it still refers to the OpenSSL 3.0 config file.

@noraj
Copy link
Contributor

noraj commented Dec 6, 2022

If you take a look at evil-winrm gemspec https://github.com/Hackplayers/evil-winrm/blob/381b126d6a8dc3ca38f7fab73cb80175fcbe8d45/evil-winrm.gemspec#L27, it relies on the winrm gem.

I suggest you open a bug request upstream for openssl 3.0 support.

@D3vil0p3r
Copy link
Contributor Author

If you take a look at evil-winrm gemspec https://github.com/Hackplayers/evil-winrm/blob/381b126d6a8dc3ca38f7fab73cb80175fcbe8d45/evil-winrm.gemspec#L27, it relies on the winrm gem.

I suggest you open a bug request upstream for openssl 3.0 support.

Opened to WinRb/WinRM#340

@D3vil0p3r D3vil0p3r deleted the patch-8 branch December 6, 2022 09:26
@noraj
Copy link
Contributor

noraj commented Dec 6, 2022

By reading WinRb/WinRM#340, I think we can make a workaround.

  1. add openssl-1.1 in the dependencies
    depends=('ruby' 'ruby-bundler' 'libxslt' 'ruby-rexml' 'git')
  2. Modify the wrapper to add an inline OPENSSL_CONF in the wrapper exec OPENSSL_CONF=/path/to/customconf bundle exec $pkgname.rb "\$@"
    cat > "$pkgdir/usr/bin/$pkgname" << EOF
    #!/bin/sh
    cd /usr/share/$pkgname
    exec bundle exec $pkgname.rb "\$@"
    EOF
    and setting the path to openssl 1.1 conf.

or maybe better so there is no need of openssl 1.1.1

  1. only add openssl (3.0) in the dependencies
  2. Modify the wrapper to add an inline OPENSSL_CONF, copy openssl 3.0 conf in /usr/share/$pkgname, sed the required modifications and set OPENSSL_CONF to use the custom file

noraj added a commit that referenced this pull request Dec 8, 2022
noptrix pushed a commit that referenced this pull request Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants