Very useful, crossing posting to Qualys community!
Thanks, glad you liked it
So if I wanted to use this to collect a different set of data, would I just change the QID? Is there a way for me to get Vulnerability and severity levels from this? Sorry.. I'm fairly new to Powershell.
Hi, thnaks for your comment. Yes, if you change the QID, you would get the results for that QID. The PowerShell after that would be different to parse the result into a form you wanted.The vulnerability and severity levels are included in the response. For example, I used QID 105689 (EOL/Obsolete Software: Microsoft VC++ 2005 Detected) which returned the following elements:-<TYPE>Confirmed</TYPE><SEVERITY>5</SEVERITY>Hope this helps
Thanks very much for your post.I found that using the CSV type may be easier to parse. Simply change the `output_type=XML` to `output_type=CSV` and then its already pre-formatted to parse. I used the following code, and apologies if this doesn't format correctly: $content = $HttpResponse.Content $lines = $content | select-string RESPONSE_BODY_CSV | select -ExpandProperty LineNumber $csv = content | select -Skip $lines -First ($lines - $lines - 1) | Out-String | ConvertFrom-Csv # Provide optional filtering if required # $csv | ConvertFrom-QualysRecord $csv
Amended script, as I had my array references incorrect:$content = $HttpResponse.Content# The 'CSV' has marker lines, so extract the body$lines = $content | select-string RESPONSE_BODY_CSV | select -ExpandProperty LineNumber # The lines above mark the beginning ($lines) and end ($lines) of the content$csv = content | select -Skip $lines -First ($lines - $lines - 1) | Out-String | ConvertFrom-Csv # Provide optional filtering if required# $csv | ConvertFrom-QualysRecord$csv
Thanks for your comment. I'd overlooked CSV as a format, i'll see if I can make any of my scripts simpler in the future by using that format
New comments are not allowed.