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

Sped up interesting files check #45

Merged
merged 1 commit into from
Jan 7, 2020

Conversation

Jrhenderson11
Copy link
Contributor

Really love this tool, but I noticed it's quite slow when scanning for SUID / SGID files. It looks like it's repeatedly running a "find /" and scanning the entire filesystem when it checks for SUID files and then also SUID owned by root or SUID world writeable, so I made some changes so it should scan the filesystem once for all SUID / SGID files, then use that variable later when checking for files owned by root for example.

To test I removed all sections except the interesting files and ran with and without my modifications, the timings for the unmodified script were

real 5m49.574s
user 0m21.573s
sys 2m5.306s

And with my modifications:

custom
real 2m16.087s
user 0m7.370s
sys 0m50.301s

I also ran a diff over the outputs to ensure they were identical and wasn't taking shortcuts it shouldn't.

Hope this is a helpful modification!

@rebootuser
Copy link
Owner

Great to see this kind of improvement! Running a few tests and will look to merge soon.

@rebootuser rebootuser merged commit 13741ce into rebootuser:master Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants