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

GraphQL

Joe | Last updated: Jun 21, 2021 05:10PM UTC

I am attempting to retrieve a list of scans via the GraphQL and Python. No matter what query I send, I get the same generic error: {"errors":[{"message":"Unexpected exception occurred. Check logs for more details.","extensions":{"code":77}}]} Last query attempt: query = """{"query": scans() }"""

Joe | Last updated: Jun 21, 2021 06:14PM UTC

I switched from get to post and that seems to have changed the error, but I think my query is wrong. Please help with an example of what the "scans()" query should look like to retrieve all scans.

Uthman, PortSwigger Agent | Last updated: Jun 22, 2021 08:45AM UTC

Hi Joe, You can find an example of the fields a Scans query accepts here: https://portswigger.net/burp/extensibility/enterprise/graphql-api/queries.html E.g. query GetScans { scans(site_id: 6, scan_status: []) { id start_time end_time status } } In Python, you could use the requests library. For example: import requests url = "<ENTERPRISE-SERVER-URL>/graphql/v1" payload = "{\"query\":\"query GetScans {\\n scans(site_id: 6, scan_status: []) {\\n id\\n start_time\\n end_time\\n status\\n }\\n}\\n\\n\",\"operationName\":\"GetScans\"}" headers = { "Content-Type": "application/json", "Authorization": "<API-KEY>" } response = requests.request("POST", url, data=payload, headers=headers) print(response.text) <ENTERPRISE-SERVER-URL> and <API-KEY> need to be updated as appropriate.

Joe | Last updated: Jun 22, 2021 03:30PM UTC