Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Commit

Permalink
Added link to log format
Browse files Browse the repository at this point in the history
  • Loading branch information
spartantri committed Aug 27, 2019
1 parent 8eb87c1 commit 8e0681d
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions util/send-payload-pls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,31 @@
# Script to post a payload against a local webserver at each paranoia level
#
# Note: Webserver has to be prepared to take desired PL as Request Header "PL"
# Check the access log format at https://www.netnea.com/cms/apache-tutorial-5_extending-access-log/
#
#Path to CRS rule set and local files
# Path to CRS rule set and local files
CRS="/usr/share/modsecurity-crs/rules/"
accesslog="/apache/logs/access.log"
errorlog="/apache/logs/error.log"

#URL of web server
# URL of web server
URL="localhost:40080"

#Rules per Paranoia level
#Paranoia level 1 rules, rule 012 is the phase 2 rule delimiter of the start of PL1
#Paranoia level 1 rules, rule 013 is the phase 1 rule delimiter of the finish of PL1
# Rules per Paranoia level
# Paranoia level 1 rules, rule 012 is the phase 2 rule delimiter of the start of PL1
# Paranoia level 1 rules, rule 013 is the phase 1 rule delimiter of the finish of PL1
PL1=$(awk "/012,phase:2/,/013,phase:1/" $CRS/*.conf |egrep -v "(012|013),phase" |egrep -o "id:[0-9]+" |sed -r 's,id:([0-9]+),\1\\,' |tr -t '\n' '\|' |sed -r 's,\\\|$,,')

#Paranoia level 2 rules, rule 014 is the phase 2 rule delimiter of the start of PL2
#Paranoia level 2 rules, rule 015 is the phase 1 rule delimiter of the finish of PL2
# Paranoia level 2 rules, rule 014 is the phase 2 rule delimiter of the start of PL2
# Paranoia level 2 rules, rule 015 is the phase 1 rule delimiter of the finish of PL2
PL2=$(awk "/014,phase:2/,/015,phase:1/" $CRS/*.conf |egrep -v "(014|015),phase" |egrep -o "id:[0-9]+" |sed -r 's,id:([0-9]+),\1\\,' |tr -t '\n' '\|' |sed -r 's,\\\|$,,')

#Paranoia level 3 rules, rule 016 is the phase 2 rule delimiter of the start of PL3
#Paranoia level 3 rules, rule 017 is the phase 1 rule delimiter of the finish of PL3
# Paranoia level 3 rules, rule 016 is the phase 2 rule delimiter of the start of PL3
# Paranoia level 3 rules, rule 017 is the phase 1 rule delimiter of the finish of PL3
PL3=$(awk "/016,phase:2/,/017,phase:1/" $CRS/*.conf |egrep -v "(016|017),phase" |egrep -o "id:[0-9]+" |sed -r 's,id:([0-9]+),\1\\,' |tr -t '\n' '\|' |sed -r 's,\\\|$,,')

#Paranoia level 4 rules, rule 018 is the phase 2 rule delimiter of the start of PL4
#Paranoia level 4 rules, "Paranoia Levels Finished" delimiter of the finish of PL4
# Paranoia level 4 rules, rule 018 is the phase 2 rule delimiter of the start of PL4
# Paranoia level 4 rules, "Paranoia Levels Finished" delimiter of the finish of PL4
PL4=$(awk "/018,phase:2/,/Paranoia Levels Finished/" $CRS/*.conf |egrep -v "018,phase" |egrep -o "id:[0-9]+" |sed -r 's,id:([0-9]+),\1\\,' |tr -t '\n' '\|' |sed -r 's,\\\|$,,')

if [ ! -z "$1" ]; then
Expand Down

0 comments on commit 8e0681d

Please sign in to comment.