
# 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
同じコマンドが2回実行されます。