• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.pylintrcH A D27-Oct-202114.4 KiB474357

README.mdH A D27-Oct-202111.3 KiB392223

application-detection.gmp.pyH A D27-Oct-20212 KiB7338

bulk-modify-schedules.gmp.pyH A D27-Oct-20212.6 KiB8950

cfg-gen-for-certs.gmp.pyH A D27-Oct-20213.3 KiB11362

check-gmp.gmp.pyH A D27-Oct-202141.6 KiB1,4051,024

clean-sensor.gmp.pyH A D27-Oct-20213 KiB9258

combine-reports.gmp.pyH A D27-Oct-20214 KiB12580

create-consolidated-report.gmp.pyH A D27-Oct-202110.3 KiB369272

create-cve-report-from-json.gmp.pyH A D27-Oct-202118.9 KiB586479

create-dummy-data.gmp.pyH A D27-Oct-20212.8 KiB9758

create-targets-from-host-list.gmp.pyH A D27-Oct-20212.5 KiB8948

default_report_data.jsonH A D27-Oct-202127.3 KiB833833

delete-overrides-by-filter.gmp.pyH A D27-Oct-20211.9 KiB7234

export-pdf-report.gmp.pyH A D27-Oct-20212.7 KiB9247

generate-random-reports.gmp.pyH A D27-Oct-202113.3 KiB465353

generate-random-targets.gmp.pyH A D27-Oct-20212.3 KiB7839

list-tasks.gmp.pyH A D27-Oct-20211.4 KiB4616

monthly-report-gos4.gmp.pyH A D27-Oct-20213.6 KiB12275

monthly-report.gmp.pyH A D27-Oct-20214.2 KiB13986

nvt-scan.gmp.pyH A D27-Oct-20213.6 KiB12472

scan-new-system.gmp.pyH A D27-Oct-20213.1 KiB10561

send-delta-emails.gmp.pyH A D27-Oct-20217.4 KiB221165

send-schedules.gmp.pyH A D27-Oct-20212.4 KiB8443

send-targets.gmp.pyH A D27-Oct-20214.4 KiB14289

send-tasks.gmp.pyH A D27-Oct-20215.8 KiB180126

start-alert-scan.gmp.pyH A D27-Oct-202111.1 KiB402303

start-multiple-alerts-scan.gmp.pyH A D27-Oct-20218.7 KiB293201

start-nvt-scan.gmp.pyH A D27-Oct-20215.5 KiB190122

sync-hosts.gmp.pyH A D27-Oct-20212.4 KiB7640

update-task-target.gmp.pyH A D27-Oct-20214.8 KiB175112

README.md

1![Greenbone Logo](https://www.greenbone.net/wp-content/uploads/gb_logo_resilience_horizontal.png)
2
3# GVM Example Scripts
4
5## `application-detection.gmp.py`
6
7This script will search the reports and display all hosts with the requested applications!
8
9### Arguments
10
11* `<application>`: Name of the application
12
13### Example
14
15  `$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/application-detection.gmp.py <application>`
16
17---
18
19## `cfg-gen-for-certs.gmp.py`
20
21This script creates a new scan config with nvts from a given CERT-Bund!
22
23### Arguments
24
25* `<cert>`: Name or ID of the CERT-Bund
26
27### Example
28
29`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/cfg-gen-for-certs.gmp.py CB-K16/0943`
30
31---
32
33## `check-gmp.gmp.py`
34
35This script can test different methods of the gmp API.
36
37| Optional argument | Description |
38| --- | --- |
39|`-H`:      |              Show this help message and exit
40|`-V`, `--version`: |        Show program's version number and exit
41|`--cache [CACHE]`:  |   Path to cache file. Default: `/var/folders/mk/ dfxkj16j4779x98r26n21qnr0000gn/ T/check_gmp/reports.db`
42| `--clean` | Activate to clean the database
43| `-u GMP_USERNAME`, `--gmp-username GMP_USERNAME` | GMP username
44| `-w GMP_PASSWORD`, `--gmp-password GMP_PASSWORD` | GMP password
45|`-F HOSTADDRESS`, `--hostaddress HOSTADDRESS` | Report last report status of host `<ip>`.
46|`-T TASK`, `--task TASK` | Report status of task `<task>`.
47|`--apply-overrides`    | Apply overrides.
48|`--overrides`          | Include overrides.
49|`-d`, `--details`       |  Include connection details in output.
50|`-l`, `--report-link`   |  Include URL of report in output.
51|`--dfn`               |  Include DFN-CERT IDs on vulnerabilities in output.
52|`--oid`               |  Include OIDs of NVTs finding vulnerabilities in output.
53|`--descr`             |  Include descriptions of NVTs finding vulnerabilities in output.
54|`--showlog`           |  Include log messages in output.
55| `--show-ports`       |   Include port of given vulnerable nvt in output.
56| `--scanend`          |   Include timestamp of scan end in output.
57| `--autofp {0,1,2}`  |    Trust vendor security updates for automatic false positive filtering (`0=No`, `1=full match`, `2=partial`).
58| `-e`, `--empty-as-unknown` | Respond with `UNKNOWN` on empty results.
59| `-I MAX_RUNNING_INSTANCES`, `--max-running-instances MAX_RUNNING_INSTANCES` | Set the maximum simultaneous processes of check-gmp
60| `--hostname [HOSTNAME]`
61| `--ping`               | Ping the gsm appliance.
62| `--status`            |  Report status of task.
63| `--days DAYS`        |   Delete database entries that are older than given days.
64| `--ip IP`             |  Delete database entry for given ip.
65| `--trend`             |  Report status by trend.
66| `--last-report`      |   Report status by last report.
67
68### Example
69
70`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/check-gmp.gmp.py --ip 127.0.0.1 --ping`
71
72---
73
74## `clean-sensor.gmp.py`
75
76This script removes all resources from a sensor, except active tasks.
77
78### Example
79
80`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/clean-sensor.gmp.py`
81
82---
83
84## `combine-reports.gmp.py`
85
86This script will combine desired reports into a single report. The combined report will then be sent to a desired container task. This script will create a container task for the combined report to be sent to, however, if you would like the report to be sent to an existing task, place the report of the desired task first and add the argument 'first_task'.
87
88### Arguments
89
90* `<report_1_uuid>, ..., <report_n_uuid>`: UUIDs of the reports to be combined
91
92### Example
93
94`$ gvm-script --gmp-username=namessh --gmp-password=pass ssh --hostname=hostname scripts/combine-reports.gmp.py "d15a337c-56f3-4208-a462-afeb79eb03b7" "303fa0a6-aa9b-43c4-bac0-66ae0b2d1698" 'first_task'`
95
96---
97
98## `create-dummy-data.gmp.py`
99
100This script will create random data in the given GVM database.
101
102### Arguments
103
104* `<count>`: Number of datasets to create
105
106### Example
107
108`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/create-dummy-data.gmp.py <count>`
109
110---
111
112## `create-targets-from-host-list.gmp.py`
113
114This script pulls hostnames from a text file and creates a target for each.
115
116### Arguments
117
118* `<hostname>`: IP of the GVM host
119* `<hosts_textfile>`: text file containing hostnames
120
121### Example
122
123`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/create_targets_from_host_list.gmp.py <hostname> <hosts_textfile>`
124
125---
126
127## `delete-overrides-by-filter.gmp.py`
128
129This script deletes overrides with a specific filter value.
130
131### Arguments
132
133* `<filter>`: the parameter for the filter.
134
135### Example
136
137`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/delete-overrides-by-filter.gmp.py <filter>`
138
139---
140
141## `gen-random-targets.gmp.py`
142
143This script generates random task data and feeds it to a desired GSM database.
144
145### Arguments
146
147* `<host_number>`: number of dummy hosts to select from
148* `<number>`: number of targets to be generated
149* `'with-gauss'`: (optional), if you would like for the number of targets generated
150    to be randomized on a Gaussian distribution
151
152### Example
153
154`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/gen-random-targets.gmp.py 3 40 with-gauss`
155
156---
157
158## `list-tasks.gmp.py`
159
160Lists the tasks stored in an GSM Database
161
162### Example
163
164`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/list-tasks.gmp.py`
165
166---
167
168## `monthly-report.gmp.py`
169
170This script will display all vulnerabilities from the hosts of the reports in a given month!
171
172### Arguments
173
174* `<month>`: month of the monthly report
175* `<year>`: year of the monthly report
176* `'with-tables'`: (optional), parameter to activate a verbose output of hosts.
177
178### Example
179
180`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/monthly-report.gmp.py 05 2019 with-tables`
181
182---
183
184## `monthly-report2.gmp.py`
185
186This script will display all vulnerabilities from the hosts of the reports in a given month!
187
188### Arguments
189
190* `<month>`: month of the monthly report
191* `<year>`: year of the monthly report
192
193### Example
194
195`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/monthly-report2.gmp.py 05 2019`
196
197---
198
199## `nvt-scan.gmp.py`
200
201This script creates a new task with specific host and nvt!
202
203### Arguments
204* `<oid>`:   oid of the nvt
205* `<target>`: scan target.
206
207### Example
208
209`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> 1.3.6.1.4.1.25623.1.0.106223 localhost`
210
211---
212
213## `pdf-report.gmp.py`
214
215This script requests the given report and saves it as a pdf file locally.
216
217### Arguments
218
219* `<report_id>`: ID of the report
220* `<pdf_filename>`: (optional), pdf file name
221
222### Example
223
224`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/pdf-report.gmp.py <report_id> <pdf_file>`
225
226---
227
228## `random-report-gen.gmp.py`
229
230This script generates randomized report data.
231
232### Arguments
233
234* `<number of tasks>`:   number of tasks to be generated
235* `<number of reports>`: number of reports per task
236* `<number of results>`: number of results per report
237* `<number of hosts>`:   number of randomized hosts to select from
238* `'with-gauss'`: if you would like for the number of reports/task and results/report to be randomized along a Gaussian distribution
239
240### Example
241
242`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/random-report-gen.gmp.py 10 50 2500 256 with-gauss`
243
244---
245
246## `scan-new-system.gmp.py`
247
248This script starts a new scan on the given host.
249
250### Arguments
251
252* `<host_ip>`  IP Address of the host system
253
254### Example
255
256`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/scan-new-system.gmp.py <host_ip>`
257
258---
259
260## `send-delta-emails.gmp.py`
261
262This script, once started, will continuously send delta reports via email for selected tasks. The routine follows this procedure:
263
264Every `<interval>` minutes do:
265* Get all tasks where the tag `<task_tag>` is attached.
266* For each of these tasks get the finished reports:
267  * If less than 2 reports, continue with next task
268  * If latest report has tag "delta_alert_sent", continue with next task
269  * Create a CSV report from the delta of latest vs. previous report where filtered for only the new results.
270  * Send the CSV as an attachment to the configured email address.
271
272> You may edit the scripts hardcoded variables like `from_address`, `to_address`, etc.
273
274### Example
275
276`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/send-delta-emails.gmp.py`
277
278---
279
280## `send-schedules.gmp.py`
281
282This script pulls schedule data from an xml document and feeds it to a desired GSM.
283
284### Arguments
285
286* `<xml_doc>`:   .xml file containing schedules
287
288### Example
289
290`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/send-schedules.gmp.py example_file.xml`
291
292---
293
294## `send-targets.gmp.py`
295
296This script pulls target data from an xml document and feeds it to a desired GSM.
297
298### Arguments
299
300* `<xml_doc>`:   .xml file containing schedules
301
302### Example
303
304`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/send-targets.gmp.py example_file.xml`
305
306---
307
308## `send-tasks.gmp.py`
309
310This script pulls tasks data from an xml document and feeds it to a desired GSM.
311
312### Arguments
313
314* `<xml_doc>`:   .xml file containing schedules
315
316### Example
317
318`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/send-tasks.gmp.py example_file.xml`
319
320---
321
322## `start-alert-scan.gmp.py`
323
324This script makes an alert scan and sends the report via email.
325
326### Arguments
327
328* `<sender_email>`:      E-Mail of the sender
329* `<receiver_email>`:    E-Mail of the receiver
330
331### Example
332
333`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/start-alert-scan.gmp.py <sender_email> <receiver_email>`
334
335---
336
337## `start-multiple-alerts-scan.gmp.py`
338
339This script makes an alert scan and sends the report via email.
340
341### Arguments
342
343* `<sender_email>`:      E-Mail of the sender
344* `<receiver_email>`:    E-Mail of the receiver
345
346### Example
347
348`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/start-multiple-alerts-scan.gmp.py <sender_email> <receiver_email>`
349
350---
351
352## `start-nvt-scan.gmp.py`
353
354This script creates a new task (if the target is not existing) with specific host and nvt!
355
356### Arguments
357* `<oid>`:   oid of the nvt
358* `<target>`: scan target.
359
360### Example
361
362`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/start-nvt-scan.gmp.py 1.3.6.1.4.1.25623.1.0.106223 localhost`
363
364---
365
366## `sync-assets.gmp.py`
367
368This script reads asset data from a csv file and sync it with the gsm.
369
370### Arguments
371
372* `<csv_file>`:    should contain a table of IP-addresses with an optional a comment
373
374### Example
375
376`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/sync-assets.gmp.py <csv_file>`
377
378---
379
380## `update-task-target.gmp.py`
381
382This script will update target hosts information for a desired task.
383
384### Arguments
385
386* `<hosts_file>`:   .csv file containing desired target hosts separated by ','
387* `<task_uuid>`:    uuid of task to be modified
388
389### Example
390
391`$ gvm-script --gmp-username name --gmp-password pass ssh --hostname <gsm> scripts/update-task-target.gmp.py hosts_file.csv "303fa0a6-aa9b-43c4-bac0-66ae0b2d1698"`
392