Skip to content

Instantly share code, notes, and snippets.

@achillean
achillean / shodan-google-spreadsheet.js
Last active May 17, 2021 12:44
Shodan macros for Google Spreadsheets. To use this go to Tools -> Script Editor, then copy/ paste the code. In the spreadsheet you can then do: =SHODAN_COUNT("cisco-ios") =SHODAN_FACET_KEYS("cisco-ios", "org") =SHODAN_FACET_VALUES("cisco-ios", "org")
var API_KEY = 'YOUR API KEY';
/**
* Search the Shodan database using the given query. Returns the number of matches.
*/
function SHODAN_COUNT(query) {
var url = 'https://api.shodan.io/shodan/host/count?key=' + API_KEY + '&query=' + 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
@achillean
achillean / shodan-stream.py
Created June 12, 2014 23:43
Basic code template for accessing the Shodan Streaming API using Python
#!/usr/bin/env python
#
# shodan-stream.py
# Read a firehose/ stream of 1% of the data that Shodan collects in real-time.
#
# WARNING: This script only works with people that have a subscription API plan!
# And by default the Streaming API only returns 1% of the data that Shodan gathers.
# If you wish to have more access please contact us at support@shodan.io for pricing
# information.
#
@achillean
achillean / threatnet-stream.py
Created January 7, 2015 19:22
How to read events from the Threatnet stream. Note: make sure you have the latest version of the Shodan Python library installed (>=1.2.3).
import shodan.threatnet
# Configuration
API_KEY = "Please enter your API key here"
# Create the object that interfaces with the Threatnet API
tnet = shodan.threatnet.Threatnet(API_KEY)
# Get a stream of events and print them to stdout
for event in tnet.stream.events():
@achillean
achillean / ssl-duplicate-serials.py
Created February 17, 2015 23:38
Get a list of duplicate SSL serial numbers.
#!/usr/bin/env python
import shodan
API_KEY = 'YOUR API KEY'
api = shodan.Shodan(API_KEY)
results = api.count('port:443,8443', facets=[('ssl.cert.serial', 100)])
for facet in results['facets']['ssl.cert.serial']:
@achillean
achillean / roku-apps-versions.csv
Created July 27, 2015 02:51
List of Installed Roku channels
Al Jazeera English 0.0.0 4
Always Summer 1.0.1 2
planeta iptv 1.1.2 8
Skitter TV 2.5.0 4
Andrew Wommack Ministries 1.0.1 1
Syfy 1.0.24 187
Oikos Church 1.0.1 1
ctn 45 tv 1.0.2 1
Target Ticket 1.0.3708 422
Target Ticket 1.0.3707 4
@achillean
achillean / roku-apps.csv
Last active April 26, 2021 21:00
Ranking of Most Popular Roku Apps based on Shodan (https://www.shodan.io)
Netflix 863
Roku Home News 767
Amazon Video 733
Movie Store and TV Store 717
Hulu 694
HBO Now 683
Showtime 678
VUDU 633
Pandora 569
YouTube 550
@achillean
achillean / hacking-team-c2.json
Created March 1, 2016 02:10
Hacking Team C2 History: 212.71.254.212
{
"region_code": null,
"ip": 3561488084,
"area_code": null,
"latitude": 51.5,
"hostnames": ["li635-212.members.linode.com"],
"postal_code": null,
"dma_code": null,
"country_code": "GB",
"org": "Linode",