scapy があれば対話的に、または Python スクリプトから任意のパケットを生成すること (等) が出来ます。OS X への scapy インストール手順をメモしておきます。検証には OS X El Captian (10.11.4) を、インストールには homebrew を使いました (homebrew はインストールされている前提です)。
/usr/local/Cellar/scapy/2.3.1 (238 files, 3.6M) *
Built from source on 2016-05-06 at 16:18:44
From: https://github.com/Homebrew/homebrew-python/blob/master/scapy.rb
==> Dependencies
Required: libdnet
scapy の対話的ツールも /usr/local/bin/scapy にインストールされました。
$ file /usr/local/bin/scapy
/usr/local/bin/scapy: a /usr/bin/python script text executable
#!/usr/bin/python
#############################################################################
## ##
## scapy.py --- Interactive packet manipulation tool ##
## see http://www.secdev.org/projects/scapy/ ##
## for more informations ##
## ##
## Copyright (C) Philippe Biondi <phil@secdev.org> ##
## ##
## This program is free software; you can redistribute it and/or modify it ##
## under the terms of the GNU General Public License version 2 as ##
## published by the Free Software Foundation. ##
## ##
## This program is distributed in the hope that it will be useful, but ##
## WITHOUT ANY WARRANTY; without even the implied warranty of ##
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ##
## General Public License for more details. ##
## ##
#############################################################################
from scapy.main import interact
interact()
$ scapy
Traceback (most recent call last):
File "send_icmp.py", line 1, in <module>
from scapy.all import send, IP, ICMP
ImportError: No module named scapy.all
コメント