Skip to content

[tgssub.py] New example script: adding tgssub for SPN-jacking and manual sname manipulation#1256

Open
ShutdownRepo wants to merge 5 commits into
fortra:masterfrom
ShutdownRepo:tgssub
Open

[tgssub.py] New example script: adding tgssub for SPN-jacking and manual sname manipulation#1256
ShutdownRepo wants to merge 5 commits into
fortra:masterfrom
ShutdownRepo:tgssub

Conversation

@ShutdownRepo

Copy link
Copy Markdown
Contributor

Example script to allow for SPN-jacking and manual manipulation of tickets to edit the sname (i.e. SPN) the ticket is issued for.
Python equivalent to Rubeus tgssub command (https://github.com/GhostPack/Rubeus#tgssub)

This can be done because the service name is not in the encrypted part of the ticket (cf. Wagging the Dog).

This is already done in Impacket internals with the AnySPN technique but now, attackers can use this standalone script, along with describeTicket.py from #1201 to manipulate (Rubeus tgssub) and inspect tickets (Rubeus describe) manually.

References

Screenshot from 2022-02-12 17-13-20

@ShutdownRepo

Copy link
Copy Markdown
Contributor Author

#1202 now handles -altservice, allowing for mirroring of Rubeus's ability to do so. Service substitution can then be conducted either separately with this standalone tool, or with getST's new feature brought in bdf6c0e

@ShutdownRepo

Copy link
Copy Markdown
Contributor Author

and you will get error here image

because ticket reutrned by s4u2self have no service class, so there is no '/'

Can you use GitHub's review feature, or indicate lines where you think there are errors?

@ShutdownRepo

Copy link
Copy Markdown
Contributor Author

there is some problem when I integrate this PR to getST the ticket it generated can not be used when the source ticket is returned by s4u2self

Can you give more details (debug print, screenshot) of what you're trying to do?

@ShutdownRepo

Copy link
Copy Markdown
Contributor Author

and you will get error here image
because ticket reutrned by s4u2self have no service class, so there is no '/'

Can you use GitHub's review feature, or indicate lines where you think there are errors?

If you're referring to https://github.com/SecureAuthCorp/impacket/pull/1256/files#diff-6282295c24020ba24be7e2a8a1133327088ab06cd43bded706a193ec283ea1e7R49, as you can see this line is in an "if/else" statement checking the presence of "/" in the original ticket's sname. Have you even tried before pointing this out?

@ShutdownRepo
ShutdownRepo marked this pull request as ready for review February 19, 2022 16:53
…t/cccache credentials

Co-authored-by: wqreytuk <wochinijiamile@qq.com>
@ShutdownRepo

Copy link
Copy Markdown
Contributor Author

Worked with @wqreytuk, this feature needs further testing, but it now works on our end. The substitution wasn't complete. The information in the ticket wasn't replaced. Only the information in the credential object was. This is now fixed.

@anadrianmanrique anadrianmanrique added the in review This issue or pull request is being analyzed label Feb 16, 2023
@0xdeaddood 0xdeaddood added the low Low priority item label Feb 23, 2023
@ShutdownRepo ShutdownRepo changed the title New example script: adding tgssub for SPN-jacking and manual sname manipulation [tgssub.py] New example script: adding tgssub for SPN-jacking and manual sname manipulation Aug 23, 2023
GeisericII added a commit to ThePorgs/impacket that referenced this pull request Jun 3, 2024
@anadrianmanrique anadrianmanrique self-assigned this Sep 19, 2024
@anadrianmanrique anadrianmanrique removed the low Low priority item label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Examples in review This issue or pull request is being analyzed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants