# satellite_sim.py - Spacecraft that executes telecommands without checking sequence number
class Satellite:
def __init__(self):
self.executed = set()
def receive_tc(self, cmd_id, seq_num):
# Vulnerability: ignores seq_num, allowing replay of same command
self.execute(cmd_id)
def execute(cmd_id):
print(f"Executing command {cmd_id}")
sat = Satellite()
# Legitimate command
sat.receive_tc("ORBIT_CORRECTION", 1001)
# Attacker replays the same command
sat.receive_tc("ORBIT_CORRECTION", 1001)
卫星指令系统接受 CCSDS 遥控指令数据包,但未验证序列号以防止重放。拦截到指令的攻击者可以重放该指令,导致推进器重复点火或其他有害操作。
运行模拟:
python satellite_sim.py
相同的命令被执行两次。