MCPcopy Create free account
hub / github.com/secdev/scapy / SMBNegotiate_Response_NoSecurity

Class SMBNegotiate_Response_NoSecurity

scapy/layers/smb.py:377–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375
376
377class SMBNegotiate_Response_NoSecurity(_SMBNegotiate_Response):
378 name = "SMB Negotiate No-Security Response (CIFS)"
379 fields_desc = [
380 ByteField("WordCount", 0x1),
381 LEShortField("DialectIndex", 7),
382 FlagsField(
383 "SecurityMode",
384 0x03,
385 8,
386 [
387 "USER_SECURITY",
388 "ENCRYPT_PASSWORDS",
389 "SECURITY_SIGNATURES_ENABLED",
390 "SECURITY_SIGNATURES_REQUIRED",
391 ],
392 ),
393 LEShortField("MaxMpxCount", 50),
394 LEShortField("MaxNumberVC", 1),
395 LEIntField("MaxBufferSize", 16144), # Windows: 4356
396 LEIntField("MaxRawSize", 65536),
397 LEIntField("SessionKey", 0x0000),
398 FlagsField("ServerCapabilities", 0xF3F9, -32, _SMB_ServerCapabilities),
399 UTCTimeField(
400 "ServerTime",
401 None,
402 fmt="<Q",
403 epoch=[1601, 1, 1, 0, 0, 0],
404 custom_scaling=1e7,
405 ),
406 ScalingField("ServerTimeZone", 0x3C, fmt="<h", unit="min-UTC"),
407 FieldLenField(
408 "ChallengeLength",
409 None,
410 # aka EncryptionKeyLength
411 length_of="Challenge",
412 fmt="<B",
413 ),
414 LEFieldLenField(
415 "ByteCount",
416 None,
417 length_of="DomainName",
418 adjust=lambda pkt, x: x + len(pkt.Challenge),
419 ),
420 XStrLenField(
421 "Challenge",
422 b"", # aka EncryptionKey
423 length_from=lambda pkt: pkt.ChallengeLength,
424 ),
425 StrNullField("DomainName", "WORKGROUP"),
426 ]
427
428
429bind_top_down(SMB_Header, SMBNegotiate_Response_NoSecurity, Command=0x72, Flags=0x80)

Callers

nothing calls this directly

Calls 10

ByteFieldClass · 0.90
LEShortFieldClass · 0.90
FlagsFieldClass · 0.90
LEIntFieldClass · 0.90
UTCTimeFieldClass · 0.90
ScalingFieldClass · 0.90
FieldLenFieldClass · 0.90
LEFieldLenFieldClass · 0.90
XStrLenFieldClass · 0.90
StrNullFieldClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…