Skip to content

Commit

Permalink
Merge branch 'secdev:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ksnieck authored Dec 13, 2023
2 parents bcc3e8f + 0dd08cd commit 4d9d29e
Show file tree
Hide file tree
Showing 207 changed files with 8,686 additions and 2,814 deletions.
6 changes: 3 additions & 3 deletions .config/ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ if [ -z $TOXENV ]
then
case ${SCAPY_TOX_CHOSEN} in
both)
export TOXENV="${TESTVER}_non_root,${TESTVER}_root"
export TOXENV="${TESTVER}-non_root,${TESTVER}-root"
;;
root)
export TOXENV="${TESTVER}_root"
export TOXENV="${TESTVER}-root"
;;
*)
export TOXENV="${TESTVER}_non_root"
export TOXENV="${TESTVER}-non_root"
;;
esac
fi
Expand Down
10 changes: 9 additions & 1 deletion .config/codespell_ignore.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
Ether
aci
ans
archtypes
applikation
ba
byteorder
cace
cas
componet
cros
delt
doas
doubleclick
ether
eventtypes
fo
funktion
gost
hart
iff
interaktive
inout
microsof
mitre
nd
negociate
optiona
ot
potatoe
referer
requestor
ro
ser
singl
slac
te
temporaere
tim
ue
uint
vas
wan
wanna
webp
widgits
14 changes: 13 additions & 1 deletion .config/mypy/mypy_enabled.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ scapy/__main__.py
scapy/all.py
scapy/ansmachine.py
scapy/arch/__init__.py
scapy/arch/bpf/__init__.py
scapy/arch/bpf/consts.py
scapy/arch/bpf/core.py
scapy/arch/bpf/supersocket.py
scapy/arch/common.py
scapy/arch/libpcap.py
scapy/arch/linux.py
scapy/arch/unix.py
scapy/arch/solaris.py
scapy/arch/unix.py
scapy/arch/windows/__init__.py
scapy/arch/windows/native.py
scapy/arch/windows/structures.py
Expand Down Expand Up @@ -86,6 +90,14 @@ scapy/contrib/isotp/isotp_utils.py
scapy/contrib/roce.py
scapy/contrib/tcpao.py

# LIBS
scapy/libs/__init__.py
scapy/libs/ethertypes.py
scapy/libs/extcap.py
scapy/libs/matplot.py
scapy/libs/structures.py
scapy/libs/test_pyx.py

# TEST
test/testsocket.py

Expand Down
51 changes: 51 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This file contains the list of commits that should be excluded from
# git blame. Read more informations on:
# https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view

# PEPin - https://github.com/secdev/scapy/issues/1277
# E231 - missing whitespace after ','
e7365b2baeded1a0e1e3b59bc0ad14a78d6e3086
# E30* - Incorrect number of blank lines
b770bbc58c26437b354c0bd21dc4e2fcfa3abfdf
# E20* - Incorrect number of whitespace
6861a35d8ed4466df7b2ff82341e60caf9ff869a
# E12* - visual indent
275ad3246b5231bb046a66bcfdf3654d67fdea20
# W29* - useless whitespaces
453f2592f7b6f2b8677619769f8427932894dc1c
# E251 - unexpected spaces around keyword / parameter equals
203254afd771b42ccf0fcca96ba92dc4075cfe4a
# E26 - comments
b7a3db73dfd17ec1e7bbace8d52464982bf8ea8d
# E1 - incorrect indentation
f2f1de742aa36167e2c86247a26ed5e7393366ea
# F821 - undefined name 'name'
f8525ea9f17cedf148febcab8d1dab51ddca9afe
# E2* - whitespaces errors
1c2fe99c131bb05e009896410766371a2f870175
# E71* - tests syntax
927c157b58918d5fdce9714a3c35627339cc8657
# F841 - local variable 'name' is assigned to but never used
dbe409531a22d1245cf4669f72a425b42c83b0db
# PEPin several fixes
93232490193ca2b59e3b1425131913d28f408f7a
# E501 - line too long (> 79 characters)
e89d8965748439adc253714316de7a9a35b8bd73
# F601 - dictionary key repeated with different values
0fd7d76550e56831f887664202d743846d3619dd
# F811 - redefinition of unused variable/class/...
10454d1ca243d0fd8d2ab4a148d688e3ea916e49
# E402 - module level import not at top of file
0f4a904d2801e8bbbc82880345ad453ceb6ee34f
# E722 - do not use bare except
a35575ff22da176a8b515405faea9a689462da0c
# E741 - ambiguous variable name 'l'
7c61676aef950ca268eac480902dd91cb0abe3a4
# F405 - variable/function/... may be undefined, or defined from star
8773983edb0336db7aa84777dee2aa9892508418
# F401 - 'module' imported but unused
a58e1b90a704c394216a0b5a864a50931754bdf7
# W502 - line break before binary operator
9687222c3f0af6ef89ecfe15e5b983e1f7b5b31e
# E275 - Missing whitespace after keyword
08b1f9d67c8e716fd44036a027bdc90dcb9fcfdf
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: [gpotter2, guedou, p-l-]
github: [gpotter2, guedou, p-l-, polybassa]
23 changes: 12 additions & 11 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.12"
- name: Install tox
run: pip install tox
- name: Run flake8 tests
Expand All @@ -32,15 +32,16 @@ jobs:
- name: Run gitarchive check
run: tox -e gitarchive
docs:
# 'runs-on' and 'python-version' should match the ones defined in .readthedocs.yml
name: Build doc
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Scapy
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.12"
- name: Install tox
run: pip install tox
- name: Build docs
Expand All @@ -54,7 +55,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
- name: Install tox
run: pip install tox
- name: Run mypy
Expand All @@ -69,15 +70,15 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ["3.7", "3.8", "3.9", "3.10"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
mode: [non_root]
installmode: ['']
flags: [" -K scanner"]
allow-failure: ['false']
include:
# Linux root tests
- os: ubuntu-latest
python: "3.10"
python: "3.12"
mode: root
flags: " -K scanner"
# PyPy tests: root only
Expand All @@ -87,18 +88,18 @@ jobs:
flags: " -K scanner"
# Libpcap test
- os: ubuntu-latest
python: "3.10"
python: "3.12"
mode: root
installmode: 'libpcap'
flags: " -K scanner"
# macOS tests
- os: macos-12
python: "3.10"
python: "3.12"
mode: both
flags: " -K scanner"
# Scanner tests
- os: ubuntu-latest
python: "3.10"
python: "3.12"
mode: root
allow-failure: 'true'
flags: " -k scanner"
Expand All @@ -108,7 +109,7 @@ jobs:
allow-failure: 'true'
flags: " -k scanner"
- os: macos-12
python: "3.10"
python: "3.12"
mode: both
allow-failure: 'true'
flags: " -k scanner"
Expand Down Expand Up @@ -138,7 +139,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.12"
- name: Install tox
run: pip install tox
# pyca/cryptography's CI installs cryptography
Expand Down
12 changes: 9 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ formats:
- pdf

build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.12"
# To show the correct Scapy version, we must unshallow
# https://docs.readthedocs.io/en/stable/build-customization.html#unshallow-git-clone
jobs:
post_checkout:
- git fetch --unshallow || true

# https://docs.readthedocs.io/en/stable/config-file/v2.html#python
python:
install:
- method: pip
path: .
extra_requirements:
- docs
- doc
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# <img src="https://github.com/secdev/scapy/raw/master/doc/scapy/graphics/scapy_logo.png" width="64" valign="middle" alt="Scapy" />&nbsp;&nbsp; Scapy

[![Scapy unit tests](https://github.com/secdev/scapy/workflows/Scapy%20unit%20tests/badge.svg?event=push)](https://github.com/secdev/scapy/actions?query=workflow%3A%22Scapy+unit+tests%22+branch%3Amaster+event%3Apush) <!-- ignore_ppi -->
[![Scapy unit tests](https://github.com/secdev/scapy/actions/workflows/unittests.yml/badge.svg?branch=master&event=push)](https://github.com/secdev/scapy/actions/workflows/unittests.yml?query=event%3Apush) <!-- ignore_ppi -->
[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/os03daotfja0wtp7/branch/master?svg=true)](https://ci.appveyor.com/project/secdev/scapy/branch/master) <!-- ignore_ppi -->
[![Codecov Status](https://codecov.io/gh/secdev/scapy/branch/master/graph/badge.svg)](https://codecov.io/gh/secdev/scapy) <!-- ignore_ppi -->
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/30ee6772bb264a689a2604f5cdb0437b)](https://www.codacy.com/app/secdev/scapy) <!-- ignore_ppi -->
Expand Down
8 changes: 4 additions & 4 deletions doc/scapy.1
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ increase log verbosity. Can be used many times.
use FILE to save/load session values (variables, functions, instances, ...)
.TP
\fB\-p\fR PRESTART_FILE
use PRESTART_FILE instead of $HOME/.scapy_prestart.py as pre-startup file
use PRESTART_FILE instead of $HOME/.config/scapy/prestart.py as pre-startup file
.TP
\fB\-P\fR
do not run prestart file
.TP
\fB\-c\fR STARTUP_FILE
use STARTUP_FILE instead of $HOME/.scapy_startup.py as startup file
use STARTUP_FILE instead of $HOME/.config/scapy/startup.py as startup file
.TP
\fB\-C\fR
do not run startup file
Expand All @@ -82,7 +82,7 @@ lists scapy's main user commands.
this object contains the configuration.

.SH FILES
\fB$HOME/.scapy_prestart.py\fR
\fB$HOME/.config/scapy/prestart.py\fR
This file is run before Scapy core is loaded. Only the \fBconf\fP object
is available. This file can be used to manipulate \fBconf.load_layers\fP
list to choose which layers will be loaded:
Expand All @@ -92,7 +92,7 @@ conf.load_layers.remove("bluetooth")
conf.load_layers.append("new_layer")
.fi

\fB$HOME/.scapy_startup.py\fR
\fB$HOME/.config/scapy/startup.py\fR
This file is run after Scapy is loaded. It can be used to configure
some of the Scapy behaviors:

Expand Down
2 changes: 1 addition & 1 deletion doc/scapy/backmatter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Credits
*********

- Philippe Biondi is Scapy's author. He has also written most of the documentation.
- Pierre Lalet, Gabriel Potter, Guillaume Valadon are the current most active maintainers and contributors.
- Pierre Lalet, Gabriel Potter, Guillaume Valadon, Nils Weiss are the current most active maintainers and contributors.
- Fred Raynal wrote the chapter on building and dissecting packets.
- Peter Kacherginsky contributed several tutorial sections, one-liners and recipes.
- Dirk Loss integrated and restructured the existing docs to make this book.
Expand Down
6 changes: 4 additions & 2 deletions doc/scapy/build_dissect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -869,10 +869,12 @@ Legend:
XShortField
X3BytesField # three bytes as hex
LEX3BytesField # little endian three bytes as hex
XLE3BytesField # little endian three bytes as hex
ThreeBytesField # three bytes as decimal
LEThreeBytesField # little endian three bytes as decimal
LE3BytesEnumField
XLE3BytesEnumField

IntField
SignedIntField
LEIntField
Expand Down
Binary file not shown.
35 changes: 0 additions & 35 deletions doc/scapy/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -309,41 +309,6 @@ Screenshots
:scale: 80
:align: center

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 <https://wiki.wireshark.org/CaptureSetup/WLAN>`_ and in the `WinPcap FAQ <https://www.winpcap.org/misc/faq.htm>`_. 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 ``'Winpcap is installed over Npcap.'`` 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::

C:/Windows/System32/wpcap.dll
C:/Windows/System32/Packet.dll

And if you are on an x64 machine::

C:/Windows/SysWOW64/wpcap.dll
C:/Windows/SysWOW64/Packet.dll

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

2. If you get the message ``'The installed Windump version does not work with Npcap'`` 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
===============================

Expand Down
Loading

0 comments on commit 4d9d29e

Please sign in to comment.