i'm trying to capture the network traffic generated by my virtual machine only . On my physical system i'm using python 2.5 and scapy to capture packets from the physical system right now, but i noticed that its capturing the physical system's traffic also . I am using the (pyvbox) virtualbox api to interface with the Oracle VirtualBox .

My VirtualBox network configurations are as follows : enter image description here

有帮助吗?

解决方案

The easiest way is to use a BPF filter. In Scapy:

sniff(..., filter='ether host 08:00:27:73:3c:46')

If for some reason that do not work, you can use the lfilter parameter (slower):

sniff(..., lfilter=lambda p: '08:00:27:73:3c:46' in [p.src, p.dst])

其他提示

Using pyvbox you can capture network traffic from a network adapter as shown in this example: https://gist.github.com/mjdorma/9045130

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top