In God we trust. All others must bring data. ~Bob Rudis
With endless amounts of data, technical detail, and insights on WannaCrypt/WannaCry, and even more FUD, speculation, and even downright trolling, herein is a proposal for you to do your own data-driven security analysis. My favorite book to help you scratch that itch? Data Driven Security: Analysis, Visualization and Dashboards, by Jay Jacobs Bob Rudis. A few quick samples, using WannaCry data and R, the open source programming language and software environment for statistical computing and graphics. If ever you wanted to pick up a bit of immediately useful programming, R is for you.
Our good friends over at Team Cymru tweeted out a great GitHubGist WannaCry factsheet, therein are a number of useful resources, many leading to other good reads. I easily tracked down a list of malicious IPs associated with WannaCry.
You can always learn interesting insights from IPs and this situation is no different. In very few lines of R, we can identify and visualize the data for further insight. Ill walk you through it. First, lets pull in the libraries we need to do some IP geolocation, create a word cloud, and make said word cloud more color rich, and make a nice plot.
We need to then read in Maxmind data (GeoLite2-Country) and call Oliver Key and @hrbrmstrs rgeolocate package
file – system.file(extdata,GeoLite2-Country.mmdb, package = rgeolocate)
Follow that with our malicious WannaCry IP addresses.
ips – c(220.127.116.11,18.104.22.168,22.214.171.124,126.96.36.199,188.8.131.52,184.108.40.206,
Finally, we pull it all together and receive our first results file.
results – maxmind(ips, file, c(continent_name, country_code, country_name width:328px” />
And in one fell swoop, we create a word cloud from our data.
wordcloud(results$country_name, max.words = 100, min.freq = 1, random.order = FALSE, rot.per=0.35, colors=brewer.pal(8, Dark2 width:267px” />
Hmm, looks like most of the malicious IPs are in Germany. 🙂
Prefer to visualize that a different way? No problem, well run a quick count and use plotH to create a scatterplot with histogram-like bars.
ct – count(results$country_name)
plotH(freq~x,data=ct,ylab=Frequency,xlab=Country,col=blue width:434px” />
Give it a try for yourself. When events such as WannaCry have you frustrated and down, you can at least take data-driven security analysis in your own hands.
Resources for this article:
(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.