能用来干什么请看这个:
https://www.hostloc.com/thread-741034-1-1.html
https://www.hostloc.com/thread-741474-1-1.html
https://www.hostloc.com/thread-741616-1-1.html
运行截图:
结果截图:
首先声明,github抄的,改了一点点内容
使用方法: python cfscan.py 183.201.1.1-183.201.255.255 800
cfscan.py = 你保存的文件名
183.201.1.1-183.201.255.255 = 你要扫的起始IP-结尾IP
800 = 线程数
脚本代码:
#!/usr/bin/env python
# coding=utf-8
# python2.7 only
import threading
import requests
import Queue
import sys
import re
#ip to num
def ip2num(ip):
ip = [int(x) for x in ip.split('.')]
return ip[0] << 24 | ip[1] << 16 | ip[2] << 8 | ip[3]
#num to ip
def num2ip(num):
return '%s.%s.%s.%s' % ((num & 0xff000000) >> 24,(num & 0x00ff0000) >> 16,(num & 0x0000ff00) >> 8,num & 0x000000ff)
#
def ip_range(start, end):
return [num2ip(num) for num in range(ip2num(start), ip2num(end) + 1) if num & 0xff]
#
def bThread(iplist):
threadl = []
queue = Queue.Queue()
for host in iplist:
queue.put(host)
for x in xrange(0, int(SETTHREAD)):
threadl.append(tThread(queue))
for t in threadl:
t.start()
for t in threadl:
t.join()
#create thread
class tThread(threading.Thread):
def __init__(self, queue):
threading.Thread.__init__(self)
self.queue = queue
def run(self):
while not self.queue.empty():
host = self.queue.get()
try:
checkServer(host)
except:
continue
def checkServer(host):
header ={'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36'}
aimurl = "http://"+host+":443"
response = requests.get(url=aimurl,headers=header,timeout=10)
serverText = response.headers['server']
if len(serverText) > 0:
print "-"*50+"\n"+aimurl +"\nServer: "+serverText
if (serverText == "CloudFront"):
f.write(host+"\n")
if __name__ == '__main__':
print '\n############# Cloud Front Scan ################'
print ' Author hostloc.com'
print '################################################\n'
global SETTHREAD
try:
SETTHREAD = sys.argv[2]
f = open("result.txt", "w")
iplist = ip_range(sys.argv[1].split('-')[0], sys.argv[1].split('-')[1])
print '\n[Note] Will scan '+str(len(iplist))+" host...\n"
bThread(iplist)
except KeyboardInterrupt:
print 'Keyboard Interrupt!'
sys.exit()
I always spent my half an hour to read this blog’s content
every day along with a cup of coffee.
my webpage tracfone special coupon 2022
Pretty nice post. I just stumbled upon your weblog and wanted to say that I’ve
really enjoyed surfing around your blog posts.
In any case I will be subscribing to your rss
feed and I hope you write again soon!
Also visit my webpage tracfone coupon
It’s very straightforward to find out any matter
on net as compared to textbooks, as I found this article at this web site.
This is my first time visit at here and i am really pleassant to read all at alone place.
Appreciation to my father who informed me regarding this web site, this website is truly awesome.
When I originally commented I clicked the “Notify me when new comments are added” checkbox and
now each time a comment is added I get four e-mails with the
same comment. Is there any way you can remove people from
that service? Cheers!
Hello! I know this is kinda off topic but I was wondering which blog platform are you using for this website?
I’m getting tired of Wordpress because I’ve had issues with
hackers and I’m looking at options for another platform.
I would be great if you could point me in the direction of a
good platform.
Look at my homepage :: raycon
It’s an amazing paragraph designed for all the online viewers;
they will get benefit from it I am sure.
Thankfulness to my father who told me concerning this
blog, this weblog is actually remarkable.
An impressive share! I’ve just forwarded this onto a coworker who
was conducting a little research on this. And he actually ordered me breakfast
because I discovered it for him… lol. So allow me to reword
this…. Thanks for the meal!! But yeah, thanks for spending
the time to discuss this issue here on your site.
Keep on writing, great job!
I do not even know how I ended up here, but I thought
this post was good. I do not know who you are but definitely you are going to a famous blogger if you aren’t
already 😉 Cheers!
Way cool! Some very valid points! I appreciate you penning this post
and the rest of the website is also very good.
I absolutely love your blog and find nearly all of your post’s to be exactly what I’m looking
for. Would you offer guest writers to write content for yourself?
I wouldn’t mind writing a post or elaborating on some of the subjects you write in relation to here.
Again, awesome website!