Skip to content

Commit 7d80b7a

Browse files
committed
Update packet_sniffer.py
1 parent 60c7005 commit 7d80b7a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packet_sniffer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@
3131
import sys
3232
import time
3333
import platform
34+
import tempfile
3435
from collections import Counter, defaultdict
3536

37+
# Configure Scapy to use a temp directory for cache to avoid permission issues
38+
os.environ['SCAPY_TEMP'] = tempfile.gettempdir()
39+
os.environ['SCAPY_CACHE_DIR'] = os.path.join(tempfile.gettempdir(), 'scapy_cache')
40+
3641
try:
3742
from scapy.all import (
3843
sniff, wrpcap, IP, TCP, UDP, ICMP, DNS, Ether,

0 commit comments

Comments
 (0)