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 5081d43 commit f813c06
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions templates/tsql/Get-Credentials-Hijack.tsql
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@


--------------------------
-- Create a new credential named 'MyCredential'
-- Create a new credential named 'MyCredential' - for testing
--------------------------
CREATE CREDENTIAL [MyCredential]
WITH IDENTITY = 'machinename\owusername',
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

0 comments on commit f813c06

Please sign in to comment.