Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python
- import json
- import urllib2
- import socket
- tkn = "API Token" # Get it from https://www.cloudflare.com/my-account.html
- u = "Email" # Fill in the email you use to sign in to cloudlfare
- z="Zone/domain" # Fill in the domain you want to use
- baseurl = "https://www.cloudflare.com/api_json.html?u=" + u + "&tkn=" + tkn + "&z=" + z
- response = json.load(urllib2.urlopen(baseurl + "&a=zone_ips&hours=48"))
- hits = response['response']['ips']
- for hit in hits:
- host = hit['ip']
- try:
- host = socket.gethostbyaddr(hit['ip'])[0]
- if host == ".":
- host = hit['ip']
- except:
- continue
- print host + " - " + str(hit['hits']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement