Skip to content
This repository has been archived by the owner on Sep 18, 2022. It is now read-only.

502 Bad Gateway when searching for exploits #2

Open
dguido opened this issue Aug 24, 2013 · 6 comments
Open

502 Bad Gateway when searching for exploits #2

dguido opened this issue Aug 24, 2013 · 6 comments

Comments

@dguido
Copy link

dguido commented Aug 24, 2013

From irb with a fresh install of the shodan gem:

>> api = Shodan::WebAPI.new(SHODAN_API_KEY)
=> #>, @base_url="http://www.shodanhq.com/api/", @exploitdb=#>, @api_key="xxx", @msf=#>>
>> api.exploitdb.search('cve-2011-1255')
JSON::ParserError: 757: unexpected token at '

... snipped a bunch of HTML that wouldn't render on GitHub ...

> 
@erran
Copy link

erran commented Aug 24, 2013

The significant portion was: <title>www.shodanhq.com | 502: Bad gateway</title> and the whole error page is in this gist.

As a side note @dguido, html wrapped in triple back ticks ``` would've allowed you to paste it on GitHub (or better yet into a gist).

@dguido
Copy link
Author

dguido commented Aug 24, 2013

Ah, yeah I was using pre tags. Thanks for the tip!

@erran
Copy link

erran commented Aug 24, 2013

Are you able to execute a normal search? I'm getting a Net::ReadTimeout exception raised. I can't connect through the URL when used via the browser either. The info function's still working. I'll create a pull request with some error handling for the Shodan gem now. I'll give you a link to install the gem via GitHub (until @achillean releases a new version).

@erran
Copy link

erran commented Aug 24, 2013

Oh, and if you check out @achillean's twitter account. You'll seen there were some problems going on in the last few days.

@dguido
Copy link
Author

dguido commented Aug 24, 2013

Regular search works. ExploitDB and MSF search return 502, with both the Python and Ruby libraries.

@achillean
Copy link
Owner

I rewrote the Exploits search, put it on a separate domain and in the process also normalized the data (so there isn't a need for different classes for ExploitDB and Metasploit). But I didn't yet update the API to make use of the new Exploits website. The new endpoint for the API calls is https://exploits.shodan.io/api and I'm in the process of updating the wrapper classes to use that new URL. Note that the search results now contain the contents of the files, so you don't need to do a separate call anymore to grab/ download the contents of a script.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants