Trojan Horse

Started by
30 comments, last by a7h3iz7 21 years, 8 months ago
I have these two programming question about Trojan Horse. 1) Some trojan can read every key pressed by a user. The trojan program can read keypressed even though it is running in the background. How can I do this? 2) Some trojan can output random character. For example when you are typing in notepad, suddenly the trojan output random characters that you have not type. How can I do this? For (1), I have no idea, but for (2), I guess that the trojan use some function like notepad_handle=GetGlobalWindow(xxx) to get the notepad handle and then SetWindowText(notepad_handle,random_str). I'm programming in Visual C++ so please send Visual C++ code sample if you want to help. I'll appreciate any help. [edited by - a7h3iz7 on August 17, 2002 2:06:00 PM]
Advertisement
What are you trying to do? a virus or something? In any case, I bet anyone wants to help you with it (in gamedev.net)
It''s all about the hooks. Don''t go off doing anything stupid, though.

[twitter]warrenm[/twitter]

For just getting key presses, a simple GetAsyncKeyState() will work if the application is in the background.

For sending text to a window, you have the right idea. Once you find the right window (using any of the multitude of finding window commands, eg GetForegroundWindow, FindWindow, etc.) You can start sending messages to it using Post/SendMessage at your own will. So WM_SETTEXT would work, WM_KEYDOWN, etc.

Freeware development:
http://www.ruinedsoft.com/
___________________________Freeware development:ruinedsoft.com
quote:Original post by iwasbiggs


I really appreciate your help. Mucho Gracias.
Is it just me, or is there clearly malicious, not-game development going on here?

Idea for a new forum:

Sociopath: everything you ever wanted to know about being a 1337 unproductive cyber troll
Actually, it''s not clear that he''s using the information for malicious purposes; that''s merely your assumption.

[twitter]warrenm[/twitter]

I suppose that you''re right but it seems to me that if he had a legitimate purpose he would have asked the question in a way that better suites that purpose and not basicaly "How does a trojan work?"
a7h3iz7, y don''t you let us know what this is for? were all curious.
You''re a moron. No offense.

This topic is closed to new replies.

Advertisement