Hi,

The Greenbone interface for OpenVAS 7 won't let me add a target with
credentials, so I'm trying to do it with OMP ... but I'm getting an error
message.

Would anyone be able to give me a workaround or tell me what I'm doing
wrong?  Maybe I just need another pair of eyes on it.  Here are the details:

# omp -X '
<create_lsc_credential>
    <name>OpenVAS SSH Key</name>
    <login>root</login>
    <key>
        <private>-----BEGIN RSA PRIVATE KEY-----
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-----END RSA PRIVATE KEY-----</private>
        <public>ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABAQCjoIDsiJWLMtGp7dNa4KinMsJroEceK/DkgZmGcGInctAUDfj5wFoFMKjPsuPn9dvRWqG9NYJBazCAK6OeqowEGJ4FcAHDGRSn1JB27a4/8KlHopwikMXHlSIZPnSp/xeiKRnBV+MBN433CovigVsh0NsRyB4Wzl5Ng+NYNPP0TkoTc+gWwBO7icIbyeg4epqOVL9LjVlh2dpRNQpx9yyDatLOie8cgrvbsMiVG9gC/aqVSiXwW2cgyckEz+2mDmgCIGf7Spd3Fi5Ohw9zebn7aw54qoYaAbThEyeWRKwie/DvvO7U4RtAijHDzvQ48NOYFQx7nlqWyCoiY+SGtATZ
openvas@openvas</public>
    </key>
</create_lsc_credential>
'


This appears to succeed.

# cat bin/ompx
#!/bin/bash
omp -i -X "<$*/>"
# ompx get_lsc_credentials
    <get_lsc_credentials_response status_text="OK" status="200">
      <lsc_credential id="d50da9b2-58a3-4c19-8194-a3d1d5d7ca14">
        <owner>
          <name>admin</name>
        </owner>
        <name>OpenVAS SSH Key</name>
        <comment></comment>
        <creation_time>2014-09-17T20:17:36Z</creation_time>
        <modification_time>2014-09-17T21:04:59Z</modification_time>
        <writable>1</writable>
        <in_use>0</in_use>
        <permissions>
          <permission>
            <name>Everything</name>
          </permission>
        </permissions>
        <user_tags>
          <count>0</count>
        </user_tags>
        <login>root</login>
        <type>gen</type>
      </lsc_credential>
      ...


But adding a target with these credentials fails.

# omp -v -X '
<create_target>
    <name>Johns Test VM</name>
    <hosts>10.0.1.17</hosts>
    <ssh_lsc_credential id=”d50da9b2-58a3-4c19-8194-a3d1d5d7ca14”>
        <port>22</port>
    </ssh_lsc_credential>
</create_target>
'
WARNING: Verbose mode may reveal passwords!
Will try to connect to host localhost, port 9390...
Sending to manager:
<create_target>
    <name>Johns Test VM</name>
    <hosts>10.0.1.17</hosts>
    <ssh_lsc_credential id=”d50da9b2-58a3-4c19-8194-a3d1d5d7ca14”>
        <port>22</port>
    </ssh_lsc_credential>
</create_target>
lib   xml-Message:    Error: Error on line 1 char 1: Document was empty or
contained only whitespace
(omp:3776): lib   xml-WARNING **:    End error: Error on line 1 char 1:
Document was empty or contained only whitespace
Failed to read response.



I'm using the OpenVAS 7 virtual appliance, which I updated to the latest:

greenbone-security-assistant-5.0.3.tar.gz
openvas-cli-1.3.0.tar.gz
openvas-libraries-7.0.4.tar.gz
openvas-manager-5.0.4.tar.gz
openvas-scanner-4.0.3.tar.gz


Any help would be much appreciated!

--John
Sept 17, 2014
_______________________________________________
Openvas-discuss mailing list
[email protected]
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss

Reply via email to