Skip to content

Commit a0ec268

Browse files
authored
Merge pull request #79 from EMSeek/master
Next version
2 parents b807720 + 1a858c4 commit a0ec268

36 files changed

+352
-15
lines changed

Changelog

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
3.9 2025 May 22
2+
Added giterate misc script
3+
Added snumerate misc script
4+
Added svnlog misc script
5+
Added svnscan misc script
6+
Added jwt rules
7+
Added some Docker rules
8+
Updated supression rules
9+
Updated dotnet rules
10+
Updated golang rules
11+
Updated java rules
12+
Updated js rules
13+
Updated php rules
14+
Updated python rules
15+
Updated ruby rules
16+
Updated scala rules
17+
Updated sql rules
18+
Updated secrets rules
19+
Added and updated unit tests
20+
121
3.8 2025 Apr 20
222
Updated default rules
323
Updated js rules

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ prefix = /usr
66
dataroot = $(prefix)/share
77
datadir = $(dataroot)/graudit
88
bindir = $(prefix)/bin
9-
SIGNATURES := signatures/actionscript.db signatures/android.db signatures/asp.db signatures/c.db signatures/cobol.db signatures/default.db signatures/dotnet.db signatures/exec.db signatures/fruit.db signatures/go.db signatures/ios.db signatures/java.db signatures/js.db signatures/kotlin.db signatures/nim.db signatures/perl.db signatures/php.db signatures/python.db signatures/ruby.db signatures/scala.db signatures/secrets.db signatures/spsqli.db signatures/sql.db signatures/strings.db signatures/typescript.db signatures/xss.db
9+
SIGNATURES := signatures/actionscript.db signatures/android.db signatures/asp.db signatures/c.db signatures/cobol.db signatures/default.db signatures/docker.db signatures/dotnet.db signatures/exec.db signatures/fruit.db signatures/go.db signatures/ios.db signatures/java.db signatures/js.db signatures/kotlin.db signatures/nim.db signatures/perl.db signatures/php.db signatures/python.db signatures/ruby.db signatures/scala.db signatures/secrets.db signatures/spsqli.db signatures/sql.db signatures/strings.db signatures/typescript.db signatures/xss.db signatures/jwt.db
1010
DISTFILES := Changelog graudit LICENSE README.md
1111
MANFILES := graudit.1
1212
VERSION=`./graudit -v | cut -d' ' -f 3`
@@ -78,6 +78,7 @@ signatures:
7878
cat signatures/*/fruit.db > signatures/fruit.db
7979
cat signatures/*/sql.db > signatures/sql.db
8080
cat signatures/*/xss.db > signatures/xss.db
81+
cat signatures/*/jwt.db > signatures/jwt.db
8182

8283
manpages:
8384
nroff -Tascii -mandoc <graudit.in.1 >/dev/null

graudit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
set -- $GRARGS $@
66
set -e
77
set -o pipefail
8-
VERSION='3.8'
8+
VERSION='3.9'
99
basedir=$(dirname "$0")
1010
BINFILE=$(which grep)
1111

@@ -44,7 +44,7 @@ banner() {
4444
\___ /|__| (____ /____/\____ | |__||__|
4545
/_____/ \/ \/
4646
grep rough audit - static analysis tool
47-
v3.8 written by @Wireghoul
47+
v3.9 written by @Wireghoul
4848
=================================[justanotherhacker.com]==='
4949
fi
5050
}

misc/giterate.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
# iterate through every git commit and run graudit rules against the diff... do the same on a branch if specified
3+
4+
# Display help string for -h/--help
5+
if [[ "$1" =~ ^-.+ ]]; then
6+
echo "Usage: $0 <db> <branch>"
7+
exit
8+
fi
9+
10+
# Default to secrets db unless one is specified
11+
DB=${1:-secrets}
12+
13+
# Default to current branch if none specified
14+
BRANCH=${2:-$(git rev-parse --abbrev-ref HEAD 2>&1)}
15+
if [[ "$BRANCH" =~ ^fatal: ]]; then
16+
echo $BRANCH
17+
exit 2
18+
fi
19+
20+
# Check if db is valid
21+
if [[ ! -e $DB ]]; then
22+
RESULT=$(graudit -B -d $DB /dev/null 2>&1)
23+
if [[ "$RESULT" =~ database\ path\ not\ found ]]; then
24+
echo "Invalid database specified"
25+
exit 2
26+
fi
27+
fi
28+
29+
echo "Running graudit with $DB on commits in branch: $BRANCH"
30+
31+
# Get all commit hashes for the branch
32+
COMMITS=$(git log --pretty=format:"%H" $BRANCH)
33+
34+
# Loop through each commit
35+
for COMMIT in $COMMITS; do
36+
echo -n "Checking commit $COMMIT... "
37+
38+
# Search for patterns in this commit
39+
RESULT=$(git show $COMMIT | graudit -B -c 0 -d "$DB" /dev/stdin)
40+
41+
if [ -n "$RESULT" ]; then
42+
echo "FOUND MATCH!"
43+
echo "$RESULT"
44+
else
45+
echo "No matches"
46+
fi
47+
done
48+
49+
50+
51+

misc/supression.db

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ ApexXSSFromEscapeFalse
1414
ApexXSSFromURLParam
1515
(#|//)[[:space:]]+nosemgrep
1616
#[[:space:]]*rubocop:disable.*
17+
#pragma warning disable EF1000

misc/svnlog.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# Get the SVN URL for the specific path
4+
echo "Getting revision history for this path..."
5+
6+
# Get all revisions for this specific path
7+
REVISIONS=$(svn log -q | grep -E '^r[0-9]+' | awk '{print $1}' | sed 's/r//')
8+
9+
# Count total revisions to scan
10+
TOTAL_REVS=$(echo "$REVISIONS" | wc -l)
11+
echo "Found $TOTAL_REVS revisions to scan"
12+
13+
# Loop through each revision
14+
for REV in $REVISIONS; do
15+
((CURRENT++))
16+
echo -n "Checking revision $REV ($CURRENT/$TOTAL_REVS)... "
17+
18+
# Get the previous revision
19+
# PREV_REV=$((REV-1))
20+
21+
# Search for password patterns in this revision
22+
RESULT=$(svn log -c $REV 2>/dev/null | grep -Ei '(security|sqli|sql inj|xss| rce |command injection|vulnerability|cmdi| lfi |traversal)')
23+
24+
if [ -n "$RESULT" ]; then
25+
echo "$RVE matches"
26+
echo $RESULT
27+
echo "show $diff ?"
28+
read -n1 -s -p $'Press enter to continue...any other key to skip...\n' key
29+
if [ "$key" = '' ]; then
30+
svn diff -c $REV
31+
fi
32+
else
33+
echo "No matches"
34+
fi
35+
done
36+

misc/svnscan

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
# download and scan a single github repo, output to stdout
3+
if [ -z $1 ]; then
4+
echo "$0 <https://svn/repo/url>"
5+
exit 2
6+
fi
7+
url=$1
8+
echo "Scanning $url!"
9+
mkdir -p churn
10+
cd churn
11+
svn co $url
12+
graudit -x *.js,*.json,*.map,*.sql -d flatline .

misc/svnumerate.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
3+
# iterate through every svn commit and run graudit rules against the diff... do the same on a branch if specified
4+
5+
# Display help string for -h/--help
6+
if [[ "$1" =~ ^-.+ ]]; then
7+
echo "Usage: $0 <db> <branch>"
8+
exit
9+
fi
10+
11+
DB=${1:-secrets}
12+
13+
SVN_PATH=${2:-.}
14+
15+
# Get the SVN URL for the specific path
16+
# SVN_URL=$(svn info --show-item url "$SVN_PATH")
17+
# It's never used again.....
18+
19+
# Check if db is valid
20+
if [[ ! -e $DB ]]; then
21+
RESULT=$(graudit -B -d $DB /dev/null 2>&1)
22+
if [[ "$RESULT" =~ database\ path\ not\ found ]]; then
23+
echo "Invalid database specified"
24+
exit 2
25+
fi
26+
fi
27+
28+
echo "Running graudit with $DB on commits in branch: $BRANCH"
29+
30+
# Get all revisions for this specific path
31+
REVISIONS=$(svn log -q "$SVN_PATH" | grep -E '^r[0-9]+' | awk '{print $1}' | sed 's/r//')
32+
33+
# Count total revisions to scan
34+
#TOTAL_REVS=$(echo "$REVISIONS" | wc -l)
35+
#echo "Found $TOTAL_REVS revisions to scan"
36+
37+
# Counter for tracking matches
38+
#MATCHES=0
39+
#CURRENT=0
40+
41+
# Loop through each revision
42+
for REV in $REVISIONS; do
43+
#((CURRENT++))
44+
echo -n "Checking revision $REV... " # ($CURRENT/$TOTAL_REVS)... "
45+
46+
# Get the previous revision
47+
PREV_REV=$((REV-1))
48+
49+
# Search for patterns in this revision
50+
RESULT=$(svn diff -r $PREV_REV:$REV "$SVN_PATH" 2>/dev/null | graudit -B -c 0 -d "$DB" /dev/stdin)
51+
52+
if [ -n "$RESULT" ]; then
53+
echo "FOUND MATCH!"
54+
echo "$RESULT"
55+
# ((MATCHES++))
56+
else
57+
echo "No matches"
58+
fi
59+
done
60+

signatures/docker.db

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
^[[:space:]]*RUN[[:space:]]+sudo[[:space:]]+
2+
^[[:space:]]*USER[[:space:]]+root$
3+
^[[:space:]]*VOLUME[[:space:]]+/var/run/docker\.sock:

signatures/dotnet.db

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ system.web.ui.webcontrols.label
5353
system.web.ui.webcontrols.linkbutton
5454
system.web.ui.webcontrols.listbox
5555
system.web.ui.webcontrols.checkboxlist
56-
system.web.ui.webcontrols.dropdownlist# Dotnet legacy
56+
system.web.ui.webcontrols.dropdownlistValidateLifetime[[:space:]]*=[[:space:]]*false
57+
# Dotnet legacy
5758
printf
5859
strcpy
5960
# Dotnet Logging

0 commit comments

Comments
 (0)