-
Notifications
You must be signed in to change notification settings - Fork 634
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
krb5 Kerberos #1706
Merged
Merged
krb5 Kerberos #1706
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
patch_release
creates a patch release
and removed
patch_release
creates a patch release
labels
Oct 2, 2024
github-actions
bot
added
patch_release
creates a patch release
and removed
patch_release
creates a patch release
labels
Oct 3, 2024
github-actions
bot
added
patch_release
creates a patch release
and removed
patch_release
creates a patch release
labels
Oct 3, 2024
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. OpenSSF Scorecard
Scanned Files |
github-actions
bot
added
minor_release
creates a minor release
and removed
patch_release
creates a patch release
labels
Oct 24, 2024
github-actions
bot
added
minor_release
creates a minor release
and removed
minor_release
creates a minor release
labels
Nov 4, 2024
github-actions
bot
added
minor_release
creates a minor release
and removed
minor_release
creates a minor release
labels
Nov 11, 2024
github-actions
bot
added
minor_release
creates a minor release
and removed
minor_release
creates a minor release
labels
Dec 3, 2024
To not have to deal with cmake the implementation of krb5 moved from kerberos to misc. Additionally the bindings to add it into openvas are created.
This allows to authenticate against a kdc as well as creating data to send to and from the target.
Adds new nasl functions: - krb5_gss_session_key: to extract the session key - krb5_error_code_to_string: to translate the stored error code into a string. Usage: ``` sk = krb5_gss_session_key(); display("Error code: " + krb5_error_code_to_string()); ```
As long as krb5_gss_update_context_needs_more send the krb5 data to the target and update the context with the result of that.
When creating the credentials nasl_krb5 checks if the provided realm is configured within the provided krb5.conf. If not it adds the provided kdc to the realm within krb5.conf. Additionally this commit fixes the error handling by first setting msg_ctx to 0.
Since we made the decision to rather use GSS instead of KRB5 directly and accepting that we lose controll in favor of convencience.
Reduce cognitive load by using a macro for testing maj stat within `orkb5_gss_authenticate`, Free user_principal as it is not needed after the authentication is done.
In krb5_gss_update_context the data len was retrived by using strlen, this is incorrect as the data is not a str, although the name indicates it, but is actually a pointer to raw data and therefore `get_var_size_by_num` must be used instead. The freeing method `okrb5_gss_free_context` did not release gss specific data this is changed.
When scan_attack is done every cached gss context should be released/cleared.
To be able to reverse lookup the IP address of either the target or given IP address a new function `ip_reverse_lookup` is introduced. This function does not rely on found vhosts to be easier to use within a krb5 context. It does not fork and just calls `getnameinfo`. The function can used with an IP address: ``` ip_reverse_lookup('1.1.1.1'); ``` and without: ``` ip_reverse_lookup(); ``` When no ip address is given than the target ip address will be used.
To enable kbr5 the kdc must be set. ``` login = string( get_kb_item( "KRB5/login_filled/0" ) ); password = string( get_kb_item( "KRB5/password_filled/0" ) ); realm = string( get_kb_item( "KRB5/realm_filled/0" ) ); kdc = string( get_kb_item( "KRB5/kdc_filled/0" ) ); host = ip_reverse_lookup(); cmd = 'powershell -Command "& {Get-Process}"'; result = win_cmd_exec(cmd:cmd, password:password, username:login, realm: realm, kdc: kdc, host:host); display(result); ```
github-actions
bot
added
minor_release
creates a minor release
and removed
minor_release
creates a minor release
labels
Dec 17, 2024
github-actions
bot
added
minor_release
creates a minor release
and removed
minor_release
creates a minor release
labels
Dec 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds krb5 functionality to NASL by utilizing GSSAPI of MIT KRB5.
Missing:
[x] Automated REALM handling
[x] Human readable error messages
[x] OSP adaptation greenbone/ospd-openvas#1011
[ ] OpenVASD integration