From: Victor Julien Date: Tue, 7 Jun 2016 16:29:42 +0000 (+0200) Subject: afl: fix various --afl-* options X-Git-Tag: suricata-3.1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b673e1441110a4624c708cb40f94004f6071c0ae;p=thirdparty%2Fsuricata.git afl: fix various --afl-* options --- diff --git a/src/suricata.c b/src/suricata.c index 5482002a54..198420b3e6 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -1384,26 +1384,41 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri) } #ifdef AFLFUZZ_RULES } else if(strcmp((long_opts[option_index]).name, "afl-rules") == 0) { + MpmTableSetup(); + SpmTableSetup(); exit(RuleParseDataFromFile(optarg)); #endif #ifdef AFLFUZZ_APPLAYER } else if(strcmp((long_opts[option_index]).name, "afl-http-request") == 0) { //printf("arg: //%s\n", optarg); + MpmTableSetup(); + SpmTableSetup(); + AppLayerProtoDetectSetup(); AppLayerParserSetup(); RegisterHTPParsers(); exit(AppLayerParserRequestFromFile(ALPROTO_HTTP, optarg)); } else if(strcmp((long_opts[option_index]).name, "afl-http") == 0) { //printf("arg: //%s\n", optarg); + MpmTableSetup(); + SpmTableSetup(); + AppLayerProtoDetectSetup(); AppLayerParserSetup(); RegisterHTPParsers(); exit(AppLayerParserFromFile(ALPROTO_HTTP, optarg)); } else if(strcmp((long_opts[option_index]).name, "afl-tls-request") == 0) { //printf("arg: //%s\n", optarg); + MpmTableSetup(); + SpmTableSetup(); + AppLayerProtoDetectSetup(); + AppLayerParserSetup(); RegisterSSLParsers(); exit(AppLayerParserRequestFromFile(ALPROTO_TLS, optarg)); } else if(strcmp((long_opts[option_index]).name, "afl-tls") == 0) { //printf("arg: //%s\n", optarg); + MpmTableSetup(); + SpmTableSetup(); + AppLayerProtoDetectSetup(); AppLayerParserSetup(); RegisterSSLParsers(); exit(AppLayerParserFromFile(ALPROTO_TLS, optarg)); @@ -1420,20 +1435,33 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri) } else if(strcmp((long_opts[option_index]).name, "afl-ssh-request") == 0) { //printf("arg: //%s\n", optarg); + MpmTableSetup(); + SpmTableSetup(); + AppLayerProtoDetectSetup(); RegisterSSHParsers(); exit(AppLayerParserRequestFromFile(ALPROTO_SSH, optarg)); } else if(strcmp((long_opts[option_index]).name, "afl-ssh") == 0) { //printf("arg: //%s\n", optarg); + MpmTableSetup(); + SpmTableSetup(); + AppLayerProtoDetectSetup(); AppLayerParserSetup(); RegisterSSHParsers(); exit(AppLayerParserFromFile(ALPROTO_SSH, optarg)); } else if(strcmp((long_opts[option_index]).name, "afl-ftp-request") == 0) { //printf("arg: //%s\n", optarg); + MpmTableSetup(); + SpmTableSetup(); + AppLayerProtoDetectSetup(); + AppLayerParserSetup(); RegisterFTPParsers(); exit(AppLayerParserRequestFromFile(ALPROTO_FTP, optarg)); } else if(strcmp((long_opts[option_index]).name, "afl-ftp") == 0) { //printf("arg: //%s\n", optarg); + MpmTableSetup(); + SpmTableSetup(); + AppLayerProtoDetectSetup(); AppLayerParserSetup(); RegisterFTPParsers(); exit(AppLayerParserFromFile(ALPROTO_FTP, optarg)); @@ -1441,22 +1469,32 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri) } else if(strcmp((long_opts[option_index]).name, "afl-smtp-request") == 0) { //printf("arg: //%s\n", optarg); MpmTableSetup(); + SpmTableSetup(); + AppLayerProtoDetectSetup(); AppLayerParserSetup(); RegisterSMTPParsers(); exit(AppLayerParserRequestFromFile(ALPROTO_SMTP, optarg)); } else if(strcmp((long_opts[option_index]).name, "afl-smtp") == 0) { //printf("arg: //%s\n", optarg); MpmTableSetup(); + SpmTableSetup(); + AppLayerProtoDetectSetup(); AppLayerParserSetup(); RegisterSMTPParsers(); exit(AppLayerParserFromFile(ALPROTO_SMTP, optarg)); } else if(strcmp((long_opts[option_index]).name, "afl-smb-request") == 0) { //printf("arg: //%s\n", optarg); + MpmTableSetup(); + SpmTableSetup(); + AppLayerProtoDetectSetup(); RegisterSMBParsers(); exit(AppLayerParserRequestFromFile(ALPROTO_SMB, optarg)); } else if(strcmp((long_opts[option_index]).name, "afl-smb") == 0) { //printf("arg: //%s\n", optarg); + MpmTableSetup(); + SpmTableSetup(); + AppLayerProtoDetectSetup(); AppLayerParserSetup(); RegisterSMBParsers(); exit(AppLayerParserFromFile(ALPROTO_SMB, optarg)); @@ -1481,6 +1519,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri) } else if(strcmp((long_opts[option_index]).name, "afl-decoder-ppp") == 0) { StatsInit(); MpmTableSetup(); + SpmTableSetup(); AppLayerProtoDetectSetup(); DefragInit(); FlowInitConfig(FLOW_QUIET);