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

keepass_trigger error during password extraction #278

Open
sepauli opened this issue Apr 27, 2024 · 1 comment
Open

keepass_trigger error during password extraction #278

sepauli opened this issue Apr 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@sepauli
Copy link
Contributor

sepauli commented Apr 27, 2024

Describe the bug
The extract_password function in the keepass_trigger module does not parse the xml file (exported keepass database) correctly, which leads to an error.
keepass_trigger_error

I encountered this bug when I was working on the HTB Academy Module "Using CrackMapExec" in the task "Popular Modules" -
Discovering KeePass

To Reproduce
You can test it by adding some groups, subgroups and entries in keepass and executing the function on the exported keepass database
Database -> Export -> XML-File

Expected behavior
I think the problem here lies in the extract_password function, which looks for entries under [“KeePassFile”][“Root”][“Group”][“Entry”] and [“KeePassFile”][“Root”][“Group”][“Group”].
A keepass database can have any number of subgroups “Groups” with entries, which is apparently not considered here
Old passwords can also exist in a history or in the notes of entries.

NetExec info

  • OS: Kali
  • Version of nxc: nxc from main branch
  • Installed from: github

Additional context
I'm not very good at programming at the moment, which is why I haven't opened a pull request yet.
I have put the code in a branch. If you want and it suits you, I can open another pull request for this
main...sepauli:NetExec:sepauli/fix-keepass_trigger

keepass_trigger_fixed

@Marshall-Hallenbeck
Copy link
Collaborator

I'm not very good at programming at the moment, which is why I haven't opened a pull request yet.

We're not either, so don't feel bad ;)

Please do open the PR, and we can review it/change stuff ourselves. Thanks for filing this!

@Marshall-Hallenbeck Marshall-Hallenbeck added bug-fix This Pull Request fixes a bug bug Something isn't working and removed bug-fix This Pull Request fixes a bug labels Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants