borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (Milage calculator) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Creating a application that no one can remove and terminate
Poster Message
VYX
Level: Professor


Registered: 16-12-2005
Posts: 70

icon Creating a application that no one can remove and terminate

Hi..

I want to create a program that no one can remove and terminate this kind of application... anybody help me .. how to do this?

Anybody can do for me and guide me.. I want this to do the Monitoring of all transactions of my Agency that run only exclusively for their transaction..

Thanks in advance really appreaciated...

vyx



27-01-2006 at 09:02 AM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1623
icon Re: Creating a application that no one can remove and terminate

Any application that's running (except for 2-3 windows system programs) can be terminated.

You could run 2 programs, have each monitor for the other, and re-open the other if it's closed -- HOWEVER, they must allow the user to log off, lock the workstation, restart the computer, shutdown the computer, etc.  If the programs constantly try to restart (even if the computer's shutting down), it could cause problems, or display error messages.

Likewise... there's no way to guarentee (other than using NT permissions on the registry to prevent non admins from removing the program) that the program will run at login.

____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

27-01-2006 at 11:19 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
TJ_01
Level: VB Lord


Registered: 24-08-2005
Posts: 320
icon Re: Creating a application that no one can remove and terminate

You can simply disable the X (close) button of your form or you can handle your form's closing event.

HTH

____________________________
Im JAMES  

31-01-2006 at 07:28 AM
View Profile Send Email to User Show All Posts | Quote Reply
xtramac
Level: Professor


Registered: 28-08-2005
Posts: 94
icon Re: Creating a application that no one can remove and terminate

tj,

what about the taskmanager?? i think that application will appear there?? Not in the application tab maybe but on the process tab for sure.. is there another way?? am also curious bout this..



andrew

31-01-2006 at 10:38 AM
View Profile Send Email to User Show All Posts | Quote Reply
admin
Level: Administrator


Registered: 04-04-2002
Posts: 532
icon Re: Creating a application that no one can remove and terminate

what about this?


Option Explicit

Private Sub Command1_Click()
    App.TaskVisible = Not App.TaskVisible
End Sub

Private Sub Form_Load()
    App.TaskVisible = False
End Sub


[Edited by admin on 31-01-2006 at 05:29 PM GMT]

____________________________
AndreaVB

31-01-2006 at 04:27 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Creating a application that no one can remove and terminate

TaskVisible will remove it from Applications tab, but will still be visible in Processes. As far as I know, this is not possible.... IT was possoble with Windows98, you only needed to use RegisterServiceProcess API, and it would hide it from Processes.

____________________________
If you find the answer helpful, please mark this topic as solved.

31-01-2006 at 07:37 PM
View Profile Send Email to User Show All Posts | Quote Reply
pavol
Level: Sage

Registered: 11-07-2005
Posts: 68
icon Re: Creating a application that no one can remove and terminate

i think i've heard this somewhere.
can't you just close the task manager once it's open?

____________________________
"Intellectuals solve problems, geniuses prevent them."
-Albert Einstein

Pavol

31-01-2006 at 08:58 PM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1623
icon Re: Creating a application that no one can remove and terminate

Perhaps... although I'd strongly recommend against it.

Really, I've yet to see any program that's absolutely needed to run and take over the system to prevent the user from doing anything (i.e. run/close a app) that it doesn't want it to other than two programs: 1) the os itself, 2) a virus

If you do prevent the task manager from opening, you also prevent the user from closing any other program that might be acting up. And then comes the other part of, what happens if your program is actually acting up (locks, etc)?

Not to mention that I believe some/many of the "anti-spyware" programs that exist (not to mention some other development programs I believe) have the ability of terminating a process from running.  Some programs exist explicitly for terminating applications.

And there also appears to be tens->hundreds of command line programs that are designed to kill processes. From what I saw... microsoft does also include in a resource kit (at one time at least) two programs designed to view the running processes & kill them.




____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

31-01-2006 at 11:00 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Creating a application that no one can remove and terminate

quote:
pavol wrote:
i think i've heard this somewhere.
can't you just close the task manager once it's open?


You can kill it without the task manager. try it:

start notepad and execute this line from command prompt

taskkill /f /im notepad.exe


____________________________
If you find the answer helpful, please mark this topic as solved.
01-02-2006 at 11:48 AM
View Profile Send Email to User Show All Posts | Quote Reply
VYX
Level: Professor


Registered: 16-12-2005
Posts: 70
icon Re: Creating a application that no one can remove and terminate

ok thank you very much to all of you.... i'd really and highly  appreciated all of your suggestions...

i therefore conclude that there so many way to teminate an application..






04-02-2006 at 06:08 AM
View Profile Send Email to User Show All Posts | Quote Reply
iopit69
Level: Trainee

Registered: 29-08-2006
Posts: 1
icon Re: Creating a application that no one can remove and terminate

well, really there are many ways ti hide an app from the task manager, Tasks and Process Tabs.

But, how can someone call himself a VB Lord writing an answer like this:

quote:
You can simply disable the X (close) button of your form or you can handle your form's closing event.


Or someone called Professor asking the same question instead of answering.

Close the task manager once it's open is a stupid solution, if the app must be hide, a behavior like this is not normal. And a user canīt close another hanging app.

And Answering how to kill apps to this question... The purpouse of a forum is to answer the questions.



And now, some solutions to this problem:

1: (The dumbest one) Name your app SVCHOST.EXE

2: Use apis to take a snapshot of the processes and the heaps, modules, and threads used by the processes, then if taskmanager is one of the proces, read the memory and replace your app exe name for something like SVCHOST.EXE
(Api->CreateToolhelp32Snapshot)

3: Use apis to find the Task Manager's window, and use apis to modify the entry of your app from the listview (Search for the "LVM" constants like)

4: Use apis to find the Task Manager's window, and use apis to delete the entry of your app from the listview

5: Make your app a service, and be shure to make it "no desktop interactive" to prevent of showing in process tab.

6: Use proccess injection to inject your app in another (ej, explorer.exe or SVCHOST.EXE)

There are many other ways, this are just the principals.

Remember:
If some one tell you "That can't be done", is just an ignorant who doesn't know how to do it.  
29-08-2006 at 05:13 AM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1623
icon Re: Creating a application that no one can remove and terminate

quote:
iopit69 wrote:
And now, some solutions to this problem:

1: (The dumbest one) Name your app SVCHOST.EXE

2: Use apis to take a snapshot of the processes and the heaps, modules, and threads used by the processes, then if taskmanager is one of the proces, read the memory and replace your app exe name for something like SVCHOST.EXE
(Api->CreateToolhelp32Snapshot)

3: Use apis to find the Task Manager's window, and use apis to modify the entry of your app from the listview (Search for the "LVM" constants like)

4: Use apis to find the Task Manager's window, and use apis to delete the entry of your app from the listview

5: Make your app a service, and be shure to make it "no desktop interactive" to prevent of showing in process tab.

6: Use proccess injection to inject your app in another (ej, explorer.exe or SVCHOST.EXE)

There are many other ways, this are just the principals.

Remember:
If some one tell you "That can't be done", is just an ignorant who doesn't know how to do it.  


#2-4,6 AKA: virus-like activity, and possibly blocked by virus-scanners
#5 -- it's visible in the services directory, or other location
And on top of it all.... the program STILL has to be listed in the registry or startup menu for it to run, so the user can still find it, and then be able to terminate it.

Not to mention, it still doesn't twart the few dozen/hundred/thousand programs that also tell you what's running, and allow you to kill it.  Taskmanager's the easiest, no where near the only way. (not to mention a little program called "hijackthis" that'd tell you what the programs running PATH is)




[Edited by JLRodgers on 29-08-2006 at 11:37 PM GMT]

____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
30-08-2006 at 05:34 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 907
icon Re: Creating a application that no one can remove and terminate

Here's a method.
mimic explorer.exe.
Just fwd all api calls straight through to the "real" explorer api calls.
That way you'd be the only explorer running and you could do whatever you want!

Oh.. btw.
You need to generate the bytes after your core code to be the same size and checksum as the actual explorer - or v/checkers will find it (not toooo difficult, but takes a long time to rev/eng the checksum),
oh, and the "hidden" m/s api calls to shell32, explorer, shelldocvw, etc.

no probs... just takes a bit o' time.

l=a=m=e... why have something that noone can terminate. You can set up winsec to restrict access to taskmanager, run, shell, api calls, procview and stuff

Wouldn't that be easier?
K


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

30-08-2006 at 09:08 PM
View Profile Send Email to User Show All Posts | Quote Reply
VYX
Level: Professor


Registered: 16-12-2005
Posts: 70
icon Re: Creating a application that no one can remove and terminate

Hello guys!!

I'm very sorry for this forgotten topic I'd lost my focus for this for  how many months because of the reasons that I had so many works to be prioritized but thank you very much to all of you..

Anyway I'm still reviewing all those posted help to this topic..but  I'm sorry about the suggestions had been posted here it seems so very complicated and hard to understand .. please

quote:


You need to generate the bytes after your core code to be the same size and checksum as the actual explorer - or v/checkers will find it (not toooo difficult, but takes a long time to rev/eng the checksum),


And now, some solutions to this problem:

1: (The dumbest one) Name your app SVCHOST.EXE

2: Use apis to take a snapshot of the processes and the heaps, modules, and threads used by the processes, then if taskmanager is one of the proces, read the memory and replace your app exe name for something like SVCHOST.EXE
(Api->CreateToolhelp32Snapshot)

3: Use apis to find the Task Manager's window, and use apis to modify the entry of your app from the listview (Search for the "LVM" constants like)

4: Use apis to find the Task Manager's window, and use apis to delete the entry of your app from the listview

5: Make your app a service, and be shure to make it "no desktop interactive" to prevent of showing in process tab.

6: Use proccess injection to inject your app in another (ej, explorer.exe or SVCHOST.EXE)







Could you please elaborate this more so that i could understand for just to take a try..

I'm looking forward to this topic...

Again thanks in advance

vyx



"Genius is one percent inspiration but ninety nine percent perspiration" by:Thomas Edison


[Edited by VYX on 15-08-2007 at 11:07 AM GMT]
15-08-2007 at 03:01 AM
View Profile Send Email to User Show All Posts | Quote Reply
aredz
Level: Trainee

Registered: 08-12-2007
Posts: 3
icon Re: Creating a application that no one can remove and terminate

VYX... or anyone here in this topic... may I suggest something....

I don't really know the flow of the topic.. I'm sooo off... I'm dizzy and have not slept...

but here's the catch.. If you want to make a program that cannot be terminated by windows component.. like the task manager... why not disable it while running the application... same as the switch keys... and the close keys... then make your form always on top... i have a coding that I'd like to share... if it is ok....

not really my code.. but I used most on my application...

DECLARATIONS:

Private Declare Function TaskSwitching_Enable_Disable Lib "InjectApp.dll" (ByVal bEnableDisable As Boolean) As Integer
Private Declare Function CtrlAltDel_Enable_Disable Lib "InjectApp.dll" (ByVal bEnableDisable As Boolean) As Integer

'API function declaration
Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
'some constants for the API function
Private Const conHwndTopmost = -1
Private Const conHwndNoTopmost = -2
Private Const conSwpNoActivate = &H10
Private Const conSwpShowWindow = &H40


FORM CODES:

Private Sub Form_Load()
SetWindowPos hWnd, conHwndTopmost, 0, 0, Screen.Width, Screen.Height, conSwpNoActivate Or conSwpShowWindow
TaskSwitching_Enable_Disable False
CtrlAltDel_Enable_Disable (False)
End Sub

Private Sub Form_Unload(Cancel As Integer)
TaskSwitching_Enable_Disable True
CtrlAltDel_Enable_Disable (True)
End Sub

... end it here....

if you've completed the program here is how it should be performing:

1.) you cannot access the task manager
        - via Ctrl + Alt + Del
        - via Ctrl + Shift + Esc
2.) you will not be able to use the switch keys
        - via Alt + Tab
        - via Alt + Esc
3.) you will not be able to use the hot keys
        - via WindowButton + Esc (consiedered as switch key also)
        - via WindowButton + Any keys
        - via WindowButton itself
4.) you will not be able to use the close keys
        - via Alt + f4
        - via Ctrl + f4

to complete the program make your border to none... and it's set... hope this helps.... i'll provide the InjApp.dll if you are interested in my post... that's all there to is... hope i'd help in a way... ü

09-12-2007 at 03:18 AM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1623
icon Re: Creating a application that no one can remove and terminate

You might also want to consider that now windows Vista exists -- a lot of the things listed here might be blocked.  With viruses and Trojans becoming more evil -- there's more advanced virus programs and spyware ones as well.  Not to mention the greater security issues (non-administrators don't have the same permissions as administrators; and administrators don't have total access to the computer by default  [hard drive]).

And even the best trojan that exists -- can be removed and noticed that it's running.


____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

10-12-2007 at 08:17 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
aredz
Level: Trainee

Registered: 08-12-2007
Posts: 3
icon Re: Creating a application that no one can remove and terminate

in my opinion VISTA is still a crap... not to be rude... it is still prone to virus.. not that I don't agree on it's security but it is so alarmed on everything that interacts on the operating system... but like as you said... virus and trojans are yeah.... GREAT DEAL... even if I'm using windows sp2 my antivirus thinks that the dll i used is some sort of hidden install which may damage the system... and as for the non admins... there are sort of ways which windows cannot erase on their system that would help bypass system permissions... and I know you're aware of that...  but that is merely for a local computer only... through the network... it would be more difficult to intrude those permissions.. so yeah I guess... it will be harder for non-admins to bypass security permissions...

have you used VISTA?... can you still use access-list on VISTA's command prompt?.. btw.. thanks for the reply..

10-12-2007 at 11:38 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Creating a application that no one can remove and terminate
Next Topic (Milage calculator) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder