r/Batch • • Mar 26 '20

Question (Solved) Keylogger batch script

Hi, i was wondering if it's possible to make a keylogger with a batch script. I don't want any code, i'm just curious if it's possible :)

4 Upvotes

15 comments sorted by

View all comments

Show parent comments

1

u/Lusankya Mar 29 '20

The pseudo-object IS the WSH instance. You just create the appropriate registry entries to register the instance itself as a COM object. The messages are coming directly from winapi into WSH with nothing in between.

It's called a pseudo-object because it's not a true COM object; it does not persist across instances. If you close your WSH instance, you need to re-register the new instance as a COM object for it to work.

1

u/jcunews1 Mar 29 '20

That COM object won't provide any mean to call Windows API. Neither wscript.exe or cscript.exe provide any function for scripts to call any Windows API function. It's not even defined in the type libraries of both EXEs.

1

u/Lusankya Mar 29 '20

The article I linked is literally how to create a COM object purely in VBScript executing via WSH. It requires having the VB6 runtime redistributable installed, but that's to be expected when running any VBScript on modern Windows.

We're talking in circles here. I know that conventional wisdom and most Google results says that it's impossible. It's not, and I linked the proof. It's an incredibly masochistic process, and you'd be insane to actually do it, but it is absolutely possible to do it if you hate yourself enough to try.