Commit Graph

6567 Commits

Author SHA1 Message Date
gpotter2 c2ce8dc5d3
Small HTTP session fixes (#4601) 2024-12-03 16:35:18 +01:00
gpotter2 07854abd93
Fqdn (#4598)
* FQDN coding fix

* Update gtp_v2.uts

* Fix PEP8

---------

Co-authored-by: Ivan Stepanenko <stepanenko-i@protei.ru>
Co-authored-by: ElKobano <iw.stepanenko2016@ya.ru>
2024-11-25 15:49:42 +01:00
gpotter2 62e335db63
Kerberos improvements and SMB bugfix (session handling of a bad password) (#4597) 2024-11-25 15:49:29 +01:00
Nils Weiss 45de3db195
Fix #4547: Change hashret of DoIP (#4586)
* Fix #4547: Change hashret of DoIP

* debug

* update timeout
2024-11-23 12:34:46 +01:00
itform-fr 680107d30f
Improve CDPMsgIPPrefix : allow more than one IP address (#4585)
* Update cdp.py for CDPIPPrefix

if the length of IP addresses prefixes was more than one address all the following content wasn't interpreted (Raw payload). This seams to fix it

* Update cdp.py

A better approach with a list rather than packets

* Update cdp.py case error on Prefix

* Fix PEP8 formatting

* Rename IPPrefix -> CDPPrefix

---------

Co-authored-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
2024-11-23 12:33:18 +01:00
gpotter2 8e08cbf759
LDAP: add modify/add/delete (#4580) 2024-11-05 09:33:14 +01:00
Nils Weiss 206f1beea0
Add EOF condition to HTTP_Server state SERVE (#4577) 2024-11-03 18:30:04 +01:00
gpotter2 a9eed2d0e5
Add some [MS-DRSR] parts (#4572) 2024-10-21 17:42:09 +02:00
gpotter2 28287eb5c7
Try cache mkdir in XDG handling 2024-10-17 08:47:31 +02:00
gpotter2 b2f6dec77d
Include .1 in zipapp (#4570) 2024-10-16 00:33:17 +02:00
gpotter2 38150fe632
Restore scapy.1 installation (#4569) 2024-10-14 22:04:48 +02:00
gpotter2 1efdc1ea47
Fix LDAP test crash (#4568) 2024-10-14 21:35:49 +02:00
Arjun 4a66706fbb
Fix corruption of certain packets containing invalid TLS extension fields (#4554)
* Fix corruption of certain packets with invalid TLS extension fields

* Use idioms

---------

Co-authored-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
2024-10-14 21:33:55 +02:00
gpotter2 b9aebbef8f
Chown when Scapy is run with sudo (#4566) 2024-10-14 21:04:42 +02:00
gpotter2 014a86a829
Fix arping() without route (#4567) 2024-10-14 21:01:07 +02:00
gpotter2 6f0faf3859
Fix GH4550 (#4561) 2024-10-08 21:28:06 +02:00
gpotter2 93c94722da
Work around GH#4541 (#4560) 2024-10-06 23:36:15 +02:00
Guillaume Valadon 2ae46b79c9
Fix the race condition (#4558) 2024-10-06 12:24:21 +02:00
Nils Weiss c38a5de175
Update HSFZ with more details (#4544) 2024-10-02 14:26:59 +02:00
David H. Gutteridge 87b6e26210
Handle release tag formats in _parse_tag() (#4548)
* Handle release tag formats in _parse_tag()

Also accommodate formal release tags, so the generated version is
correct for downstream packagers.

* Also handle release candidate format in _parse_tag()
2024-10-02 12:14:38 +02:00
Evgeny Vereshchagin 79974f22ee
tests: filter out non-ICMP packets in the tun test (#4543)
When systemd-resolved with its LLMNR/mDNS responders enabled is run it
starts sending its probes as soon as the tun interface pops up:
```
00:36:36.643708 IP c > igmp.mcast.net: igmp v3 report, 2 group record(s)
00:36:36.644530 IP c.mdns > mdns.mcast.net.mdns: 0 [1n] ANY (QM)? c.local. (44)
00:36:36.645307 IP c.llmnr > 224.0.0.252.llmnr: UDP, length 22
```
and that interferes with the test. Since the test is interested in
ICMP packets only it can safely skip everything else.

Fixes:
```
 #(006)=[failed] Send ping packets from Linux into Scapy
 ...
 assert len(icmp4_sequences) == 3
 AssertionError
```
2024-10-01 10:06:54 +02:00
gpotter2 1f9061d36b
Relicense files in doc/tls/notebook/raw_data (#4542) 2024-09-30 12:24:35 +02:00
Evgeny Vereshchagin 41b6f2c081
ci: skip OpenLDAP tests on Packit (#4540)
until I figure out whether it's possible to set up slapd there by
analogy with what the scapy action on GitHub does.

It's a follow-up to https://github.com/secdev/scapy/pull/4539.
2024-09-28 23:48:49 +02:00
gpotter2 f7a64114b3
LDAP - test against openLDAP, minor win-proto fixes (#4539)
* DCE/RPC: fix any() for conformant fields

* Kerberos: fix crealm in Authenticator

* Kerberos: add GET_SALT mode

* LDAP: improve client, support for search()

* Greatly improve SMB2 ACL support

* Test our LDAP client against OpenLDAP

* Update LDAP doc

* TLS client test: also close client_socket
2024-09-28 15:11:32 +02:00
Guillaume Valadon a07e5d5ece
Fix crash with StreamSocket and TLS (#4535)
Co-authored-by: Guillaume Valadon <guillaume.valadon@gitguardian.com>
Co-authored-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
2024-09-24 23:06:27 +02:00
phil777 bf8652b8b9
2 small fixes related to Pipetools (#4532)
* Fix: make sure ObjectPipe does not overwrite sensible defaut name by Pipe class

* Fix: fds are non-inheritable by default since Python 3.4. It broke TermSink
2024-09-24 22:28:15 +02:00
Nils Weiss da9a952f2a
Fix threaded sendrecv (#4538)
* Restore sndrcv behaviour from before 53afe84

* Fix possible race condition of sndrcv

* Use much better timeout for threading

* Reduce abuse on public servers

* fix doip unit tests

* add testcase

* fix test case

* fix unit tests

* fix unit tests

* fix unit tests

* fix unit tests

---------

Co-authored-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
2024-09-24 13:25:10 +02:00
Nils Weiss 19eeafef17
Cleanup DoIP sockets (#4533)
* Cleanup DoIP sockets

* change get_addr_info
2024-09-23 15:50:10 +02:00
Benedikt Wagner 30b0398863
Changes to be committed: (#4522)
modified:   ../scapy/contrib/automotive/uds.py
            added descriptions for NRC 0x50-0x5D

Co-authored-by: bwagner <benedikt.wagner@stud.tu-darmstadt.de>
2024-09-12 16:21:08 +02:00
Guillaume Valadon 4b71ab873f
Catch OverflowError (#4529) 2024-09-11 10:08:10 +02:00
Evgeny Vereshchagin 1464fa9c7c
tests: replace the LDAP OSS-Fuzz testcase (#4530)
The original testcase triggers a separate issue on 32-bit machines:
https://github.com/secdev/scapy/issues/4527 and it should probably be
tested separately. The new testcase triggers the issue fixed in
1935723c18 only:
```sh
>>> assert l[0][LDAP].summary() == "LDAP"
Traceback (most recent call last):
  File "<input>", line 2, in <module>
  File "scapy/scapy/packet.py", line 1692, in summary
    return self._do_summary()[1]
           ^^^^^^^^^^^^^^^^^^
  File "scapy/scapy/packet.py", line 1669, in _do_summary
    ret = self.mysummary()
          ^^^^^^^^^^^^^^^^
  File "scapy/scapy/layers/ldap.py", line 736, in mysummary
    self.messageID.val,
    ^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'val'
```
2024-09-08 12:24:07 +02:00
Nils Weiss 45c216f135
Fix #4472: Add ability to parse multiple DoIP packets in one TCP pkt (#4515)
* Fix #4472: Add ability to parse multiple DoIP packets in one TCP packet via TCPSession

* update

* When not in app mode, tcp_reassemble sub-packets

---------

Co-authored-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
2024-09-07 22:46:59 +02:00
gpotter2 867f92a37d
Remove unnecessary check (#4528) 2024-09-07 15:50:14 +02:00
gpotter2 1c09692fdd
Small optimization of cache during parsing (#4526) 2024-09-07 15:49:38 +02:00
Guillaume Valadon 1935723c18
Check LDAP fields (#4524) 2024-09-05 23:15:25 +02:00
Antonio Vazquez a51bcd5bbf
bluetooth: Add more hci packets (#4514) 2024-09-05 22:04:36 +02:00
C.J. May 45ea41a327
Match Netbios responses for hostnames over length 15 (#4446)
* avoid long names not matching response packet

* unit test for long netbios hostname

* trim original request hostname not response packet hostname

* truncate name in h2i method instead

* Work if None is passed

---------

Co-authored-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
2024-09-05 18:45:20 +02:00
Nils Weiss 32c79bae2c
add intermediat DoIPSocket (#4518) 2024-09-03 20:40:52 +02:00
Frank Buss 5c7b694854
Don't crash on invalid certificates (TLS) (#4494) 2024-09-03 07:22:23 +00:00
gpotter2 6f0eb89f00
HTTPS server, better Automaton.spawn (#4520)
* HTTPS server, better Automaton.spawn

* Note regarding the closure of automatons
2024-09-03 00:20:16 +02:00
gpotter2 a5dab9efc5
Add classifier for Python 3.13 support 2024-09-02 22:46:56 +02:00
gpotter2 38073d444b Remove weird un-scapy like default for Ether 2024-09-02 22:45:03 +02:00
Nils Weiss 32b18410cf Add Ecu automaton documentation 2024-09-02 22:20:33 +02:00
gpotter2 528626a02c
Rewrite arch/bpf (#4497)
* Rewrite arch/bpf

* Adapt for NetBSD

* Adapt for Darwin

* Cleanup VEthPair test

* Cleanup get_if_raw_hwaddr where not useful

* Test on all BSDs

* Some tests only work on Little endian machines
2024-09-02 21:36:04 +02:00
Iman Afaneh dcb0e0c3af
ipsec: Fix IPsec decrypt_esp for NAT-Traversal (#4370)
* ipsec: Fix IPsec decrypt_esp for NAT-Traversal

When having nat_header, encrypted.underlayer will return
UDP/ESP, so when decrypting IPv6 packet, the decrypt packet
will be return with nat_header (UDP), which will return a corrupted packet.

Example:

original packet:
IPv6/TCP/Raw
encrypted packet:
IPv6/UDP/ESP
Decrypted packet:
IPv6/UDP/TCP/Raw

Signed-off-by: Iman Afaneh <iafaneh@nvidia.com>

* ipsec.uts: add unit test for IPsec NAT-Traversal

Signed-off-by: Iman Afaneh <iafaneh@nvidia.com>

---------

Signed-off-by: Iman Afaneh <iafaneh@nvidia.com>
2024-09-02 21:07:50 +02:00
gpotter2 3365f3ca24
Fix cryptography deprecation warnings (#4516) 2024-09-02 20:42:02 +02:00
gpotter2 722f18b03c
Improve cache warnings (#4517) 2024-09-02 20:41:52 +02:00
gpotter2 97a49f32b9
Support for Scope Identifiers in IP addresses (#4461) 2024-08-22 16:00:26 +03:00
Michael 3b95e80764
Fixed wrong IKEv2 gw_id_type in IKEv2_Notify for Redirect Payloads (#4496) 2024-08-21 14:31:00 +03:00
Evgeny Vereshchagin 363a726a76
tests: catch expected DNS deprecation warnings (#4500)
to make it possible to run the tests with `-Werror`.

Fixes
```sh
>>> assert pkt.an.rdata == b'140C768FFE28@Freebox Server._raop._tcp.local.'
Traceback (most recent call last):
  File "<input>", line 2, in <module>
  File "scapy/layers/dns.py", line 1256, in __getattr__
    warnings.warn(
DeprecationWarning: The DNS fields 'qd', 'an', 'ns' and 'ar' are now PacketListField(s) !
```

It's a follow-up to dda902e829
2024-08-18 09:41:28 +03:00