Skip to content
Snippets Groups Projects
Commit 451988e4 authored by Phil's avatar Phil
Browse files

Merge with windows branch

parents b87a7a1f 1f926c28
No related branches found
No related tags found
No related merge requests found
@REM Use Python to run the UTscapy script from the current directory, passing all parameters
@python %~dp0\UTscapy %*
@REM Use Python to run the Scapy script from the current directory, passing all parameters
@python %~dp0\scapy %*
...@@ -364,9 +364,9 @@ You need the following software packages in order to install Scapy on Windows: ...@@ -364,9 +364,9 @@ You need the following software packages in order to install Scapy on Windows:
* `Python <http://www.python.org>`_: `python-2.5.4.msi <http://www.python.org/ftp/python/2.5.4/python-2.5.4.msi>`_. After installation, add ``C:\Python25`` and ``C:\Python25\Scripts`` to your PATH. I'm using Python 2.5. Scapy-win does not work with Python 2.4 or 2.6, because not all third-party extensions on this page are available for them. * `Python <http://www.python.org>`_: `python-2.5.4.msi <http://www.python.org/ftp/python/2.5.4/python-2.5.4.msi>`_. After installation, add ``C:\Python25`` and ``C:\Python25\Scripts`` to your PATH. I'm using Python 2.5. Scapy-win does not work with Python 2.4 or 2.6, because not all third-party extensions on this page are available for them.
* `Scapy-win2 <http://hg.secdev.org/scapy-win2>`_: `latest version from the Mercurial repository <http://hg.secdev.org/scapy-win2/archive/tip.zip>`_. Unzip the archive, open a command prompt in that directroy and run "python setup.py install". * `Scapy-win2 <http://hg.secdev.org/scapy-win2>`_: `latest version from the Mercurial repository <http://hg.secdev.org/scapy-win2/archive/tip.zip>`_. Unzip the archive, open a command prompt in that directroy and run "python setup.py install".
* `pywin32 <http://python.net/crew/mhammond/win32/Downloads.html>`_: `pywin32-214.win32-py2.5.exe <http://surfnet.dl.sourceforge.net/sourceforge/pywin32/pywin32-214.win32-py2.5.exe>`_ * `pywin32 <http://python.net/crew/mhammond/win32/Downloads.html>`_: `pywin32-214.win32-py2.5.exe <http://surfnet.dl.sourceforge.net/sourceforge/pywin32/pywin32-214.win32-py2.5.exe>`_
* `Wireshark <http://www.wireshark.org/>`_: `Wireshark download page <http://www.wireshark.org/download.html>`_. * `Wireshark <http://www.wireshark.org/>`_: `Wireshark download page <http://www.wireshark.org/download.html>`_. If you get WinPcap installation errors on Windows 7, please run the installation program in "Vista compatibility" mode. You might want to choose "[x] Start WinPcap service 'NPF' at startup", so that non-privileged users can sniff, especially under Vista and Windows 7.
* `pypcap <http://code.google.com/p/pypcap/>`_: `pcap-1.1-scapy-20090720.win32-py25.exe <http://dirk-loss.de/scapy/pcap-1.1-scapy-20090720.win32-py25.exe>`_. This is a *special version for Scapy*, as the original leads to some timing problems. Now works on Vista and Windows 7, too. * `pypcap <http://code.google.com/p/pypcap/>`_: `pcap-1.1-scapy-20090720.win32-py25.exe <http://www.secdev.org/projects/scapy/files/pcap-1.1-scapy-20090720.win32-py2.5.exe>`_. This is a *special version for Scapy*, as the original leads to some timing problems. Now works on Vista and Windows 7, too. Under Vista/Win7 please right-click on the installer and choose "Run as administrator".
* `libdnet <http://code.google.com/p/libdnet/>`_: `dnet-1.12.win32-py2.5.exe <http://libdnet.googlecode.com/files/dnet-1.12.win32-py2.5.exe>`_ * `libdnet <http://code.google.com/p/libdnet/>`_: `dnet-1.12.win32-py2.5.exe <http://libdnet.googlecode.com/files/dnet-1.12.win32-py2.5.exe>`_. Under Vista/Win7 please right-click on the installer and choose "Run as administrator"
* `pyreadline <http://ipython.scipy.org/moin/PyReadline/Intro>`_: `pyreadline-1.5-win32-setup.exe <http://ipython.scipy.org/dist/pyreadline-1.5-win32-setup.exe>`_ * `pyreadline <http://ipython.scipy.org/moin/PyReadline/Intro>`_: `pyreadline-1.5-win32-setup.exe <http://ipython.scipy.org/dist/pyreadline-1.5-win32-setup.exe>`_
Just download the files and run the setup program. Choosing the default installation options should be safe. Just download the files and run the setup program. Choosing the default installation options should be safe.
......
...@@ -226,11 +226,13 @@ pcapdnet.open_pcap = lambda iface,*args,**kargs: _orig_open_pcap(pcap_name(iface ...@@ -226,11 +226,13 @@ pcapdnet.open_pcap = lambda iface,*args,**kargs: _orig_open_pcap(pcap_name(iface
def read_routes(): def read_routes():
ok = 0 ok = 0
routes = [] routes = []
ip = '(\d+\.\d+\.\d+\.\d+)\s+' ip = '(\d+\.\d+\.\d+\.\d+)'
# On Vista and Windows 7 the gateway can be IP or 'on-link'. # On Vista and Windows 7 the gateway can be IP or 'On-link'.
# The exact 'on-link' string depends on the locale. # But the exact 'On-link' string depends on the locale, so we allow any text.
gw_pattern = '([\w\s]+|\d+\.\d+\.\d+\.\d+)\s+' gw_pattern = '(.+)'
netstat_line = ip + ip + gw_pattern + ip + "(\d+)" metric_pattern = "(\d+)"
delim = "\s+" # The columns are separated by whitespace
netstat_line = delim.join([ip, ip, gw_pattern, ip, metric_pattern])
pattern = re.compile(netstat_line) pattern = re.compile(netstat_line)
f=os.popen("netstat -rn") f=os.popen("netstat -rn")
for l in f.readlines(): for l in f.readlines():
......
...@@ -34,12 +34,16 @@ def make_ezipfile(base_name, base_dir, verbose=0, dry_run=0): ...@@ -34,12 +34,16 @@ def make_ezipfile(base_name, base_dir, verbose=0, dry_run=0):
archive_util.ARCHIVE_FORMATS["ezip"] = (make_ezipfile,[],'Executable ZIP file') archive_util.ARCHIVE_FORMATS["ezip"] = (make_ezipfile,[],'Executable ZIP file')
SCRIPTS = ['bin/scapy','bin/UTscapy']
# On Windows we also need additional batch files to run the above scripts
if os.name == "nt":
SCRIPTS += ['bin/scapy.bat','bin/UTscapy.bat']
setup( setup(
name = 'scapy', name = 'scapy',
version = '2.0.1-dev', version = '2.0.1-dev',
packages=['scapy','scapy/arch', 'scapy/arch/windows', 'scapy/layers','scapy/asn1','scapy/tools','scapy/modules'], packages=['scapy','scapy/arch', 'scapy/arch/windows', 'scapy/layers','scapy/asn1','scapy/tools','scapy/modules'],
scripts = ['bin/scapy','bin/UTscapy'], scripts = SCRIPTS,
data_files = [('share/man/man1', ["doc/scapy.1.gz"])], data_files = [('share/man/man1', ["doc/scapy.1.gz"])],
# Metadata # Metadata
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment