Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions regex-assembly/exclude/unix-shell-fps-pl1.ra
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ c99
cancel
cancel@
cancel~
cargo@
capsh@
cat
cat@
Expand Down Expand Up @@ -408,6 +409,8 @@ knife
knife@
knife~
ksshell
l@
la@
last
last@
last~
Expand All @@ -425,6 +428,7 @@ less~
links
links@
links~
ll@
ln
ln@
local
Expand Down Expand Up @@ -627,6 +631,7 @@ ruby@
ruby~
run-mailcap
run-parts
rust@
rview
rvim
sash
Expand All @@ -652,6 +657,7 @@ set~
sg
sg@
sg~
shred@
shuf
shutdown
shutdown@
Expand Down
15 changes: 14 additions & 1 deletion regex-assembly/include/unix-shell-4andup.ra
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
##! NL=$'\n'
##! original="$(grep -vE '^[#$]' regex-assembly/include/unix-shell-4andup.ra)"
##! # Exclude entries starting with `(dev/|etc/|proc/|#)` and empty lines, they are not commands
##! source="$(grep -vEh '^(dev/|etc/|proc/|#|$)' rules/unix-{shell,shell-builtins}.data | \
##! source="$(grep -vEh '^(dev/|etc/|proc/|#|$)' rules/unix-{shell-aliases,shell,shell-builtins}.data | \
##! awk '/^[^#$]/ {split($0,x,"/"); y=x[length(x)]} length(y) > 3 {print y}' | \
##! sort | uniq)"
##! # retain all unmodified entries in this list and skip removed ones; ignore the manually added suffixes
Expand Down Expand Up @@ -144,6 +144,10 @@ c89-gcc
c99-gcc
cancel@
capsh@
cargo@
cargo-audit
cargo-miri
cargo-watch
certbot
chattr@
chdir@
Expand All @@ -167,6 +171,7 @@ chroot@
chsh@
clang\+\+
clang@
clippy-driver
cobc@
cobcrun
column@
Expand Down Expand Up @@ -469,6 +474,13 @@ ruby~
run-mailcap
run-parts
runc@
rust-analyzer
rust-gdb
rust-lldb
rustc@
rustdoc
rustfmt
rustup
rview@
rvim@
sash@
Expand All @@ -485,6 +497,7 @@ setfacl@
setsid
sftp@
sh\.distrib
shred@
shuf@
shutdown@
sleep@
Expand Down
5 changes: 4 additions & 1 deletion regex-assembly/include/unix-shell-upto3.ra
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
##! # select words of length <= 3
##! original="$(grep -vE '^[#$]' regex-assembly/include/unix-shell-upto3.ra)"
##! # Exclude entries starting with `(dev/|etc/|proc/|#)` and empty lines, they are not commands
##! source=$(grep -vEh '^(dev/|etc/|proc/|#|$)' rules/unix-{shell,shell-builtins}.data | \
##! source=$(grep -vEh '^(dev/|etc/|proc/|#|$)' rules/unix-{shell-aliases,shell,shell-builtins}.data | \
##! awk '/^[^#$]/ {split($0,x,"/"); y=x[length(x)]} length(y) <= 3 {print y}' | \
##! sort | uniq)
##! result=""
Expand Down Expand Up @@ -123,8 +123,11 @@ irb@
jjs@
jq@
ksh@
l@
la@
ld@
ldd@
ll@
ln@
lp@
ls@
Expand Down
12 changes: 6 additions & 6 deletions rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions rules/unix-shell-aliases.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This list only includes shell aliases that are included in various Distro's out of the box
# to limit false positives. The number of shell aliases that can exist are infinite.

# ls
l
la
ll
13 changes: 13 additions & 0 deletions rules/unix-shell.data
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ bin/c99
bin/c99-gcc
bin/cancel
bin/capsh
bin/cargo
bin/cargo-audit
bin/cargo-miri
bin/cargo-watch
bin/cat
bin/cc
bin/certbot
Expand All @@ -130,6 +134,7 @@ bin/chroot
bin/chsh
bin/clang
bin/clang++
bin/clippy-driver
bin/cmp
bin/cobc
bin/cobcrun
Expand Down Expand Up @@ -496,6 +501,13 @@ bin/ruby
bin/runc
bin/run-mailcap
bin/run-parts
bin/rustc
bin/rustdoc
bin/rustfmt
bin/rustup
bin/rust-analyzer
bin/rust-gdb
bin/rust-lldb
bin/rview
bin/rvim
bin/sash
Expand All @@ -515,6 +527,7 @@ bin/sftp
bin/sg
bin/sh
bin/sh.distrib
bin/shred
bin/shuf
bin/shutdown
bin/sleep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1803,3 +1803,19 @@ tests:
output:
log:
expect_ids: [932236]
- test_id: 100
desc: "True Postitive: ll alias of ls `ll /var/www/`"
stages:
- input:
dest_addr: 127.0.0.1
headers:
User-Agent: "OWASP CRS test agent"
Host: localhost
Accept: "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"
method: GET
port: 80
uri: "/get?test=ll%20%2Fvar%2Fwww%2F"
version: HTTP/1.1
output:
log:
expect_ids: [932236]
Loading