Created
March 23, 2020 15:02
-
-
Save zimmerle/4c52aad3f7a9f719611fb134c827f278 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
diff --git a/test/fuzzer/afl_fuzzer.cc b/test/fuzzer/afl_fuzzer.cc | |
index 9c7fe3a5..f2234141 100644 | |
--- a/test/fuzzer/afl_fuzzer.cc | |
+++ b/test/fuzzer/afl_fuzzer.cc | |
@@ -23,8 +23,8 @@ | |
* for i in $(ls -l src/actions/transformations/*.h | awk {'print $9'}); do echo "#include \"$i\""; done; | |
* | |
*/ | |
-#include "src/actions/transformations/base64_decode_ext.h" | |
#include "src/actions/transformations/base64_decode.h" | |
+#include "src/actions/transformations/base64_decode_ext.h" | |
#include "src/actions/transformations/base64_encode.h" | |
#include "src/actions/transformations/cmd_line.h" | |
#include "src/actions/transformations/compress_whitespace.h" | |
@@ -43,8 +43,8 @@ | |
#include "src/actions/transformations/parity_even_7bit.h" | |
#include "src/actions/transformations/parity_odd_7bit.h" | |
#include "src/actions/transformations/parity_zero_7bit.h" | |
-#include "src/actions/transformations/remove_comments_char.h" | |
#include "src/actions/transformations/remove_comments.h" | |
+#include "src/actions/transformations/remove_comments_char.h" | |
#include "src/actions/transformations/remove_nulls.h" | |
#include "src/actions/transformations/remove_whitespace.h" | |
#include "src/actions/transformations/replace_comments.h" | |
@@ -55,6 +55,7 @@ | |
#include "src/actions/transformations/trim.h" | |
#include "src/actions/transformations/trim_left.h" | |
#include "src/actions/transformations/trim_right.h" | |
+#include "src/actions/transformations/upper_case.h" | |
#include "src/actions/transformations/url_decode.h" | |
#include "src/actions/transformations/url_decode_uni.h" | |
#include "src/actions/transformations/url_encode.h" | |
@@ -146,8 +147,8 @@ int main(int argc, char** argv) { | |
* for i in $(grep "class " -Ri src/actions/transformations/* | grep " :" | grep -v "InstantCache" | awk {'print $2'}); do echo $i *$(echo $i | awk '{print tolower($0)}') = new $i\(\"$i\"\)\; $(echo $i | awk '{print tolower($0)}')-\>evaluate\(s, NULL\)\; delete $(echo $i | awk '{print tolower($0)}')\;; done; | |
* | |
*/ | |
-Base64DecodeExt *base64decodeext = new Base64DecodeExt("Base64DecodeExt"); base64decodeext->evaluate(s, NULL); delete base64decodeext; | |
Base64Decode *base64decode = new Base64Decode("Base64Decode"); base64decode->evaluate(s, NULL); delete base64decode; | |
+Base64DecodeExt *base64decodeext = new Base64DecodeExt("Base64DecodeExt"); base64decodeext->evaluate(s, NULL); delete base64decodeext; | |
Base64Encode *base64encode = new Base64Encode("Base64Encode"); base64encode->evaluate(s, NULL); delete base64encode; | |
CmdLine *cmdline = new CmdLine("CmdLine"); cmdline->evaluate(s, NULL); delete cmdline; | |
CompressWhitespace *compresswhitespace = new CompressWhitespace("CompressWhitespace"); compresswhitespace->evaluate(s, NULL); delete compresswhitespace; | |
@@ -166,8 +167,8 @@ NormalisePathWin *normalisepathwin = new NormalisePathWin("NormalisePathWin"); n | |
ParityEven7bit *parityeven7bit = new ParityEven7bit("ParityEven7bit"); parityeven7bit->evaluate(s, NULL); delete parityeven7bit; | |
ParityOdd7bit *parityodd7bit = new ParityOdd7bit("ParityOdd7bit"); parityodd7bit->evaluate(s, NULL); delete parityodd7bit; | |
ParityZero7bit *parityzero7bit = new ParityZero7bit("ParityZero7bit"); parityzero7bit->evaluate(s, NULL); delete parityzero7bit; | |
-RemoveCommentsChar *removecommentschar = new RemoveCommentsChar("RemoveCommentsChar"); removecommentschar->evaluate(s, NULL); delete removecommentschar; | |
RemoveComments *removecomments = new RemoveComments("RemoveComments"); removecomments->evaluate(s, NULL); delete removecomments; | |
+RemoveCommentsChar *removecommentschar = new RemoveCommentsChar("RemoveCommentsChar"); removecommentschar->evaluate(s, NULL); delete removecommentschar; | |
RemoveNulls *removenulls = new RemoveNulls("RemoveNulls"); removenulls->evaluate(s, NULL); delete removenulls; | |
RemoveWhitespace *removewhitespace = new RemoveWhitespace("RemoveWhitespace"); removewhitespace->evaluate(s, NULL); delete removewhitespace; | |
ReplaceComments *replacecomments = new ReplaceComments("ReplaceComments"); replacecomments->evaluate(s, NULL); delete replacecomments; | |
@@ -178,61 +179,61 @@ Transformation *transformation = new Transformation("Transformation"); transform | |
Trim *trim = new Trim("Trim"); trim->evaluate(s, NULL); delete trim; | |
TrimLeft *trimleft = new TrimLeft("TrimLeft"); trimleft->evaluate(s, NULL); delete trimleft; | |
TrimRight *trimright = new TrimRight("TrimRight"); trimright->evaluate(s, NULL); delete trimright; | |
+UpperCase *uppercase = new UpperCase("UpperCase"); uppercase->evaluate(s, NULL); delete uppercase; | |
UrlDecode *urldecode = new UrlDecode("UrlDecode"); urldecode->evaluate(s, NULL); delete urldecode; | |
UrlDecodeUni *urldecodeuni = new UrlDecodeUni("UrlDecodeUni"); urldecodeuni->evaluate(s, NULL); delete urldecodeuni; | |
UrlEncode *urlencode = new UrlEncode("UrlEncode"); urlencode->evaluate(s, NULL); delete urlencode; | |
Utf8ToUnicode *utf8tounicode = new Utf8ToUnicode("Utf8ToUnicode"); utf8tounicode->evaluate(s, NULL); delete utf8tounicode; | |
- | |
- | |
+#if 0 | |
/** | |
* Operators, generated by: | |
* | |
- * for i in $(grep "class " -Ri src/operators/* | grep " :" | awk {'print $2'}); do echo $i *$(echo $i | awk '{print tolower($0)}') = new $i\(\"$i\", z, false\)\; $(echo $i | awk '{print tolower($0)}')-\>evaluate\(t, s\)\; delete $(echo $i | awk '{print tolower($0)}')\;; done; | |
+ * for i in $(grep "class " -Ri src/operators/* | grep " :" | awk {'print $2'}); do echo $i *$(echo $i | awk '{print tolower($0)}') = new $i\(\"$i\"\)\; $(echo $i | awk '{print tolower($0)}')-\>evaluate\(t, s\)\; delete $(echo $i | awk '{print tolower($0)}')\;; done; | |
* | |
*/ | |
-BeginsWith *beginswith = new BeginsWith("BeginsWith", z, false); beginswith->evaluate(t, s); delete beginswith; | |
-Contains *contains = new Contains("Contains", z, false); contains->evaluate(t, s); delete contains; | |
-ContainsWord *containsword = new ContainsWord("ContainsWord", z, false); containsword->evaluate(t, s); delete containsword; | |
-DetectSQLi *detectsqli = new DetectSQLi("DetectSQLi", z, false); detectsqli->evaluate(t, s); delete detectsqli; | |
-DetectXSS *detectxss = new DetectXSS("DetectXSS", z, false); detectxss->evaluate(t, s); delete detectxss; | |
-EndsWith *endswith = new EndsWith("EndsWith", z, false); endswith->evaluate(t, s); delete endswith; | |
-Eq *eq = new Eq("Eq", z, false); eq->evaluate(t, s); delete eq; | |
-FuzzyHash *fuzzyhash = new FuzzyHash("FuzzyHash", z, false); fuzzyhash->evaluate(t, s); delete fuzzyhash; | |
-Ge *ge = new Ge("Ge", z, false); ge->evaluate(t, s); delete ge; | |
-GeoLookup *geolookup = new GeoLookup("GeoLookup", z, false); geolookup->evaluate(t, s); delete geolookup; | |
-GsbLookup *gsblookup = new GsbLookup("GsbLookup", z, false); gsblookup->evaluate(t, s); delete gsblookup; | |
-Gt *gt = new Gt("Gt", z, false); gt->evaluate(t, s); delete gt; | |
-InspectFile *inspectfile = new InspectFile("InspectFile", z, false); inspectfile->evaluate(t, s); delete inspectfile; | |
-IpMatchF *ipmatchf = new IpMatchF("IpMatchF", z, false); ipmatchf->evaluate(t, s); delete ipmatchf; | |
-IpMatchFromFile *ipmatchfromfile = new IpMatchFromFile("IpMatchFromFile", z, false); ipmatchfromfile->evaluate(t, s); delete ipmatchfromfile; | |
-IpMatch *ipmatch = new IpMatch("IpMatch", z, false); ipmatch->evaluate(t, s); delete ipmatch; | |
-Le *le = new Le("Le", z, false); le->evaluate(t, s); delete le; | |
-Lt *lt = new Lt("Lt", z, false); lt->evaluate(t, s); delete lt; | |
-NoMatch *nomatch = new NoMatch("NoMatch", z, false); nomatch->evaluate(t, s); delete nomatch; | |
-PmF *pmf = new PmF("PmF", z, false); pmf->evaluate(t, s); delete pmf; | |
-PmFromFile *pmfromfile = new PmFromFile("PmFromFile", z, false); pmfromfile->evaluate(t, s); delete pmfromfile; | |
-Pm *pm = new Pm("Pm", z, false); pm->evaluate(t, s); delete pm; | |
+BeginsWith *beginswith = new BeginsWith("BeginsWith"); beginswith->evaluate(t, s); delete beginswith; | |
+Contains *contains = new Contains("Contains"); contains->evaluate(t, s); delete contains; | |
+ContainsWord *containsword = new ContainsWord("ContainsWord"); containsword->evaluate(t, s); delete containsword; | |
+DetectSQLi *detectsqli = new DetectSQLi("DetectSQLi"); detectsqli->evaluate(t, s); delete detectsqli; | |
+DetectXSS *detectxss = new DetectXSS("DetectXSS"); detectxss->evaluate(t, s); delete detectxss; | |
+EndsWith *endswith = new EndsWith("EndsWith"); endswith->evaluate(t, s); delete endswith; | |
+Eq *eq = new Eq("Eq"); eq->evaluate(t, s); delete eq; | |
+FuzzyHash *fuzzyhash = new FuzzyHash("FuzzyHash"); fuzzyhash->evaluate(t, s); delete fuzzyhash; | |
+Ge *ge = new Ge("Ge"); ge->evaluate(t, s); delete ge; | |
+GeoLookup *geolookup = new GeoLookup("GeoLookup"); geolookup->evaluate(t, s); delete geolookup; | |
+GsbLookup *gsblookup = new GsbLookup("GsbLookup"); gsblookup->evaluate(t, s); delete gsblookup; | |
+Gt *gt = new Gt("Gt"); gt->evaluate(t, s); delete gt; | |
+InspectFile *inspectfile = new InspectFile("InspectFile"); inspectfile->evaluate(t, s); delete inspectfile; | |
+IpMatchF *ipmatchf = new IpMatchF("IpMatchF"); ipmatchf->evaluate(t, s); delete ipmatchf; | |
+IpMatchFromFile *ipmatchfromfile = new IpMatchFromFile("IpMatchFromFile"); ipmatchfromfile->evaluate(t, s); delete ipmatchfromfile; | |
+IpMatch *ipmatch = new IpMatch("IpMatch"); ipmatch->evaluate(t, s); delete ipmatch; | |
+Le *le = new Le("Le"); le->evaluate(t, s); delete le; | |
+Lt *lt = new Lt("Lt"); lt->evaluate(t, s); delete lt; | |
+NoMatch *nomatch = new NoMatch("NoMatch"); nomatch->evaluate(t, s); delete nomatch; | |
+PmF *pmf = new PmF("PmF"); pmf->evaluate(t, s); delete pmf; | |
+PmFromFile *pmfromfile = new PmFromFile("PmFromFile"); pmfromfile->evaluate(t, s); delete pmfromfile; | |
+Pm *pm = new Pm("Pm"); pm->evaluate(t, s); delete pm; | |
// Rbl test is too slow to be tested here. | |
-// Rbl *rbl = new Rbl("Rbl", z, false); rbl->evaluate(t, s); delete rbl; | |
-Rsub *rsub = new Rsub("Rsub", z, false); rsub->evaluate(t, s); delete rsub; | |
-Rx *rx = new Rx("Rx", z, false); rx->evaluate(t, s); delete rx; | |
- | |
-StrEq *streq = new StrEq("StrEq", z, false); streq->evaluate(t, s); delete streq; | |
+// Rbl *rbl = new Rbl("Rbl"); rbl->evaluate(t, s); delete rbl; | |
+Rsub *rsub = new Rsub("Rsub"); rsub->evaluate(t, s); delete rsub; | |
+Rx *rx = new Rx("Rx"); rx->evaluate(t, s); delete rx; | |
-StrMatch *strmatch = new StrMatch("StrMatch", z, false); strmatch->evaluate(t, s); delete strmatch; | |
-UnconditionalMatch *unconditionalmatch = new UnconditionalMatch("UnconditionalMatch", z, false); unconditionalmatch->evaluate(t, s); delete unconditionalmatch; | |
-ValidateByteRange *validatebyterange = new ValidateByteRange("ValidateByteRange", z, false); validatebyterange->evaluate(t, s); delete validatebyterange; | |
-ValidateDTD *validatedtd = new ValidateDTD("ValidateDTD", z, false); validatedtd->evaluate(t, s); delete validatedtd; | |
-ValidateHash *validatehash = new ValidateHash("ValidateHash", z, false); validatehash->evaluate(t, s); delete validatehash; | |
-ValidateSchema *validateschema = new ValidateSchema("ValidateSchema", z, false); validateschema->evaluate(t, s); delete validateschema; | |
-ValidateUrlEncoding *validateurlencoding = new ValidateUrlEncoding("ValidateUrlEncoding", z, false); validateurlencoding->evaluate(t, s); delete validateurlencoding; | |
-ValidateUtf8Encoding *validateutf8encoding = new ValidateUtf8Encoding("ValidateUtf8Encoding", z, false); validateutf8encoding->evaluate(t, s); delete validateutf8encoding; | |
-VerifyCC *verifycc = new VerifyCC("VerifyCC", z, false); verifycc->evaluate(t, s); delete verifycc; | |
-VerifyCPF *verifycpf = new VerifyCPF("VerifyCPF", z, false); verifycpf->evaluate(t, s); delete verifycpf; | |
-VerifySSN *verifyssn = new VerifySSN("VerifySSN", z, false); verifyssn->evaluate(t, s); delete verifyssn; | |
-Within *within = new Within("Within", z, false); within->evaluate(t, s); delete within; | |
+StrEq *streq = new StrEq("StrEq"); streq->evaluate(t, s); delete streq; | |
+StrMatch *strmatch = new StrMatch("StrMatch"); strmatch->evaluate(t, s); delete strmatch; | |
+UnconditionalMatch *unconditionalmatch = new UnconditionalMatch("UnconditionalMatch"); unconditionalmatch->evaluate(t, s); delete unconditionalmatch; | |
+ValidateByteRange *validatebyterange = new ValidateByteRange("ValidateByteRange"); validatebyterange->evaluate(t, s); delete validatebyterange; | |
+ValidateDTD *validatedtd = new ValidateDTD("ValidateDTD"); validatedtd->evaluate(t, s); delete validatedtd; | |
+ValidateHash *validatehash = new ValidateHash("ValidateHash"); validatehash->evaluate(t, s); delete validatehash; | |
+ValidateSchema *validateschema = new ValidateSchema("ValidateSchema"); validateschema->evaluate(t, s); delete validateschema; | |
+ValidateUrlEncoding *validateurlencoding = new ValidateUrlEncoding("ValidateUrlEncoding"); validateurlencoding->evaluate(t, s); delete validateurlencoding; | |
+ValidateUtf8Encoding *validateutf8encoding = new ValidateUtf8Encoding("ValidateUtf8Encoding"); validateutf8encoding->evaluate(t, s); delete validateutf8encoding; | |
+VerifyCC *verifycc = new VerifyCC("VerifyCC"); verifycc->evaluate(t, s); delete verifycc; | |
+VerifyCPF *verifycpf = new VerifyCPF("VerifyCPF"); verifycpf->evaluate(t, s); delete verifycpf; | |
+VerifySSN *verifyssn = new VerifySSN("VerifySSN"); verifyssn->evaluate(t, s); delete verifyssn; | |
+Within *within = new Within("Within"); within->evaluate(t, s); delete within; | |
+#endif | |
/** | |
* ModSec API | |
* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment