Last active
April 29, 2017 21:55
-
-
Save jgamblin/7615b81cedd10e44d4f2220347b69cb0 to your computer and use it in GitHub Desktop.
Search Cisco Top 1,000,000 Domains ForA KeyWord, Do GeoIP Lookup & Build A Map.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(leaflet) | |
library(ipapi) | |
#devtools::install_github("hrbrmstr/ipapi") | |
library(tidyverse) | |
# Get Top 25,000 Cisco Domains | |
if (file.exists(fn)) file.remove(fn) | |
temp <- tempfile() | |
download.file("http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip",temp) | |
unzip(temp, "top-1m.csv") | |
sites <- read_csv("top-1m.csv", col_names = FALSE) | |
search <- sites[grep("^cisco", sites$X2), ] | |
unlink(temp) | |
#Build Map: | |
locations <- mutate(geolocate(search$X2)) | |
search <- merge(search, locations, by.x = 0, by.y = 0) | |
m <- leaflet(search) %>% addTiles('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png') | |
m %>% addMarkers(clusterOptions = markerClusterOptions(), ~lon, ~lat, popup = paste("DNS:", search$X2, "<br>", | |
"RANK:", search$X1, "<br>", | |
"IP:", search$query, "<br>", | |
"ISP", search$isp, "<br>", | |
"ASN:", search$as)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment