Skip to content

Scapy REPL demo #147

@nirs

Description

@nirs

Summary

Add a Python demo/tool that uses vmnet-helper to provide an interactive Scapy REPL for vmnet networks. This allows sending and receiving raw Ethernet frames to/from any VM or external host.

Motivation

Normally, raw Ethernet access requires root privileges. vmnet-helper provides unprivileged access to vmnet networks via a file descriptor, making it possible to:

  • Debug VM networking - see what's on the wire
  • Learn networking - craft packets interactively
  • Test connectivity between VMs
  • Security testing - inject traffic into VM network

Example usage

from scapy.all import *
import vmnet_helper

# Get file descriptor for the shared network
fd = vmnet_helper.acquire("shared")

# Sniff traffic
sniff(fd=fd, count=5)

# Send ARP request
sendp(Ether()/ARP(pdst="192.168.105.2"), fd=fd)

# Ping external host via vmnet gateway
sendp(Ether()/IP(dst="8.8.8.8")/ICMP(), fd=fd)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions