Scapy on Mac OS X 10.11 and beyond

Scapy is a Python library that does low-level packet manipulation. It’s also useful in playing with Amazon Dash Buttons. There are plenty of older instructions on getting it running on Mac OS X, but many of these don’t work on Mac OS X 10.11/10.12 where System Integrity Protection (SIP) is enabled by default. Here’s a script to do it for you:


echo "We need root permissions to install libdnet"
sudo echo "OK"
curl -O ""
python --user
$PIP_BIN install scapy --user
$PIP_BIN install pypcap --user
curl -L -o
cd libdnet-libdnet-1.12
sudo make install
cd python
python install --user

A few notes:

  • You will need the Command Line Tools package to compile libdnet. If you don’t have them installed already, you should be automagically prompted by the OS.
  • We use the --user flag to install locally in our home directory, avoiding problems with SIP (which protects system files, including parts of the shared Python directories)
  • We use pypcap rather than pcapy, because the latter does not work
  • The latest version of libdnet is 1.12 (contrary to the SourceForge page, which indicates that the latest is 1.11), and can be found on GitHub
This entry was posted in Pub. Bookmark the permalink.

10 Responses to Scapy on Mac OS X 10.11 and beyond

Leave a Reply

Your email address will not be published.