MCPcopy
hub / github.com/fortra/impacket / decode

Method decode

impacket/ImpactDecoder.py:525–565  ·  view source on GitHub ↗
(self, aBuffer)

Source from the content-addressed store, hash-verified

523 self.dot11 = dot11_obj
524
525 def decode(self, aBuffer):
526 if self.dot11.get_fromDS() and self.dot11.get_toDS():
527 if self.dot11.is_QoS_frame():
528 p = dot11.Dot11DataAddr4QoSFrame(aBuffer)
529 else:
530 p = dot11.Dot11DataAddr4Frame(aBuffer)
531 elif self.dot11.is_QoS_frame():
532 p = dot11.Dot11DataQoSFrame(aBuffer)
533 else:
534 p = dot11.Dot11DataFrame(aBuffer)
535 self.set_decoded_protocol( p )
536
537 if not self.dot11.get_protectedFrame():
538 self.llc_decoder = LLCDecoder()
539 packet = self.llc_decoder.decode(p.body_string)
540 else:
541 if not self.dot11.get_fromDS() and self.dot11.get_toDS():
542 bssid = p.get_address1()
543 elif self.dot11.get_fromDS() and not self.dot11.get_toDS():
544 bssid = p.get_address2()
545 elif not self.dot11.get_fromDS() and not self.dot11.get_toDS():
546 bssid = p.get_address3()
547 else:
548 # WDS, this is the RA
549 bssid = p.get_address1()
550
551 wep_decoder = Dot11WEPDecoder(self.key_manager)
552 wep_decoder.set_bssid(bssid)
553 packet = wep_decoder.decode(p.body_string)
554 if packet is None:
555 wpa_decoder = Dot11WPADecoder()
556 packet = wpa_decoder.decode(p.body_string)
557 if packet is None:
558 wpa2_decoder = Dot11WPA2Decoder()
559 packet = wpa2_decoder.decode(p.body_string)
560 if packet is None:
561 data_decoder = DataDecoder()
562 packet = data_decoder.decode(p.body_string)
563
564 p.contains(packet)
565 return p
566
567class Dot11WEPDecoder(BaseDot11Decoder):
568 def __init__(self, key_manager):

Callers 1

decodeMethod · 0.95

Calls 15

get_address1Method · 0.95
get_address2Method · 0.95
get_address3Method · 0.95
set_bssidMethod · 0.95
decodeMethod · 0.95
decodeMethod · 0.95
decodeMethod · 0.95
decodeMethod · 0.95
LLCDecoderClass · 0.85
Dot11WEPDecoderClass · 0.85
Dot11WPADecoderClass · 0.85
Dot11WPA2DecoderClass · 0.85

Tested by

no test coverage detected