-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts to generate a dictionary and seed corpus for the config f…
…uzzing
- Loading branch information
1 parent
df86635
commit 3807675
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# If this is not commented out, we get 'sed' commands in our output below | ||
#set -e | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
function usage() { | ||
echo "${BASH_SOURCE[0]} destination-file" | ||
} | ||
|
||
function main() { | ||
if [[ $# < 1 ]]; then | ||
usage | ||
exit 1 | ||
fi | ||
|
||
# dict format is keyword="value" or just "value" - so we need to make sure our output is quoted. | ||
|
||
egrep -h -R -o "HasMember\\(\"([^\"]+)\"\\)" * | sed 's/HasMember(//' | sed 's/)//' > tmp | ||
egrep -h -o -e "\"([^\"]+)\"" $SCRIPT_DIR/../../../tools/tests/*.conf >> tmp | ||
|
||
sort tmp | uniq > $1 | ||
rm tmp | ||
} | ||
|
||
main $@ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
function usage() { | ||
echo "${BASH_SOURCE[0]} destination-file" | ||
} | ||
|
||
function main() { | ||
if [[ $# < 1 ]]; then | ||
usage | ||
exit 1 | ||
fi | ||
|
||
zip -j $1 $SCRIPT_DIR/../../../tools/tests/*.conf | ||
} | ||
|
||
main $@ |