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
162 stars 89 forks source link

Credentials parameter issue while executing send-targets.gmp #233

Closed SanthoshSamaka closed 3 years ago

SanthoshSamaka commented 4 years ago

Expected behavior

ssh_credential should be considered as parameter

Current behavior

ssh_credential is not recognizing as parameter

Steps to reproduce

  1. execute below command which will create a target from xm;l template gvm-script --gmp-username <u/n>--gmp-password <p/w> socket --socketpath /var/run/openvasmd.sock send-targets.gmp target_template.xml

GVM versions

gsa: (gsad --version) Greenbone Security Assistant 7.0.3 Copyright (C) 2010-2016 Greenbone Networks GmbH License GPLv2+: GNU GPL version 2 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. gvm: (gvmd --version) openvasmd --version OpenVAS Manager 7.0.3 Manager DB revision 184 Copyright (C) 2010-2016 Greenbone Networks GmbH License GPLv2+: GNU GPL version 2 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

openvas-scanner: (openvassd --version) openvassd --version OpenVAS Scanner 5.1.3 Most new code since 2005: (C) 2016 Greenbone Networks GmbH Nessus origin: (C) 2004 Renaud Deraison deraison@nessus.org License GPLv2: GNU GPL version 2 This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

gvm-libs: gvm-script

gvm-tools: (gvm-cli --version) gvm-cli --version gvm-cli 2.0.0 (API version 1.0.0)

Environment

UBUNTU

git hub

Logfiles

Sending targets...
{'name': 'Template', 'hosts': '127.0.0.1', 'exclude_hosts': None, 'ssh_credential': {'id': '3ffecd7a-c6e3-499f-9220-83f5191f7fc3', 'port': '22'}, 'smb_credential': {'id': '3ffecd7a-c6e3-499f-9220-83f5191f7fc3'}, 'esxi_credential': {'id': '3ffecd7a-c6e3-499f-9220-83f5191f7fc3'}, 'port_range': 'T:22,80,443,2301,9920,9960,12443,U:22,80,443,2301,9920,9960,12443', 'port_list_id': 'f34642aa-e335-4781-81ed-2f2b58d1c195'}
Traceback (most recent call last):
  File "/usr/local/bin/gvm-script", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/gvmtools/script.py", line 119, in main
    run_script(args.scriptname, global_vars)
  File "/usr/local/lib/python3.6/dist-packages/gvmtools/helper.py", line 145, in run_script
    exec(file, global_vars)  # pylint: disable=exec-used
  File "<string>", line 166, in <module>
  File "<string>", line 160, in main
  File "<string>", line 145, in parse_send_xml_tree
TypeError: create_target() got an unexpected keyword argument 'ssh_credential'
y0urself commented 3 years ago

After all, this should now be fixed.