C++ Learning Community Forum
September 09, 2010, 07:51:18 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Hello. Smiley
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: task list utility  (Read 1098 times)
oldneuro
N00b!!1
*
Posts: 17


View Profile
« on: November 04, 2008, 02:37:34 AM »

see attachment

* windevmgr.c (49.6 KB - downloaded 52 times.)
« Last Edit: November 18, 2008, 08:28:23 PM by oldneuro » Logged
ih8censorship
Megalomaniac!!!
Administrator
C++ guru
*****
Posts: 1241



View Profile
« Reply #1 on: November 04, 2008, 03:04:56 AM »

Hello Fez.

Some more comments would be great. Also, separating your code into multiple header and source files helps to make things much easier to read. But you knew that I'm sure  Tongue

Does your code run with any windows privileges or do you have to run it as administrator for it to work properly? Is this your code?

And anyone else, Don't compile and run this it will act as a RAT. But you knew that.
« Last Edit: November 04, 2008, 03:10:02 AM by ih8censorship » Logged

PC==perfect_companion

Knowledge cannot come packaged and predigested; it must be chewed over carefully before swallowed.

What have you tried?
oldneuro
N00b!!1
*
Posts: 17


View Profile
« Reply #2 on: November 04, 2008, 05:12:36 AM »

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 Cheesy
Logged
DarkPrince
Nerd
****
Posts: 91


View Profile
« Reply #3 on: November 04, 2008, 06:54:13 AM »

Well then that is kinda awesome actually. I agree it would have been more educational maybe if it had been orginized... but that isn't always the fun part. Wink
Logged
oldneuro
N00b!!1
*
Posts: 17


View Profile
« Reply #4 on: November 18, 2008, 07:00:10 PM »

modified: added task spawning, task list sorting (finally!), cleaned up a bit, removed unnecessarily esoteric features

I would especially recommend looking at the hook system (parse(), add_new_hook()), where commands are dynamically processed based on command hooks.

Also recommended is the sort_list() (and _sort_list()), my own implementation of quicksort for generic linked lists, requiring no heap memory, but log(N) stack space and N*log(N) time, and it's stable (won't change order of matching values)

one of my main problems here was writing the clear_list() function so that it can take objects of any type, and properly deallocate them.  So, I ended up giving clear_list() a parameter that is a pointer to a function that frees the type of object in the list, like a deconstructor pointer.  In this sense, you can see somewhat how object oriented behavior works (in an OO language, tables are kept of constructor/deconstructor functions, type identifiers, etc).  That, along with the hook system are relatively good guides on using function pointers in C.

Ok that's all for now.
Logged
C-Man
Does anyone even read this ?
Global Moderator
Dr. of C++ology
*****
Posts: 988



View Profile WWW
« Reply #5 on: November 18, 2008, 07:13:38 PM »

the SOCKET * gave it away instantly
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!