Insecure permissions on service executable
Suppose we have found a service with executable that has insecure permissions (eg. C:\insecure\permissions\bin.exe
). The account is srv_user
.
The following command (icacls
) allows us to view the permissions of the executable:
The following line: Everyone:(I)(M)
shows that the Everyone
group has modify (M)
permissons on the service executable. This allows us to overwrite the executable with our own payload and have it run as the privileges of the configured service user account.
The following steps can be taken to replace the original .exe
file with our own:
Use the
move
command to move bin.exe to a backup location (.exe.bkp
). The new location can have any name or extensionCreate a executable payload with
msfvenom
, and move the created payload to the file name of the original file (bin.exe
)Provide full permission
(F)
to the Everyone group. This allows any user to execute this file.
When the service is started, the executable created by us will be executed.
Last updated