Python

Moderators: None (Apply to moderate this forum)
Number of threads: 474
Number of posts: 1166

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Python Keylogger Posted by kelcha on 15 Dec 2004 at 4:01 PM
This message was edited by kelcha at 2004-12-15 16:21:17

hey i was wandering what i would use to write a python based keylogger,

i am wanting this to check if people are on my comp while im gone.

i would like chars and numbers to be recorded to file...
thx for any help

edit: just so yall know im not asking for the entire code just how to get the key pressed... and save that key to a variable or write it to the file...

of course the more code your willing to share the more i would like as itll help me understand better so i dont needd to ask for help as much...
Report
Re: Python Keylogger Posted by infidel on 16 Dec 2004 at 8:11 AM
: This message was edited by kelcha at 2004-12-15 16:21:17

: hey i was wandering what i would use to write a python based keylogger,
:
: i am wanting this to check if people are on my comp while im gone.
:
: i would like chars and numbers to be recorded to file...
: thx for any help
:
: edit: just so yall know im not asking for the entire code just how to get the key pressed... and save that key to a variable or write it to the file...
:
: of course the more code your willing to share the more i would like as itll help me understand better so i dont needd to ask for help as much...

This may depend on the operating system you are running on. Normally a program only receives key events if it has focus, so you would have to tap into the API for the OS to capture such things while running in the background.

Windows has an API function, GetAsyncKeyState, which is probably available in the win32 extensions for Python. The problem there is that it will only tell you the state of a single key at the moment the function is called.

What I think you need to look for are called "system hooks". I've never written any and I've only seen them mentioned in VB, but it should be possible to write them in Python too.



infidel

$ select * from users where clue > 0
no rows returned


Report
Re: Python Keylogger Posted by kelcha on 16 Dec 2004 at 11:45 AM
: : This message was edited by kelcha at 2004-12-15 16:21:17

: : hey i was wandering what i would use to write a python based keylogger,
: :
: : i am wanting this to check if people are on my comp while im gone.
: :
: : i would like chars and numbers to be recorded to file...
: : thx for any help
: :
: : edit: just so yall know im not asking for the entire code just how to get the key pressed... and save that key to a variable or write it to the file...
: :
: : of course the more code your willing to share the more i would like as itll help me understand better so i dont needd to ask for help as much...
:
: This may depend on the operating system you are running on. Normally a program only receives key events if it has focus, so you would have to tap into the API for the OS to capture such things while running in the background.
:
: Windows has an API function, GetAsyncKeyState, which is probably available in the win32 extensions for Python. The problem there is that it will only tell you the state of a single key at the moment the function is called.
:
: What I think you need to look for are called "system hooks". I've never written any and I've only seen them mentioned in VB, but it should be possible to write them in Python too.
:
:
:
: infidel
:
:
: $ select * from users where clue > 0
: no rows returned
: 

:
:

ok... well im running windows XP... well ill try to find some stuff for system hooks and if anyone has some code that i could try to work with or just use it as a guide i would appreciate that too... thx



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.