yes more comments would be nice. Mostly I removed them so as to decrease the chance of the code being traced back to me. Not that I care... it does not exploit any weaknesses in the OS, just uses it in a "special" way...
And of course splitting the file up would be nice. And of course it does not use any C++ specific constructs so might arguably be considered off-topic. The library of functions come from a larger project I worked on that works as a generic socket server with a large exported API for several possible types of modules. I just put it in one file for transportability.
Yes the code is original and written by anonymous (I can neither confirm nor deny being the author of this derivative work -- only that I wrote the code to a totally different project on which it is based).
As for the necessary priveleges to run -- it can run with no special priveleges, but may not work as expected. In particular, you probably need administrative priveleges to write registry entries to the auto-start and windows firewall keys. You also need priveleges to shut down the host machine for the SHUTDOWN command to work, but that should not necessarily be restricted to administrators only.
The intended target OS is Windows 2000, XP or 2003. PSAPI and ADVAPI32 only work on Win2k+. It works on Vista as well, but will probably raise many of those great permission windows to grant it permission to run. Of course, by deluging the OS with so many countless permission nag screens, microsoft has essentially duped themselves, as users get so tired and used to them that they will just blindly click OK every time such a dialogue appears. But that is a matter of social engineering, not technological specifications. Also, it will work on Wine, with limited successful results.
If the program fails to insert itself into the registry or move itself to SYSTEMROOT, it won't bail-out on those problems alone.
FYI, if you run this, and wish to uninstall it, there are 2 ways:
first: manual:
1. open taskmanager and terminate windevmgr.exe (or whatever you compiled it as)
2. open regedit and go to HKLM\Software\Microsoft\Windows\CurrentVersion\Run and remove WINDEVMGR (or whatever you set KEYNAME to be)
3. open regedit and go to HKLM\Sysyem\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List and remove windevmgr.exe (or whatever you compiled it as)
4. open windows explorer and delete C:\WINDOWS\windevmgr.exe (or whatever your %SYSTEMROOT% is)
second: automatic:
telnet localhost 6969
login loonybin
die
have fun
