Skip to content

Commit

Permalink
Version 2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
wireghoul committed Oct 30, 2020
1 parent cb51ea3 commit e95face
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
13 changes: 13 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
2.8 2020 Oct 30
Updated Electron rules
Updated PHP rules
More scala rules and a scala signature set
Updated C rules
Updated Java rules
Updated fruit rules
Documentation tweaks
Improved error handling
Updated gitscan script
AMPscript and ssjs example rules
git log scanner example script

2.7 2020 Sep 23
Carriage return tolerance fixed for non GNU sed versions
Updated PHP rules
Expand Down
18 changes: 12 additions & 6 deletions graudit
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Released under the GPL licence
set -e
set -o pipefail
VERSION='2.7'
VERSION='2.8'
basedir=$(dirname "$0")
BINFILE=$(which grep)

Expand All @@ -23,7 +23,7 @@ OLD_COLORS=$GREP_COLORS
OLD_COLOR=$GREP_COLOR

if [ ! -x "$BINFILE" ]; then
echo "grep not found!"
echo "Can't find grep, which is a requirement to run graudit"
exit 2
fi
$BINFILE --exclude-dir=. test "$0" >/dev/null 2>&1
Expand All @@ -43,7 +43,7 @@ banner() {
\___ /|__| (____ /____/\____ | |__||__|
/_____/ \/ \/
grep rough audit - static analysis tool
v2.7 written by @Wireghoul
v2.8 written by @Wireghoul
=================================[justanotherhacker.com]==='
fi
}
Expand All @@ -59,7 +59,7 @@ Usage: graudit [opts] /path/to/scan
OPTIONS
-d <dbname> database to use or /path/to/file.db (uses default if not specified)
-A scan ALL files
-A scan unwanted and difficult (ALL) files
-x exclude these files (comma separated list: -x *.js,*.sql)
-i case in-sensitive scan
-c <num> number of lines of context to display, default is 2
Expand Down Expand Up @@ -152,7 +152,7 @@ while getopts "AbBhvilLzZd:c:x:" opt; do
excludefiles=""
;;
\?)
echo "Invalid option: -$OPTARG" >&2
#echo "Invalid option: -$OPTARG" >&2
usage
exit 2
;;
Expand All @@ -163,7 +163,7 @@ shift $((OPTIND-1))

#Database location can vary based on installation
if [ "$sigdb" == '-' ]; then
database='-'
database='/dev/stdin'
elif [ -f "$GRDIR/$sigdb.db" ]; then
database="$GRDIR/$sigdb.db"
elif [ -f "/usr/share/graudit/$sigdb.db" ]; then
Expand All @@ -184,6 +184,12 @@ if [ -z "$1" ]; then
exit 2
fi

if [ ! -e $database ]; then
echo "database path not found: $database, try running graudit with -l" >&2
usage
exit 2
fi

# -R is recursive
# -H prints the name of the file
# -C prints # lines of context before and after the match
Expand Down

0 comments on commit e95face

Please sign in to comment.