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

Small Bug Fix on Listing SMB Shares with Kerberos Auth #357

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

termanix
Copy link
Contributor

This is a bug I came across while working with Kerberos on another project. If the information of the user in the ticket is not in the workspace database, it gives an index error cause of user_id is empty. I thought about adding the ticket information as user_id, but since it wouldn't have any meaning when it expired, I proceeded with pass.

Before:

└─# impacket-getST test.local/userd1:'Password!123' -dc-ip 192.168.37.101 -spn ldap/DC2.test.local
Impacket v0.12.0.dev1+20240327.181547.f8899e65 - Copyright 2023 Fortra

[*] Getting TGT for user
[*] Getting ST for user
[*] Saving ticket in userd1.ccache
                                                                                                                                                                                 
┌──(venv)─(root㉿kali)-[/opt/NetExec]
└─# export KRB5CCNAME=userd1.ccache
                                                                                                                                                                                 
┌──(venv)─(root㉿kali)-[/opt/NetExec]
└─# klist
Ticket cache: FILE:userd1.ccache
Default principal: userd1@TEST.LOCAL

Valid starting       Expires              Service principal
06/25/2024 18:26:51  06/26/2024 04:26:50  ldap/DC2.test.local@TEST.LOCAL
        renew until 06/26/2024 18:26:51

image

Note: If we tried with Kerberos after authenticating with the user with username and password, there is no error because user_id is assigned with same user.

image

After:

image

This is a bug I came across while working with Kerberos on another project.  If the information of the user in the ticket is not in the database, it gives an index error cause of user_id is empty. I thought about adding the ticket information as user_id, but since it wouldn't have any meaning when it expired, I proceeded with pass.


Signed-off-by: termanix <50464194+termanix@users.noreply.github.com>
@NeffIsBack NeffIsBack added the bug-fix This Pull Request fixes a bug label Jun 26, 2024
@NeffIsBack
Copy link
Contributor

Thanks for the PR!

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.

The problem is, that this applies to kerberos in general as the database functionality is not implemented for kerberos. So we should change the check if self.kerberos: for now

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.

Fixed and LGTM:
image

@NeffIsBack NeffIsBack merged commit ccbeb4e into Pennyw0rth:main Jul 2, 2024
5 checks passed
@mpgn mpgn added this to the v1.3.0 milestone Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix This Pull Request fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants