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

refactoring to fix InterfaceError of DB #400

Merged
merged 6 commits into from
Oct 10, 2024

Conversation

dazzgt
Copy link
Contributor

@dazzgt dazzgt commented Aug 18, 2024

Issue topic #395
Summary
When netexec find a lot of suitable target hosts it start too many calls to DB at once and because of nature of SQLite it leads to InterfaceError. The same can happen with much fewer hosts but get that timing is much harder.
This PR don't fix IndexError mentioned in issue topic because it require dirty hack in current realization.

@AkechiShiro you can try to test it.

@dazzgt
Copy link
Contributor Author

dazzgt commented Aug 18, 2024

Updated. Accidentally delete reflect_tables from mssql database.

@Marshall-Hallenbeck
Copy link
Collaborator

@dazzgt nice, thanks for this PR. Have you run the e2e tests against any hosts?

@dazzgt
Copy link
Contributor Author

dazzgt commented Aug 18, 2024

@dazzgt nice, thanks for this PR. Have you run the e2e tests against any hosts?

I ran it against the same subnet where i found this bug. Also there some rdp, winrm, smb test hosts, so i tried to run this protocols too. All works perfectly fine

@NeffIsBack
Copy link
Contributor

NeffIsBack commented Aug 18, 2024

Thanks for the PR!
Please also run Ruff against the code (install poetry -> poetry run python -m ruff check . --preview)

@dazzgt dazzgt force-pushed the bugfix/db-interface-error branch from e98d048 to be27b22 Compare August 19, 2024 08:08
@dazzgt
Copy link
Contributor Author

dazzgt commented Aug 19, 2024

@NeffIsBack fixed two ruff errors.

@NeffIsBack NeffIsBack added enhancement New feature or request bug-fix This Pull Request fixes a bug labels Aug 23, 2024
@NeffIsBack NeffIsBack linked an issue Aug 24, 2024 that may be closed by this pull request
@dazzgt dazzgt force-pushed the bugfix/db-interface-error branch 3 times, most recently from dd11405 to 355becd Compare September 2, 2024 12:22
@dazzgt dazzgt force-pushed the bugfix/db-interface-error branch from 355becd to 96df458 Compare September 10, 2024 11:20
@dazzgt
Copy link
Contributor Author

dazzgt commented Sep 10, 2024

If this solution is not good, then i open to suggestion how to fix it more elegant)

@NeffIsBack
Copy link
Contributor

If this solution is not good, then i open to suggestion how to fix it more elegant)

Hi, I am currently on vacation so I am not reviewing PRs at the moment. There are also a lot of PRs still waiting for a review, but I will take a deeper look at this one when am back at home.
At first glance it looks good though :)

@AkechiShiro
Copy link

I'm sorry I haven't been able to test this PR on my side, I'm lacking time to do so but I believe it's a good improvement

@dazzgt dazzgt force-pushed the bugfix/db-interface-error branch from 96df458 to 3b1eac7 Compare September 23, 2024 12:21
@NeffIsBack NeffIsBack added this to the v1.3.0 milestone Oct 6, 2024
@NeffIsBack
Copy link
Contributor

I will test the performance of this next week, if there isn't a drastic change we should be good to go

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.

LGTM

@NeffIsBack NeffIsBack merged commit b59d823 into Pennyw0rth:main Oct 10, 2024
5 checks passed
@dazzgt dazzgt deleted the bugfix/db-interface-error branch October 10, 2024 22:06
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 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSH module DB exceptions
4 participants