Skip to content

Instantly share code, notes, and snippets.

@achillean
Created March 10, 2013 11:14
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achillean/5128200 to your computer and use it in GitHub Desktop.
Save achillean/5128200 to your computer and use it in GitHub Desktop.
Shodan macro for Google Spreadsheets. To use this go to Tools -> Script Editor, then copy/ paste the code. In the spreadsheet you can then do =SHODAN("cisco-ios")
/**
* Search the Shodan database using the given query. Returns the number of matches.
*/
function SHODAN(query) {
var API_KEY = 'YOUR API KEY';
var url = 'http://www.shodanhq.com/api/count?key=' + API_KEY + '&q=' + query;
var response = UrlFetchApp.fetch(url);
var data = Utilities.jsonParse(response.getContentText());
return data.total;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment