Skip to content

Instantly share code, notes, and snippets.

@arehmandev
Last active May 13, 2017 21:26
Show Gist options
  • Save arehmandev/ede6123a112dd9dd2a1b9f44d1ad619c to your computer and use it in GitHub Desktop.
Save arehmandev/ede6123a112dd9dd2a1b9f44d1ad619c to your computer and use it in GitHub Desktop.
Test if WannaCry sinkhole is reachable
import urllib2
from urllib2 import urlopen
ipverifier = "http://ip.42.pl/raw"
publicip = urlopen(ipverifier).read()
url = "http://iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com/"
def sinkholetest(endpoint):
try:
urllib2.urlopen(endpoint).read()
print "WannaCry Sinkhole was reached"
print "Your public ip is", publicip
except urllib.error.URLError as e:
print "WannaCry Sinkhole not reachable"
try:
print "Your public ip is", publicip
except urllib.error.URLError as e:
print "Are you sure you're connected to the internet?"
return
sinkholetest(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment