Benutzer-Werkzeuge

Webseiten-Werkzeuge


ne:scapy

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
ne:scapy [2020/01/22 12:02] – [Paketgenerierung] adminne:scapy [2023/08/28 13:55] (aktuell) – [Paketgenerierung] admin
Zeile 1: Zeile 1:
-====== Einführung ======+====== Scapy ====== 
 +===== Einführung ===== 
  
   * Einführungsvortrag von Tobias Rosenau: {{:ne:scapy_einführung.pdf|Scapy Einführung}}   * Einführungsvortrag von Tobias Rosenau: {{:ne:scapy_einführung.pdf|Scapy Einführung}}
 +  * https://0xbharath.github.io/art-of-packet-crafting-with-scapy/index.html - **The Art of Packet Crafting with Scapy**
   * https://thepacketgeek.com/series/building-network-tools-with-scapy/   * https://thepacketgeek.com/series/building-network-tools-with-scapy/
   * [[http://dirk-loss.de/scapy/Scapy_pyCologne_2010-01-13_DirkLoss_v1.1.pdf|Python user group Präsentation von Dirk Loss]]   * [[http://dirk-loss.de/scapy/Scapy_pyCologne_2010-01-13_DirkLoss_v1.1.pdf|Python user group Präsentation von Dirk Loss]]
   * Einführung auf Packetlevel.ch: http://www.packetlevel.ch/html/scapy/scapy.html    * Einführung auf Packetlevel.ch: http://www.packetlevel.ch/html/scapy/scapy.html 
   * [[http://media.packetlife.net/media/library/36/scapy.pdf|Scapy Cheat Sheet]]   * [[http://media.packetlife.net/media/library/36/scapy.pdf|Scapy Cheat Sheet]]
 +  * [[https://www.idsv6.de/Downloads/IPv6PacketCreationWithScapy.pdf|IPv6 Packet Creation With Scapy]]
 +
 +  * [[https://www.youtube.com/watch?v=YKxKnVE5FaE&list=PLhfrWIlLOoKOc3z424rgsej5P5AP8yNKR|Python Network Hacking with Kali Linux and Scapy]]
 +
 +
 +===== Scapy benutzen =====
 +
  
   * Paket-Captures lesen und schreiben: [[ne:scapy_read_write_pcap|read/write *.pcap's]]   * Paket-Captures lesen und schreiben: [[ne:scapy_read_write_pcap|read/write *.pcap's]]
   * Pakete schnell versenden: [[scapy - fastest way to send packets]]   * Pakete schnell versenden: [[scapy - fastest way to send packets]]
  
-**Overview:** +**Übersicht:** 
-''ls()'' lists all available protocols and protocol options+''ls()'' listet alle verfügbaren Protokolle und Protokoll-Optionen,\\ 
-''lsc()'' shows available scapy commands.+''lsc()'' zeigt alle verfügbaren Scapy Kommandos. 
 + 
 +Man kann ''ls()'' auch auf ein generiertes Paket anwenden und zeigt die aktuellen sowie die Default-Werte der einzelnen Felder an: 
 +<code python> 
 + pkt = Ether()/IP()/UDP() 
 + ls(pkt) 
 +</code>
  
 The ''summary()'' method provides a quick look at the packet’s layers: The ''summary()'' method provides a quick look at the packet’s layers:
Zeile 21: Zeile 37:
 The ''show()'' and ''show2()'' methods provide a deeper look into the packet structure: The ''show()'' and ''show2()'' methods provide a deeper look into the packet structure:
 <code python> <code python>
- pkt.show()+ pkt.show()  # hierarchische Ansicht 
 + pkt.show2() # fügt auch dynamisch berechnete Werte ein (Prüfsummen, etc.)
 </code> </code>
  
Zeile 40: Zeile 57:
 send(p) # sends at IP level send(p) # sends at IP level
 sendp(Ether()/p) # sends at Ethernet level sendp(Ether()/p) # sends at Ethernet level
 +</code>
 +
 +Auf die Felder der einzelnen Layer kann auch direkt zugegriffen werden:
 +<code Python>
 +>>> p=IP()/UDP()
 +>>> p[UDP].sport = 123
 </code> </code>
  
   * [[ne:scapy:ipv6_ra|IPv6 Router Advertisements]]   * [[ne:scapy:ipv6_ra|IPv6 Router Advertisements]]
   * [[ne:scapy:ipv6_na|IPv6 Neighbor Solicitations & Advertisements]]   * [[ne:scapy:ipv6_na|IPv6 Neighbor Solicitations & Advertisements]]
 +  * https://github.com/mrizvic/scapy
 +
 +=== Scapy-GUI ===
 +  * https://github.com/albfan/scapy-gui-ipv6/blob/master/gui.py - **exportierter Code von Google**
 +  * https://github.com/Mellanox/scapy-ui
 +
  
 ===== Generieren von Tunnelpaketen ===== ===== Generieren von Tunnelpaketen =====
Zeile 58: Zeile 87:
   * IPsec ([[http://article.gmane.org/gmane.comp.security.scapy.general/4340|nicht geplant]])   * IPsec ([[http://article.gmane.org/gmane.comp.security.scapy.general/4340|nicht geplant]])
   * 6LoWPAN ([[http://article.gmane.org/gmane.comp.security.scapy.general/4299|projekt]])   * 6LoWPAN ([[http://article.gmane.org/gmane.comp.security.scapy.general/4299|projekt]])
 +  * [[ne:scapy:new_protocol|Erstellung eines eigenen Protokoll-Layers]]
  
 ===== Fragmentierung ===== ===== Fragmentierung =====
Zeile 63: Zeile 93:
   * [[ne:scapy_fragment_v6-packets|IPv6-Pakete fragmentieren]]   * [[ne:scapy_fragment_v6-packets|IPv6-Pakete fragmentieren]]
  
 +===== Dokumentation =====
 +
 +  * [[https://scapy.readthedocs.io/en/latest/troubleshooting.html|Troubleshooting FAQ]]
 +  * [[https://scapy.readthedocs.io/en/latest/routing.html|Routing & Netzwerk-Konfiguration]]
 +
 +
 +===== WLAN =====
 +
 +  * http://www.cs.toronto.edu/~arnold/427/18s/427_18S/indepth/scapy_wifi/scapy_tut.html
 +  * https://www.4armed.com/blog/forging-wifi-beacon-frames-using-scapy/
 +  * https://stackoverflow.com/questions/10818661/scapy-retrieving-rssi-from-wifi-packets
 ===== Verschiedenes ===== ===== Verschiedenes =====
 +
   * Das Capturing/Decoding ist langsam ([[http://article.gmane.org/gmane.comp.security.scapy.general/4319|cf]]) bei Problemen kann zusätzlich [[http://code.google.com/p/pypcap/|pypcap]] benutzt werden ([[http://article.gmane.org/gmane.comp.security.scapy.general/4421|cf]])   * Das Capturing/Decoding ist langsam ([[http://article.gmane.org/gmane.comp.security.scapy.general/4319|cf]]) bei Problemen kann zusätzlich [[http://code.google.com/p/pypcap/|pypcap]] benutzt werden ([[http://article.gmane.org/gmane.comp.security.scapy.general/4421|cf]])
 +  * Unter Windows sind möglicherweise nicht alle Interfaces nutzbar ([[https://github.com/secdev/scapy/issues/1542|nur die über pcap angebotenen]]): <code python>
 +winList = get_windows_if_list()
 +intfList = get_if_list()
 +
 +# Pull guids and names from the windows list
 +guidToNameDict = { e["guid"]: e["name"] for e in winList}
 +
 +# Extract the guids from the interface list
 +guidsFromIntfList = [(e.split("_"))[1] for e in intfList]
 +
 +# Using the interface list of guids, pull the names from the
 +# Windows map of guids to names
 +namesAllowedList = [guidToNameDict .get( e ) for e in guidsFromIntfList]
 +</code>
   * Für feste und wiederkehrende Test-Abläufe ist [[https://www.secdev.org/projects/scapytain/|scapytain]] praktisch. Es erlaubt die Definition vieler Tests (mit ja/nein-Resultaten) mit Gruppierungen und Abhängigkeiten.   * Für feste und wiederkehrende Test-Abläufe ist [[https://www.secdev.org/projects/scapytain/|scapytain]] praktisch. Es erlaubt die Definition vieler Tests (mit ja/nein-Resultaten) mit Gruppierungen und Abhängigkeiten.
   * anderes penetration test tool auf Scapy-Basis: http://inguma.eu/projects/inguma   * anderes penetration test tool auf Scapy-Basis: http://inguma.eu/projects/inguma
Zeile 81: Zeile 137:
   * https://changecheng.github.io/technology/2017/01/15/how-to-install-scapy-on-macos-sierra.html   * https://changecheng.github.io/technology/2017/01/15/how-to-install-scapy-on-macos-sierra.html
   * https://stackoverflow.com/questions/46602880/importerror-no-module-named-scapy-all   * https://stackoverflow.com/questions/46602880/importerror-no-module-named-scapy-all
 +  * https://hub.docker.com/r/travelping/scapy - **Scapy via Docker**
  
ne/scapy.1579694546.txt.gz · Zuletzt geändert: 2020/01/22 12:02 von admin