Skip to content

Commit

Permalink
[win] Netlogon: support AES (#4447)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpotter2 committed Jun 29, 2024
1 parent 31b3588 commit 8ed8647
Show file tree
Hide file tree
Showing 6 changed files with 689 additions and 178 deletions.
15 changes: 13 additions & 2 deletions doc/scapy/layers/http.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,28 @@ Start an unauthenticated HTTP server automaton:
iface="eth0",
)
We could also have started the same server, but requiring NTLM authorization using:
We could also have started the same server, but requiring **NTLM authorization using**:

.. code:: python
server = HTTP_Server.spawn(
port=8080,
iface="eth0",
HTTP_AUTH_MECHS.NTLM,
mech=HTTP_AUTH_MECHS.NTLM,
ssp=NTLMSSP(IDENTITIES={"user": MD4le("password")}),
)
Or **basic auth**:

.. code:: python
server = HTTP_Server.spawn(
port=8080,
iface="eth0",
mech=HTTP_AUTH_MECHS.BASIC,
BASIC_IDENTITIES={"user": MD4le("password")},
)
- ``TCP_client.tcplink``:

Send an HTTPRequest to ``www.secdev.org`` and write the result in a file:
Expand Down
12 changes: 6 additions & 6 deletions scapy/layers/dcerpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ class NL_AUTH_SIGNATURE(Packet):
{
0xFFFF: "Unencrypted",
0x007A: "RC4",
0x00A1: "AES-128",
0x001A: "AES-128",
},
),
XLEShortField("Pad", 0xFFFF),
Expand Down Expand Up @@ -2671,8 +2671,8 @@ def in_pkt(self, pkt):
opnum, opts = self._up_pkt(pkt)
# Check for encrypted payloads
body = None
if conf.raw_layer in pkt:
body = bytes(pkt[conf.raw_layer])
if conf.raw_layer in pkt.payload:
body = bytes(pkt.payload[conf.raw_layer])
# If we are doing passive sniffing
if conf.dcerpc_session_enable and conf.winssps_passive:
# We have Windows SSPs, and no current context
Expand Down Expand Up @@ -2801,18 +2801,18 @@ def in_pkt(self, pkt):
"Unknown opnum %s for interface %s"
% (opnum, self.rpc_bind_interface)
)
pkt[conf.raw_layer].load = body
pkt.payload[conf.raw_layer].load = body
return pkt
if body:
# Dissect payload using class
payload = cls(body, ndr64=self.ndr64, ndrendian=self.ndrendian, **opts)
pkt[conf.raw_layer].underlayer.remove_payload()
pkt.payload[conf.raw_layer].underlayer.remove_payload()
pkt /= payload
elif not cls.fields_desc:
# Request class has no payload
pkt /= cls(ndr64=self.ndr64, ndrendian=self.ndrendian, **opts)
elif body:
pkt[conf.raw_layer].load = body
pkt.payload[conf.raw_layer].load = body
return pkt

def out_pkt(self, pkt):
Expand Down
Loading

0 comments on commit 8ed8647

Please sign in to comment.