NetExec icon indicating copy to clipboard operation
NetExec copied to clipboard

refactoring to fix InterfaceError of DB

Open dazzgt opened this issue 1 year ago • 8 comments

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 avatar Aug 18 '24 12:08 dazzgt

Updated. Accidentally delete reflect_tables from mssql database.

dazzgt avatar Aug 18 '24 15:08 dazzgt

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

Marshall-Hallenbeck avatar Aug 18 '24 17:08 Marshall-Hallenbeck

@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

dazzgt avatar Aug 18 '24 19:08 dazzgt

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

NeffIsBack avatar Aug 18 '24 22:08 NeffIsBack

@NeffIsBack fixed two ruff errors.

dazzgt avatar Aug 19 '24 08:08 dazzgt

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

dazzgt avatar Sep 10 '24 11:09 dazzgt

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 :)

NeffIsBack avatar Sep 11 '24 09:09 NeffIsBack

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

AkechiShiro avatar Sep 11 '24 09:09 AkechiShiro

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

NeffIsBack avatar Oct 06 '24 19:10 NeffIsBack