No matter what I do I am unable to pass arguments to the gvm-tools. I am running:
Centos 7.6
gvmd-8.0.0-6928.el7.art.x86_64
greenbone-security-assistant-8.0.0-6932.el7.art.x86_64
greenbone-vulnerability-manager-10.0.0-6947.el7.art.noarch
And via pip gvm-tools 2.0.0b1
I have configured my gvm-tools.conf like so:
[main]
timeout=60
hostname=127.0.0.1
tls_path=/var/lib/gvm/CA
[gmp]
gmp_username=USERME
gmp_password=PASSSSS
[ssh]
username=USERME
password=PASSSSS
port=9392
[unixsocket]
socketpath=/usr/local/var/run/gvmd.sock
[tls]
port=9392
certfile=%(tls_path)s/clientcert.pem
keyfile=%(tls_path)s/servercert.pem
cafile=%(tls_path)s/cacert.pem
And it seems that regardless of the position of the options or what options I give gvm-pyshell or gvm-cli it keeps getting confused over the options.
first of all I am wondering why a beta version got packaged for end users. Beta version are likely to have bugs and are mostly intended for early adopters.
Iâve re-written the parser of gvm-tools in master since the this last release. So you could try to use the master branch instead.
I just download the master branch via GIT and when I ran a pip install . It told me that it was installing:
Successfully built gvm-tools
Installing collected packages: gvm-tools
Found existing installation: gvm-tools 2.0.0b1
Uninstalling gvm-tools-2.0.0b1:
Successfully uninstalled gvm-tools-2.0.0b1
Successfully installed gvm-tools-2.0.0b1
I tried re-cloning from master (which is what I always do anyway) but it was the same version. On the github page it says:
Latest commit 1d558cd on Apr 23
So I am not sure where you updated too.
I can open a ticket if you still want me to. Or I can try the version in the repo:
gvm-tools.noarch 1.4.1-6952.el7.art
However, the reason I uninstalled the version in the repo was because gvm-cli and gvm-pyshell were not found as a normal user but only as root. And this was not a path problem in the shell since my user could see /usr/bin/gvm-cli. The python scripts in gvm-tools could not find things.
Since this release/tag Iâve changed the code in the master branch regarding parsing the console line arguments. This code still has some small issue I would like to fix before the final 2.0.0 release but may already have fixed your issues hopefully. If not please create a new ticket via https://github.com/greenbone/gvm-tools/issues/new
So that I fully understand what you are asking do you want me to install with: pip install gvm-tools --user (so it installs from pypi.org)
Or do you want me to do:
git clone https://github.com/greenbone/gvm-tools.git
cd gvm-tools
pip install . --user
Regardless if I do:
git clone https://github.com/greenbone/gvm-tools.git
cd gvm-tools
pip install . --user
or pip install gvm-tools #(to install from pypi.org)
I end up with the same version of gvm-tools-2.0.0b1. Is there another place I can down load it? Or is there a branch I can down load???
As I already wrote thatâs ok and expected. I did forgot to increment the version in master branch after the 2.0.0beta1 release. Therefore both will show 2.0.0b1 as version but contain different code.
Ok tried that. Now getting this error:
[lbohm@pci-sec02 ~]$ gvm-cli ssh --hostname=127.0.0.1 --xml="<get_version/>"
ERROR:paramiko.transport:Exception: Error reading SSH protocol banner
ERROR:paramiko.transport:Traceback (most recent call last):
ERROR:paramiko.transport: File â/usr/lib/python3.6/site-packages/paramiko/transport.pyâ, line 1930, in _check_banner
ERROR:paramiko.transport: buf = self.packetizer.readline(timeout)
ERROR:paramiko.transport: File â/usr/lib/python3.6/site-packages/paramiko/packet.pyâ, line 331, in readline
ERROR:paramiko.transport: buf += self._read_timeout(timeout)
ERROR:paramiko.transport: File â/usr/lib/python3.6/site-packages/paramiko/packet.pyâ, line 487, in _read_timeout
ERROR:paramiko.transport: raise EOFError()
ERROR:paramiko.transport:EOFError
ERROR:paramiko.transport:
ERROR:paramiko.transport:During handling of the above exception, another exception occurred:
ERROR:paramiko.transport:
ERROR:paramiko.transport:Traceback (most recent call last):
ERROR:paramiko.transport: File â/usr/lib/python3.6/site-packages/paramiko/transport.pyâ, line 1782, in run
ERROR:paramiko.transport: self._check_banner()
ERROR:paramiko.transport: File â/usr/lib/python3.6/site-packages/paramiko/transport.pyâ, line 1934, in _check_banner
ERROR:paramiko.transport: raise SSHException(âError reading SSH protocol bannerâ + str(e))
ERROR:paramiko.transport:paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
ERROR:paramiko.transport:
(âSSH Connection failedâ, SSHException(âError reading SSH protocol bannerâ,))
Googling that it seems related to this issue: https://github.com/paramiko/paramiko/issues/673. But I am running:
[lbohm@pci-sec02 ~]$ pip list
Package Version
------------ -------
asn1crypto 0.24.0
cffi 1.9.1
cryptography 2.3
defusedxml 0.6.0
gvm-tools 2.0.0b1
idna 2.7
lxml 4.3.3
paramiko 2.1.1
pip 19.1.1
ply 3.9
pyasn1 0.1.9
pycparser 2.14
python-gvm 1.0.0b2
setuptools 41.0.1
six 1.11.0
wheel 0.33.4
And from what I can see the problem is not really in paramiko but with the code used to called it. Specifically the time out.
Can you please explain to me why this does not work:
[lbohm@pci-sec02 ~]$ gvm-cli socket --gmp-username=admin --gmp-password=8gUtP*zeUhefmpT --xml="<get_tasks/>"
usage: gvm-cli [-h] [-c [CONFIG]]
[âlog [{DEBUG,INFO,WARNING,ERROR,CRITICAL}]]
[âtimeout TIMEOUT] [âgmp-username GMP_USERNAME]
[âgmp-password GMP_PASSWORD] [-V] [âprotocol {GMP,OSP}]
CONNECTION_TYPE âŠ
gvm-cli: error: unrecognized arguments: --gmp-username=admin --gmp-password=8gUtP*zeUhefmpT
But this does work; gvm-cli socket --xml "<commands><authenticate><credentials><username>admin</username><password>8gUtP*zeUhefmpT</password></credentials></authenticate> <get_tasks/> </commands>"