PDA

View Full Version : از قفل در آوردن سیستم



Mask
چهارشنبه 28 بهمن 1388, 15:27 عصر
با سلام با دستور زیر سیستم میره در حالت قفل

rundll32.exe user32.dll,LockWorkStation
البته مبره در حالت Swich.
حالا با چه دستوری با استفاده از برنامه از این حالت درش بیارم.
ممنون.

mrbm_2007
چهارشنبه 28 بهمن 1388, 15:56 عصر
اگه account پسورد داشته باشه چی؟

Mask
چهارشنبه 28 بهمن 1388, 19:23 عصر
اگه account پسورد داشته باشه چی؟

با فرض اینکه سیستم فقط یک یوزرداشته باشه و پسووردی هم در کار نباشه.

mrbm_2007
چهارشنبه 28 بهمن 1388, 22:24 عصر
شاید این کمک کنه:



LogonUser




The LogonUser function attempts to log a user on to the local computer. The local computer is the computer from which LogonUser was called. You cannot use LogonUser to log on to a remote computer. You specify the user with a user name and domain and authenticate the user with a plaintext password. If the function succeeds, you receive a handle to a token that represents the logged-on user. You can then use this token handle to impersonate the specified user or, in most cases, to create a process that runs in the context of the specified user.
BOOL LogonUser(
LPTSTR lpszUsername,
LPTSTR lpszDomain,
LPTSTR lpszPassword,
DWORD dwLogonType,
DWORD dwLogonProvider,
PHANDLE phToken
);

Parameters


lpszUsername A pointer to a null-terminated string that specifies the name of the user. This is the name of the user account to log on to. If you use the [I]user principal name (UPN) format, user@DNS_domain_name, the lpszDomain parameter must be NULL. lpszDomain [in] A pointer to a null-terminated string that specifies the name of the domain or server whose account database contains the lpszUsername account. If this parameter is NULL, the user name must be specified in UPN format. If this parameter is ".", the function validates the account by using only the local account database. lpszPassword [in] A pointer to a null-terminated string that specifies the plaintext password for the user account specified by lpszUsername. When you have finished using the password, clear the password from memory by calling the SecureZeroMemory function. For more information about protecting passwords, see Handling Passwords. dwLogonType The type of logon operation to perform. This parameter can be one of the following values. Value Meaning LOGON32_LOGON_BATCH This logon type is intended for batch servers, where processes may be executing on behalf of a user without their direct intervention. This type is also for higher performance servers that process many plaintext authentication attempts at a time, such as mail or Web servers. The LogonUser function does not cache credentials for this logon type. LOGON32_LOGON_INTERACTIVE This logon type is intended for users who will be interactively using the computer, such as a user being logged on by a [I]terminal server, remote shell, or similar process. This logon type has the additional expense of caching logon information for disconnected operations; therefore, it is inappropriate for some client/server applications, such as a mail server. LOGON32_LOGON_NETWORK This logon type is intended for high performance servers to authenticate plaintext passwords. The LogonUser function does not cache credentials for this logon type. LOGON32_LOGON_NETWORK_CLEARTEXT This logon type preserves the name and password in the authentication package, which allows the server to make connections to other network servers while impersonating the client. A server can accept plaintext credentials from a client, call LogonUser, verify that the user can access the system across the network, and still communicate with other servers.
Windows NT: This value is not supported. LOGON32_LOGON_NEW_CREDENTIALS This logon type allows the caller to clone its current token and specify new credentials for outbound connections. The new logon session has the same local identifier but uses different credentials for other network connections. This logon type is supported only by the LOGON32_PROVIDER_WINNT50 logon provider.

Windows NT: This value is not supported. LOGON32_LOGON_SERVICE Indicates a service-type logon. The account provided must have the service privilege enabled. LOGON32_LOGON_UNLOCK This logon type is for GINA DLLs that log on users who will be interactively using the computer. This logon type can generate a unique audit record that shows when the workstation was unlocked. dwLogonProvider Specifies the logon provider. This parameter can be one of the following values. Value Meaning LOGON32_PROVIDER_DEFAULT Use the standard logon provider for the system. The default [I]security provider is negotiate, unless you pass NULL for the domain name and the user name is not in UPN format. In this case, the default provider is NTLM.
Windows 2000/NT: The default security provider is NTLM. LOGON32_PROVIDER_WINNT50 Use the negotiate logon provider.
Windows NT: This value is not supported. LOGON32_PROVIDER_WINNT40 Use the NTLM logon provider. LOGON32_PROVIDER_WINNT35 Use the Windows NT 3.5 logon provider. phToken [out] A pointer to a handle variable that receives a handle to a token that represents the specified user. You can use the returned handle in calls to the ImpersonateLoggedOnUser function.
In most cases, the returned handle is a primary token that you can use in calls to the CreateProcessAsUser function. However, if you specify the LOGON32_LOGON_NETWORK flag, LogonUser returns an impersonation token that you cannot use in CreateProcessAsUser unless you call DuplicateTokenEx to convert it to a primary token.
When you no longer need this handle, close it by calling the CloseHandle function.

Return Value



If the function succeeds, the function returns nonzero.

If the function fails, it returns zero. To get extended error information, call GetLastError.