Use PowerRunAsAttached to Escalate Privileges on Windows – LLODO


You are using a computer running Windows operating system but have a lot of Users but you want to access CMD and Powershell of other Users but you don’t want to get out of your current User? You don’t want to close your applications but you need access to another User to work? Don’t worry, today I will show you how to access other User’s Console using a script called PowerRunAsAttached

PowerRunAsAttached – Script to support you in information technology

Personally, on my computer there are many different Users to serve different jobs. For example, I will normally have 3 Users including: 1 User for gaming, 1 User for coding and 1 User for others to use and they all have different purposes for more focus at work. But sometimes I also have things I will need to use the rest of the User but I don’t want to get out of the current User?

PowerShell on windows

Quite lucky for me when I found a script on the github community. Your PowerRunAsAttached script has a Username of DarkCoderSc and this script is generated for the purpose of calling Console (CMD or Powershell) of other users.

Join me and set up now to be able to access the Console of other Users through PowerRunAsAttached!

Instructions for using PowerRunAsAttached to escalate privileges on Windows

Part 1: Setup Script

To do this part, your device requires:

  • Windows license has been activated
  • Fully updated
  • Have at least 2 Users or more

After you have completed the above requirements, let’s go into how to Setup this script!

Step 1: You can download the script from github here. Then proceed to extract the file

Step 2: In the PowerRunAsAttached-main folder, that folder will have a file named PowerRunAsAttached. Do you remember the path to that file?

File PowerRunAsAttached

Step 3: Start Powershell as Administrator

Step 4: In Powershell, you write the following commands:

# mẫu tham khảo
$p = [Environment]::GetEnvironmentVariable("PSModulePath")
$p += ";[đường dẫn tới file PowerRunAsAttached trong bước 2]"
[Environment]::SetEnvironmentVariable("PSModulePath",$p)
# Ví dụ
$p = [Environment]::GetEnvironmentVariable("PSModulePath")
$p += ";C:UsershoangDesktopPowerRunAsAttached-mainPowerRunAsAttached-main"
[Environment]::SetEnvironmentVariable("PSModulePath",$p)

Step 5: You add the following statement to import the script as a module

Import-Module PowerRunAsAttached

Note: If it shows an error as shown below, then run the following command:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted

Security policy

At this point, you have completed the setup part. Now I will show you how to use the script!

Part 2: Instructions for using scripts

What you just need to enter on your Powershell is the command below:

Invoke-RunAsAttached -Username "[Tên username của user đó]" -Password "[password của user đó (để trống nếu không có)]"

Eg:

Invoke-RunAsAttached -Username "wdchocopie" -Password "anonyviet123@"

Run the script

You can use the whoami command to check which user you are in! Good luck



Link Hoc va de thi 2021

Chuyển đến thanh công cụ