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

{"error":{"code":"404","message": "Resource not found"}} Empty response from Bing.: domain:testphp.vulnweb.com

andrea | Last updated: Oct 02, 2023 08:00AM UTC

Hi everyone I'm trying to use an extension Bing for BURP in Python but I'm getting the following error: {"error":{"code":"404","message": "Resource not found"}} Empty response from Bing.: domain:testphp.vulnweb.com Empty response from Bing.: ip:44.228.249.3 These are the values used by the script: API_KEY = 'XXXXXXXXXXXXXXXXXX' API_HOST = 'api.bing.microsoft.com' and below a section of the method used: def bing_query(self, bing_query_string): print('Performing Bing search: %s' % bing_query_string) http_request = 'GET https://%s/bing/v7.0/search?' % API_HOST http_request += 'q=%s HTTP/1.1\r\n' % urllib.quote(bing_query_string) http_request += 'Host: %s\r\n' % API_HOST http_request += 'Connection:close\r\n' http_request += 'Ocp-Apim-Subscription-Key: %s\r\n' % API_KEY http_request += 'User-Agent: Black Hat Python\r\n\r\n' json_body = self._callbacks.makeHttpRequest(API_HOST, 443, True, http_request).tostring() json_body = json_body.split('\r\n\r\n', 1)[1] I also tried to verify this with curl command but, I'm pretty sure, I wrongly set something anywhere. Any tip on this? Thanks in advance

Dominyque, PortSwigger Agent | Last updated: Oct 02, 2023 12:32PM UTC

Hi Andrea By any chance, have you tried following along with this article: https://ismailakkila.medium.com/black-hat-python-bing-for-burp-fc1bffe0ea5c

andrea | Last updated: Oct 02, 2023 12:57PM UTC

Hi Dominyque Same result. I tried to put some print statements to see the requests. Tried to work with: bing_api_host = "api.cognitive.microsoft.com" bing_api_urlquery = "https://api.cognitive.microsoft.com/bing/v7.0/search?count=20&q=" And the resut was "401". Then I moved to: bing_api_host = "api.bing.microsoft.com" bing_api_urlquery = "https://api.bing.microsoft.com/bing/v7.0/search?count=20&q=" And this is the output: Incoming Request(s): 1 http_request GET https://api.bing.microsoft.com/bing/v7.0/search?count=20&q=%27domain%3Atestphp.vulnweb.com%27 HTTP/1.1 Host: api.bing.microsoft.com Connection: close Ocp-Apim-Subscription-Key: xxxxxxxxxxxxxxxxx User-Agent: BlackHat Python json_body {"error":{"code":"404","message": "Resource not found"}} No results from Bing

andrea | Last updated: Oct 02, 2023 01:19PM UTC

This makes me think the key should be ok, when using bing_api_host = "api.bing.microsoft.com" rather than the cognitive one (that it seems it was migrated time ago)

Dominyque, PortSwigger Agent | Last updated: Oct 02, 2023 01:41PM UTC

Hi Andrea I believe you may be right about the API host. Have you managed to perform the curl command yet (of course, changing the q query parameter to search for what you'd like): curl -H "Ocp-Apim-Subscription-Key: <yourkeygoeshere>" https://api.bing.microsoft.com/v7.0/search?q=microsoft+devices

andrea | Last updated: Oct 02, 2023 01:49PM UTC

Yeah, launched but I got something that is not correct: curl -H "Ocp-Apim-Subscription-Key: XXXXXXX" https://api.bing.microsoft.com/v7.0/search?q=microsoft+devices {"error":{"code":"401","message": "The Search Operation under Web Search API - v7 is not supported with the current subscription key and pricing tier Bing.CustomSearch.F0."}} The subscription should be ok but I don't know why it's saying that

Dominyque, PortSwigger Agent | Last updated: Oct 03, 2023 07:07AM UTC

Hi Andrea Unfortunately, this is outside the scope of Burp Suite technical support. We suggest that you get in touch with Microsoft support to determine why you are encountering this error message.

andrea | Last updated: Oct 03, 2023 08:09AM UTC

Hi Dominyque I understand your point. Before raising with Microsoft/Azure etc, can you please tell me if this request worked (or works) for you: curl -H "Ocp-Apim-Subscription-Key: XXXXXXX" https://api.bing.microsoft.com/v7.0/search?q=microsoft+devices {"error":{"code":"401","message": "The Search Operation under Web Search API - v7 is not supported with the current subscription key and pricing tier Bing.CustomSearch.F0."}} I guess you have a key and all works as expected. Just to address the problem with them. If the answer to my question is positive, then I could focus myself on finding the solution with Microsoft. Thanks

Dominyque, PortSwigger Agent | Last updated: Oct 03, 2023 08:13AM UTC

Hi Andrea We do not have a key available for us to use. Again, the error message you are seeing is from Microsoft's side. I have seen a few of their forum posts with others who have encountered the same message. We suggest you contact Microsoft support.

andrea | Last updated: Oct 03, 2023 09:29AM UTC