@ -145,6 +145,13 @@
# include "app-layer.h"
# include "app-layer-parser.h"
# include "app-layer-htp.h"
# include "app-layer-ssl.h"
# include "app-layer-dns-tcp.h"
# include "app-layer-ssh.h"
# include "app-layer-ftp.h"
# include "app-layer-smtp.h"
# include "app-layer-smb.h"
# include "app-layer-modbus.h"
# include "util-radix-tree.h"
# include "util-host-os-info.h"
@ -1136,6 +1143,22 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
{ " netmap " , optional_argument , 0 , 0 } ,
{ " pcap " , optional_argument , 0 , 0 } ,
{ " simulate-ips " , 0 , 0 , 0 } ,
{ " afl-http-request " , required_argument , 0 , 0 } ,
{ " afl-http " , required_argument , 0 , 0 } ,
{ " afl-tls-request " , required_argument , 0 , 0 } ,
{ " afl-tls " , required_argument , 0 , 0 } ,
{ " afl-dns-request " , required_argument , 0 , 0 } ,
{ " afl-dns " , required_argument , 0 , 0 } ,
{ " afl-ssh-request " , required_argument , 0 , 0 } ,
{ " afl-ssh " , required_argument , 0 , 0 } ,
{ " afl-ftp-request " , required_argument , 0 , 0 } ,
{ " afl-ftp " , required_argument , 0 , 0 } ,
{ " afl-smtp-request " , required_argument , 0 , 0 } ,
{ " afl-smtp " , required_argument , 0 , 0 } ,
{ " afl-smb-request " , required_argument , 0 , 0 } ,
{ " afl-smb " , required_argument , 0 , 0 } ,
{ " afl-modbus-request " , required_argument , 0 , 0 } ,
{ " afl-modbus " , required_argument , 0 , 0 } ,
# ifdef BUILD_UNIX_SOCKET
{ " unix-socket " , optional_argument , 0 , 0 } ,
# endif
@ -1324,6 +1347,92 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
usage ( argv [ 0 ] ) ;
return TM_ECODE_FAILED ;
}
# ifdef AFLFUZZ_APPLAYER
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-http-request " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
AppLayerParserSetup ( ) ;
RegisterHTPParsers ( ) ;
exit ( AppLayerParserRequestFromFile ( ALPROTO_HTTP , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-http " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
AppLayerParserSetup ( ) ;
RegisterHTPParsers ( ) ;
exit ( AppLayerParserFromFile ( ALPROTO_HTTP , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-tls-request " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
RegisterSSLParsers ( ) ;
exit ( AppLayerParserRequestFromFile ( ALPROTO_TLS , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-tls " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
AppLayerParserSetup ( ) ;
RegisterSSLParsers ( ) ;
exit ( AppLayerParserFromFile ( ALPROTO_TLS , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-dns-request " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
RegisterDNSTCPParsers ( ) ;
exit ( AppLayerParserRequestFromFile ( ALPROTO_DNS , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-dns " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
AppLayerParserSetup ( ) ;
RegisterDNSTCPParsers ( ) ;
exit ( AppLayerParserFromFile ( ALPROTO_DNS , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-ssh-request " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
RegisterSSHParsers ( ) ;
exit ( AppLayerParserRequestFromFile ( ALPROTO_SSH , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-ssh " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
AppLayerParserSetup ( ) ;
RegisterSSHParsers ( ) ;
exit ( AppLayerParserFromFile ( ALPROTO_SSH , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-ftp-request " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
RegisterFTPParsers ( ) ;
exit ( AppLayerParserRequestFromFile ( ALPROTO_FTP , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-ftp " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
AppLayerParserSetup ( ) ;
RegisterFTPParsers ( ) ;
exit ( AppLayerParserFromFile ( ALPROTO_FTP , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-smtp-request " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
MpmTableSetup ( ) ;
AppLayerParserSetup ( ) ;
RegisterSMTPParsers ( ) ;
exit ( AppLayerParserRequestFromFile ( ALPROTO_SMTP , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-smtp " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
MpmTableSetup ( ) ;
AppLayerParserSetup ( ) ;
RegisterSMTPParsers ( ) ;
exit ( AppLayerParserFromFile ( ALPROTO_SMTP , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-smb-request " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
RegisterSMBParsers ( ) ;
exit ( AppLayerParserRequestFromFile ( ALPROTO_SMB , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-smb " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
AppLayerParserSetup ( ) ;
RegisterSMBParsers ( ) ;
exit ( AppLayerParserFromFile ( ALPROTO_SMB , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-modbus-request " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
AppLayerParserSetup ( ) ;
RegisterModbusParsers ( ) ;
exit ( AppLayerParserRequestFromFile ( ALPROTO_MODBUS , optarg ) ) ;
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " afl-modbus " ) = = 0 ) {
//printf("arg: //%s\n", optarg);
AppLayerParserSetup ( ) ;
RegisterModbusParsers ( ) ;
exit ( AppLayerParserFromFile ( ALPROTO_MODBUS , optarg ) ) ;
# endif
} else if ( strcmp ( ( long_opts [ option_index ] ) . name , " simulate-ips " ) = = 0 ) {
SCLogInfo ( " Setting IPS mode " ) ;
EngineModeSetIPS ( ) ;