C# class to impersonate user

Fertiggestellt Veröffentlicht vor 7 Jahren Bezahlt bei Lieferung
Fertiggestellt Bezahlt bei Lieferung

Problem 1:

I am looking for a C# class that I can use to launch a program in an interactive user session if I am currently running in the SYSTEM context/session 0. I want something that will work on Windows XP and higher.

The goal is to use this class to display a GUI to users when running in the SYSTEM context.

I essentially want this powershell script to be written as a C# class:

[url removed, login to view]

I want the following additional options that the powershell script does not provide:

a) Be able to specify the session # that I want the program to open under.

b) Specify whether the process should be launched with an admin token or a standard user token. I'm not sure if you would have to enumerate and return both admin and standard tokens and then use choose the one specified or if you can adjust admin tokens so that they become user tokens. The PowerShell script currently only returns an admin token if both an admin and a standard token exist.

c) On line 1443, it currently filters out local services by username. This will not work for non-english languages. I would like this filter to by by SID. I believe the SID for a LOCAL SERVICE is S-1-5-19.

d) On line 1690, a WMI method is used to discover the porcess owner username and then it's compared to the SYSTEM account username to see if they are the same. I would rather discover the process owner SID and compare that to the SYSTEM account SID. Also, I would rather use the Win32 method of discovering the process owner SID as it is much faster than WMI: [url removed, login to view]

Problem 2:

The QueryUser class and the GetUserSessionInfo function located here discover all logged in users and details about them:

[url removed, login to view]

On line 559, it discovers all local admins in the local administrator's group. Instead of using this method, I would like to be able to examine the token for a user to see if they are in the local administrator's group. I would also like to be able to use the token to see if they belong to any other admin type such as domain admin.

Links for reference that I found while researching this topic:

[url removed, login to view]

[url removed, login to view]

[url removed, login to view]

[url removed, login to view]

[url removed, login to view]

[url removed, login to view]

[url removed, login to view]

.NET C# Programmierung Powershell

Projekt-ID: #10898238

Über das Projekt

4 Vorschläge Remote Projekt Aktiv vor 7 Jahren

Vergeben an:

elitewebamit

Hi, I have more than 12 years experience in Asp.net , C# . I have also worked on various technologies as a freelancer.I have deployed several successful applications/projects on market place for almost all platfor Mehr

$250 USD in 3 Tagen
(0 Bewertungen)
0.0

4 Freelancer bieten im Durchschnitt $219 für diesen Job

prashushinde9

Hello, I understood the initial scope of this project. Although i want to discuss further this job in order to prepare the final concept for this project. After Complete discussion over the call or in chat, i Mehr

$257 USD in 3 Tagen
(8 Bewertungen)
4.6
pakaimsolutions

Hello, I hope you doing very well! I have gone through the description and would like to provide a quality solution using my 5+ years of professional experience in required skills. (.NET/ASP.NET - MVC, EF, SQL, C#). Mehr

$125 USD in 3 Tagen
(10 Bewertungen)
3.6