English 中文(简体)
不管档案名称或地点如何,是否可迅速确定Windows指挥?
原标题:Is there a way to identify the Windows command prompt regardless of file name or location?

我写了一个方案,在用户迅速指挥时立即追踪和杀人(如果可能的话,可以进行管制)。 这样做是为了阻止用户控制我所没有的指挥。

我已撰写成文,在启动程序时,使用QueryFullProcessImageName检查其名称。 问题是,如果有人要重新命名指挥,那么我再也无法通过程序名称发现。 目前,我发现指挥力的方法是“弹.”,但显然并非安全。

下面是我对守则的内容。 我删除了所有对简便的错误检查。 让我知道,你是否需要更加清晰。 感谢!

TCHAR exeName[MAX_PATH];
DWORD exeNameSize = MAX_PATH;

//the pid comes into the function as a parameter
HANDLE handle = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, 0, pid);

if (handle) 
{
    if (QueryFullProcessImageName(handle, 0, exeName, &exeNameSize))
    {
        tstring name = exeName;

        /*
          badProcs would contain the path identifiers such as
          "\cmd.exe" or "\regedit.exe".  This detection is
          what I want to make better.
        */

        for(int i=0; i < badProcs.size(); i++)
        {
            if(tstring::npos != name.find(badProcs.at(i)))
            {
                if(TerminateProcess(handle,0))
                    OutputDebugString(_T("Process should be dead

"));
            }
        }
    }
    CloseHandle(handle);
}

一些补充资料: 我撰写的理由是要控制其他桌面上的内容。 我想使之成为这样的话:当用户发射一个不同的台式台时(通过任何专利程序),我能够控制他们是否能够进入给系统带来最大安全漏洞的项目。 鉴于我只想控制其他台式的行动,我不想改变环境,因为担心目标台外的腐败数据。 腐败不是令人担心的吗?

I m only interested in controlling a proprietary desktop, not mucking with what users do in their own space. Essentially the separate desktop is for corporate work, and I want to be able to limit what people can do with company information, etc.

最佳回答

页: 1 视窗有这方面的内部手段。 阅读政策编辑和(或)档案存取控制。

如果你重新管理,“用户”不是,政策(或简单的ACL)将做这项工作;如果“用户”也是一种行政管理,他们就能够轻松地打败你的方案。

问题回答

阻止指挥和登记编辑的最佳途径是通过窗口登记处。 即使你将迫害者复制到另一地点,这些工作也是如此。

登记处的编辑和指挥部都无法运行,如果登记钥匙是:

HKEY_CURRENT_USERSoftwarePoliciesMicrosoftWindowsSystemDisableRegistryTools

或用于整个机器

HKEY_LOCAL_MACHINESoftwarePoliciesMicrosoftWindowsSystemDisableRegistryTools

将这一规定设定为1级将会造成混乱,确定为0级将使之成为可能。

HKEY_CURRENT_USERSoftwarePoliciesMicrosoftWindowsSystemDisableCMD

(当地机器也在这里工作)。

将这段内容定在1号之后,指挥系统将可迅速取而代之<>和 批量档案,将这种档案编为2号,只能使指挥线脱节,而设定为0。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签