-
Notifications
You must be signed in to change notification settings - Fork 620
Add Kerberos protocol for user enumeration #985
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
base: main
Are you sure you want to change the base?
Conversation
…s and LDAP modules
…k in Kerberos modules
Signed-off-by: n3rada <72791564+n3rada@users.noreply.github.com>
Signed-off-by: n3rada <72791564+n3rada@users.noreply.github.com>
Signed-off-by: n3rada <72791564+n3rada@users.noreply.github.com>
|
Why not simply improve the smb/ldap kerberos auth when no password is provided by sending AS-REQ without any preauthentication data (no password) ? |
|
I understand the suggestion and can definitely implement it that way if needed. You all have the final say on merging, that is your call! For me, this goes against nxc's design principles because you'd end up typing I will move the code and make it work if that's the decision, but I still believe a dedicated kerberos protocol is the cleaner approach. Let me know how you want to proceed. |
|
So in NetExec protocols should be network protocols that has functionality besides authentication. While it is fine to have tools that solely does authentication or information dumping/gathering while using authentication protocols (e.g. DumpNTLMInfo.py from impacket), i don't think it would be the right choice to go that route in NetExec. That would lead to much confusion, because now you have Kerberos authentication in various network protocols, while also having it as an standalone authentication protocol. I would also chose not to implement NTLM as its own protocol just for checking stuff like NTLMv1/host header etc. Also, adding a whole separate protocol for NetExec for manipulating authentication steps that are already done in other protocols would mean a ton of duplicate code which in return means a ton of maintenance work that would otherwise not be necessary. Besides, this decision has been made implicitly in the past already, at the point where similar authentication manipulation was implemented, such as kerberoasting, asreproasting, delegation via S4U etc. This decision has indeed the disadvantage that we will do this authentication manipulation on top of a whole other protocol like SMB or LDAP, but when implemented properly and independently there is not much duplicate code or work that has to be done to utilize it in other protocols (in other words if implemented protocol independent). |
|
Understood. What are your thoughts, @NeffIsBack? Do you think this kind of enumeration should be included in Netexec, or should I put it directly in the Impacket examples? If you think it should be in netexec, where should it go? |
|
I think it is still a cool addition! That could definitely be something that would be a good addition to impacket, getting something merged into impacket is a challenge on its own (no hate to the maintainers, just a fact that is the result of the amount of PRs opened to impacket). To get this into NetExec it should live in its own file, so it is independent of the protocol, but could live in the protocol folder. I would suggest using SMB due to the existing enumeration functions, but ldap would probably work just as well. We could either add a separate flag, or just combine it with the def kerberos_login():
if continue_on_success:
get_tgt()
else:
impacket_kerb_login() |
|
Thanks for the feedback. I have refactored the code to integrate Kerberos user enumeration directly into the SMB protocol as requested, rather than as a separate protocol. However, in my opinion, it remains misleading as it shows 'SMB' and port 445 while actually using pure Kerberos (port 88), but that is our current tradeoff. At least it exists now. The enumeration is slower than desired due to NetExec's architecture - the framework uses a global semaphore ( While threading at the orchestration level (in |
|
Even though it has a low chance of hatching, I have added it directly to the examples folder: fortra/impacket#2079 |




Description
Currently, username enumeration "like
kerbrute" in NetExec requires LDAP access, which needs valid credentials. However, KerberosAS-REQrequests can enumerate valid usernames without any credentials and without incrementingbadPwdCount(resolve issue #195 ), making it interesting for initial reconnaissance, an allow us to get rid ofkerbrutelookalikes.Type of change
Insert an "x" inside the brackets for relevant items (do not delete options)
Setup guide for the review
hercules.htb).Use the
names.withletterstrick to createname.a,name.bvariants:Screenshots (if appropriate):
Single user check:
Threaded user enumeration (
kerbrute):Checklist:
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
poetry run python -m ruff check . --preview, use--fixto automatically fix what it can)tests/e2e_commands.txtfile if necessary (new modules or features are required to be added to the e2e tests)