The Burp Suite User Forum was discontinued on the 1st November 2024.

Burp Suite User Forum

For support requests, go to the Support Center. To discuss with other Burp users, head to our Discord page.

SUPPORT CENTER DISCORD

Getting scan_id from ScheduledItem

Radosław | Last updated: Sep 02, 2020 01:08PM UTC

Hi. Is it possible to obtain via GraphQL API scan_id when I have ScheduledItem ID? My scenario is that I'm creating scheduling scans using CreateScheduleItem (which as a result gives me ScheduledItem ID) and then I would like to query for created scan status.

Michelle, PortSwigger Agent | Last updated: Sep 02, 2020 03:41PM UTC

The schedule item id can be included in the information returned when querying all scans, would that help in your scenario, or are you looking for something more specific? https://portswigger.net/burp/extensibility/enterprise/graphql-api/Scan.html

Michelle, PortSwigger Agent | Last updated: Sep 03, 2020 07:45AM UTC

I've done a few more checks and as it isn't currently possible to filter the scans query using the schedule_item id I've passed the idea on to our product team to review.

Radosław | Last updated: Sep 03, 2020 01:04PM UTC

Thank you for the answers. Maybe the first solution might be a workaround for me. But I don't quite understand the documentation, how can I query for all the scans? Could post a proper Query? Another idea that comes to my mind is including information about scans to the Site (or SiteTree) object. As I understand the documentation correctly this information is not there as well, am I right?

Michelle, PortSwigger Agent | Last updated: Sep 03, 2020 03:16PM UTC

Hi You could use something like this to get the details for all the scans: query GetScans {scans{id,site_id,status,schedule_item{id}}} or this to get the scans for a specific site: query GetScans {scans(site_id:10){id,site_id,status,schedule_item{id}}} The SiteTree will include details about the Site but won't include the schedule_Item id, I'm afraid

Radosław | Last updated: Sep 03, 2020 03:53PM UTC

Hi, Thank you for the answer. I already tried similar query but for both solutions I receive error: {"errors":[{"message":"Validation error of type UnknownArgument: Unknown field argument site_id @ \u0027scans\u0027","extensions":{"code":77}}]} I understand what it means but what could be the cause? I'm using Burp Suite Enterprise Version: 2020.6-5101, Java version: 9.0.4

Michelle, PortSwigger Agent | Last updated: Sep 04, 2020 07:38AM UTC

Can you send us a copy of the query you were using, please?

Radosław | Last updated: Sep 09, 2020 12:43PM UTC

Apologies for late reply. I'm trying following query: query GetScans ($offset: Int, $limit: Int) { scans(offset: $offset, site_id: 85, sort_column: id, sort_order: asc, limit: $limit) { id schedule_item { id } status } } I intend to include site_id as a parameter - but both versions are failing.

Michelle, PortSwigger Agent | Last updated: Sep 09, 2020 02:33PM UTC

Hi Thanks for the update. The ability to filter scans on site_id was only introduced in 2020.7 (please accept my apologies for not spotting that you were using 2020.6-5101 previously) https://portswigger.net/burp/releases I've just tested your query on 2020.7, just changing the site_id from the text you posted above to one that exists on my test system and it returned results, so it will work once you have upgraded to the latest version.

Radosław | Last updated: Sep 10, 2020 09:11AM UTC