質問

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