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

.NET 

Application/Process Blocker

I think no one posted this simple way of blocking application in windows so Ill share mine.

Top most
Code
Imports Microsoft.Win32

To call
Disable Application
Code
appcontrol(True, yourblockprocessnameSTRING)

Enable Disabled Application
Code
appcontrol(False, yourblockprocessnameSTRING)

Code
Shared Sub appcontrol(accessFlag, exename)
  If accessFlag = True Then
    'adding to registry start
    Try

    Dim CU As Microsoft.Win32.RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun", True)

    If CU Is Nothing Then
    CU = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", True)
    CU.SetValue("DisallowRun", 1, RegistryValueKind.DWord)
    CU.CreateSubKey("DisallowRun")
    CU = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun", True)
    CU.SetValue(exename, exename & ".exe", RegistryValueKind.String)
    CU = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", True)
    MsgBox("Successfully Restricted " & exename & ".", MsgBoxStyle.Information)

    Else
    CU = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", True)
    CU.SetValue("DisallowRun", 1, RegistryValueKind.DWord)
    CU = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun", True)
    CU.SetValue(exename, exename & ".exe", RegistryValueKind.String)
    MsgBox("Successfully Restricted " & exename & ".", MsgBoxStyle.Information)

    End If

    Catch ex As Exception

    MsgBox("Error writing the registry" & vbNewLine & "Please use windows admin account", MsgBoxStyle.OkOnly + MsgBoxStyle.Critical)
    End Try
    'end

  Else : accessFlag = False

    Try
    Dim CU As Microsoft.Win32.RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun", True)
    CU.DeleteValue(exename)
    MsgBox("Successfully Allowed " & exename & ".", MsgBoxStyle.Information)

    Catch ex As Exception
    MsgBox(ex.Message, MsgBoxStyle.Critical)

    End Try

  End If

    End Sub

If you want to use open file dialog box
Code
Private Sub OpenFileDialogBox1_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialogBox1.FileOk
  Try
    path = ApplicationExplore.FileName.ToString()
    exename = System.IO.Path.GetFileName(path)
  Catch ex As Exception
    MsgBox(ex.Message, MsgBoxStyle.Critical)
  End Try
    End Sub
Very simple tutorial, but thanks for this, sure it will help out the noobs.

I like the usage of the registry, instead of the garbage startup folder.
Yeah, Just simple quick and easy tutorial for newbies etc.
thanx great one bro .... thanks you :)bro itz nice and easy to learn
Glad to help you out there. No problem.
great work man, any ideas on how to block site or grab the sites from a webb browser ?
^^ to block site use host file editing
(Feb 11, 2013 09:58 AM)AX5 Wrote:  great work man, any ideas on how to block site or grab the sites from a webb browser ?

https://hackforums.net/showthread.php?tid=153044

Get Firefox URL. Because of you I posted this thread :)

https://hackforums.net/showthread.php?tid=3250728
Nice small tut dude. Good work keep it up.
(Feb 11, 2013 10:55 AM)Networkmancer Wrote:  https://hackforums.net/showthread.php?tid=153044

Get Firefox URL. Because of you I posted this thread :)

https://hackforums.net/showthread.php?tid=3250728

nice one mate good job, is there a way for ie and chrome to ?
IE is simple. I found chrome but was outdated because of chromes update.
nice tutorial man c:

thanks for the share. it's really useful. i will use this on my project in future
Thanks a lot man.
Hope you will make more tutorials, that's realy usefull.
Post revived :D for reference and to help other folks out there.
Nice job man, looks pretty sweet 🤝
Polo Everything.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by TennoFeb 3, 2019 04:49 AM 4 307 Feb 3, 2019 04:49 AM
Last Post: Tenno
[C] by chrizatorJul 22, 2018 05:09 AM 4 229 Jul 22, 2018 05:09 AM
Last Post: Anzee
[C] by MeterpreterJan 4, 2018 11:35 AM 21 940 Jan 4, 2018 11:35 AM
Last Post: morph