otupy.types.targets.ipv6_net.IPv6Net
- class IPv6Net(ipv6_net=None, prefix=None)
Bases:
objectOpenC2 IPv6 Address Range
IPv6 Address Range as defined in Sec. 3.4.1.9.
The Standard is not clear on this part. The IPv6Net Target is defined as “Array /ipv6-net” (where ipv6-net –lowercase!– is never defined!) However, the json serialization requirements explicitely define:
Array /ipv6-net: JSON string containing the text representation of an IPv6 address range as specified in [RFC4291], Section 2.3.
According to this definition, I assume a single network address should be managed. Extension to an array of IP network addresses is rather straightforward by using a list for ipv6_net attribute. Note that I have to keep both the string representation of the network address as well as the
IPv6Networkobject to easily manage the code and to automate the creation of the dictionary.Methods
Returns address part only (no prefix)
Returns prefix only
- __init__(ipv6_net=None, prefix=None)
Initialize IPv6 Address Range
Initialize
IPv6Netwith IPv6 address and prefix. If no IPv6 address is given, initialize to null address. If no prefix is given, assume /128 (IPv6 address only).- Parameters:
ipv6_net – IPv6 Network Address.
prefix – IPv6 Network Adress Prefix.
- addr()
Returns address part only (no prefix)
- prefix()
Returns prefix only