今天写了一个脚本,主要目的是想爆破一个需要输入密码的elf文件,但是脚本写好了之后不知道为什么总是报错,错误信息如下
Traceback (most recent call last):
File "test.py", line 7, in <module>
subprocess.Popen.communicate(input=(i))
TypeError: communicate() missing 1 required positional argument: 'self'
/bin/sh: 1: ./root/test/test.elf: not found
以下是我写的脚本
# coding:utf8
import subprocess
i=0
for i in range(0,10251):#设定用于爆破的值的范围
subprocess.Popen("./root/test/test.elf", shell=True, stdout=subprocess.PIPE)
subprocess.Popen.communicate(input=(i))
p=subprocess.Popen("./root/桌面/test ", shell=True, stdout=subprocess.PIPE)
if p=="wrong!":
continue
print(p)
get_str()
求大佬指点