Last active
June 7, 2016 09:18
-
-
Save tawateer/a6746139908e46094706922e52a778ed to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/env python | |
""" | |
https://github.com/juliensobrier/google-safe-browsing-lookup-python | |
""" | |
import safebrowsinglookup | |
API_KEY = "" | |
DOMAINS = [ | |
"www.nosa.me", | |
"175.43.20.27", | |
"http://175.43.20.27/ws.cdn.baidupcs.com/file/e10c99fc3e505aa9c50ae9ecfbeda8f5?bkt=p2-nj-990&xcode=79a844828c722fa9f643ab1184a8518ee330ba9a1c9d12b5ed03e924080ece4b&fid=202032639-250528-4453326696376&time=1465289980&sign=FDTAXGERLBH-DCb740ccc5511e5e8fedcff06b081203-tFUp3zAx4Mh7cYiZb7rq%2F2TYR%2Fg%3D&to=lc&fm=Nan,B,U,nc&sta_dx=119&sta_cs=4353&sta_ft=zip&sta_ct=7&fm2=Nanjing,B,U,nc&newver=1&newfm=1&secfm=1&flow_ver=3&pkey=1400e10c99fc3e505aa9c50ae9ecfbeda8f55b6042450000076b3849&sl=73728078&expires=8h&rt=sh&r=951890013&mlogid=3680889027570259189&vuk=-&vbdid=364114054&fin=wine-qqintl.zip&fn=wine-qqintl.zip&slt=pm&uta=0&rtype=1&iv=0&isw=0&dp-logid=3680889027570259189&dp-callid=0.1.1&wshc_tag=0&wsts_tag=57568cfc&wsid_tag=6fce0f89&wsiphost=ipdbm" | |
] | |
def lookup(domain): | |
# c = safebrowsinglookup.SafebrowsinglookupClient(key=API_KEY, debug=1, error=1) | |
c = safebrowsinglookup.SafebrowsinglookupClient(key=API_KEY) | |
return c.lookup(domain) | |
def main(): | |
failed = [] | |
for d in DOMAINS: | |
ret = lookup(d) | |
# print ret | |
if ret[d] != "ok": | |
failed.append(ret) | |
if failed == []: | |
print "google safebrowsing lookup=OK, all domains: %s" % ",".join(DOMAINS) | |
else: | |
print "google safebrowsing lookup=Fail, failed domains: %s" % failed | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment