Hi bricks, first of all thanks for your time and attention.
I want to create a Linux command using gvm-cli or a python script that with just the report id i could make download of a report of a task in xml format.
So the code that i coded is based in the script of the GitHub(“download a single report as PDF”).
And the output of the code is just the HTTP 200 code with the HTML code, but does not download any report:
<get_reports_response status=“200” status_text=“OK”>admin2022-08-10T09:59:18Z<creation_time>2022-08-10T09:59:18Z</creation_time><modification_time>2022-08-10T10:05:00Z</modification_time>0<in_use>0</in_use>Teste3 - 127.0.0.321.4nameascendingapply_overrides=0 min_qod=70 first=1 rows=10 sort=nameHighMediumLowLogapply_overrides=0min_qod=70first=1rows=10sort=name<scan_run_status>Stopped</scan_run_status>1<closed_cves>0</closed_cves>700<ssl_certs>0</ssl_certs>Teste3 - 127.0.0.3Este é o teste tres.0Teste3 - 127.0.0.3Este é o teste tres.962022-08-10T09:58:56Z<scan_start>2022-08-10T09:59:18Z</scan_start>Coordinated Universal Time<timezone_abbrev>UTC</timezone_abbrev><result_count>88800008800<false_positive>00</false_positive></result_count>0.00.0<scan_end>2022-08-10T10:05:00Z</scan_end>0admin2022-08-10T15:30:38Z<creation_time>2022-08-10T15:30:38Z</creation_time><modification_time>2022-08-10T15:32:37Z</modification_time>0<in_use>0</in_use>Teste1 - 127.0.0.121.4nameascendingapply_overrides=0 min_qod=70 first=1 rows=10 sort=nameHighMediumLowLogapply_overrides=0min_qod=70first=1rows=10sort=name<scan_run_status>Stopped</scan_run_status>1<closed_cves>0</closed_cves>100<ssl_certs>0</ssl_certs>Teste1 - 127.0.0.1Este é o teste um.0Teste1 - 127.0.0.1Este é o teste um.02022-08-10T15:30:19Z<scan_start>2022-08-10T15:30:38Z</scan_start>Coordinated Universal Time<timezone_abbrev>UTC</timezone_abbrev><result_count>77700007700<false_positive>00</false_positive></result_count>0.00.0<scan_end>2022-08-10T15:32:37Z</scan_end>0apply_overrides=0 min_qod=70 first=1 rows=10 sort=nameapply_overrides=0min_qod=70first=1rows=10sort=namenameascending<report_count>222</report_count></get_reports_response>
Another things that i don’t understand is that in my python script when i use response = gmp.get_reports(), it works but if i put arguments in the response = gmp.get_reports(arguments) the error output is “TypeError: ReportsMixin.get_reports() takes 1 positional argument but 2 were given”, and in the github example its given more arguments “response = gmp.get_report(
report_id=report_id, report_format_id=pdf_report_format_id
)”
I viewed the links you send so i did this commands:
Hi y0urself, thanks for the help, seems like that was the problem.
But now i have another, im trying to convert the xml report to docx, and the report that i downloaded form the gui show me only the vulnerabilities, in my case a medium one, but when download the same report from my script only shows me vulnerabilities risk none. I changed the filter using the final_answer.replace(‘apply_overrides=0 min_qod=70 first=1 rows=10 sort=name’, ‘apply_overrides=0 levels=hml rows=1000 min_qod=70 first=1 sort-reverse=severity notes=1 overrides=1’), but still does not change nothing.
Im seeding the good and bad report in docx format and in xml fomat to show how is the output
if you could give any tips, i would be grateful teste1-bom.xml (193.8 KB) teste1-bom.docx (55.2 KB) teste1-mau2.xml (216.9 KB) teste1-mau2.docx (64.6 KB)