Last active
May 13, 2017 21:26
-
-
Save arehmandev/ede6123a112dd9dd2a1b9f44d1ad619c to your computer and use it in GitHub Desktop.
Test if WannaCry sinkhole is reachable
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
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