Hi guys, I'm from India, I'm doing my first year IT. We have been asked to submit a mini project, so i was trying to develop a keylogger using c, but my keylogger senses keys only within the editor and the output screen, is it possible to do that using keyboard buffers and vid mem buffers??? Please can anyone help me out. By the way don't get me in a wrong sense, I'm just curious, if I know how it is being done, maybe i can develop another program to counter it.

Recommended Answers

All 11 Replies

Its hard to answer without details of the environment/IDE/compiler you are using.
I am guessing your are using a DOS mode IDE like Turbo C/C++. If it is so your program will run in the DOS (16-bit) environment of Windows and it cannot interact with the rest of the applications running in Windows. As you said the keylogger will only work within the DOS environment (the editor and the program output screen)

If you want to develop a true keylogger for Windows in C, you'll have to learn Win32 API and write some sort of keyboard hook I guess.

Yeah, what you said is perfectly true, Thanks a lot!!!!! I'll try to learn something about that win32 API.

What a horror !!!
It is not a keylogger at all !
Ask on Professional Win32 api Group
to learn how to make real keyloggers..

I'll agree that it's not the best keylogger, but it works. The best way is to use a windows hook, which has already been suggested.

There are several ways to develop key loggers on Windows. I'll list them in order worst to best:
1. You could GetAsyncKeyState() from W32 API in a loop, but I guess most of the anti-viruses would detect those easily. But it's worth to try if you are a beginner (I made my own key logger using this way).
2. Windows Hooks. I can't give you more details on those but some say this is a popular way to make key loggers.
3. Writing a malicious keyboard driver. This takes more skills to do, as well as some assembly knowledge.
The next step you'd want to take is to decide how you are going to store data your key logger makes. This depends on the purpose of the key logger. If you do this for fun, then I guess just a plain file would be good, but if you plan to use it the "not right" way or sell it you need to do some Google research. It would probably be e-mailing or sending to a remote host, maybe an FTP server?

Hope this helps

>I'll list them in order worst to best
I wouldn't say that's the best order, why create your own malicious keyboard driver when you can just use a windows hook? But transferring the information that's been logged is out of the question, as long as you get the key strokes, what happens with the data is up to s_sridhar, and doesn't really fit in any of those three points.

The next step you'd want to take is to decide how you are going to store data your key logger makes. This depends on the purpose of the key logger. If you do this for fun, then I guess just a plain file would be good, but if you plan to use it the "not right" way or sell it you need to do some Google research. It would probably be e-mailing or sending to a remote host, maybe an FTP server?

Hope this helps

Nice indeed, but won't the firewall block it??? Is it possible to turn it off using c-programs

The second some AVs see something like SetWindowsHookEx imported, they'll flag it as suspicious. Of course some AVs are worth crap.

Truthfully I like the driver-in-the-middle loggers.

can't we use hooking mechanism?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.