Add recursive file discovery, performance improvements, and usability fixes#3
Open
ssstonebraker wants to merge 1 commit intoshifty0g:masterfrom
Open
Add recursive file discovery, performance improvements, and usability fixes#3ssstonebraker wants to merge 1 commit intoshifty0g:masterfrom
ssstonebraker wants to merge 1 commit intoshifty0g:masterfrom
Conversation
61af65e to
ac5e13f
Compare
… fixes Added --r / --recursive flag that uses find to discover .gnmap files in subdirectories so you don't have to pass them all manually. Works with all existing features (csv, summary, web, ssl, etc). Performance: - Replaced makecsv, summary, web, webdirty, ssl, and hostports shell loops with single-pass POSIX awk. Huge speedup when working with hundreds or thousands of scan files. - Recursive file loading uses batched xargs cat instead of per-file cat/sort loop. Usability: - Single-dash switches now work (-all, -csv, etc) by normalizing to double-dash internally. - Added smb-ips.txt output with plain IPs for SMB hosts. - Output directory path printed at the end so you know where files landed. - Guard on summay-log so it doesn't error when no .log files exist. Fixes: - Exclude temp.gnmap from recursive find (was catting into itself). - mkdir before realpath so it works on macOS. - Split gnmap port entries on /, instead of comma to preserve commas in version strings (e.g. LDAP domain info). - Fixed double slash in summay-log file paths. - Fixed stray dollar sign in summay-log redirect.
ac5e13f to
d2ad9c4
Compare
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.
What this does
Adds a --recursive (or --r) flag that uses
findto discover .gnmap files in subdirectories so you don't have to pass them all manually on the command line. Works with all existing features (csv, summary, web, ssl, hostports, etc).Performance
Replaced the shell
while readloops in makecsv, summary, web, webdirty, ssl, and hostports with single-pass POSIX awk. This is a huge speedup when working with hundreds or thousands of scan files. The old code was spawning 5-7 subprocesses per line per file. Now it's one awk process per function.Recursive file loading uses batched
xargs catinstead of a per-file cat/sort loop.Usability
-all,-csv, etc) by normalizing to double-dash internallysmb-ips.txtoutput with plain IPs for SMB hostsBug fixes
/,instead of comma to preserve commas in version strings (e.g. LDAP domain info was getting truncated)Compatibility
findsyntax is portable across BSD and GNU find