impersonation

Is it possible to spoof or impersonate a destination (server) IP?

陌路散爱 提交于 2019-12-25 03:58:10
问题 Is it possible to spoof or impersonate a server's IP? So that clients wanting to connect to that Server's IP, would actually connect to the attacker's machine? But the attacker would still be able to contact the actual server. This is all TCP/IP based, no name resolution, and all machines are on the same network or the internet (No NAT-ing). I am working on a networking application, and I would like to build in some authentication. What I need to do is to authenticate the server by IP. In

Run PowerShell script from ASP.NET

╄→尐↘猪︶ㄣ 提交于 2019-12-24 20:41:10
问题 I have been trying out running a PowerShell script from asp.net with no success for a few days already. The C# is: using (var process = new Process()) { ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = @"powershell.exe"; startInfo.Arguments = "arguments that call the script here"; startInfo.RedirectStandardOutput = false; startInfo.RedirectStandardError = false; startInfo.UseShellExecute = true; startInfo.CreateNoWindow = true; process.StartInfo = startInfo; process

Impersonate not working for DirectoryServices

て烟熏妆下的殇ゞ 提交于 2019-12-24 08:34:28
问题 I'm trying to execute the following code using System.DirectoryServices; public bool HasVirtualDirectory(string serverName, string virtualDirectoryName) { try { DirectoryEntry directoryEntry = new DirectoryEntry("IIS://" + serverName + "/W3SVC/1/Root"); return directoryEntry.Children.Find(virtualDirectoryName, directoryEntry.SchemaClassName.ToString()) != null; } catch (Exception) { return false; } } As I need adminstrator rights on the server to execute this code, I used this class to

Add elements to an an announcements list for a specific user

我们两清 提交于 2019-12-24 07:38:25
问题 I have a customer request to create a number of announcements based on some data from another database. Most of it seems easy enough but the new elements should be created by the user (login) specified in the input data. I was planning to add the announcements using the list web services but I sure would like to avoid using impersonation in order to get the create user right. Is there a way to assign the correct user as the creator without using impersonation? 回答1: This may not be the answer

Impersonation throws FileNotFoundException with WindowsIdentity in Powershell

时光毁灭记忆、已成空白 提交于 2019-12-23 09:33:22
问题 I am encountering a somewhat weird error with performing impersonation in PowerShell and C#. Executing the folowing code does not show any errors. PSObject result = null; using (PowerShell powershell = PowerShell.Create()) { RunspaceConfiguration config = RunspaceConfiguration.Create(); powershell.Runspace = RunspaceFactory.CreateRunspace(config); powershell.Runspace.Open(); powershell.AddScript(String.Format(CmdletMap[PSVocab.OsBootTime], this.ComputerName)); result = powershell.Invoke()

Calling an async WCF Service while being impersonated

无人久伴 提交于 2019-12-23 09:02:51
问题 I have a WCF Service running on a Server, which is configured to accept Kerberos authentication. Kerberos works fine and the WCF Service therefore knows, which user is connecting to him. The Service offers everything as Async Methods. Like this here (just an example for clearity). public ExampleService : IExampleService { public Task<string> GetUsernameAsync() { return await Task.Run(() => System.Threading.Thread.CurrentPrincipal.Name); } } On the Client side I have an Controller (it's an MVC

Why is my MVC app trying to log into my DB as my machine, and not as the App Pool identity?

删除回忆录丶 提交于 2019-12-23 07:07:31
问题 When I try and access my newly deployed (to lcoal IIS 7.5) MVC4 app, I get the error: Login failed for user 'DOMAIN\MACHINE-NAME$' where the '$' is appended and not part of the machine name. The connection string in web.config looks like this: <add name="ComairRIEntities" connectionString="metadata=res://*/Data.ComairRI.csdl|res://*/Data.ComairRI.ssdl|res://*/Data.ComairRI.msl;provider=System.Data.SqlClient;provider connection string="data source=(local);initial catalog=MyDB;integrated

ASP.NET Impersonation and SQL Server Trusted Connection Calls

徘徊边缘 提交于 2019-12-23 04:44:36
问题 I am working on an ASP.NET page that we, in code impersonate the requesting user. We are using the following code to start impersonating. Dim impersonationContext As System.Security.Principal.WindowsImpersonationContext Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity currentWindowsIdentity = CType(User.Identity, System.Security.Principal.WindowsIdentity) impersonationContext = currentWindowsIdentity.Impersonate() After this we have validated that the application is

How to impersonate a WellKnownSidType?

懵懂的女人 提交于 2019-12-23 03:43:29
问题 I know I can impersonate a windows account using: http://msdn.microsoft.com/en-us/library/chf6fbt4.aspx But how do I go about impersonating a WellKnownSidType account? SecurityIdentifier sid = new SecurityIdentifier(WellKnownSidType.LocalSystemSid, null); NTAccount account = sid.Translate(typeof(NTAccount)) as NTAccount; if (account != null) { //Impersonate here??? } 回答1: First off, you will not be able to impersonate built-in accounts like 'Network Service' or 'Local Service' unless you are

“Cannot open log for source” - Windows 7 - .NET web service - event log

泪湿孤枕 提交于 2019-12-23 01:09:19
问题 I have a .NET web service that is trying to log to the Windows Event Log. However, when I try to send a SOAP request to a web method in this web service, I get back this error in the SOAP response: System.InvalidOperationException: Cannot open log for source 'MySource'. You may not have write access. ---> System.ComponentModel.Win32Exception: Access is denied I've tried Googling around for a solution. This one describes editing a registry key that does not exist for me in Windows 7 64-bit;