greenbone / gvm-tools

Remote control your Greenbone Community Edition or Greenbone Enterprise Appliance
https://greenbone.github.io/gvm-tools/
GNU General Public License v3.0
167 stars 90 forks source link

how to activated the GMP Protocol? #17

Closed HelloXiaoHe closed 6 years ago

HelloXiaoHe commented 6 years ago

hi, I successfully installed openvas and gvm-tools.

cd /usr/local/python3.6.5/bin run ./gvm-cli socket --gmp-username admin --gmp-password 123456 --sockpath /run/redis/redis.sock --xml "Suspect Host10.17.2.137"

it return , timed out

and find the User Manuals , http://docs.greenbone.net/GSM-Manual/gos-4/en/omp.html#activating-the-gmp-protocol http://docs.greenbone.net/GSM-Manual/gos-4/en/systemadministration.html#gmp

but I cant find the menu

rgrewe commented 6 years ago

You have used the wrong socket. Default for sockpath is "/usr/local/var/run/openvasmd.sock". You have to look where your openvasmd.sock exist.

HelloXiaoHe commented 6 years ago

thanks,it works,i find my openvasmd.sock find / -name openvasmd.sock /run/openvasmd.sock then I try again ./gvm-cli socket --gmp-username admin --gmp-password 123456 --sockpath /run/openvasmd.sock --xml "Suspect Host10.17.2.137"

it return the right response

then I get the config_id ./gvm-cli socket --gmp-username admin --gmp-password 123456 --sockpath /run/openvasmd.sock --xml "" it return the config_id is e38627b6-9ea5-48cf-bb11-79413bd2c2cb and create the task

./gvm-cli socket --gmp-username admin --gmp-password 123456 --sockpath /run/openvasmd.sock --xml "Scan Suspect Host"

but it return Connection was closed by remote server

rgrewe commented 6 years ago

According to http://docs.greenbone.net/API/OMP/omp-7.0.html#command_create_task and http://docs.greenbone.net/GSM-Manual/gos-4/en/omp.html#activating-the-gmp-protocol you have to add at least a target id and a config id.

F.e.: --xml "Scan Suspect Host \ <target id=\"4574473f-a5d0-494c-be6f-3205be487793\"> \ <config id=\"daba56c8-73ec-11df-a475-002264764cea\">"

cfi-gb commented 6 years ago

@HelloXiaoHe I would suggest to move this discussion over to http://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss as also advised in https://github.com/greenbone/openvas-scanner/issues/71

This avoids that the information here gets lost within a bugtracker and is archived within the mailinglist.

HelloXiaoHe commented 6 years ago

it return ,Connection was closed by remote server @rgrewe I find the answer I see the log ,/var/log/openvas/openvassmd.log,it have some error md omp: INFO:2018-04-23 06h06.25 UTC:72488: Failed to parse client XML: Error on line 1 char 167: Odd character '0', expected an open quote mark after the equals sign when giving value for attribute 'id' of element 'target'

the interpunction is wrong,I use single quotes instead of double quotation marks “”

@cfi-gb hi, my English is poor,I dont know how to use the mailinglist,do you mean that I would sent the email with the discussion?