Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Since this is for your System Programming course, I won't give you the exact answer here, but I can definately give you enough to help
"..teach a man to fish.."

cjf, myself, and others discussed this briefly on the CB soon after it was posted, and I gave up a few ideas on how to solve this. First a few key questions have to be asked:

  1. Will you have access to create character devices on the target machine?
  2. Will you be able to rebuild a kernel or reboot the kernel on the target machine?
  3. Can you run a daemon on the user machine, global to all processes?
  4. Are you limited to using pure perl? Or can you use C also?
With this, you could begin to construct several plans of attack:
  • Write a kernel module (does not require a reboot, but requires sufficient access to load it into userspace) which will log all calls through the kernel keyboard driver to a file via normal kernel printk() mechanisms.
  • Create a character device in /dev that you can peek from and write to a file (requires root access to create devices)
  • Set up a userspace daemon that polls for input, a 'shim' between keyboard driver and input application.
  • Work with Inline::C and integrate it with your perl code
Some other modules you may be able to use at your disposal are:
  • Net::Daemon to create your daemon process in userspace.
  • IPC::open3 to allow you to open a process for for reading/writing/error reporting
  • Standard pipe() function for opening and dealing with your system calls..
  • The source to xev, the X Event Interface could give you some ideas also

In reply to Re: perl keylogger on linux by hacker
in thread perl keylogger on linux by SMA

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-19 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found