- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以我一直在尝试为 php 表单创建一个简单的暴力破解脚本(当然是在我自己的本地网络服务器上),它本质上是通过 for 循环将数据输入到列表中来工作的。问题就在这里;如果我的列表是: list = ['a','b','c','d','e','f','g']
并且我的 for 循环看起来像这个:
for i in list:
r = request.post(url, values) #posts the values
if 'id=correct' in open('output.txt').read(): #check if it works
print("logged in")
#if it works, it would print this, if not,
#it will retry with the next element in the list
问题是,这仅适用于一个字母的密码(因为它只在列表中循环一次)。我的问题是;我如何得到它,以便一旦它循环遍历列表一次,它将再次启动 for 循环,除了列表中的两个元素(即 aa、ab、ac、ad、ae、ef 等)
谢谢!
最佳答案
您可以通过递增数字并将其转换为基数 7(列表的长度)来将此视为基数转换问题:
def convert(n, lst):
s = ''
while True:
s = lst[n % len(lst)] + s
if n < len(lst):
break
n = n // len(lst) - 1
return s
这样:
lst = ['a','b','c','d','e','f','g']
print(convert(0, lst))
print(convert(6, lst))
print(convert(7, lst))
print(convert(8, lst))
print(convert(55, lst))
print(convert(56, lst))
print(convert(57, lst))
输出:
a
g
aa
ab
gg
aaa
aab
关于python - 逐渐增加字母表中的字母,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53007574/
我想要一个可以逐渐将页面底部的不透明度从 0 更改为 1 的函数。 我在元素的顶部使用了类似的功能,但我使用的不是淡入,而是淡出。创建它相当容易,但在页面底部使用设置的阈值淡入是一场噩梦。 经过研究,
li 状态是关闭和打开。 闭合:颜色为黑色(没有光照,相互折叠)。 打开:颜色为红色(有光,全视野)。 我希望颜色从两个元素之间的点开始淡化,以表明阴影从轴心开始,直到它们关闭。 $('button'
我的问题很简单: 1)我有一个扩展 JFrame 的主类。 2)该类内部有一个 JPanel,其顶部有一个 BufferedImage。 3)最后还有一个 JButton,我称之为“Fire”..这就
我有这个立方体,我想在延迟 3000 后将其转换为不同的 X 和 Y 点。我无法理解如何在 jQuery 的帮助下做到这一点。这是一个JS Fiddle .下面是代码。 JS // code for
我们如何向背景图像添加黑色阴影,阴影从不透明度 1 开始逐渐降低到不透明度 0,在图像的所有 4 个边上? (至少 50 像素值的“降低阴影不透明度”。box-shadow 仅提供少量不透明度逐渐下降
我是一名优秀的程序员,十分优秀!