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

Openvas_connect not working #8538

Closed
Swiftb0y opened this issue Jun 10, 2017 · 9 comments
Closed

Openvas_connect not working #8538

Swiftb0y opened this issue Jun 10, 2017 · 9 comments

Comments

@Swiftb0y
Copy link

Swiftb0y commented Jun 10, 2017

Steps to reproduce

./msfconsole
msf >load openvas
msf > openvas_connect swiftb0y *************************** 127.0.0.1 9392
/usr/share/metasploit-framework/vendor/bundle/ruby/2.3.0/gems/openvas-omp-0.0.4/lib/openvas-omp.rb:201:in `sendrecv': Object#timeout is deprecated, use Timeout.timeout instead.
[-] Error while running command openvas_connect: uninitialized constant OpenVASOMP::OMPConnectionError

Call stack:
/usr/share/metasploit-framework/plugins/openvas.rb:195:in `rescue in cmd_openvas_connect'
/usr/share/metasploit-framework/plugins/openvas.rb:189:in `cmd_openvas_connect'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:430:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:392:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:386:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:386:in `run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:205:in `run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
/usr/bin/msfconsole:48:in `<main>'`

Expected behavior

idk, I guess it should connect to the openvas scanner?

Current behavior

See above. Works fine via the openvas-webinterface.

~/.msf4/logs/framework.log`(nothing relevant in there):

`[06/02/2017 22:30:39] [w(0)] core: No connection received before the handler completed
[06/03/2017 13:25:37] [e(0)] core: Unable to load module /usr/share/metasploit-framework/modules/exploits/linux/smtp/haraka.py NoMethodError undefined method `match?' for #<String:0x0055e932991a80>
Did you mean?  match
[06/03/2017 13:27:54] [e(0)] core: The accept() returned nil in stream server listener monitor:  #<Socket:fd 14>
[06/04/2017 18:01:31] [e(0)] core: Unable to load module /usr/share/metasploit-framework/modules/exploits/linux/smtp/haraka.py NoMethodError undefined method `match?' for #<String:0x00558f5fae46a8>
Did you mean?  match
[06/05/2017 20:22:03] [e(0)] core: Unable to load module /usr/share/metasploit-framework/modules/exploits/linux/smtp/haraka.py NoMethodError undefined method `match?' for #<String:0x005637522f8020>
Did you mean?  match
[06/10/2017 09:25:37] [e(0)] core: Unable to load module /usr/share/metasploit-framework/modules/exploits/linux/smtp/haraka.py NoMethodError undefined method `match?' for #<String:0x0055eff74c5350>
Did you mean?  match
`

Metasploit version

metasploit v4.14.24-dev

I installed Metasploit with:

Kali package via apt

OS

uname -r:
4.9.0-kali4-amd64

modpr0be pushed a commit to modpr0be/metasploit-framework that referenced this issue Jun 12, 2017
@busterb
Copy link
Member

busterb commented Jun 15, 2017

It's saying there is a connection error, which leads me to believe you have an issue in the supplied parameters. There's an error coming down from the 3rd-party openvas-omp gem. You might track down who maintains that.

@Swiftb0y
Copy link
Author

yeah.... the last update was made in early 2011: https://github.com/kost/openvas-omp-ruby
So is the plugin dead or will r7 make a replacement?

@busterb
Copy link
Member

busterb commented Jun 15, 2017

It's an open-source project, anyone can improve it.

@Swiftb0y
Copy link
Author

Anyone who knows how to make gems, which is not me...

@pbarry-r7
Copy link
Contributor

pbarry-r7 commented Jun 15, 2017

@Swiftb0y, you might check you are connecting to the correct mgmt port (usually it's 9390): http://www.ehacking.net/2011/11/how-to-use-openvas-in-metasploit.html

@Swiftb0y
Copy link
Author

GOD!!! I hate myself... that was the problem. I literally tried ports 9391 through 9399....
Sorry for costing you time.

@pbarry-r7
Copy link
Contributor

Glad it worked out. 👍

@mursson
Copy link

mursson commented Dec 19, 2018

I was trying port 9392 as the web interface uses this and didn't work.

Thanks for this useful comment! @pbarry-r7

@ayadim
Copy link

ayadim commented Nov 15, 2019

hi brother ... am facing the same problem but with different details
am using metasploit 5 and openvas is running on appliance
i tried many port 9390 - 9399 but still the same problem
i tried to scan the appliance but i don't get any port of these ... 9390 - 9399 port
only these two :
80/tcp open http
443/tcp open https

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

No branches or pull requests

5 participants