|
|
|
|
@ -29,6 +29,7 @@ use super::parser::{
|
|
|
|
|
CIP_MULTIPLE_SERVICE,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
use crate::core::{STREAM_TOCLIENT, STREAM_TOSERVER};
|
|
|
|
|
use crate::detect::uint::{
|
|
|
|
|
detect_match_uint, detect_parse_uint_enum, DetectUintData, SCDetectU16Free, SCDetectU16Match,
|
|
|
|
|
SCDetectU16Parse, SCDetectU32Free, SCDetectU32Match, SCDetectU32Parse, SCDetectU8Free,
|
|
|
|
|
@ -1347,8 +1348,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_CIPSERVICE_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"cip\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.capabilities\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1363,8 +1363,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_CAPABILITIES_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.capabilities\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.cip_attribute\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1379,8 +1378,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_CIP_ATTRIBUTE_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.cip_attribute\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.cip_class\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1395,8 +1393,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_CIP_CLASS_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.cip_class\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.vendor_id\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1411,8 +1408,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_VENDOR_ID_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.vendor_id\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.status\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1427,8 +1423,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_STATUS_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.status\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.state\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1443,8 +1438,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_STATE_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.state\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.serial\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1459,8 +1453,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_SERIAL_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.serial\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.revision\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1475,8 +1468,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_REVISION_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.revision\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.protocol_version\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1491,8 +1483,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_PROTOCOL_VERSION_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.protocol_version\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.product_code\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1507,8 +1498,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_PRODUCT_CODE_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.product_code\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip_command\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1523,8 +1513,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_COMMAND_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.command\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.identity_status\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1539,8 +1528,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_IDENTITY_STATUS_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.identity_status\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.device_type\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1555,8 +1543,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_DEVICE_TYPE_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.device_type\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.cip_status\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1571,8 +1558,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_CIP_STATUS_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.cip_status\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.cip_instance\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1587,8 +1573,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_CIP_INSTANCE_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.cip_instance\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SCSigTableAppLiteElmt {
|
|
|
|
|
name: b"enip.cip_extendedstatus\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
@ -1604,8 +1589,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
G_ENIP_CIP_EXTENDEDSTATUS_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
b"enip.cip_extendedstatus\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
);
|
|
|
|
|
let kw = SigTableElmtStickyBuffer {
|
|
|
|
|
name: String::from("enip.product_name"),
|
|
|
|
|
@ -1618,8 +1602,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
b"enip.product_name\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
b"ENIP product name\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
product_name_get_data,
|
|
|
|
|
);
|
|
|
|
|
let kw = SigTableElmtStickyBuffer {
|
|
|
|
|
@ -1633,8 +1616,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
b"enip.service_name\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
b"ENIP service name\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|
service_name_get_data,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|