Skip to content

Commit

Permalink
Update Get-Credentials-Hijack.tsql
Browse files Browse the repository at this point in the history
  • Loading branch information
nullbind authored Aug 20, 2024
1 parent f813c06 commit df25b1d
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions templates/tsql/Get-Credentials-Hijack.tsql
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ CREATE CREDENTIAL [MyCredential]
WITH IDENTITY = 'machinename\osusername',
SECRET = 'P@ssw0rd!';

EXEC sp_add_proxy
@proxy_name = N'MyCredentialProxy', -- Name of the proxy
@credential_name = N'MyCredential'; -- Name of the existing credential

EXEC sp_grant_proxy_to_subsystem
@proxy_name = N'MyCredentialProxy',
@subsystem_id = 3; -- 3 represents the Operating System (CmdExec) subsystem

--------------------------
-- Get list of all credentials
--------------------------
Expand Down Expand Up @@ -45,11 +37,11 @@ USE msdb;
GO

EXEC sp_add_proxy
@proxy_name = N'OSCommandProxy', -- Name of the proxy
@proxy_name = N'MyCredentialProxy', -- Name of the proxy
@credential_name = N'MyCredential'; -- Name of the existing credential

EXEC sp_grant_proxy_to_subsystem
@proxy_name = N'OSCommandProxy',
@proxy_name = N'MyCredentialProxy',
@subsystem_id = 3; -- 3 represents the Operating System (CmdExec) subsystem

--------------------------
Expand Down

0 comments on commit df25b1d

Please sign in to comment.