コード例 #1
0
class CIP_ReqForwardOpen(scapy_all.Packet):
    """Forward Open request"""
    name = "CIP_ReqForwardOpen"
    fields_desc = [
        scapy_all.BitField("priority", 0, 4),
        scapy_all.BitField("tick_time", 0, 4),
        scapy_all.ByteField("timeout_ticks", 249),
        scapy_all.LEIntField("OT_network_connection_id", 0x80000031),
        scapy_all.LEIntField("TO_network_connection_id", 0x80fe0030),
        scapy_all.LEShortField("connection_serial_number", 0x1337),
        scapy_all.LEShortField("vendor_id", 0x004d),
        scapy_all.LEIntField("originator_serial_number", 0xdeadbeef),
        scapy_all.ByteField("connection_timeout_multiplier", 0),
        scapy_all.X3BytesField("reserved", 0),
        scapy_all.LEIntField("OT_rpi", 0x007a1200),  # 8000 ms For ToCNC and ToCell
        #scapy_all.LEIntField("OT_rpi", 0x00000000),     # for j
        scapy_all.LEShortField("OT_connection_param", 0x4802), #for ToCNC and ToCell
        #scapy_all.LEShortField("OT_connection_param", 0x0400), #for j
        #scapy_all.PacketField('OT_connection_param', CIP_ConnectionParam(), CIP_ConnectionParam),
        scapy_all.LEIntField("TO_rpi", 0x007a1200),     #ToCNC and ToCell
        #scapy_all.LEIntField("TO_rpi", 0x00000000),     #for j
        scapy_all.LEShortField("TO_connection_param", 0x281a), #for ToCNC and ToCell
        #scapy_all.LEShortField("TO_connection_param", 0x0400),  #for j
        #scapy_all.PacketField('TO_connection_param', CIP_ConnectionParam(), CIP_ConnectionParam),
        scapy_all.XByteField("transport_type", 0x81),  # direction server, application object, class 3
        scapy_all.ByteField("path_wordsize", None),
        CIP_PathField("path", None, length_from=lambda p: 2 * p.path_wordsize),
    ]
コード例 #2
0
ファイル: cip.py プロジェクト: VincentLyu/scapy-cip-enip
class CIP_ReqForwardOpen(scapy_all.Packet):
    """Forward Open request"""
    name = "CIP_ReqForwardOpen"
    fields_desc = [
        scapy_all.XByteField("priority_ticktime", 0),
        scapy_all.ByteField("timeout_ticks", 249),
        scapy_all.LEIntField("OT_network_connection_id", 0x80000031),
        scapy_all.LEIntField("TO_network_connection_id", 0x80fe0030),
        scapy_all.LEShortField("connection_serial_number", 0x1337),
        scapy_all.LEShortField("vendor_id", 0x004d),
        scapy_all.LEIntField("originator_serial_number", 0xdeadbeef),
        scapy_all.ByteField("connection_timeout_multiplier", 0),
        scapy_all.XByteField("reserved1", 0),
        scapy_all.XByteField("reserved2", 0),
        scapy_all.XByteField("reserved3", 0),
        scapy_all.LEIntField("OT_rpi", 0x007a1200),  # 8000 ms
        scapy_all.LEShortField("OT_connection_param",
                               0x43f4),  # exclusive, PtP, low prio, size 500
        scapy_all.LEIntField("TO_rpi", 0x007a1200),
        scapy_all.LEShortField("TO_connection_param", 0x43f4),
        scapy_all.XByteField(
            "transport_type",
            0xa3),  # direction server, application object, class 3
        scapy_all.ByteField("path_wordsize", None),
        CIP_PathField("path", None, length_from=lambda p: 2 * p.path_wordsize),
    ]
コード例 #3
0
class ENIP_TCP(scapy_all.Packet):
    """Ethernet/IP packet over TCP"""
    name = "ENIP_TCP"
    fields_desc = [
        #add missing bits here
        scapy_all.LEShortEnumField(
            "command_id",
            None,
            {
                0x0004: "ListServices",
                0x0063: "ListIdentity",
                0x0064: "ListInterfaces",
                0x0065: "RegisterSession",
                0x0066: "UnregisterSession",
                0x006f: "SendRRData",  # Send Request/Reply data
                0x0070: "SendUnitData",
            }),
        scapy_all.LEShortField("length", None),
        scapy_all.LEIntField("session", 0),
        scapy_all.LEIntEnumField("status", 0, {0: "success"}),
        scapy_all.LELongField("sender_context", 0),
        scapy_all.LEIntField("options", 0),
    ]

    def extract_padding(self, p):
        return p[:self.length], p[self.length:]

    def post_build(self, p, pay):
        if self.length is None and pay:
            l = len(pay)
            p = p[:2] + struct.pack("<H", l) + p[4:]
        return p + pay
コード例 #4
0
class CIP_RespForwardOpen(scapy_all.Packet):
    """Forward Open response"""
    name = "CIP_RespForwardOpen"
    fields_desc = [
        scapy_all.LEIntField("OT_network_connection_id", None),
        scapy_all.LEIntField("TO_network_connection_id", None),
        scapy_all.LEShortField("connection_serial_number", None),
        scapy_all.LEShortField("vendor_id", None),
        scapy_all.LEIntField("originator_serial_number", None),
        scapy_all.LEIntField("OT_api", None),
        scapy_all.LEIntField("TO_api", None),
        scapy_all.ByteField("application_reply_size", None),
        scapy_all.XByteField("reserved", 0),
    ]
コード例 #5
0
ファイル: plc1.py プロジェクト: yuqiChen94/Active_fuzzer
class SWAT_P1_PLC(scapy_all.Packet):
    name = "SWAT_P1_PLC"
    fields_desc = [
        scapy_all.LEShortField('counter', 0),
        scapy_all.LEIntField('number', 0),
        scapy_all.LEShortField('spare', 0),
    ]
コード例 #6
0
class CIP_PortSegment(scapy_all.Packet):
    name="CIP_PortSegment"

    PORT_IDENT={
        0: "Reserved",
        1: "Back-Plane",
        15: "Extended",
    }

    fields_desc = [
        scapy_all.BitField("extended_link_address_size", 0, 1),
        scapy_all.BitEnumField("port_identifier", 0, 4, PORT_IDENT),
        scapy_all.ByteField("link_address_size", 0),
        scapy_all.ConditionalField(
            scapy_all.LEIntField("extended_port_identifier", 0),
            lambda p: p.port_identifier == 0xf  # If the Port Identifier is 15, then a 16-bit field, called the Extended Port Identifier, shall be the next part of the Port Segment
        ),
        scapy_all.ConditionalField(
                scapy_all.FieldListField("Link_Address", [],
                                         scapy_all.XByteField("",0), length_from=lambda p: p.link_address_size
                                         ),
            lambda p: p.extended_link_address_size == 0x1 # If the Port Identifier is 15, then a 16-bit field, called the Extended Port Identifier, shall be the next part of the Port Segment
        )
    ]

    def extract_padding(self, p):
        print self.__class__.__name__ + ": P=" + str(p)
        return "", p
コード例 #7
0
class ENIP_SendUnitData(scapy_all.Packet):
    """Data in ENIP header specific to the specified command"""
    name = "ENIP_SendUnitData"
    fields_desc = [
        scapy_all.LEIntField("interface_handle", 0),
        scapy_all.LEShortField("timeout", 0),
        utils.LEShortLenField("count", None, count_of="items"),
        scapy_all.PacketListField("items", [],
                                  ENIP_SendUnitData_Item,
                                  count_from=lambda p: p.count),
    ]
コード例 #8
0
ファイル: plc1.py プロジェクト: yuqiChen94/Active_fuzzer
class SWAT_P1_WRIO_AI(scapy_all.Packet):
    name = "SWAT_P1_WRIO_AI"
    fields_desc = [
        scapy_all.LEShortField('counter', 0),
        scapy_all.LEIntField('padding', 0),
        scapy_all.LEShortField('level', 0),
        scapy_all.LEShortField('flow', 0),
        scapy_all.FieldListField(
            "spare", [],
            scapy_all.LEShortField("", 0),
            length_from=lambda p: p.underlayer.length - 10),
    ]
コード例 #9
0
class CIP_ReqForwardClose(scapy_all.Packet):
    """Forward Close request"""
    name = "CIP_ReqForwardClose"
    fields_desc = [
        scapy_all.XByteField("priority_ticktime", 0),
        scapy_all.ByteField("timeout_ticks", 249),
        scapy_all.LEShortField("connection_serial_number", 0x1337),
        scapy_all.LEShortField("vendor_id", 0x004d),
        scapy_all.LEIntField("originator_serial_number", 0xdeadbeef),
        scapy_all.ByteField("path_wordsize", None),
        scapy_all.XByteField("reserved", 0),
        CIP_PathField("path", None, length_from=lambda p: 2 * p.path_wordsize),
    ]
コード例 #10
0
ファイル: enip_swat.py プロジェクト: yuqiChen94/A6-MITM
class SWAT_FIT(scapy_all.Packet):
    name = 'SWAT_FIT'
    fields_desc = [
        scapy_all.LEIntField('Pv', 0),
        scapy_all.LEIntField('Heu', 0),
        scapy_all.LEIntField('Leu', 0),
        scapy_all.LEIntField('SALL', 0),
        scapy_all.LEIntField('SAL', 0),
        scapy_all.LEIntField('SAH', 0),
        scapy_all.LEIntField('SAHH', 0),
        scapy_all.LEIntField('Totaliser', 0),
        scapy_all.BitEnumField('status', 0, 1, {0: 'unhealthy', 1: 'healthy'}),
        scapy_all.BitEnumField('Rst_Totaliser', 0, 1, {0: 'unhealthy', 1: 'healthy'}),
        scapy_all.BitEnumField('WiFi', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('control', 0, 1, {0: 'actual', 1: 'simulation'}),
        scapy_all.BitEnumField('ALL', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('AL', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('AH', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('AHH', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.X3BytesField('Spare', 0),
        scapy_all.LEIntField('Sim_Pv', 0),
        scapy_all.LEIntField('Spare2', 0)

    ]      
コード例 #11
0
ファイル: plc1.py プロジェクト: yuqiChen94/Active_fuzzer
class SWAT_P1_RIO_DI(scapy_all.Packet):
    name = 'SWAT_P1_RIO_DI'
    fields_desc = [
        scapy_all.LEShortField('counter', 0),
        scapy_all.LEIntField('padding', 0),
        scapy_all.BitEnumField('pump2_fault', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('pump2_run', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('pump2_auto', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('pump1_fault', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('pump1_run', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('pump1_auto', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('rio_wireless', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('plc_wireless', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitField('spare', 0, 6),
        scapy_all.BitEnumField('valve_close', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('valve_open', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.LEShortField('spare2', 0),
    ]
コード例 #12
0
ファイル: _PLC5.py プロジェクト: yuqiChen94/Active_fuzzer
class SWAT_P5_RIO_AI(scapy_all.Packet):
    name = "SWAT_P5_RIO_AI"
    fields_desc = [
        scapy_all.LEShortField('counter', 0),
        scapy_all.LEIntField('padding', 0),
        scapy_all.LEShortField('AIT501_pH', 0),
        scapy_all.LEShortField('AIT502_ORP', 0),
        scapy_all.LEShortField('AIT503_Water_Cond', 0),
        scapy_all.LEShortField('AIT504_Perm_Cond', 0),
        scapy_all.LEShortField('FIT501_Feed_Flow', 0),
        scapy_all.LEShortField('FIT502_Perm_Flow', 0),
        scapy_all.LEShortField('FIT503_Con_Flow', 0),
        scapy_all.LEShortField('FIT504_Recirculation_Flow', 0),
        scapy_all.LEShortField('PIT501_RO_Pressure', 0),
        scapy_all.LEShortField('PIT502_Perm_Pressure', 0),
        scapy_all.LEShortField('PIT503_Con_Pressure', 0),
        scapy_all.LEShortField('spare', 0),
    ]
コード例 #13
0
class SWAT_P4_RIO_AI(scapy_all.Packet):
    name = "SWAT_P4_RIO_AI"
    fields_desc = [
        scapy_all.LEShortField('counter', 0),
        scapy_all.LEIntField('padding', 0),
        scapy_all.LEShortField('LIT401_Level', 0),
        scapy_all.LEShortField('AIT401_Hardness', 0),
        scapy_all.LEShortField('FIT401_Flow', 0),
        scapy_all.LEShortField('AIT402_ORP', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
    ]
コード例 #14
0
ファイル: _PLC3.py プロジェクト: yuqiChen94/Active_fuzzer
class SWAT_P3_RIO_AI(scapy_all.Packet):
    name = "SWAT_P3_RIO_AI"
    fields_desc = [
        scapy_all.LEShortField('counter', 0),
        scapy_all.LEIntField('padding', 0),
        scapy_all.LEShortField('LIT301_Level', 0),
        scapy_all.LEShortField('FIT301_Flow', 0),
        scapy_all.LEShortField('DPIT301_Differential_pressure', 0),
        scapy_all.LEShortField('AIT301_pH', 0),
        scapy_all.LEShortField('AIT302_ORP', 0),
        scapy_all.LEShortField('AIT303_Cond', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
    ]
コード例 #15
0
ファイル: _PLC6.py プロジェクト: yuqiChen94/Active_fuzzer
class SWAT_P6_RIO_AI(scapy_all.Packet):
    name = "SWAT_P6_RIO_AI"
    fields_desc = [
        scapy_all.LEShortField('counter', 0),
        scapy_all.LEIntField('padding', 0),
        scapy_all.LEShortField('FIT601_Flow', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
    ]
コード例 #16
0
class SWAT_P2_RIO_DI(scapy_all.Packet):
    name = "SWAT_P2_RIO_DI" 
    fields_desc =[
        scapy_all.LEShortField('counter', 0),
        scapy_all.LEIntField('padding', 0),


        scapy_all.BitEnumField('P202_Fault', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P202_Run', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P202_Auto', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P201_Fault', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P201_Run', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P201_Auto', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('RIO2_Wifi', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('PLC2_Wifi', 0, 1, {0: 'disable', 1: 'enable'}),

        scapy_all.BitEnumField('P205_Run', 0, 1, {0: 'disable', 1: 'enable'}),
		scapy_all.BitEnumField('P205_Auto', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P204_Fault', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P204_Run', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P204_Auto', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P203_Fault', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P203_Run', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P203_Auto', 0, 1, {0: 'disable', 1: 'enable'}),

		scapy_all.BitEnumField('P208_Auto', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P207_Fault', 0, 1, {0: 'disable', 1: 'enable'}),
    	scapy_all.BitEnumField('P207_Run', 0, 1, {0: 'disable', 1: 'enable'}),
		scapy_all.BitEnumField('P207_Auto', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P206_Fault', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P206_Run', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P206_Auto', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('P205_Fault', 0, 1, {0: 'disable', 1: 'enable'}),
        
        scapy_all.BitEnumField('spare', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('LS203_Low', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('LS202_Low', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('LS201_Low', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('MV201_Close', 0, 1, {0: 'disable', 1: 'enable'}), 
        scapy_all.BitEnumField('MV201_Open', 0, 1, {0: 'disable', 1: 'enable'}),  
        scapy_all.BitEnumField('P208_Fault', 0, 1, {0: 'disable', 1: 'enable'}),
    	scapy_all.BitEnumField('P208_Run', 0, 1, {0: 'disable', 1: 'enable'}),
       
    ]
コード例 #17
0
class SWAT_P2_RIO_AI(scapy_all.Packet):
    name = "SWAT_P2_RIO_AI"
    fields_desc = [
        scapy_all.LEShortField('counter', 0),
        scapy_all.LEIntField('padding', 0),
        scapy_all.LEShortField('FIT201_Flow', 0),
        scapy_all.LEShortField('AIT201_Conductivity', 0),
        scapy_all.LEShortField('AIT202_pH', 0),
        scapy_all.LEShortField('AIT203_ORP', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
        scapy_all.LEShortField('spare', 0),
      
    ]
コード例 #18
0
class ENIP_PACKET(scapy_all.Packet):
    """Ethernet/IP packet over TCP"""
    name = "ENIP_PACKET"
    fields_desc = [
        scapy_all.LEShortEnumField("command_id", None, ENCAPSULATION_COMMANDS),
        scapy_all.LEShortField("length", None),
        utils.XLEIntField("session", 0),
        scapy_all.LEIntEnumField("status", 0, {0: "success"}),
        scapy_all.LELongField("sender_context", 0),
        scapy_all.LEIntField("options", 0),
    ]

    def extract_padding(self, p):
        return p[:self.length], p[self.length:]

    def post_build(self, p, pay):
        if self.length is None and pay:
            l = len(pay)
            p = p[:2] + struct.pack("<H", l) + p[4:]
        return p + pay
コード例 #19
0
ファイル: enip_swat.py プロジェクト: yuqiChen94/A6-MITM
class SWAT_P(scapy_all.Packet):
    name = 'SWAT_P'
    fields_desc = [
        scapy_all.ByteEnumField('cmd', 0, {1: 'closed', 2: 'open'}),
        scapy_all.ByteField('spare2', 0),
        scapy_all.ByteEnumField('status', 0, {1: 'closed', 2: 'open'}),
        scapy_all.ByteField('spare3', 0),
        scapy_all.LEIntField('RunMin', 0),
        scapy_all.LEIntField('Total_RunMin', 0),
        scapy_all.LEIntField('RunHr', 0),
        scapy_all.LEIntField('Total_RunHr', 0),
        scapy_all.LEIntField('Permissive', 0),
        scapy_all.LEIntField('Shutdown', 0),
        scapy_all.LEIntField('SD', 0),
        scapy_all.BitEnumField('Avl', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('Fault', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('Auto', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('Remote', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('FTS', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('FTR', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('Reset_RunHr', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('Reset', 0, 1, {0: 'disable', 1: 'enable'}),
    ] 
コード例 #20
0
class ENIP_UDP_SequencedAddress(scapy_all.Packet):
    name = "ENIP_UDP_SequencedAddress"
    fields_desc = [
        scapy_all.LEIntField("connection_id", 0),
        scapy_all.LEIntField("sequence", 0),
    ]
コード例 #21
0
class SWAT_P4_RIO_DI(scapy_all.Packet):
    name = 'SWAT_P4_RIO_DI'
    fields_desc = [
        scapy_all.LEShortField('counter', 0),
        scapy_all.LEIntField('padding', 0),
        scapy_all.BitEnumField('P402_Fault', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P402_Run', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P402_Auto', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P401_Fault', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P401_Run', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P401_Auto', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('RIO4_Wifi', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('PLC4_Wifi', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('UV401_Run', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('UV401_Auto', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P404_Fault', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P404_Run', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P404_Auto', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P403_Fault', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P403_Run', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P403_Auto', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('LS401_Low', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('UV401_Fault', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
    ]
コード例 #22
0
ファイル: enip_swat.py プロジェクト: yuqiChen94/A6-MITM
class SWAT_P1_ALL(scapy_all.Packet):
    name = 'SWAT_P1_ALL'
    fields_desc = [
        scapy_all.LEIntField('FIT101_Pv', 0),
        scapy_all.LEIntField('LIT101_Pv', 0),
        scapy_all.ByteField('spare3', 0),
        scapy_all.ByteField('spare4', 0),
        scapy_all.ByteEnumField('P101_cmd', 0, {1: 'off', 2: 'on'}),
        scapy_all.ByteField('spare5', 0),
        scapy_all.ByteEnumField('P102_cmd', 0, {1: 'off', 2: 'on'}),
        scapy_all.ByteField('spare6', 0),
        scapy_all.ByteField('spare7', 0),
        scapy_all.ByteField('spare8', 0),
        scapy_all.BitEnumField('FIT101_status', 0, 1, {0: 'unhealthy', 1: 'healthy'}),
        scapy_all.BitEnumField('FIT101_Rst_Totaliser', 0, 1, {0: 'unhealthy', 1: 'healthy'}),
        scapy_all.BitEnumField('FIT101_WiFi', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('FIT101_control', 0, 1, {0: 'actual', 1: 'simulation'}),
        scapy_all.BitEnumField('FIT101_ALL', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('FIT101_AL', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('FIT101_AH', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('FIT101_AHH', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.ByteField('spare9', 0),
        scapy_all.LEIntField('FIT101_H', 0),
        scapy_all.LEIntField('FIT101_HH', 0),
        scapy_all.LEIntField('FIT101_L', 0),
        scapy_all.LEIntField('FIT101_LL', 0),
        scapy_all.BitEnumField('LIT101_spare', 0, 1, {}),
        scapy_all.BitEnumField('LIT101_control', 0, 1, {0: 'actual', 1: 'simulation'}),
        scapy_all.BitEnumField('LIT101_status', 0, 1, {0: 'unhealthy', 1: 'healthy'}),
        scapy_all.BitEnumField('LIT101_WiFi', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('LIT101_ALL', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('LIT101_AL', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('LIT101_AH', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('LIT101_AHH', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.LEIntField('LIT101_SALL', 0),
        scapy_all.LEIntField('LIT101_SAL', 0),
        scapy_all.LEIntField('LIT101_SAH', 0),
        scapy_all.LEIntField('LIT101_SAHH', 0),
        scapy_all.BitEnumField('spare10', 0, 1, {}),
        scapy_all.BitEnumField('spare11', 0, 1, {}),
        scapy_all.BitEnumField('spare12', 0, 1, {}),
        scapy_all.BitEnumField('MV101_Avl', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('MV101_FTC', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('MV101_FTO', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('MV101_Auto', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.BitEnumField('MV101_Reset', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.ByteEnumField('MV101_status', 0, {1: 'off', 2: 'on'}),
        scapy_all.ByteField('spare13', 0),
        scapy_all.ByteField('spare14', 0),
        scapy_all.ByteEnumField('P101_status', 0, {1: 'off', 2: 'on'}),
        scapy_all.X3BytesField('Spare', 0),
        scapy_all.LEIntField('spare15', 0),
        scapy_all.LEIntField('spare16', 0),
        scapy_all.LEIntField('spare17', 0),
        scapy_all.LEIntField('spare18', 0),
        scapy_all.LEIntField('P101_RunHr', 0),
        scapy_all.LEIntField('P101_RunHr2', 0),
        scapy_all.ByteField('spare19', 0),
        scapy_all.ByteField('spare20', 0),
        scapy_all.LEIntField('P101_Permissive', 0),
        scapy_all.LEIntField('spare21', 0)
        # scapy_all.ByteField('spare4', 0),
        # scapy_all.LEIntField('spare', 0),
        # scapy_all.LEIntField('LIT101_Sim_Pv', 0),
        # scapy_all.ByteField('spare4', 0),
        # scapy_all.ByteField('spare5', 0),
        # scapy_all.LEIntField('P102_RunHr', 0),
        # scapy_all.LEIntField('P102_RunHr', 0),
        # scapy_all.ByteField('spare4', 0),
        # scapy_all.ByteField('spare5', 0),
        # scapy_all.LEIntField('P102_Permissive', 0),
        # scapy_all.LEIntField('spare', 0)
    ]  
コード例 #23
0
class ENIP_ConnectionAddress(scapy_all.Packet):
    name = "ENIP_ConnectionAddress"
    fields_desc = [scapy_all.LEIntField("connection_id", 0)]
コード例 #24
0
ファイル: _PLC6.py プロジェクト: yuqiChen94/Active_fuzzer
class SWAT_P6_RIO_DI(scapy_all.Packet):
    name = 'SWAT_P6_RIO_DI'
    fields_desc = [
        scapy_all.LEShortField('counter', 0),
        scapy_all.LEIntField('padding', 0),
        scapy_all.BitEnumField('P602_Fault', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P602_Run', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P602_Auto', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P601_Fault', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P601_Run', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P601_Auto', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('RIO6_Wifi', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('PLC6_Wifi', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('LS603_Low', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('LS602_High', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('LS602_Low', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('LS601_High', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('LS601_Low', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P603_Fault', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P603_Run', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P603_Auto', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('LS603_High', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
    ]
コード例 #25
0
class CPF_SequencedAddressItem(scapy_all.Packet):
    name = "CPF_SequencedAddressItem"
    fields_desc = [
        scapy_all.LEIntField("connection_id", 0),
        scapy_all.LEIntField("sequence_number", 0),
    ]
コード例 #26
0
ファイル: _PLC5.py プロジェクト: yuqiChen94/Active_fuzzer
class SWAT_P5_RIO_DI(scapy_all.Packet):
    name = 'SWAT_P5_RIO_DI'
    fields_desc = [
        scapy_all.LEShortField('counter', 0),
        scapy_all.LEIntField('padding', 0),
        scapy_all.BitEnumField('P502_Fault', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P502_Run', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P502_Auto', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P501_Fault', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P501_Run', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('P501_Auto', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('RIO5_Wifi', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('PLC5_Wifi', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('MV504_Close', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('MV504_Open', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('MV503_Close', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('MV503_Open', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('MV502_Close', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('MV502_Open', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('MV501_Close', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('MV501_Open', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        #scapy_all.BitEnumField('VSD502_Start', 0, 1, {0: 'disable', 1: 'enable'}),
        #scapy_all.BitEnumField('VSD501_Start', 0, 1, {0: 'disable', 1: 'enable'}),
        scapy_all.LEShortField('VSD502_Start', 0),  #VSD is pump
        scapy_all.LEShortField('VSD501_Start', 0),
        scapy_all.BitEnumField('PSH501_High', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('PSL501_Low', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
        scapy_all.BitEnumField('spare', 0, 1, {
            0: 'disable',
            1: 'enable'
        }),
    ]