LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-21-2010, 12:14 AM   #1
hamedhsn
Member
 
Registered: Feb 2010
Distribution: opensuse 11.2
Posts: 57

Rep: Reputation: 0
manipulate the "ps" source code in order to hide a process


hi..
how can i manipulate the source code of ps command in order to hide a process from the list that run by ps.
as you know ps command list all the process that exist in /proc.
so how can i do this??
this is part of my assingment...
plz response me as soon as possible...
thanks...

Last edited by hamedhsn; 02-21-2010 at 12:15 AM.
 
Old 02-21-2010, 12:35 AM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
What do you mean, "part of your assignment" ? Is this schoolwork?

Forgive me, but it sounds like a rather sketchy assignment to me. What is the intention of hiding certain processes?

In any event, you seem to understand that you would need to edit the sourcecode of `ps` to accommodate your request. This would produce a new "tool" which would/should no longer be known as `ps`, since it would be somewhat defective compared to the REAL `ps` tool. You need to learn some C programming to do this.

Do you want someone to do the assignment for you? That won't happen. Show us what you've come up with so far, and *maybe* someone can point you in the right direction.

Sasha
 
1 members found this post helpful.
Old 02-21-2010, 12:39 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Answering this question may be contrary to LQ Rules: "Posts containing information about cracking, piracy, warez, fraud or any topic that could be damaging to either LinuxQuestions.org or any third party will be immediately removed". Thread reported for decision by the moderators.
 
1 members found this post helpful.
Old 02-21-2010, 12:43 AM   #4
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by catkin View Post
Answering this question may be contrary to LQ Rules: "Posts containing information about cracking, piracy, warez, fraud or any topic that could be damaging to either LinuxQuestions.org or any third party will be immediately removed". Thread reported for decision by the moderators.
And in what way is it cracking, piracy or warez?
GNU GPL = Source is suppose to be modified.
 
0 members found this post helpful.
Old 02-21-2010, 01:05 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
You know fully well what their concerns are. A hidden process suggests bad things at foot. Just like Aircrack is a fine piece of code, it's uses are typically less admirable.
 
1 members found this post helpful.
Old 02-21-2010, 01:47 AM   #6
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
The OP hints its a school assignment.
And there is legit uses for example filtering out "ps" itself.
 
1 members found this post helpful.
Old 02-21-2010, 03:54 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Yes there is that, and as such I've not closed the thread. As for needing to remove itself? Can't see it personally. If you felt the need to do that, then you're probably using the wrong tool, and should use pgrep or someething else.
 
Old 02-21-2010, 04:26 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by smeezekitty View Post
The OP hints its a school assignment.
And there is legit uses for example filtering out "ps" itself.
The OP wrote "this is part of my assingment" which may or may not be academic. It would be a strange academic assignment, having no obvious application in the (ethical) real world.
 
Old 02-21-2010, 04:53 AM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Note that the first reply already challenged the OP wrt homework or not. Echoing that post or trying to discuss the case before the OP replies clutters up this thread and does not help LQ, the OP or you.
 
1 members found this post helpful.
Old 02-21-2010, 09:47 AM   #10
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by hamedhsn View Post
...
how can i manipulate the source code
...
You download the source code, you read it, you understand it, then you change it where appropriate.

Or you want others to do the job for you ?
 
Old 02-23-2010, 06:00 AM   #11
hamedhsn
Member
 
Registered: Feb 2010
Distribution: opensuse 11.2
Posts: 57

Original Poster
Rep: Reputation: 0
hi friends..this mini project is part of my system security course.
by using one programming language like c, i have to change ps source code such that one existing process will be hided from the list which showed by running ps -a in console.
any help is helpful for me,because i don't know how to start.
 
Old 02-23-2010, 06:39 AM   #12
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by hamedhsn View Post
...
i don't know how to start.
Download the source code first.
 
Old 02-23-2010, 06:48 AM   #13
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by Sergei Steshenko
Download the source code first.
And the souce code can be downloaded here:

1. http://procps.sourceforge.net/

or

2. http://procps.cvs.sourceforge.net/procps/procps/
 
Old 02-23-2010, 07:06 AM   #14
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by anishakaul View Post
And the souce code can be downloaded here:

1. http://procps.sourceforge.net/

or

2. http://procps.cvs.sourceforge.net/procps/procps/
This, of course, is correct. And this can be inferred from reading 'man ps'. And reading 'man ps' to the very end is what I expected from the OP.
 
1 members found this post 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Do i need "RPM Packages" or "SuSe Source code packages" Donati Linux - Software 3 03-19-2009 07:32 PM
howto hide a process from "ps" balusss Linux - General 1 03-17-2008 05:56 AM
How to convert Assembly code to "C" source code ssg14j Programming 2 08-01-2005 12:48 PM
A source close to SCO: "linux code has been copied in to system V" qanopus General 4 06-12-2003 01:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:20 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