No still don’t working, maybe GVM versions don’t match, my version:
gvm-check-setup -h
gvm-check-setup 23.11.0
Test completeness and readiness of GVM-23.11.0
Step 1: Checking OpenVAS (Scanner)…
OK: OpenVAS Scanner is present in version 23.13.1.
OK: Notus Scanner is present in version 22.6.4.
Above script which u provided doesn’t working, copilot didn’t helped with that as well, after some time I detected that need to move “socket” after credential inputs, from this:
1.
RESPONSE=$(gvm-cli socket --gmp-username “$GVM_USER” --gmp-password “$GVM_PASS” --xml “$XML_REQUEST”)
To this:
2.
RESPONSE=$(gvm-cli --gmp-username “$GVM_USER” --gmp-password “$GVM_PASS” socket --xml “$XML_REQUEST”)
In 1 scenario it returned next error:
gvm-cli: error: unrecognized arguments --gmp-username --gmp-password test
Failed to extract report content. Check report ID and credentials.
In 2 scenario have another error:
sudo -u _gvm bash bash.sh
Requesting report from GVM…
ERROR:gvmtools.cli:[Errno 104] Connection reset by peer
Failed to extract report content. Check your credentials and report ID.
Current time i using next script:
#!/bin/bash
=== Configuration ===
GVM_USER=“admin”
GVM_PASS=“test”
REPORT_ID=“40bcd1ce-9c50-4780-a62f-4cc2e3964ee6”
CSV_FORMAT_ID=“c1645568-627a-11e3-a660-406186ea4fc5” # CSV format
OUTPUT_FILE=“report.csv”
=== Build XML Request ===
XML_REQUEST=“<get_reports report_id="$REPORT_ID" format_id="$CSV_FORMAT_ID" details="1" ignore_pagination="1"/>”
=== Run gvm-cli and capture output ===
echo “
Requesting report from GVM…”
RESPONSE=$(gvm-cli --gmp-username “$GVM_USER” --gmp-password “$GVM_PASS” socket --xml “$XML_REQUEST”)
=== Extract base64 content from response ===
BASE64_CONTENT=$(echo “$RESPONSE” | sed -n “s/.<report format="$CSV_FORMAT_ID" content_type="text/csv">(.)</report>.*/\1/p”)
if [ -z “$BASE64_CONTENT” ]; then
echo “
Failed to extract report content. Check your credentials and report ID.”
exit 1
fi
=== Decode base64 and write to file ===
echo “$BASE64_CONTENT” | base64 --decode > “$OUTPUT_FILE”
echo “
CSV report successfully saved to: $OUTPUT_FILE”
I have already updated and upgraded, but still executed it again.
About last Github link, it shouldn’t will overwrite to my scan results?
Regarding scan question, in target list are 577 IP’s and results are 4298 of 28762: