Python 而循环只正确迭代一次

Python 而循环只正确迭代一次,python,python-3.x,loops,while-loop,Python,Python 3.x,Loops,While Loop,我正在编写一个python脚本,以暴力破解我在安全事件中发现的恶意Java脚本。长话短说,在这个过程中的某一点上,他们用XOR混淆了重定向到有效负载的脚本。这就是我要做的。 Python: elsePageXoffest是我存储模糊JS的文本文件 但是,它只迭代一次,除非它们用XOR^1混淆,否则对我没有好处 所有其他迭代的错误消息: <bound method Popen.wait of <subprocess.Popen object at 0x7fb65c6c9128>&

我正在编写一个python脚本,以暴力破解我在安全事件中发现的恶意Java脚本。长话短说,在这个过程中的某一点上,他们用XOR混淆了重定向到有效负载的脚本。这就是我要做的。 Python:

elsePageXoffest是我存储模糊JS的文本文件

但是,它只迭代一次,除非它们用XOR^1混淆,否则对我没有好处

所有其他迭代的错误消息:

<bound method Popen.wait of <subprocess.Popen object at 0x7fb65c6c9128>>

返回while循环内部,这意味着它只运行一次

如果将返回移到while循环之外,代码应该可以正常工作

def deobBrute():
    count = 0
    while (count < 101):
        count = count + 1
    return(str(userInput)+str(perl)+str(count)+str(tail))
def deobBrute():
计数=0
而(计数<101):
计数=计数+1
返回(str(userInput)+str(perl)+str(count)+str(tail))
< /代码> 如果这是您的方法(您的制表符被弄乱),则函数将返回“代码>(STR(USER输入)+STR(Perl)+ STR(计数)+ STR(尾部))< /代码>,其余的函数将不执行,如果您想继续在该方法中并返回更多的值,请考虑使用收益率。当yield返回一个生成器时,您需要迭代
deobBrute
,以访问值

def deobBrute():
    count = 0
    while (count < 101):
        return(str(userInput)+str(perl)+str(count)+str(tail))
        count = count + 1

def deobBrute():
    count = 0
    while (count < 101):
        yield(str(userInput)+str(perl)+str(count)+str(tail))
        count = count + 1

您忘记调用
wait
return
将退出循环,函数将退出。这给了我Attirbteerror“Generator”obejct没有attirbute“next”好,Python脚本正在工作,但总体目标没有。这个变量perl是我正在使用的perl脚本的一部分。我试图做的是让python运行perl脚本或cat textFileName | perl-pe的/([;\}]{])/$Python Script Number Change\n/g'它不是在终端中作为命令运行的,我输入到Python脚本的文件只是在终端中打印了100次,而没有在该文本文件上运行perl脚本。我不是一个聪明人。很抱歉,我的perl脚本需要修复,此解决方案非常有效。谢谢。
def deobBrute():
    count = 0
    while (count < 101):
        count = count + 1
    return(str(userInput)+str(perl)+str(count)+str(tail))
def deobBrute():
    count = 0
    while (count < 101):
        return(str(userInput)+str(perl)+str(count)+str(tail))
        count = count + 1

def deobBrute():
    count = 0
    while (count < 101):
        yield(str(userInput)+str(perl)+str(count)+str(tail))
        count = count + 1
#!/usr/bin/python
import os
import subprocess
perl = "perl -pe 's/([;\}\{])/$"
userInput = input("")
tail = (r"\n/g'")

def deobBrute():
    for i in range(1, 102):
        yield "{0}{1}{2}{3}".format(userInput, perl, i, tail)

brute = deobBrute()

for i in brute:
    print(subprocess.Popen(i, shell=True))