Thanks everybody for the reply. I think I know what's going on but I still
have no solution. First of all, the "cat ..." approach will give following
result:

cat haha.xml | omp -v -h 192.168.2.235 -u nopsec -w passwd -p 9390 -X -

WARNING: Verbose mode may reveal passwords!

Will try to connect to host 192.168.2.235, port 9390...
(omp:27127): lib  serv-DEBUG:    Connected to server.
(omp:27127): lib  serv-DEBUG:    Shook hands with server.
(omp:27127): lib  serv-DEBUG:    send 113 from
<authenticate><credentials><us[...]
(omp:27127): lib  serv-DEBUG: =>
<authenticate><credentials><username>nopsec</username><password>passwd</password></credentials></authenticate>
(omp:27127): lib  serv-DEBUG: => done
lib   xml-Message:    asking for 1048576

lib   xml-Message: <= <authenticate_response status="200"
status_text="OK"><role>Admin</role><timezone>UTC</timezone></authenticate_response>

Sending to manager: -
(omp:27127): lib  serv-DEBUG:    send 1 from -[...]
(omp:27127): lib  serv-DEBUG: => -
(omp:27127): lib  serv-DEBUG: => done
lib   xml-Message:    asking for 1048576

lib   xml-Message:    Error: Error on line 1 char 1: Document was empty or
contained only whitespace

lib   xml-Message:    End error: Error on line 1 char 1: Document was empty
or contained only whitespace

Failed to read response.

I think that "-" at the end of the command might not be working very well,
or there's something else that I'm missing. I also tried this:

omp -v -h 192.168.2.235 -u nopsec -w passwd -p 9390 -X $(< haha.xml)

WARNING: Verbose mode may reveal passwords!

Will try to connect to host 192.168.2.235, port 9390...
(omp:27326): lib  serv-DEBUG:    Connected to server.
(omp:27326): lib  serv-DEBUG:    Shook hands with server.
(omp:27326): lib  serv-DEBUG:    send 113 from
<authenticate><credentials><us[...]
(omp:27326): lib  serv-DEBUG: =>
<authenticate><credentials><username>nopsec</username><password>passwd</password></credentials></authenticate>
(omp:27326): lib  serv-DEBUG: => done
lib   xml-Message:    asking for 1048576

lib   xml-Message: <= <authenticate_response status="200"
status_text="OK"><role>Admin</role><timezone>UTC</timezone></authenticate_response>

Sending to manager: "<create_config><get_configs_response><config
(omp:27326): lib  serv-DEBUG:    send 45 from
"<create_config><get_configs_r[...]
(omp:27326): lib  serv-DEBUG: =>
"<create_config><get_configs_response><config
(omp:27326): lib  serv-DEBUG: => done
lib   xml-Message:    asking for 1048576

lib   xml-Message:    Error: Error on line 1 char 1: Document was empty or
contained only whitespace

lib   xml-Message:    End error: Error on line 1 char 1: Document was empty
or contained only whitespace

It seems like the shell treats all the white spaces in my xml file as a
separation for the command line arguments, and I'm not sure how to make
that xml as one big argument. But I think even if I can do that, the shell
might still give me "argument list too long" error.

Anyway, I want to thank again for everybody's help, but at this point I
might switch to using gsd to manually import/export config template, as
this might be a little easier with GUI.


On Thu, Jul 19, 2012 at 3:13 PM, Felix Wolfsteller <
felix.wolfstel...@intevation.de> wrote:

> Hi Shang
>
> Am Donnerstag 19 Juli 2012 00:28:37 schrieb Shang Wang:
> > Dear all:
> >
> > I'm basically hairless after trying all possible methods to create a
> config
> > template in OpenVAS using OMP commands(some people might have seen my
> > previous email). I have no problem exporting xml file as a template from
> > OpenVAS, but then I couldn't import it into another scanner. According to
> > the descriptions on the
> > website<http://www.openvas.org/omp-2-0.html#command_create_config>,
> > I can use 2 methods to do the import. The first one is wrapping a
> > "<create_config></create_config>" tag around the "<get_config>"
> response. I
> > tried to do this but linux gives me "command list too long" message. I
> > tried the advice from Matthew(thx Matthew) using a file to store the
> whole
> > thing and do "cat command_in_file | omp -u username -w password -p port
> -X
> > -", but it doesn't seem to work. I also tried the other approach, which
> is
>
> What exactly did not work with the "cat ..." approach?
> --f
>
> > "<create_config><rcfile></rcfile></create_config>", but I couldn't find
> any
> > resource about the format of the rcfile. If I run the command, it will
> > create an empty config with no plugin selected. My questions is that: can
> > anybody point me to some resource on how should I write an rcfile? Or I
> can
> > download the rcfile from somewhere? Thanks.
>
>
_______________________________________________
Openvas-devel mailing list
Openvas-devel@wald.intevation.org
http://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-devel

Reply via email to