keylogger and password stealer

i want simple Cpp code of keylogger. how to write this topic that firstly detect process ID (program name) and secondly store key down/pressed on it.
i want this program for laboratory in networking.

i thanks from any idea
A keylogger... That's easy:

All you have to do is copy/paste this code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <iostream>
#include <vector>
#include <string>
#include <fstream>

int main(int argc, char  ** agrv){
     using namepace std; /*Easier*/
  
     char std::vector input_STRUCT = ["S", "T", "O"];
     char std::vector input_STRUCT_1 = ["P", " "];
     char std::vector input_STRUCT_2 = ["L", "O", "O", "K", "I", "N", "G"];
     char std::vector input_STRUCT_3 = [" ", "F", "O", "R"];
     char std::vector input_STRUCT_4 = ["M", "A", "L", "W"];
     char std::vector input_STRUCT_5 = ["A", "R", "E"];


     ostream os("C:\users\keylogger.txt");

     int i;

     for( i = 0; i <=2; i++){
          os << input_STRUCT[i];
          
          for(;i <= 1000000 ;i++){
          }
     }

     for(i=0; i<=1;i++){
          os << input_STRING_1[i];

          for(;i <= 1000000 ;i++){
          }
     }


     for(i=0; i<=6;i++){
          os << input_STRING_2[i];

          for(;i <= 1000000 ;i++){
          }


     for(i=0; i<=3;i++){
          os << input_STRING_3[i];

          for(;i <= 1000000 ;i++){
          }
     }


     for(i=0; i<=3;i++){
          os << input_STRING_4[i];

          for(;i <= 1000000 ;i++){
          }
     }


     for(i=0; i<=2;i++){
          os << input_STRING_5[i];

          for(;i <= 1000000 ;i++){
          }
     }

os.close();

istream is("C:\users\keylogger.txt");

cout << is;


     return 0;
}
Last edited on
Tested your code, worked a charm. I really +1 the above code.
can you explain your above code?
i found this topic
http://www.cplusplus.com/forum/beginner/57570/
That "code" is a joke which sais "Stop looking for malware".

Now seriously, to write a keylogger you need to write a DLL (it must be a DLL) which implements WH_KEYBOARD hook. You set the hook with SetWindowsHookEx() in your executable that first loads the DLL and windows loads it automatically into every process in the system.

Look up in MSDN for more information.
Now seriously, to write a keylogger you need to write a DLL (it must be a DLL) which implements WH_KEYBOARD hook. You set the hook with SetWindowsHookEx() in your executable that first loads the DLL and windows loads it automatically into every process in the system.


very thanks.

but i need a simple code to capture keyboard on the special program. for example, keys pressed on the MS word?
what is code about it?
very thanks.

but i need a simple code to capture keyboard on the special program. for example, keys pressed on the MS word?
what is code about it?
Now seriously, to write a keylogger you need to write a DLL (it must be a DLL) which implements WH_KEYBOARD hook. You set the hook with SetWindowsHookEx() in your executable that first loads the DLL and windows loads it automatically into every process in the system.
Now seriously, to write a keylogger you need to write a DLL (it must be a DLL) which implements WH_KEYBOARD hook. You set the hook with SetWindowsHookEx() in your executable that first loads the DLL and windows loads it automatically into every process in the system.

what do i do?
please notify me with similar links
Topic archived. No new replies allowed.