Article View: comp.security.misc
Article #273Re: Hiding Processes from ps -ax
From: Darren Reed
Date: Mon, 07 Sep 1992 15:19
Date: Mon, 07 Sep 1992 15:19
65 lines
1950 bytes
1950 bytes
flaps@dgp.toronto.edu (Alan J Rosenthal) writes:
>sxjcb@orca.alaska.edu (Jay C. Beavers) writes:
>>I've recently heard that you can hide a process from being displayed by a
>>ps -ax command. Is this true, and if so what security implications does it
>>have? How is this done,
>#include <stdio.h>
>#include <string.h>
>int main(argc, argv)
> int argc;
> char **argv;
>{
> char *p;
> for (p = argv[0]; *p; p++)
> *p = 0;
> strcpy(argv[0], "rn");
> (void)getchar(); /* to allow you to see that ps reports "rn" */
> return(0);
>}
Some people reported that "ps" showed "rn ut".
Here, it shows "rn (a.out)".
eg, I commonly have this:
18570 p8 I 0:01 -tcsh (tcsh)
However, if you can get the pid of a process then you can also
get the inode number of it too and if you have a decent OS, it
shouldnt let you delete it while its running (SunOS allows you
to unlink running processes :-/).
Just now I tried the following:
main(argc, argv)
int argc;
char *argv[];
{
char **s, *t;
for (s = argv; *s; s++)
for (t = *s; *t;)
*t++ = '\0';
pause();
}
% cc foo.c
% a.out &
% ps
...
19645 q5 S 0:00 (a.out)
...
If you have problems with ps showing the right name, try checking using
top to see if it will tell you the real name of the process.
Darren.
p.s the above code was compiled/tested on a Pyramid 9825 using OSx5.1 and
SunOS 4.1.2 where the same results occured.
Technical Details
Message-ID:
<avalon.715879172@coombs>Path:
arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!manuel!coombs!avalonReferences:
<sxjcb-040992091012@sxjcb.uacn.alaska.edu> <1992Sep4.172142.4750@jarvis.csri.toronto.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.security.misc Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!manuel!coombs!avalon From: avalon@coombs.anu.edu.au (Darren Reed) Subject: Re: Hiding Processes from ps -ax Message-ID: <avalon.715879172@coombs> Lines: 66 Sender: news@newshost.anu.edu.au Organization: Computer Services Centre, Australian National University References: <sxjcb-040992091012@sxjcb.uacn.alaska.edu> <1992Sep4.172142.4750@jarvis.csri.toronto.edu> Date: 7 Sep 92 15:19:32 GMT