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

Implement Fake Process #8

Open
metadone666 opened this issue Oct 15, 2019 · 5 comments
Open

Implement Fake Process #8

metadone666 opened this issue Oct 15, 2019 · 5 comments

Comments

@metadone666
Copy link

Hello !
A Fake Process will be awesome.
This is an example of a fake process command line :

trcpy(argv[0],FAKE); // fake the proccess name.
while(fgets(buff,sizeof(buff),fp))
{
c=strchr(buff,'n');
if(c!=NULL) *c='.';
if (!(fork()))
{
where=0;
// printf("--> attacking %s",buff);
for (i=0; i<count; i=i+2){
// printf("--> Trying %s:%s %sn",a[i],a[i+1],buff);
checkauth(a[i],a[i+1],buff); // try to auth
}
exit(0);

this is taken from
https://github.com/MrMugiwara/against-cracker/blob/master/against.py
Of course, this is py, but i guess this can also be done in C.
Thank you, Brother !

@matricali
Copy link
Owner

matricali commented Oct 15, 2019

Hello !
A Fake Process will be awesome.
This is an example of a fake process command line :

trcpy(argv[0],FAKE); // fake the proccess name.
while(fgets(buff,sizeof(buff),fp))
{
c=strchr(buff,'n');
if(c!=NULL) *c='.';
if (!(fork()))
{
where=0;
// printf("--> attacking %s",buff);
for (i=0; i<count; i=i+2){
// printf("--> Trying %s:%s %sn",a[i],a[i+1],buff);
checkauth(a[i],a[i+1],buff); // try to auth
}
exit(0);

this is taken from
https://github.com/MrMugiwara/against-cracker/blob/master/against.py
Of course, this is py, but i guess this can also be done in C.
Thank you, Brother !

Your code is ANSI C, not Python 😆
But yes, the way to change the process name on UNIX systems are writing on memory where argv[0] is allocated. 👍

I guess that your code has a missing "s", should be:
strcpy(argv[0], FAKE); <--- Basically it's copying memory from FAKE to address where argv[0] is allocated.
This single line covers your request :D

@matricali
Copy link
Owner

matricali commented Oct 15, 2019

Other Linux-standard possible solutions:

  • pthread_setname_np(pthread_self(), "newName"); is probably the better method, it comes from glibc and might be portable to other non-Linux systems

  • prctl(PR_SET_NAME, (unsigned long)"newName", 0, 0, 0);

@metadone666
Copy link
Author

prctl(PR_SET_NAME, (unsigned long)"newName", 0, 0, 0);

First, thank you for the quick response.
Second, where should i place this line ?
"prctl(PR_SET_NAME, (unsigned long)"newName", 0, 0, 0);"

_<

@metadone666
Copy link
Author

Other Linux-standard possible solutions:

* [`pthread_setname_np`](https://linux.die.net/man/3/pthread_setname_np)(pthread_self(), "newName"); is probably the better method, it comes from `glibc` and might be portable to other non-Linux systems

* [`prctl`](https://linux.die.net/man/2/prctl)(PR_SET_NAME, (unsigned long)"newName", 0, 0, 0);

Hello again, Brother!
As above, I'm asking you about those lines :D
where should i place them ?
cbrutekrag.c ?
is there anything else to insert ?
can you give me an example ?
Thank you so much brother !
Note: my coding skills are horrible :))))

@metadone666
Copy link
Author

I also got plenty of errors when i tried to add prctl or pthread_setname_np

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants