LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-27-2010, 12:26 PM   #1
JonhQ
LQ Newbie
 
Registered: Mar 2010
Posts: 1

Rep: Reputation: 0
Tracing a user's system calls.


I would like to trace a user's activity by monitoring system calls. Is there a way to use strace such that at startup it will begin tracing all system calls? Or is there any other method to automatically trace the system calls used during a user's session automatically without having to call strace manually?
 
Old 03-27-2010, 01:20 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by JonhQ View Post
I would like to trace a user's activity by monitoring system calls.
It's possible to trace syscalls (see: Auditd, GRSecurity or else maybe LTTng or utrace). I'm wondering though if you're choosing the wrong tool for the right job. Could you please elaborate why you need it? Note logging syscalls means kernel space logging which definitely is not granular so you'll need to filter things afterwards. Also please note monitoring user activity and the privacy aspect. Even if the reason is of a purely technical nature one should be concerned with it. And especially if it applies to a true multi-user system. (Post recycling 1, 2, 3.)

Last edited by unSpawn; 03-27-2010 at 01:27 PM. Reason: //more *is* more
 
Old 03-27-2010, 02:14 PM   #3
JohnQ.
LQ Newbie
 
Registered: Mar 2010
Posts: 2

Rep: Reputation: 0
Well, I basically want to classify normal user behavior by collecting this data from several users. This will be done with their consent obviously so no need to worry about privacy. I know there will be a need for a lot of filtering and it will kill performance, that's not a major issue. Also, strace allows you to select which system calls to be traced and things like that. But I would like to do something like strace -ff init at startup to monitor all process system calls automatically. The machines I will be using are running Ubuntu 9.10 or RHEL 5.4.
 
Old 03-27-2010, 06:23 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Have a look at systemtap - it comes with several "canned" scripts. Wouldn't take much to post-process the output if they don't fit what you want.
ftrace might be a chance as well - wouldn't think it would be available on the RHEL system though.
 
Old 03-27-2010, 08:01 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by JohnQ. View Post
Well, I basically want to classify normal user behavior by collecting this data from several users. This will be done with their consent obviously so no need to worry about privacy.
Sure. It's just the "obviously" part didn't show from your OP...


Quote:
Originally Posted by JohnQ. View Post
strace allows you to select which system calls to be traced and things like that.
Auditd allows you to configure which syscalls will be traced and things like that. BTW Auditd doesn't but System Tap requires a debug kernel AFAIK.
 
Old 03-27-2010, 09:14 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Requires the debug filesystem (plus a couple of other bits), not necessarily a kernel compiled with -g.

Might be an excuse for me to (finally) go look at Auditd.

Last edited by syg00; 03-27-2010 at 09:16 PM.
 
Old 03-30-2010, 10:44 AM   #7
JohnQ.
LQ Newbie
 
Registered: Mar 2010
Posts: 2

Rep: Reputation: 0
Any info on how to use auditd on Ubuntu 9.10? man page isn't very helpful.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how does java calls the system calls which are written in c babu198649 Linux - General 3 12-05-2011 03:40 AM
Tracing Intruders connecting to our system in Redhat Linux operating system vkunasani Linux - Software 4 02-15-2010 06:23 AM
Tracing function calls... How? ik_nitk Programming 3 06-05-2006 07:05 AM
Tracing system calls of sendmail sOldFiSh Programming 2 11-30-2005 02:34 PM
Tracing the system calls arunachalam Linux - Software 2 09-24-2005 02:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration