Question

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

Was it helpful?

Solution

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])

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top