Collect init.d scripts when root is available - #127
Open
besendorf wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AndroidQF does not currently collect init.d scripts, which can provide evidence of commands configured to run at startup on rooted devices.
This adds an
init_scriptsmodule that checks the existingHasRoot()helper before accessing/system/etc/init.d. When root is available, it collects regular files recursively, including hidden files, intoinit_scripts/with relative paths preserved. It uses the same staged root extraction as the other root-only modules, so failed reads do not leave incomplete archive entries. Scripts are never executed and symlinks within the directory are not followed.Devices without working root or an init.d directory are skipped. Enumeration and file-read failures are reported as partial collection, while other files can still be collected. The README documents the behavior and
-module init_scriptsusage.Regression tests cover unavailable or denied root, missing directories, recursive collection, unsafe paths, enumeration failures, and failed pulls followed by successful collection.
Validation:
go test -tags unbundle ./...andgo vet -tags unbundle ./...pass. Not tested on a physical Android device.Closes #121.