- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在使用“Microsoft 终端服务控件类型库”来建立与远程桌面服务器的连接。我正在寻找一种方法来阻止或抑制在连接到使用网络级身份验证 (NLA) 的远程桌面服务器时未能提供正确的用户名/密码组合时显示的“Windows 安全”提示。窗口看起来像这样:
我已经阅读并尝试了目前可以在网上找到的所有设置组合,但没有一个成功。以下是我在 stackoverlow 上发现的几个问题,它们讨论了这个确切的问题,据说可以解决,但答案对我不起作用:
AxMsRdpClient9 Dismiss login dialog
AxMsRdpClient6NotSafeForScripting AllowPromptingForCredentials
这听起来可能很荒谬,但我的最终目标只是尝试连接到 rdp 服务器并故意输入无效的用户名/密码,然后在失败时断开连接。我不关心实际连接或显示任何东西。如果这很重要,我这样做是为了在远程服务器上的事件日志中触发失败的登录尝试,稍后另一个应用程序将使用该登录尝试。
下面的代码已经在事件日志中触发了一次失败的登录尝试,但我只是找不到阻止这个失败的登录框在客户端计算机上弹出的方法,我宁愿不求助于尝试关闭窗口后的黑客攻击是打开。当远程桌面服务器配置为允许来自运行任何版本的远程桌面的计算机的连接(不太安全的选项)时,我没有同样的问题,因为弹出提示显然是 NLA 提供的额外安全性的一部分。
我已经为此控件尝试了许多不同的设置组合,以至于我的头都在旋转。这是一个示例,它以上述其他 stackoverflow 问题之一为模型:
Public Class Form1
Dim WithEvents oRemote As AxMSTSCLib.AxMsRdpClient6NotSafeForScripting
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
oRemote = New AxMSTSCLib.AxMsRdpClient6NotSafeForScripting
CType(oRemote, System.ComponentModel.ISupportInitialize).BeginInit()
oRemote.Dock = System.Windows.Forms.DockStyle.Fill
oRemote.Enabled = True
oRemote.Name = "OfficeWin7"
Me.Controls.Add(oRemote)
CType(oRemote, System.ComponentModel.ISupportInitialize).EndInit()
oRemote.CreateControl()
oRemote.Size = New System.Drawing.Size(800, 600)
oRemote.Server = "IPADDRESS"
oRemote.UserName = "TestAccount"
oRemote.AdvancedSettings7.ClearTextPassword = "WrongPassword"
Dim ocx As MSTSCLib.IMsRdpClientNonScriptable4 = oRemote.GetOcx()
ocx.EnableCredSspSupport = True
ocx.AllowCredentialSaving = False
ocx.PromptForCredentials = False
ocx.PromptForCredsOnClient = False
oRemote.Connect()
End Sub
Private Sub oRemote_OnAuthenticationWarningDismissed(sender As Object, e As EventArgs) Handles oRemote.OnAuthenticationWarningDismissed
MessageBox.Show("The credentials popup is now closing")
End Sub
Private Sub oRemote_OnAuthenticationWarningDisplayed(sender As Object, e As EventArgs) Handles oRemote.OnAuthenticationWarningDisplayed
MessageBox.Show("The credentials popup is about to be shown")
End Sub
End Class
ocx.PromptForCredentials = False
应该阻止此弹出的行,但如果将该值设置为
True
似乎没有什么区别或
False
.我几乎会假设
ocx.PromptForCredsOnClient
的属性名称可能实际上有效,但同样,我设置该值并没有什么不同。我总是得到相同的弹出窗口。
AxMsRdpClient6NotSafeForScripting
像
AxMsRdpClient9NotSafeForScripting
这样的其他对象甚至
AxMsTscAxNotSafeForScripting
当我将它放到表单上时,这是控件使用的默认类型。但是,我已经尝试了一堆这些设置组合,并希望有人能对这种情况有所了解。
Microsoft Terminal Services Control Type Library
。如果有的话。如果它们确实存在,我没有太多运气找到它们,但如果我在搜索中遗漏了任何内容,请告诉我。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private AxMSTSCLib.AxMsRdpClient6NotSafeForScripting withEventsField_oRemote;
public AxMSTSCLib.AxMsRdpClient6NotSafeForScripting oRemote {
get { return withEventsField_oRemote; }
set {
if (withEventsField_oRemote != null) {
withEventsField_oRemote.OnAuthenticationWarningDismissed -= oRemote_OnAuthenticationWarningDismissed;
withEventsField_oRemote.OnAuthenticationWarningDisplayed -= oRemote_OnAuthenticationWarningDisplayed;
}
withEventsField_oRemote = value;
if (withEventsField_oRemote != null) {
withEventsField_oRemote.OnAuthenticationWarningDismissed += oRemote_OnAuthenticationWarningDismissed;
withEventsField_oRemote.OnAuthenticationWarningDisplayed += oRemote_OnAuthenticationWarningDisplayed;
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
oRemote = new AxMSTSCLib.AxMsRdpClient6NotSafeForScripting();
((System.ComponentModel.ISupportInitialize)oRemote).BeginInit();
oRemote.Dock = System.Windows.Forms.DockStyle.Fill;
oRemote.Enabled = true;
oRemote.Name = "OfficeWin7";
this.Controls.Add(oRemote);
((System.ComponentModel.ISupportInitialize)oRemote).EndInit();
oRemote.CreateControl();
oRemote.Size = new System.Drawing.Size(800, 600);
oRemote.Server = "IPADDRESS";
oRemote.UserName = "TestAccount";
oRemote.AdvancedSettings7.ClearTextPassword = "WrongPassword";
MSTSCLib.IMsRdpClientNonScriptable4 ocx = (MSTSCLib.IMsRdpClientNonScriptable4)oRemote.GetOcx();
ocx.EnableCredSspSupport = true;
ocx.AllowCredentialSaving = false;
ocx.PromptForCredentials = false;
ocx.PromptForCredsOnClient = false;
oRemote.Connect();
}
private void oRemote_OnAuthenticationWarningDismissed(object sender, EventArgs e)
{
MessageBox.Show("The credentials popup is now closing");
}
private void oRemote_OnAuthenticationWarningDisplayed(object sender, EventArgs e)
{
MessageBox.Show("The credentials popup is about to be shown");
}
public Form1()
{
Load += Form1_Load;
}
}
}
最佳答案
首先,您确实需要确保您的测试环境使用 RDP 的最新更新,特别是如果它是 Windows 7 - 只需运行 Windows Update。
接下来,关注这一行:
ocx.EnableCredSspSupport = True
Load locally stored credentials; if there aren't such - ask the user then crypt, hash, bla-bla, and store them locally, in order to use them next time
False
看看会发生什么。
关于c# - 在未能使用网络级身份验证向远程桌面服务器提供正确凭据后防止登录尝试失败窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37669589/
我有一个应用程序,其中许多对象都扩展了一个抽象类,该抽象类定义了诸如 create() edit() retrieve() 和 delete()。由于每个子类对这些函数使用相同的逻辑,抽象类定义了默认
我正在使用$anchorScroll滚动到页面顶部,其中 html 元素具有 ID #brand。 AngularJS 代码: $location.hash(
我想停用我的应用程序中的右键单击,该右键单击提供了在桌面上安装应用程序的选项。我该如何做这样的事情? 最佳答案 右键单击 Visual Studio 中的项目并选择属性。那里有一个复选框“启用浏览器运
我使用 jquery 定位 div,在我的 CSS 中我有一个 div.right-sm:hover{background-color: blue} 我想使用 jquery 停止悬停: $(this
所以,我正在尝试复制 html5“占位符”属性功能。 我目前坚持的一件事是,在获得元素焦点时,插入符号立即出现在输入的开头。 就目前情况而言,插入符号出现在用户单击的位置,然后当我使用 jQuery
当表单填写并发送时,如果您刷新页面,它表示表单将再次发送。 (再次提交表格)。 防止这种情况发生的好方法是什么?或者终止这个 session ? 这方面有什么指导吗? 谢谢 最佳答案 处理完POST信
我想阻止 @ 被输入到 input 中。但它不起作用,知道为什么吗? $(function() { $(document).on('keyup', '[placeholder="x"]', fun
我正在使用 PHP 创建一个应用程序并涉及 MySQL。如果在请求过程中发生错误,我将如何“将查询分组在一起”,检查它是否会成功,然后对真实表进行实际影响。如果对表的实际更新失败,则恢复到更新之前的状
这个问题在这里已经有了答案: 关闭 11 年前。 Possible Duplicate: Best Java obfuscator ? 对于我的示例,我知道 eclipse 提供了一个反编译插件。而
这是一个演示我的问题的 fiddle :JSFiddle 我正在制作自定义下拉菜单(实际上我使用的是 icomoon 图标而不是 V)...它看起来不错,但是父元素的 ::after 是阻止选择:(
每当我编写需要大量条件的代码时,我都会这样做: if foo: if bar: if foobar: if barfoo: if foobarfoo:
我不确定术语是否正确,您可以使用哪些代码实践来使某人难以修改二进制文件/程序集以绕过检查: 例如在源代码中。 bool verificationResult = verify(); if (verif
我正在寻找一种简单的方法来检查多个零件表,以确定给定零件号在添加到给定表之前是否已经存在。 我目前想到的最好的想法是一个辅助表,它简单地将所有表中的每个 PN 列在一个列中,并带有一个唯一的键;但是我
这个问题在这里已经有了答案: jquery stop child triggering parent event (7 个答案) 关闭 8 年前。 我不确定这是否真的冒泡,我会解释。 我有这个:
我有一个 Spring MVC web 应用程序(不确定该信息是否重要,但它可能是)使用 ModelAndView 将字符串值传递给 JSP 文件。 字符串值的形式是: d@.
我在这里尝试使用表单 key 方法进行 csrf 保护 http://net.tutsplus.com/tutorials/php/secure-your-forms-with-form-keys/
htmlentities 是防止 PHP 中的 XSS 的最佳解决方案吗?我还想允许像 b、i、a 和 img 这样的简单标签。实现这一点的最佳解决方案是什么?我确实考虑过 bbcode,但发现如果没
我有一个非常基本的 JAX-RS 服务(下面的 BookService 类),它允许创建 Book 类型的实体(也在下面)。 POST负载 { "acquisitionDate": 14188
我正在使用 Polymer 1.5,我确实需要“this”变量不要映射到外部。我知道 typescript 会为某些人做这件事 valid reasons . declare var Polymer:
这个问题在这里已经有了答案: Class-level read-only properties in Python (3 个答案) 关闭 6 年前。 有没有一种方法可以通过重写实例变量的 __set
我是一名优秀的程序员,十分优秀!