trustedsec / ptf

The Penetration Testers Framework (PTF) is a way for modular support for up-to-date tools.
5.14k stars 1.24k forks source link

updatedb takes a long time, potentially runs too often. #574

Closed dnx-seek closed 3 years ago

dnx-seek commented 3 years ago

If I install a module ptf runs updatedb at the end. Which is fair enough. I'm not sure the exact reason for adding this, but I assume it's useful to have various paths searchable immediately.

So far in my experience updatedb is the slowest part of any install.

If a module has dependencies updatedb runs between each installed dependency.

If I run an update, and there is no update, it still runs updatedb.

If I run a multi install, it runs updatedb between each installed tool.

I feel like this could be changed to run less - eg if no update, then don't run updatedb. If a multi-step install, run only at the end. I wonder also if any paths could be prunned (--prunepaths=) or if it would be useful to scope to specific paths --localpaths=

BustedSec commented 3 years ago

This is a really clever find, I'm gonna play around with trying to get that to work. I'm sure Dave could figure it out way faster though.

jeffmcjunkin commented 3 years ago

Silly idea, but how about just running update & so it doesn't hang up interactive runs and batch runs?

CPU cycles are cheap, but human attention isn't.

ghost commented 3 years ago

I've never experienced slowness when updatedb runs.