Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions scapy/layers/dot11.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ class Dot11(Packet):
[
(
FlagsField("FCfield", 0, 4,
["pw-mgt", "MD", "protected", "order"]),
["pw_mgt", "MD", "protected", "order"]),
lambda pkt: (pkt.type, pkt.subtype) == (1, 6)
),
(
Expand All @@ -718,8 +718,8 @@ class Dot11(Packet):
)
],
FlagsField("FCfield", 0, 8,
["to-DS", "from-DS", "MF", "retry",
"pw-mgt", "MD", "protected", "order"])
["to_DS", "from_DS", "MF", "retry",
"pw_mgt", "MD", "protected", "order"])
),
ConditionalField(
BitField("FCfield_bw", 0, 3),
Expand All @@ -746,7 +746,7 @@ class Dot11(Packet):
ConditionalField(
_Dot11MacField("addr4", ETHER_ANY, 4),
lambda pkt: (pkt.type == 2 and
pkt.FCfield & 3 == 3), # from-DS+to-DS
pkt.FCfield & 3 == 3), # from_DS+to_DS
)
]

Expand Down Expand Up @@ -2116,7 +2116,7 @@ def make_reply(self, p):
tcp = p.getlayer(TCP)
pay = raw(tcp.payload)
p[IP].underlayer.remove_payload()
p.FCfield = "from-DS"
p.FCfield = "from_DS"
p.addr1, p.addr2 = p.addr2, p.addr1
p /= IP(src=ip.dst, dst=ip.src)
p /= TCP(sport=tcp.dport, dport=tcp.sport,
Expand Down
8 changes: 4 additions & 4 deletions scapy/modules/krack/automaton.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def build_GTK_KDE(self):
])

def send_wpa_enc(self, data, iv, seqnum, dest, mic_key,
key_idx=0, additionnal_flag=["from-DS"],
key_idx=0, additionnal_flag=["from_DS"],
encrypt_key=None):
"""Send an encrypted packet with content @data, using IV @iv,
sequence number @seqnum, MIC key @mic_key
Expand Down Expand Up @@ -551,7 +551,7 @@ def send_wpa_handshake_1(self):
addr1=self.client,
addr2=self.mac,
addr3=self.mac,
FCfield='from-DS',
FCfield='from_DS',
SC=(next(self.seq_num) << 4),
)
rep /= LLC(dsap=0xaa, ssap=0xaa, ctrl=3)
Expand Down Expand Up @@ -595,7 +595,7 @@ def send_wpa_handshake_3(self, pkt):
addr1=self.client,
addr2=self.mac,
addr3=self.mac,
FCfield='from-DS',
FCfield='from_DS',
SC=(next(self.seq_num) << 4),
)

Expand Down Expand Up @@ -652,7 +652,7 @@ def krack_proceed(self, send_3handshake=False, send_gtk=False):
addr1=self.client,
addr2=self.mac,
addr3=self.mac,
FCfield='from-DS',
FCfield='from_DS',
SC=(next(self.seq_num) << 4),
subtype=0,
type="Data",
Expand Down
2 changes: 1 addition & 1 deletion test/answering_machines.uts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def check_WiFi_am_reply(packet):
assert isinstance(packet, list) and len(packet) == 2
assert TCP in packet[0] and Raw in packet[0] and raw(packet[0][Raw]) == b"5c4pY"

test_WiFi_am(Dot11(FCfield="to-DS")/IP()/TCP()/"Scapy",
test_WiFi_am(Dot11(FCfield="to_DS")/IP()/TCP()/"Scapy",
check_WiFi_am_reply,
iffrom="scapy0", ifto="scapy1", replace="5c4pY", pattern="Scapy")

Expand Down
1 change: 1 addition & 0 deletions test/scapy/layers/dot11.uts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ assert raw(PPI()/Dot11(type=2, subtype=8, FCfield=0x40)/Dot11QoS()/Dot11WEP()) =
conf.wepkey = "test123"
a = PPI(b'\x00\x00\x08\x00i\x00\x00\x00\x88@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x008(^a')
assert a[Dot11QoS][Dot11WEP].icv == 942169697
assert not a[Dot11].FCfield.to_DS

= Dot11TKIP - dissection

Expand Down