Skip to content

Commit 61251f4

Browse files
committed
DCE/RPC: improve context handling
1 parent a89dfcd commit 61251f4

2 files changed

Lines changed: 158 additions & 68 deletions

File tree

scapy/layers/dcerpc.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,14 @@ class RPC_C_AUTHN_LEVEL(IntEnum):
451451
DCE_C_AUTHN_LEVEL = RPC_C_AUTHN_LEVEL # C706 name
452452

453453

454+
class RPC_C_IMP_LEVEL(IntEnum):
455+
DEFAULT = 0x0
456+
ANONYMOUS = 0x1
457+
IDENTIFY = 0x2
458+
IMPERSONATE = 0x3
459+
DELEGATE = 0x4
460+
461+
454462
# C706 sect 13.2.6.1
455463

456464

@@ -2766,9 +2774,9 @@ def __init__(self, *args, **kwargs):
27662774
self.ssp = kwargs.pop("ssp", None)
27672775
self.sspcontext = kwargs.pop("sspcontext", None)
27682776
self.auth_level = kwargs.pop("auth_level", None)
2769-
self.auth_context_id = kwargs.pop("auth_context_id", 0)
27702777
self.sent_cont_ids = []
27712778
self.cont_id = 0 # Currently selected context
2779+
self.auth_context_id = 0 # Currently selected authentication context
27722780
self.map_callid_opnum = {}
27732781
self.frags = collections.defaultdict(lambda: b"")
27742782
self.sniffsspcontexts = {} # Unfinished contexts for passive
@@ -3283,7 +3291,6 @@ def __init__(self, *args, **kwargs):
32833291
self.session = DceRpcSession(
32843292
ssp=kwargs.pop("ssp", None),
32853293
auth_level=kwargs.pop("auth_level", None),
3286-
auth_context_id=kwargs.pop("auth_context_id", None),
32873294
support_header_signing=kwargs.pop("support_header_signing", True),
32883295
)
32893296
super(DceRpcSocket, self).__init__(*args, **kwargs)

0 commit comments

Comments
 (0)