"src_addr | dst_addr | src_port | dst_port | " \
"eth_src | eth_dst | eth_type | eth_len | " \
"ttl | tos | id | ip_len | dgm_len | " \
- "icmp_type | icmp_code | icmp_id | icmp_seq" \
+ "icmp_type | icmp_code | icmp_id | icmp_seq | " \
"tcp_flags | tcp_seq | tcp_ack | tcp_len | tcp_win | " \
"udp_len"
#define CHECKSUM_MODE_OPT__NO_ICMP "noicmp"
#endif
-
static const Parameter s_params[] =
{
- { "*action", Parameter::PT_ENUM, "disable|enable", nullptr,
+ { "action", Parameter::PT_ENUM, "disable|enable", nullptr,
"stop or start stream reassembly" },
- { "*direction", Parameter::PT_ENUM, "client|server|both", nullptr,
+ { "direction", Parameter::PT_ENUM, "client|server|both", nullptr,
"action applies to the given direction(s)" },
{ "noalert", Parameter::PT_IMPLIED, nullptr, nullptr,
bool ReassembleModule::set(const char*, Value& v, SnortConfig*)
{
- if ( v.is("*action") )
+ if ( v.is("action") )
srod.enable = v.get_long();
- else if ( v.is("*direction") )
+ else if ( v.is("direction") )
srod.enable = v.get_long() + 1;
else if ( v.is("noalert") )
static const Parameter s_params[] =
{
- { "*direction", Parameter::PT_ENUM, "either|client|server|both", nullptr,
+ { "direction", Parameter::PT_ENUM, "either|client|server|both", nullptr,
"compare applies to the given direction(s)" },
- { "*operator", Parameter::PT_ENUM, "= | != | < | > | <= | >=", nullptr,
+ { "operator", Parameter::PT_ENUM, "= | != | < | > | <= | >=", nullptr,
"how to compare" },
- { "*size", Parameter::PT_INT, nullptr, nullptr,
+ { "size", Parameter::PT_INT, nullptr, nullptr,
"size for comparison" },
{ nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
if (snort_option == nullptr || lua_table == nullptr)
return false;
-
table_api.open_table(*lua_table);
if(lua_option == nullptr)
- {
lua_option = snort_option;
- }
else if (snort_option->compare(*lua_option))
- {
table_api.add_diff_option_comment(*snort_option, *lua_option);
- }
+
while (stream >> val)
retval = table_api.add_list(*lua_option, val) && retval;
if (!(data_stream >> keyword))
return retval;
-
// parsing the format list.
std::istringstream format(keyword);
while (std::getline(format, val, ','))
else if (!val.compare("proto"))
tmpval = table_api.add_list("csv", "proto");
- else if (!val.compare("dst"))
- tmpval = table_api.add_list("csv", "dst");
-
- else if (!val.compare("src"))
- tmpval = table_api.add_list("csv", "src");
-
else if (!val.compare("ttl"))
tmpval = table_api.add_list("csv", "ttl");
else if (!val.compare("tos"))
tmpval = table_api.add_list("csv", "tos");
+ else if (!val.compare("trheader"))
+ tmpval = table_api.add_deleted_comment("trheader");
+
+ else if (!val.compare("dst"))
+ {
+ table_api.add_diff_option_comment("dst", "dst_addr");
+ tmpval = table_api.add_list("csv", "dst_addr");
+ }
+
+ else if (!val.compare("src"))
+ {
+ table_api.add_diff_option_comment("src", "src_addr");
+ tmpval = table_api.add_list("csv", "src_addr");
+ }
+
else if (!val.compare("sig_generator"))
{
table_api.add_diff_option_comment("sig_generator", "gid");
tmpval = table_api.add_list("csv", "gid");
}
- else if (!val.compare("sid_id"))
+ else if (!val.compare("sig_id"))
{
- table_api.add_diff_option_comment("sid_id", "sid");
+ table_api.add_diff_option_comment("sig_id", "sid");
tmpval = table_api.add_list("csv", "sid");
}
tmpval = table_api.add_list("csv", "eth_len");
}
+ else if (!val.compare("ethtype"))
+ {
+ table_api.add_diff_option_comment("ethtype", "eth_type");
+ tmpval = table_api.add_list("csv", "eth_type");
+ }
+
+
else if (!val.compare("tcpflags"))
{
table_api.add_diff_option_comment("tcpflags", "tcp_flags");
tmpval = table_api.add_list("csv", "icmp_seq");
}
+ else if (!val.compare("udplength"))
+ {
+ table_api.add_diff_option_comment("udplength", "udp_len");
+ tmpval = table_api.add_list("csv", "udp_len");
+ }
+
else
{
tmpval = false;
rule_pcre.cc
rule_react.cc
rule_resp.cc
+ rule_stream_reassemble.cc
rule_tag.cc
rule_threshold.cc
rule_unchanged.cc
rule_pcre.cc \
rule_react.cc \
rule_resp.cc \
+rule_stream_reassemble.cc \
rule_tag.cc \
rule_threshold.cc \
rule_unchanged.cc \
else
rule_api.bad_rule(data_stream, "tag:<type> " + value + " - unknown metric");
}
-
cnt = !cnt;
}
tmp_pos = data_stream.tellg();
}
+ if (!found_gid)
+ table_api.add_option("gid", 1);
+
table_api.close_table();
table_api.close_table();
const ConvertMap* sameip_map = &rule_sameip;
-/************************************
- ****** STREAM_RESSAMBLE **********
- ************************************/
-
-static const std::string stream_reassemble = "stream_reassemble";
-static const ConvertMap rule_stream_reassemble =
-{
- stream_reassemble,
- unchanged_rule_ctor<&stream_reassemble>,
-};
-
-const ConvertMap* stream_reassemble_map = &rule_stream_reassemble;
-
/************************************
********* STREAM_SIZE ************
************************************/
output alert_csv:
output alert_csv: @CMAKE_CURRENT_BINARY_DIR@/alert_csv1.dlt
output alert_csv: @CMAKE_CURRENT_BINARY_DIR@/alert_csv2.dlt default
-output alert_csv: @CMAKE_CURRENT_BINARY_DIR@/alert_csv3.dlt timestamp,sig_generator,sid_id,sig_rev,msg,proto,src,srcport,dst,dstport,ethsrc,ethdst,ethlen,tcpflags,tcpseq,tcpack,tcplen,tcpwindow,ttl,tos,id,dgmlen,iplen,icmptype,icmpcode,icmpid,icmpseq 63
+output alert_csv: @CMAKE_CURRENT_BINARY_DIR@/alert_csv3.dlt timestamp,sig_generator,sig_id,sig_rev,msg,proto,src,srcport,dst,dstport,ethsrc,ethdst,ethlen,tcpflags,tcpseq,tcpack,tcplen,tcpwindow,ttl,tos,id,dgmlen,iplen,icmptype,icmpcode,icmpid,icmpseq,ethtype,udplength 63
output alert_csv: @CMAKE_CURRENT_BINARY_DIR@/alert_csv4.dlt default,icmptype,icmpcode,icmpid 64K
output alert_csv: @CMAKE_CURRENT_BINARY_DIR@/alert_csv5.dlt default,icmptype,icmpcode,icmpid 65M
output alert_csv: @CMAKE_CURRENT_BINARY_DIR@/alert_csv6.dlt default,icmptype,icmpcode,icmpid 66G
alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (msg:"MALWARE-OTHER NeoSploit Malvertising - URI Requested"; flow:to_server,established; urilen:>62; content:"GET /?"; fast_pattern:only; pcre:"/\/\?[0-9a-f]{60,66}[\;\d]*$/U"; metadata:policy balanced-ips drop, policy security-ips drop, service http; classtype:trojan-activity; sid:23058; rev:2;)
alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (msg:"EXPLOIT-KIT Redkit exploit kit landing page"; flow:to_server,established; urilen:18<>21; content:".html?h="; fast_pattern:only; http_uri; pcre:"/\/[a-z]{4}\.html\?h\=\d{6,7}$/Ui"; metadata:policy balanced-ips drop, policy security-ips drop, service http; reference:cve,2012-0188; reference:cve,2012-0507; reference:cve,2012-1723; reference:cve,2012-4681; reference:cve,2013-0422; reference:cve,2013-2423; reference:url,blog.malwarebytes.org/intelligence/2013/04/redkit-exploit-kit-does-the-splits/; classtype:trojan-activity; sid:26345; rev:3;)
alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (msg:"EXPLOIT-KIT Blackholev2 exploit kit Initial Gate from Linked-In Mailing Campaign"; flow:to_server,established; urilen:17,norm; content:"/linkendorse.html"; fast_pattern:only; http_uri; metadata:policy balanced-ips drop, policy security-ips drop, ruleset community, service http; classtype:trojan-activity; sid:26814; rev:1;)
-alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (msg:"EXPLOIT-KIT Blackholev2 exploit kit Initial Gate from Linked-In Mailing Campaign"; flow:to_server,established; urilen:17,raw; content:"/linkendorse.html"; fast_pattern:only; http_uri; metadata:policy balanced-ips drop, policy security-ips drop, ruleset community, service http; classtype:trojan-activity; sid:26814; rev:1;)
+alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (msg:"EXPLOIT-KIT Blackholev2 exploit kit Initial Gate from Linked-In Mailing Campaign"; flow:to_server,established; urilen:17,raw; content:"/linkendorse.html"; fast_pattern:only; http_uri; metadata:policy balanced-ips drop, policy security-ips drop, ruleset community, service http; classtype:trojan-activity; sid:26815; rev:1;)
+
+alert tcp any any -> any any ( sid:26816; msg:"tunnel"; flow:established; content:"250-localhost"; stream_reassemble:disable,both,fastpath; )
+alert tcp any any -> any any ( sid:26817; msg:"tunnel"; flow:established; content:"250-localhost"; stream_reassemble:enable,client,fastpath,noalert; )
+alert tcp any any -> any any ( sid:26818; msg:"tunnel"; flow:established; content:"250-localhost"; stream_reassemble:enable,server,fastpath,noalert; )