Skip to content

Instantly share code, notes, and snippets.

@achillean
achillean / gist:5128200
Created March 10, 2013 11:14
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());
@achillean
achillean / shodan_wps_example.py
Created April 29, 2011 04:53
Shodan WPS Example
# Import the class
from shodan.wps import GoogleLocation
# Setup the object
wps_client = GoogleLocation()
# Locate the physical address of the MAC/ BSSID
address = wps_client.locate('00:1D:7E:F0:A2:B0')
@achillean
achillean / install_shodan.sh
Created April 29, 2011 04:52
Install Shodan Library
$ easy_install shodan
# or easy_install -U shodan
# or pip install shodan
@achillean
achillean / wps.py
Created April 29, 2011 04:48
Wifi Positioning System
"""
WiFi Positioning System
Wrappers around the SkyHook and Google Locations APIs to resolve
wireless routers' MAC addresses (BSSID) to physical locations.
"""
try:
from json import dumps, loads
except:
from simplejson import dumps, loads