Closed Isodoro closed 8 months ago
I think this PR here should resolve your issue if you wanted to give it a quick test https://github.com/rapid7/metasploit-framework/pull/18959
Hi,
Thanks for the response :-)
I manually edited my openvas.rb file with your line 189 change from #18959 The result as follows:
msf6 > openvas_connect msfconsole msfconsole 127.0.0.1 9392 [*] Connecting to OpenVAS instance at 127.0.0.1:9392 with username msfconsole... [-] Error while running command openvas_connect: undefined method `timeout' for #<OpenVASOMP::OpenVASOMP:0x00007f2ef9ee01b8 @host="127.0.0.1", @port="9392", @user="msfconsole", @password="msfconsole", @bufsize=16384, @debug=0, @areq="", @read_timeout=3, @plain_socket=#<TCPSocket:fd 11, AF_INET, 127.0.0.1, 45912>, @socket=#<OpenSSL::SSL::SSLSocket:0x00007f2ef9ee4c40 @context=#<OpenSSL::SSL::SSLContext:0x00007f2ef9ee59b0 @verify_mode=0, @verify_hostname=false>, @io=#<TCPSocket:fd 11, AF_INET, 127.0.0.1, 45912>, @eof=false, @rbuffer="", @sync=true, @sync_close=true, @wbuffer="">, @rbuf="">
Call stack:
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/openvas-omp-0.0.4/lib/openvas-omp.rb:201:in sendrecv' /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/openvas-omp-0.0.4/lib/openvas-omp.rb:303:in
login'
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/openvas-omp-0.0.4/lib/openvas-omp.rb:138:in initialize' /usr/share/metasploit-framework/plugins/openvas.rb:185:in
new'
/usr/share/metasploit-framework/plugins/openvas.rb:185:in cmd_openvas_connect' /usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:581:in
run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:530:in block in run_single' /usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in
each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:524:in run_single' /usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:165:in
block in run'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:309:in block in with_history_manager_context' /usr/share/metasploit-framework/lib/rex/ui/text/shell/history_manager.rb:35:in
with_context'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:306:in with_history_manager_context' /usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:133:in
run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:54:in start' /usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in
start'
/usr/bin/msfconsole:23:in `
ah, damn alright, thanks for dropping the stacktrace, was hoping I could get away without setting it up, I'll have a crack at fixing it when I get but feel free to throw up a PR if you wanna have a crack at fixing it yourself
no worries - I'm learning to code currently (very much a beginner)... this is all a bit new to me I'm going to have a stab at working it out. If I manage to pull it off I'll post for sure. Don't hold your breath though! :-)
Ah ok so @Isodoro I did a little more digging and it looks like that's a pretty old unmaintained gem we're using https://rubygems.org/gems/openvas-omp
the issue seems to lie in the gem itself rather than in framework itself so I'm afraid getting this working would be more effort than I would have expected
Hi - Thanks for looking! Appreciated.
Completely understand - I tried a few things but nowhere near your level of expertise. I'd probably pull the "load openvas" option away from the next release btw.
Appears that the gvm-cli tools would be the way to move forward with this, however time consuming just for the sake of this automation. REF: https://github.com/greenbone/gvm-tools
Quick question: Do you know if the Nessus integration works?
if you want to close this ticket off feel free :-)
I think this partial pull request was making things better for openvas, but there was some more fixes to make: https://github.com/rapid7/metasploit-framework/pull/13944
Although it wasn't finished work, maybe that pull request would fix whatever issues are currently being hit
Edit: Also this thread: https://github.com/rapid7/metasploit-framework/issues/13797
Steps to reproduce
Sorry... me again! :-)
I might be being a muppet but I can't get Metasploit to connect to OpenVAS. All the forum stuff I've searched for has been older versions etc.
This is a fresh 2024 build with spec as follows:
Linux kali 6.6.9-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.6.9-1kali1 (2024-01-08) x86_64 GNU/Linux ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu] OpenVAS 22.7.9 gvm-libs 22.7.3
How'd you do it?
Were you following a specific guide/tutorial or reading documentation?
The OpenVAS build was followed from: https://www.kali.org/tools/gvm/ Both products work fine independently.
If yes link the guide/tutorial or documentation you were following here, otherwise you may omit this section.
Expected behavior
What should happen?
msf should connect to the OpenVAS app
Current behavior
What happens instead?
Now when I try to connect to 9392 with an admin account I created (tried admin as well) I get the following:
I also tried the local IP (192.168.x.x)
Metasploit version
msf6 > version Framework: 6.3.55-dev Console : 6.3.55-dev
Additional Information
In terms of ports LISTENING on the host:
For awareness on what is installed on the host:
The openvas settings: