keylogger and password stealer

May 4, 2012 at 6:07am
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
May 5, 2012 at 5:43pm
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 May 5, 2012 at 5:44pm
May 5, 2012 at 5:57pm
Tested your code, worked a charm. I really +1 the above code.
May 6, 2012 at 4:16pm
can you explain your above code?
i found this topic
http://www.cplusplus.com/forum/beginner/57570/
May 6, 2012 at 4:27pm
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.
May 7, 2012 at 3:55pm
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?
May 8, 2012 at 1:46pm
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.
May 8, 2012 at 5:19pm
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
May 8, 2012 at 6:25pm
Topic archived. No new replies allowed.