Skip to content

Commit

Permalink
added moving sequence number randomization to all packet types
Browse files Browse the repository at this point in the history
  • Loading branch information
mothran committed Sep 21, 2014
1 parent c882e4d commit 935417f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libbunny/Templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ def makePacket(self, inject_data):
Make a QOS data packet with injected data, fields are: Sequence num and databody
"""
self.sequence_num = struct.pack("<H", random.randrange(0,65536) & 0xF000)

outbound = self.type + self.frame_control + self.duration+ self.BSSID + self.SA + self.DA + self.sequence_num + self.QOS

outbound = outbound + struct.pack("B", len(inject_data)) + inject_data
Expand Down Expand Up @@ -325,6 +327,8 @@ def makePacket(self, inject_data):
Creates a packet with injected encrypted data.
"""

self.sequence_num = struct.pack("<H", random.randrange(0,65536) & 0xF000)

outbound = self.type + self.frame_control + self.duration + self.DA + self.SA + self.BSSID + self.sequence_num
outbound = outbound + "\x00" + struct.pack("<B", len(inject_data)) + inject_data
Expand Down

0 comments on commit 935417f

Please sign in to comment.