Hi Jeremy, I've done this last month.
The only way to do what you want with OMP is to create a temporary target and affects it to the task. Then modify your target, and affects it back to your target. The command to do this is : omp -u User -w Password -X '<modify_task task_id="HERE IS YOUR TASK ID"><target id="HERE IS YOUR TARGET ID TO AFFECT TO THE TASK"/></modify_task>' I have full automate my scans in python scripts with that to modify my task and its target. Regards, Rémi. 2017-08-31 16:27 GMT+02:00 Thijs Stuurman < [email protected]>: > I checked GVM Tools which contains functions such as: > > > > def create_target(self, name, make_unique, **kwargs) > > def delete_target(self, target_id, ultimate=0) > > def modify_target(self, target_id, **kwargs) > > def modify_task(self): > > > > but found: > > > > “”” > > def modify_task(self): > > # TODO: Multiple values are required to modify a task. Is this > correct? > > raise NotImplementedError > > “”” > > > > So.. I guess not yet. > > The “old” command line OMP has the option: > > > > -M, --modify-task Modify a task. > > > > But I never used it, not sure how it works. > > > > Thijs Stuurman > > Security Operations Center | KPN Internedservices > > [email protected] | [email protected] > > T: +31(0)299476185 <+31%20299%20476%20185> | M: +31(0)624366778 > <+31%206%2024366778> > > PGP Key-ID: 0x16ADC048 (https://pgp.surfnet.nl/) > > Fingerprint: 2EDB 9B42 D6E8 7D4B 6E02 8BE5 6D46 8007 16AD C048 > > > > W: https://www.internedservices.nl | L: http://nl.linkedin.com/in/ > thijsstuurman > > > > *Van:* Openvas-discuss [mailto:[email protected]] > *Namens *CAMPBELL Jeremy > *Verzonden:* donderdag 31 augustus 2017 16:13 > *Aan:* [email protected] > *Onderwerp:* [Openvas-discuss] Modifying task targets with omp [PUBLIC] > > > > Hi all, > > > > I have some systems in a dynamic cloud environment, and I’m trying to > automate the maintenance of targets in OpenVAS. In the past, I’ve used > alterable tasks, periodically created an updated target group, and modified > the task’s configuration to use that group. I can programmatically create > targets, but I don’t see a way to change the target group used by an > alterable task. Is it possible to change targets on a alterable task from > the command line? I’m open to doing something outside of omp if necessary. > > > > Thanks, > > JeremyThis message was classified *PUBLIC *by CAMPBELL Jeremy on > Thursday, August 31, 2017 at 10:12:47 AM. > > > ------------------------------ > > > This message, including attachments, is intended for the above-mentioned > addressees only. It may contain confidential information the review, > dissemination or disclosure of which is strictly prohibited. Should you > receive this message in error, please delete it and notify the sender to > the e-mail address indicated above. > ------------------------------ > > > ---------- Message transféré ---------- > From: Jan-Oliver Wagner <[email protected]> > To: OpenVAS Announcement List <[email protected]> > Cc: > Bcc: > Date: Thu, 10 Aug 2017 08:23:26 +0000 > Subject: [Openvas-announce] GVM-Tools > Dear OpenVAS / Greenbone Users, > > we are happy to announce the availability of GVM-Tools. This is a > collection of tools for remote controlling a OpenVAS / Greenbone > setup and is intended to replace the "openvas-cli" module with > its "omp" and "check_omp" command line tools. > > The new approach is comprised of interactive and non-interactive clients as > well as supporting libraries. The programming language Python is supported > directly for interactive scripting and library use. But it is also possible > to issue remote GMP/OMP/OSP commands without programming in Python. > > The tools are compatible with the connection methods TLS, file socket > and with the SSH GMP connection of Greenbone OS version 4. In other > words, it can be used for any supported Greenbone OS version and for > any supported OpenVAS version. > > The source code downloads are available from the usual place: > > http://www.openvas.org/install-source.html > > We have prepared standalone binaris for Windows, including the > Python environment making it unnecessary to install anything else. > The latest versions are available as (*) > > http://download.greenbone.net/tools/gvm-cli.exe > http://download.greenbone.net/tools/gvm-pyshell.exe > > > GVM-Tools is Open Source under the GNU General Public License. > The source code is currently managed at bitbucket where you can also > find some examples how to use the tools in practice: > > https://bitbucket.org/greenbone/gvm-tools > > > (*) Checksums of version 1.2.0: > SHA256 (gvm-cli.exe) = > ca19227ba49a732f69717a395db14f08c3b2cc4c73fd00a4d81ab71c4ba4d04d > SHA256 (gvm-pyshell.exe) = > 1d487c9a4d449ea1e4a15ff2a9e2af4020b7f378101d5960b1709fbd50d459de > > > Best regards > > -- > Dr. Jan-Oliver Wagner | +49-541-760278-0 | http://www.greenbone.net/ > Greenbone Networks GmbH, Neumarkt 12, 49074 Osnabrück | AG Osnabrück, HR B > 202460 > Geschäftsführer: Lukas Grunwald, Dr. Jan-Oliver Wagner > _______________________________________________ > Openvas-announce mailing list > [email protected] > https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/ > openvas-announce > > _______________________________________________ > Openvas-discuss mailing list > [email protected] > https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss >
_______________________________________________ Openvas-discuss mailing list [email protected] https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss
