I’ve been doing some tinkering with using OpenVAS from the CLI through the use of GVM-tools and gvm-script. Most of what I want seems to work but the creation of .pdf reports seems to be “broken”. I’ve used the provided script from the gvm-tools github page (and manuals) gvm-tools/scripts/pdf-report. But this leaves me with the error “Uncorrect padding”. To fix this i’ve used a “filler” to fix the numbers of “=” at the end of the file.
content += “=” * ((4 - len(content) % 4) % 4)
This allows me to be able to create the pdf, but when this has finished the actual pdf is broken (As in, the file is the correct size, but no pdf reader can open it). What I also notice is than when opening the pdf in a HEX editor i’m missing the file signature (25 50 44 46 2d) at the top of the document. (adding this manually does not fix the error)
Is anyone aware of this issue, am I the only one or does some1 know how I could fix this?
Which version of GVM do you use? Did you check if all dependencies for generating the pdf report are installed? Are you able to download the pdf via GSA?
Downloading from GSA works as it should (Using ubuntu 19.04)
As with dependencies, I do not know what I would need (mainly since I did not find any “special” requirements on the gvm-tools github page). At the moment i’m using the base pdf-report.gmp.py script which uses base64 and pathlib.
So my last solution was not correct.
Nevertheless I fixed this now … see PR for more information.
You may fix your local version or pull it from master when its merged!