shodan-client.js v3.2 releases: A Node.js library for accessing the new SHODAN API
Shodan client for JavaScript
API
👀 The content of the result is the same provided by the HTTP API. You can check them in the API documentation.
version
Library version.
async host(ip, key, opts)
Returns all services that have been found on the given host IP. Supported options:
- ip (string) – Host IP address.
- key (string) – SHODAN API key.
- opts, an object with:
- history (boolean, optional) – True if all historical banners should be returned (default: false)
- minify (boolean, optional) – True to only return the list of ports and the general host information, no banners. (default: false)
- timeout (number) – Connection timeout in ms. (default: 5000)
async search(query, key, opts)
Search Shodan using the same query syntax as the website and use facets to get summary information for different properties. This method may use API query credits depending on usage, please check the API documentation.
- query (string) – The provided string is used to search the database of banners in Shodan, with the additional option to provide filters inside the search query using a “filter:value” format. For example, the following search query would find Apache webservers located in Germany: “apache country:DE”. To see which filters are supported please check the API documentation.
- key (string) – SHODAN API key.
- opts, an object with:
- facets (string, optional) – A comma-separated list of properties to get summary information on. Property names can also be in the format of “property:count”, where “count” is the number of facets that will be returned for a property (i.e. “country:100” to get the top 100 countries for a search query). To see which filters are supported please check the API documentation. (default: null)
- page (number, optional) – The page number to page through results 100 at a time (default: 1)
- minify (boolean, optional) – Whether or not to truncate some of the larger fields (default: true)
- timeout (number) – Connection timeout in ms. (default: 5000)
- More…
Changelog v3.2
✏️ Changed
- Dependency package
request
togot
. - Major refactor to keep things simpler.
- Test engine from
mocha
toava
. - Dependencies update.
- Node.js version update in Travis setup.
- Documentation:
- Minor API improvements.
- More understandable issue template.
🐛 Fixed
- Methods
scan
andscanInternet
. - Remove invisible character breaking titles in the documentation.
🎉 Added
- Method
scanResult
.
Download
git clone https://github.com/jesusprubio/shodan-client.js.git
npm install
Use
All methods of the API need a valid key, you can get one here.
Copyright Jesús Pérez <jesusprubio@member.fsf.org>
Source: https://github.com/jesusprubio/