summaryrefslogtreecommitdiff
path: root/scapy/capture.py
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2024-09-17 15:32:53 +0200
committerjerome <jerome@xlinfo.fr>2024-09-17 15:32:53 +0200
commit550497e907868ac0249a18eef2a0fb7f5bcd9ed8 (patch)
tree5690fce051444c9897a2bcf610d174b20dfe6718 /scapy/capture.py
parentcdb4e2f17863038e28ab063415f59cc4d94491d6 (diff)
downloadpython-550497e907868ac0249a18eef2a0fb7f5bcd9ed8.tar.gz
python-550497e907868ac0249a18eef2a0fb7f5bcd9ed8.zip
scapy
Diffstat (limited to 'scapy/capture.py')
-rw-r--r--scapy/capture.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/scapy/capture.py b/scapy/capture.py
new file mode 100644
index 0000000..64393fc
--- /dev/null
+++ b/scapy/capture.py
@@ -0,0 +1,7 @@
+from scapy.all import *
+
+# fonction callback
+def packet_capture(pkt):
+ print(pkt[IP].src, "->",pkt[IP].dst)
+
+sniff(prn=packet_capture, filter="ip", count=10)