Scapegr Mac OS

Overview¶

Apple Mac OS 10.11 (OS X El Capitan) SCAP 1.2 Validated Products and Modules The General Services Administration is requiring SCAP validation within blanket purchase agreements for vulnerability and configuration management products (Solicitation Number: Reference-Number-QTA0-08-HC-B-0003 ). Mac Tools® offers a wide variety of quality cutting and scraping tools that help you conquer every tasks. Our product line is centered around offering the highest quality tools to your shop.

  1. Install Python 2.7.X or 3.4+.

  2. Follow the platform-specific instructions (dependencies).

  3. (Optional): Install additional software for special features.

  4. Run Scapy with root privileges.

Each of these steps can be done in a different way depending on your platform and on the version of Scapy you want to use. Follow the platform-specific instructions for more detail.

Scapy versions¶


Note

In Scapy v2 use fromscapy.allimport* instead of fromscapyimport*.

Installing Scapy v2.x¶

The following steps describe how to install (or update) Scapy itself.Dependent on your platform, some additional libraries might have to be installed to make it actually work.So please also have a look at the platform specific chapters on how to install those requirements.

Note

The following steps apply to Unix-like operating systems (Linux, BSD, Mac OS X).For Windows, see the special chapter below.

Make sure you have Python installed before you go on.

Latest release¶

Note

To get the latest versions, with bugfixes and new features, but maybe not as stable, see the development version.

Use pip:

In fact, since 2.4.3, Scapy comes in 3 bundles:

Bundle

Contains

Pip command

Default

Only Scapy

pipinstallscapy

Basic

Scapy & IPython. Highly recommended

pipinstall--prescapy[basic]

Complete

Scapy & all its main dependencies

pipinstall--prescapy[complete]

Current development version¶

If you always want the latest version with all new features and bugfixes, use Scapy’s Git repository:

  1. Install the Git version control system.

  2. Check out a clone of Scapy’s repository:

Note

You can also download Scapy’s latest version in a zip file:

  1. Install Scapy in the standard distutils way:

If you used Git, you can always update to the latest version afterwards:

Note

Scapegr Mac Os Catalina

You can run scapy without installing it using the run_scapy (unix) or run_scapy.bat (Windows) script or running it directly from the executable zip file (see the previous section).

Optional Dependencies¶

For some special features, Scapy will need some dependencies to be installed.Most of those software are installable via pip.Here are the topics involved and some examples that you can use to try if your installation was successful.

  • Plotting. plot() needs Matplotlib.

    Matplotlib is installable via pipinstallmatplotlib

  • 2D graphics. psdump() and pdfdump() need PyX which in turn needs a LaTeX distribution: texlive (Unix) or MikTex (Windows).

    Note: PyX requires version <=0.12.1 on Python 2.7. This means that on Python 2.7, it needs to be installed via pipinstallpyx0.12.1. Otherwise pipinstallpyx

  • Graphs. conversations() needs Graphviz and ImageMagick.

    Note

    Graphviz and ImageMagick need to be installed separately, using your platform-specific package manager.

  • 3D graphics. trace3D() needs VPython-Jupyter.

    VPython-Jupyter is installable via pipinstallvpython

  • WEP decryption. unwep() needs cryptography. Example using a Weplap test file:

    Cryptography is installable via pipinstallcryptography

  • PKI operations and TLS decryption. cryptography is also needed.

  • Fingerprinting. nmap_fp() needs Nmap. You need an old version (before v4.23) that still supports first generation fingerprinting.

  • VOIP. voip_play() needs SoX.

Platform-specific instructions¶

As a general rule, you can toggle the libpcap integration on or off at any time, using:

Linux native¶

Scapegr

Scapy can run natively on Linux, without libpcap.

  • Install Python 2.7 or 3.4+.

  • Install tcpdump and make sure it is in the $PATH. (It’s only used to compile BPF filters (-dddoption))

  • Make sure your kernel has Packet sockets selected (CONFIG_PACKET)

  • If your kernel is < 2.6, make sure that Socket filtering is selected CONFIG_FILTER)

Debian/Ubuntu/Fedora¶

Make sure tcpdump is installed:

  • Debian/Ubuntu:

  • Fedora:

Then install Scapy via pip or apt (bundled under python-scapy)All dependencies may be installed either via the platform-specific installer, or via PyPI. See Optional Dependencies for more information.

Mac OS X¶

On Mac OS X, Scapy DOES work natively since the recent versions.However, you may want to make Scapy use libpcap.You can choose to install it using either Homebrew or MacPorts. They bothwork fine, yet Homebrew is used to run unit tests withTravis CI.

Note

Libpcap might already be installed on your platform (for instance, if you have tcpdump). This is the case of OSX

Install using Homebrew¶

  1. Update Homebrew:

  2. Install libpcap:

Enable it In Scapy:

Install using MacPorts¶

  1. Update MacPorts:

  2. Install libpcap:

Enable it In Scapy:

OpenBSD¶

In a similar manner, to install Scapy on OpenBSD 5.9+, you may want to install libpcap, if you do not want to use the native extension:

Then install Scapy via pip or pkg_add (bundled under python-scapy)All dependencies may be installed either via the platform-specific installer, or via PyPI. See Optional Dependencies for more information.

SunOS / Solaris¶

Solaris / SunOS requires libpcap (installed by default) to work.

Note

In fact, Solaris doesn’t support AF_PACKET, which Scapy uses on Linux, but rather uses its own system DLPI. See this page.We prefer using the very universal libpcap that spending time implementing support for DLPI.

Windows¶

Section author: Dirk Loss <mail at dirk-loss.de>

Scapy is primarily being developed for Unix-like systems and works best on those platforms. But the latest version of Scapy supports Windows out-of-the-box. So you can use nearly all of Scapy’s features on your Windows machine as well.

You need the following software in order to install Scapy on Windows:

  • Python: Python 2.7.X or 3.4+. After installation, add the Python installation directory and its Scripts subdirectory to your PATH. Depending on your Python version, the defaults would be C:Python27 and C:Python27Scripts respectively.

  • Npcap: the latest version. Default values are recommended. Scapy will also work with Winpcap.

  • Scapy: latest development version from the Git repository. Unzip the archive, open a command prompt in that directory and run pythonsetup.pyinstall.

Just download the files and run the setup program. Choosing the default installation options should be safe. (In the case of Npcap, Scapy will work with 802.11 option enabled. You might want to make sure that this is ticked when installing).

After all packages are installed, open a command prompt (cmd.exe) and run Scapy by typing scapy. If you have set the PATH correctly, this will find a little batch file in your C:Python27Scripts directory and instruct the Python interpreter to load Scapy.

If really nothing seems to work, consider skipping the Windows version and using Scapy from a Linux Live CD – either in a virtual machine on your Windows host or by booting from CDROM: An older version of Scapy is already included in grml and BackTrack for example. While using the Live CD you can easily upgrade to the latest Scapy version by using the above installation methods.

Known bugs¶

You may bump into the following bugs, which are platform-specific, if Scapy didn’t manage work around them automatically:

  • You may not be able to capture WLAN traffic on Windows. Reasons are explained on the Wireshark wiki and in the WinPcap FAQ. Try switching off promiscuous mode with conf.sniff_promisc=False.

  • Packets sometimes cannot be sent to localhost (or local IP addresses on your own host).

Winpcap/Npcap conflicts¶

As Winpcap is becoming old, it’s recommended to use Npcap instead. Npcap is part of the Nmap project.

Note

This does NOT apply for Windows XP, which isn’t supported by Npcap.

  1. If you get the message 'WinpcapisinstalledoverNpcap.' it means that you have installed both Winpcap and Npcap versions, which isn’t recommended.

You may first uninstall winpcap from your Program Files, then you will need to remove:

And if you are on an x64 machine:

To use Npcap instead, as those files are not removed by the Winpcap un-installer.

2. If you get the message 'TheinstalledWindumpversiondoesnotworkwithNpcap' it surely means that you have installed an old version of Windump, made for Winpcap.Download the correct one on https://github.com/hsluoyz/WinDump/releases

In some cases, it could also mean that you had installed Npcap and Winpcap, and that Windump is using Winpcap. Fully delete Winpcap using the above method to solve the problem.

Build the documentation offline¶

The Scapy project’s documentation is written using reStructuredText (files *.rst) and can be built usingthe Sphinx python library. The official online version is availableon readthedocs.

HTML version¶

The instructions to build the HTML version are:

You can now open the resulting HTML file _build/html/index.html in your favorite web browser.

To use the ReadTheDocs’ template, you will have to install the corresponding theme with:

UML diagram¶

Using pyreverse you can build a UML representation of the Scapy source code’s object hierarchy. Here is anexample of how to build the inheritance graph for the Fields objects :

This will generate a classes_fields.png picture containing the inheritance hierarchy. Note that you can provide as manymodules or packages as you want, but the result will quickly get unreadable.

To see the dependencies between the DHCP layer and the ansmachine module, you can run:

Scapegr Mac Os Download

In this case, Pyreverse will also generate a packages_dhcp_ans.png showing the link between the different python modules provided.