scapy.contrib.hicp

HICP

Support for HICP (Host IP Control Protocol).

This protocol is used by HMS Anybus software for device discovery and configuration.

Note : As the specification is not public, this layer was built based on the Wireshark dissector and HMS’s HICP DLL. It was tested with a Anybus X-gateway device. Therefore, this implementation may differ from what is written in the standard.

scapy.contrib.hicp.FROM_MACFIELD(x)[source]
class scapy.contrib.hicp.HICP(_pkt, /, *, hicp_command=b'')[source]

Bases: Packet

aliastypes
do_dissect(s)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          HICP COMMAND         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                            Fig. HICP                             
HICP fields

hicp_command

StrField

b''

payload_guess

Possible sublayers: HICPConfigure, HICPInvalidConfiguration, HICPInvalidPassword, HICPModuleScanResponse, HICPModuleScan, HICPReconfigured, HICPWink

post_build(p, pay)[source]
class scapy.contrib.hicp.HICPConfigure(_pkt, /, *, target='ff:ff:ff:ff:ff:ff', password=b'', new_password=b'', ip_address='255.255.255.255', subnet_mask='255.255.255.0', gateway_address='0.0.0.0', dhcp=b'OFF', hostname=b'', dns1='0.0.0.0', dns2='0.0.0.0', padding=0)[source]

Bases: Packet

aliastypes
do_dissect(s)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             TARGET                            |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |            PASSWORD           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          NEW PASSWORD         |           IP ADDRESS          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |          SUBNET MASK          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |        GATEWAY ADDRESS        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |              DHCP             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            HOSTNAME           |              DNS1             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |              DNS2             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |    PADDING    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                        Fig. HICPConfigure                        
HICPConfigure fields

target

MACField

'ff:ff:ff:ff:ff:ff'

password

StrField

b''

new_password

StrField

b''

ip_address

IPField

'255.255.255.255'

subnet_mask

IPField

'255.255.255.0'

gateway_address

IPField

'0.0.0.0'

dhcp

StrField

b'OFF'

hostname

StrField

b''

dns1

IPField

'0.0.0.0'

dns2

IPField

'0.0.0.0'

padding

ByteField

0

post_build(p, pay)[source]
class scapy.contrib.hicp.HICPInvalidConfiguration(_pkt, /, *, source='ff:ff:ff:ff:ff:ff')[source]

Bases: Packet

aliastypes
do_dissect(s)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             SOURCE                            |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                  Fig. HICPInvalidConfiguration                   
HICPInvalidConfiguration fields

source

MACField

'ff:ff:ff:ff:ff:ff'

post_build(p, pay)[source]
class scapy.contrib.hicp.HICPInvalidPassword(_pkt, /, *, source='ff:ff:ff:ff:ff:ff')[source]

Bases: Packet

aliastypes
do_dissect(s)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             SOURCE                            |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                     Fig. HICPInvalidPassword                     
HICPInvalidPassword fields

source

MACField

'ff:ff:ff:ff:ff:ff'

post_build(p, pay)[source]
class scapy.contrib.hicp.HICPModuleScan(_pkt, /, *, hicp_command=b'Module scan', padding=0)[source]

Bases: Packet

aliastypes
do_dissect(s)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          HICP COMMAND         |    PADDING    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                       Fig. HICPModuleScan                        
HICPModuleScan fields

hicp_command

StrField

b'Module scan'

padding

ByteField

0

post_build(p, pay)[source]
class scapy.contrib.hicp.HICPModuleScanResponse(_pkt, /, *, protocol_version=b'1.00', fieldbus_type=b'', module_version=b'', mac_address='ff:ff:ff:ff:ff:ff', ip_address='255.255.255.255', subnet_mask='255.255.255.0', gateway_address='0.0.0.0', dhcp=b'OFF', password=b'OFF', hostname=b'', dns1='0.0.0.0', dns2='0.0.0.0', padding=0)[source]

Bases: Packet

aliastypes
do_dissect(s)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|        PROTOCOL VERSION       |         FIELDBUS TYPE         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         MODULE VERSION        |          MAC ADDRESS          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           IP ADDRESS                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          SUBNET MASK                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        GATEWAY ADDRESS                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              DHCP             |            PASSWORD           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            HOSTNAME           |              DNS1             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |              DNS2             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |    PADDING    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. HICPModuleScanResponse                    
HICPModuleScanResponse fields

protocol_version

StrField

b'1.00'

fieldbus_type

StrField

b''

module_version

StrField

b''

mac_address

MACField

'ff:ff:ff:ff:ff:ff'

ip_address

IPField

'255.255.255.255'

subnet_mask

IPField

'255.255.255.0'

gateway_address

IPField

'0.0.0.0'

dhcp

StrField

b'OFF'

password

StrField

b'OFF'

hostname

StrField

b''

dns1

IPField

'0.0.0.0'

dns2

IPField

'0.0.0.0'

padding

ByteField

0

post_build(p, pay)[source]
class scapy.contrib.hicp.HICPReconfigured(_pkt, /, *, source='ff:ff:ff:ff:ff:ff')[source]

Bases: Packet

aliastypes
do_dissect(s)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             SOURCE                            |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                      Fig. HICPReconfigured                       
HICPReconfigured fields

source

MACField

'ff:ff:ff:ff:ff:ff'

post_build(p, pay)[source]
class scapy.contrib.hicp.HICPWink(_pkt, /, *, target='ff:ff:ff:ff:ff:ff', padding=0)[source]

Bases: Packet

aliastypes
do_dissect(s)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             TARGET                            |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |    PADDING    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Fig. HICPWink                           
HICPWink fields

target

MACField

'ff:ff:ff:ff:ff:ff'

padding

ByteField

0

post_build(p, pay)[source]
scapy.contrib.hicp.TO_MACFIELD(x)[source]