Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C (http://www.programmingforums.org/forum60.html)
-   -   need serious help (http://www.programmingforums.org/showthread.php?t=11263)

ProjectX Sep 7th, 2006 4:13 AM

need serious help
 
hey guys, how do i make a program to run like a process in the system everytime the computer starts? And is it possible to make the program invisible?

grumpy Sep 7th, 2006 4:50 AM

The techniques depend on operating system.

If you're developing for windows NT/2000/XP, partial answers follow.

You need to develop a windows service (a particular type of program, using specific programming methods so it behaves correctly). Once you've developed such an application, it is necessary to install it so it starts during system startup (and that requires administrator privileges on the target machine).

There are several techniques to make a program "invisible", depending on what you mean by "invisible". If your meaning is that it has windows but none are visible, then the technique is easy: one attribute of windows is whether it is visible or not. If your meaning is not appearing on the task bar, or not appearing in the process list (eg through Task Manager) the techniques are a little more difficult.

tempest Sep 7th, 2006 11:06 AM

It looks like he might want to develop some kind of malware.

Edgar Sep 7th, 2006 2:36 PM

yep that is what he wnats, create a malware

Ooble Sep 7th, 2006 6:54 PM

You don't know that. While these tactics are routinely employed by malware authors, they also have legitimate uses - otherwise there wouldn't be any way to do them.

ProjectX Sep 7th, 2006 9:15 PM

well no im not writing malware. Ive just always wondered how to do that

grumpy Sep 7th, 2006 10:47 PM

Hope so, ProjectX. I would personally describe malware authors as scum of the earth, except that scum has some redeeming characteristics.

Narue Sep 9th, 2006 3:32 PM

>I would personally describe malware authors as scum of the earth
Scum is actually considered a delicacy in some countries. Maybe we should send malware authors on a one way trip to one of them. :)

...

But don't start that policy until I perform a permanent delete on all of my virus code trees. :p

>Ive just always wondered how to do that
Well, let's assume the two most common systems. In a POSIX environment you would implement a daemon by forking a new process and killing the parent. This is assuming a legitimate daemon because it's still user visible and killable. To make a daemon completely invisible is much harder, especially if you want to hide it from a superuser. Since that's crossing the boundaries of malware, I'll refrain from explaining the process. :) The meat of a basic daemon would be something like this:
:

if ( fork() == 0 ) {
  fclose ( stdin );
  fclose ( stdout );

  for ( ; ; ) {
    /* Perform payload after a certain interval forever */
    payload ();
    sleep ( interval );
  }
}
else {
  /* Kill parent process */
  exit ( 0 );
}

Windows is harder, but the concept is pretty simple and you have more options. The first option is a valid Windows service, which is an ideal solution for legit programs. Malware will typically take the low road where a basic Win32 application is created but no window is drawn and taskbar icons are hidden. It's pretty straightforward, but the code is kind of long, so I won't post it. Once again, really hiding the process is more involved and screams nasty program, so I won't describe how to do it. ;)


All times are GMT -5. The time now is 1:08 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC