暴力破解中的内存管理

问题描述

简介:

我一直在编写一个 python 脚本来暴力破解登录页面。 我想先查看数据库中是否存在用户名。 我已经向我的脚本传递了一个词表,程序尝试登录时有一些排列和组合。

问题:

我的计算机在一段时间后挂起,我认为内存不足。如何使用条件语句刷新内存。就像如果用户名不存在只需刷新内存并移动到下一个组合或排列。

我的天真代码(不完整):

import sys
from itertools import permutations
import inspect
import requests as req



symbols = '''01234567890_;.:=!@#$^*-'''
symbols = list(symbols)


crack = "User_name" 

with open(sys.argv[1]) as wordlist:
    words = wordlist.readlines()
    words = [x.replace("\n","") for x in words]
    perm = permutations(words,2)
    

        
for i in list(perm):
    for x in i:
        for y in range(len(i)):
            if x != i[y]:
                for j in symbols:
                    print(x + j + i[y])
                    print(x + i[y] + j)
                    if x + j + i[y] == crack:
                        found = crack
                    if x + i[y] + j == crack:
                        found = crack
                #print(x + i[y])
                found = crack

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)