Leser: 2
|< 1 2 >| | 11 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use Win32::AdminMisc;
my $Domain = "";
my $User = "test";
my $Password = "test";
my $Process = "cmd";
print "\nStarting \"$Process\" as $User in the \U$Domain\E domain...\n\n";
$Result = Win32::AdminMisc::LogonAsUser( $Domain,
$User,
$Password,
LOGON32_LOGON_INTERACTIVE );
if( $Result )
{
$LogonUser = Win32::AdminMisc::GetLogonName();
print "Successfully logged on as $LogonUser.\n";
$Result = Win32::AdminMisc::CreateProcessAsUser(
$Process,
"Flags" => CREATE_NEW_CONSOLE,
"XSize" => 640,
"YSize" => 80,
"X" => 200,
"Y" => 80,
"XBuffer"=> 80,
"YBuffer"=> 180,
"Show" => SW_MAXIMIZE,
"Title" => "\u$User\'s $Process program",
"Fill" => BACKGROUND_BLUE |
FOREGROUND_RED |
FOREGROUND_BLUE |
FOREGROUND_GREEN |
FOREGROUND_INTENSITY );
if( $Result )
{
print "Successful! The new processes PID is $Result.\n";
}
else
{
print "Failed.\n\tError: ", Error(), "\n";
}
}
else
{
print "Failed to logon.\n\tError: ", Error(), "\n";
}
sub Error
{
return( Win32::FormatMessage( Win32::AdminMisc::GetError() ) );
}
QuoteThis function requires the calling process to have the following rights assigned:
Privilege Display Name
--------------- -----------------------------------
SeTcbPrivilege.....Act as part of the operating system
SeAssignPrimary....Replace a process level token
SeIncreaseQuota....Increase quotas
|< 1 2 >| | 11 Einträge, 2 Seiten |