Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement s4u abuse #50

Merged
merged 15 commits into from
Nov 3, 2023
Merged

Implement s4u abuse #50

merged 15 commits into from
Nov 3, 2023

Conversation

zblurx
Copy link
Collaborator

@zblurx zblurx commented Sep 29, 2023

Added --delegate option to implement s4u abuse over smb
image
This option will do a full S4U abuse (S4U2Self + S4U2Proxy) in an automated way, allowing to use all postex functionalities of NXC 🔥

@zblurx zblurx added the enhancement New feature or request label Sep 29, 2023
@bongobongoland
Copy link
Contributor

omg.

@Marshall-Hallenbeck Marshall-Hallenbeck changed the base branch from main to develop October 2, 2023 21:55
@Marshall-Hallenbeck
Copy link
Collaborator

@zblurx can you add this to the e2e tests command file as well?

@XiaoliChan
Copy link
Contributor

XiaoliChan commented Oct 9, 2023

I test it, it works (with protocol transition)
image

BTW, I think should tell the user this attack is for constrained delegation (with protocol transition) attack @zblurx

@zblurx
Copy link
Collaborator Author

zblurx commented Oct 12, 2023

As @XiaoliChan suggested to me, we should also support s4u2self only:
image

@XiaoliChan
Copy link
Contributor

Really awesome!
image

image

Copy link
Contributor

@NeffIsBack NeffIsBack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also replace the single quotes with double quotes?

Left some comments, the rest of the code looks good👍🏼

nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
nxc/protocols/smb/proto_args.py Outdated Show resolved Hide resolved
nxc/protocols/smb.py Outdated Show resolved Hide resolved
nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Marshall-Hallenbeck Marshall-Hallenbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly a bunch of variable naming to conform to proper Pythonic naming, but also pointed out importing the nxc logger.

nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
nxc/protocols/smb/kerberos.py Outdated Show resolved Hide resolved
@zblurx
Copy link
Collaborator Author

zblurx commented Oct 21, 2023

All good now I think

@NeffIsBack
Copy link
Contributor

There are still a few single quotes but we should probably wait until #35 is merged, a lot of it is fixed in there

@NeffIsBack NeffIsBack added this to the v1.1.0 milestone Oct 21, 2023
@Marshall-Hallenbeck
Copy link
Collaborator

@zblurx #35 got merged in, if you can take care of the few conflicts here it should be good to merge.

@NeffIsBack
Copy link
Contributor

NeffIsBack commented Oct 31, 2023

There must be an hasattribute check on the delegation arg. Otherwise we get that error on other protocols:
image

EDIT: Fixed

@NeffIsBack
Copy link
Contributor

image
Working like a charm, except --ntds. @zblurx is this fixable?
image

@zblurx
Copy link
Collaborator Author

zblurx commented Nov 1, 2023

So for the --ntds, the problem is with impacket secretsdump. Actually secretsdump needs a cifs ticket AND an ldap ticket, but the --delegate will only get a cifs ticket. So my workaround is :

  • 1: You use --delegate to do a --lsa and get the nthash of the DC computer account
  • 2: You use the DC computer account to do a dcsync with --ntds

zblurx and others added 2 commits November 1, 2023 19:18
Signed-off-by: zblurx <68540460+zblurx@users.noreply.github.com>
@NeffIsBack
Copy link
Contributor

Working flawlessly
image

Copy link
Contributor

@NeffIsBack NeffIsBack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@NeffIsBack NeffIsBack added tested reviewed code Label for when a static code review was done and removed requires testing labels Nov 1, 2023
Copy link
Collaborator

@Marshall-Hallenbeck Marshall-Hallenbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zblurx zblurx merged commit 5e247be into develop Nov 3, 2023
2 checks passed
@zblurx zblurx deleted the s4u branch November 3, 2023 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request reviewed code Label for when a static code review was done tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants