Benutzer-Werkzeuge

Webseiten-Werkzeuge


ne:scapy:ipv6_ra

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

ne:scapy:ipv6_ra [2018/03/01 14:45] – angelegt adminne:scapy:ipv6_ra [2018/11/23 07:44] (aktuell) admin
Zeile 3: Zeile 3:
 [[https://tools.ietf.org/html/rfc4861]] [[https://tools.ietf.org/html/rfc4861]]
 <code python> <code python>
-head = IPv6()     # IPv6-Header +head = IPv6()                      # IPv6-Header 
-head.dst = "ff02::1"   # Destination-Adresse ist die All Nodes Multicast Address +head.dst = "ff02::1"               # Destination-Adresse ist die All Nodes Multicast Address 
-icmp6 = ICMPv6ND_RA()    # ICMPv6-Header für Neighbor Discovery Router Advertisement +icmp6 = ICMPv6ND_RA()              # ICMPv6-Header für Neighbor Discovery Router Advertisement
-o_pref = ICMPv6NDOptPrefixInfo()  # ICMPv6-Option Prefix Information +
-o_pref.prefix = '2001:db8:1::'   # Präfix wie in RA vom regulären Router +
-o_pref.prefixlen = 64   # Präfix-Länge (in Bit) setzen+
  
-pkt = (head/icmp6/o_pref)         # Zusammensetzen des Pakets +o_pref = ICMPv6NDOptPrefixInfo()   # ICMPv6-Option: Prefix Information 
-send(pkt)   # Einmaliges Senden des Pakets+o_pref.prefix = '2001:db8:1::'     # Präfix wie in RA vom regulären Router 
 +o_pref.prefixlen = 64              # Präfix-Länge (in Bit) setzen 
 +o_pref.validlifetime = 7200        # Valid-Lifetime 2h 
 +o_pref.preferredlifetime = 1800    # Prefered-Lifetime 30min 
 + 
 +o_route = ICMPv6NDOptRouteInfo()   # ICMPv6-Option: Route Information 
 +o_route.prefix ='::'               # Default Route 
 +o_route.plen = 0                   # Präfix-Länge (in Bit) setzen 
 +o_route.rtlifetime = 1800          # Same value as the Prefered-Lifetime of the Router 
 + 
 +o_rdns = ICMPv6NDOptRDNSS()        # ICMPv6-Option: Recursive DNS Server 
 +o_rdns.dns = ['2001:db8:1::1'    # List of DNS Server Addresses 
 +o_rdns.lifetime = 1800             # Same value as the Prefered-Lifetime of the Router 
 + 
 +o_mac = ICMPv6NDOptSrcLLAddr()     # ICMPv6-Option: Source Link Layer Address 
 +o_mac.lladdr = '01:02:03:04:05:06' # MAC address 
 + 
 +# Zusammensetzen des Pakets 
 +pkt = (head/icmp6/o_pref/o_route/o_rdns/o_mac) 
 + 
 +send(pkt)    # Einmaliges Senden des Pakets
 </code> </code>
  
 weitere mögliche Optionen: weitere mögliche Optionen:
 <code python> <code python>
-o_source = ICMPv6NDOptSrcLLAddr() # ICMPv6-Option Source Link Layer Address (kann entfallen) 
-o_source.lladdr = "xx:xx:xx:xx:xx:xx" 
- 
 o_mtu = ICMPv6NDOptMTU()          # ICMPv6-Option MTU (kann entfallen) o_mtu = ICMPv6NDOptMTU()          # ICMPv6-Option MTU (kann entfallen)
 </code> </code>
ne/scapy/ipv6_ra.1519915525.txt.gz · Zuletzt geändert: 2018/03/01 14:45 von admin