VbWorkerServicePinvokeLauncher is a .NET 8.0 Worker Service written in Visual Basic. This service is designed to launch and manage processes under specific user accounts, such as the SYSTEM account, by duplicating process tokens. It utilizes P/Invoke to interact with Windows APIs, enabling the service to start processes with elevated privileges or different user contexts.
- Launch processes under specific user accounts.
- Duplicate process tokens for elevated privilege management.
- Use P/Invoke to interact with Windows APIs.
- Configuration via
appsettings.json
.
- .NET 8.0 SDK
- A compatible development environment (e.g., Visual Studio 2022 or later).
To change the FilePath
variable value in your appsettings.json
file, follow these steps:
-
Open Your Project
Navigate to your project directory and open it in your preferred IDE (e.g., Visual Studio).
-
Locate the
appsettings.json
FileFind the
appsettings.json
file in the root directory of your project. -
Edit the
appsettings.json
FileOpen the
appsettings.json
file and locate the section where theFilePath
is defined. Modify the value of theFilePath
variable to your desired path. For example:{ "WorkerServiceSettings": { "FilePath": "C:\\New\\Path\\To\\Your\\File.txt" } }
-
Save Changes
Save the changes made to the appsettings.json file.
- Verify Configuration in Your Code
Ensure that your application reads the updated FilePath value correctly.
-
Clone the Repository
git clone https://github.com/1d3nt/VbWorkerServicePinvokeLauncher.git
To install the service, open a terminal or PowerShell window and use the following command. Make sure to include the .exe
extension in the path:
sc.exe create VbWorkerService binPath= "Path\\VbWorkerServicePinvokeLauncher.exe"
Note: Replace "Path\\VbWorkerServicePinvokeLauncher.exe"
with the actual path to your executable file. Use double backslashes (\\
) in the path to escape the backslash character.
Once the service is installed, you can start it using the following command:
sc.exe start VbWorkerService