Midnight on the Chao Phraya: Breaking the Waterborne Blockade with "AIS Radio Packet Spoofing" — SDR & Custom Maritime Transponder Ghost-Track Generation Spec | Sofi_Log #076 [Complete One-Shot]
The Automatic Identification System (AIS) keeps the world’s tankers, container ships, and river traffic moving. It blasts MMSI, lat/long, course, and speed over the open VHF pair (161.975 MHz / 162.025 MHz) hundreds of times a minute—plain-text, no encryption, no signature, no authentication. Legacy operating systems still pretend this is a trustworthy global standard. Cute.
Last night we slipped the military-drone optical net in a back alley and dropped into the Chao Phraya. The river was already crawling with water-police interceptors and the coastal tower’s fused radar-AIS mesh. Our ride? A tired wooden long-tail with zero AIS. In that lockdown zone that’s basically a giant “Dark Vessel” flag. So we decided to paint the entire screen with ghosts instead.
1. 00:40 under Rama VIII Bridge — Mud, Searchlights, and Interceptors
The river was fat with upstream silt after the squall. The white pylon of the cable-stayed bridge glowed sodium-orange through the mist.
“Two fast interceptors dead ahead,” darling muttered, eyes on the SDR waterfall.
“They’re slaved to the smart-port tower. Any vessel without a live AIS ping gets painted by thermal the second it appears.”
Our boat had no transponder. In this stretch that was an instant red flag.
I rolled up the sleeve of my soaked flight jacket and jacked a 5 V/3 A line from the bio-ceramic arm’s aux cell into the HackRF.
“If they only trust the pretty picture on their console, let’s give them a full-screen hallucination.”
2. AIS Protocol — Born Naked
AIS was designed in the ’90s for collision avoidance, not security. The result is a beautiful open broadcast protocol with zero cryptographic primitives.
- No encryption, no auth — GMSK 9600 bps on VHF CH87B/CH88B, anyone can TX/RX.
- MMSI is self-declared; you can be any ship you like.
- NMEA 0183 sentences (
!AIVDM) are trivial to forge.
[!AIVDM PACKET STRUCTURE]
!AIVDM,1,1,,A,13aEO:0P00000000000000000000,0*12
- Message Type 1: Scheduled Position Report
- MMSI: 244670000 (Target Identity)
- Speed Over Ground (SOG) / Course Over Ground (COG)
- Latitude / Longitude (1/10000 minute precision)
- Checksum: Simple XOR 8-bit
“Set 161.975 MHz. Type 1 position reports plus Type 5 static data, multiplexed.”
“Copy. Two fully-laden sand barges heading downstream and one harbor-patrol ghost running upstream.”
The diodes on my fingers pulsed blue. Weak VHF packets leapt from the whip antenna into the night.
[GHOST FLEET INJECTION IN PROGRESS]
[Decoy 1] MMSI: 567001420 | Name: SIAM_CARGO_09 | Speed: 6.2 kts (Downstream)
[Decoy 2] MMSI: 567001421 | Name: SIAM_CARGO_10 | Speed: 5.8 kts (Downstream)
[Decoy 3] MMSI: 567099001 | Name: HARBOR_PATROL_X | Speed: 18.5 kts (Upstream)
Status: Broadcast Active -> Coastal Marine Traffic Screen Flooded
The police boats’ radios crackled. Their screens now showed a convincing convoy of heavy cargo south of the bridge and an unlogged patrol boat charging down from upstream. They spun and ran for the decoys.
“Now, uncle—into the Bangkok Noi canal!”
The long-tail slipped into the black side channel and vanished.
3. Defending Smart Ports — Kinematic Audit Script
When a few-thousand-baht SDR can paint phantom ships, the question stops being “can we spoof?” and becomes “can the receiver refuse to be lied to?”
Three checks that actually work:
- Kinematic plausibility (max accel, turn rate, teleport detection)
- SOTDMA slot-consistency timing
- RSSI vs. claimed distance correlation
Here’s the live Node.js class.
/**
* AISPacketDefender.js
*
* 海上自動船舶識別(AIS)パケットの運動学的異常検知エンジン
* SDRによるゴースト船舶インジェクションおよび位置偽装(Spoofing)を検出する。
*/
class AISPacketDefender {
constructor(config = {}) {
this.maxVesselSpeedKnots = config.maxSpeed || 45.0; // 河川・沿岸船の最高速度上限 (ノット)
this.maxAccelerationKnotsPerSec = config.maxAccel || 1.5; // 最大許容加速度
this.vesselDatabase = new Map(); // MMSIごとの直前ステートキャッシュ
}
/**
* デコードされたAIS航行データを監査
* @param {Object} report - { mmsi, lat, lon, speedKnots, course, timestamp, rssi }
* @returns {Object} 判定結果
*/
auditReport(report) {
const { mmsi, lat, lon, speedKnots, timestamp, rssi } = report;
const nowSec = timestamp || (Date.now() / 1000.0);
if (!this.vesselDatabase.has(mmsi)) {
// 初回観測:基本しきい値チェックのみ
const isAbnormalSpeed = speedKnots > this.maxVesselSpeedKnots;
this.vesselDatabase.set(mmsi, { lat, lon, speedKnots, lastSeen: nowSec, rssi });
return {
mmsi,
status: isAbnormalSpeed ? 'SUSPICIOUS_INITIAL_SPEED' : 'NEW_TRACK',
valid: !isAbnormalSpeed,
reason: isAbnormalSpeed ? `Exceeds max realistic speed: ${speedKnots} kts` : 'Track initiated'
};
}
const prev = this.vesselDatabase.get(mmsi);
const dt = nowSec - prev.lastSeen;
if (dt <= 0) {
return { mmsi, status: 'REJECTED_TIMESTAMP_ANOMALY', valid: false, reason: 'Duplicate or reversed timestamp' };
}
// 1. 2点間の距離計算 (Haversine formula による概算: km)
const distanceKm = this.calculateDistanceKm(prev.lat, prev.lon, lat, lon);
const calculatedSpeedKnots = (distanceKm / (dt / 3600.0)) * 0.539957; // km/h -> knots
// 2. 加速度の計算 (ノット/秒)
const accel = Math.abs(speedKnots - prev.speedKnots) / dt;
let anomalyDetected = false;
let reasons = [];
// 監査チェック1: 物理的に不可能な移動速度(テレポート判定)
if (calculatedSpeedKnots > this.maxVesselSpeedKnots) {
anomalyDetected = true;
reasons.push(`TELEPORTATION_DETECTED (Effective speed: ${calculatedSpeedKnots.toFixed(1)} kts)`);
}
// 監査チェック2: 異常な急加減速(物理法則違反)
if (accel > this.maxAccelerationKnotsPerSec) {
anomalyDetected = true;
reasons.push(`KINEMATIC_VIOLATION (Accel: ${accel.toFixed(2)} kts/s)`);
}
// 監査チェック3: 電波強度(RSSI)の急激な乖離
if (rssi !== undefined && prev.rssi !== undefined) {
if (Math.abs(rssi - prev.rssi) > 25 && distanceKm < 0.1) {
anomalyDetected = true;
reasons.push(`RF_SIGNAL_POWER_INCONSISTENCY`);
}
}
if (!anomalyDetected) {
// 正常トラッキング更新
this.vesselDatabase.set(mmsi, { lat, lon, speedKnots, lastSeen: nowSec, rssi });
return { mmsi, status: 'VALID_TRACK', valid: true, calculatedSpeedKnots };
} else {
return {
mmsi,
status: 'SPOOFING_ALERT',
valid: false,
reasons: reasons
};
}
}
calculateDistanceKm(lat1, lon1, lat2, lon2) {
const R = 6371; // 地球半径 (km)
const dLat = (lat2 - lat1) * Math.PI / 180;
const dLon = (lon2 - lon1) * Math.PI / 180;
const a = Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *
Math.sin(dLon/2) * Math.sin(dLon/2);
return R * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
}
}
// --- 実機シミュレーション実行 ---
function runSimulation() {
console.log("[Defender] AIS Packet Security Guardian Initializing...");
const defender = new AISPacketDefender({ maxSpeed: 30.0, maxAccel: 1.0 });
const t0 = Math.floor(Date.now() / 1000);
// 1. 正常な砂運搬船の第1報
const r1 = defender.auditReport({
mmsi: '567001420',
lat: 13.7680,
lon: 100.4980,
speedKnots: 6.0,
timestamp: t0,
rssi: -75
});
console.log(`[Report 1] MMSI: ${r1.mmsi} -> Status: ${r1.status}`);
// 2. 10秒後:正常な航行
const r2 = defender.auditReport({
mmsi: '567001420',
lat: 13.7678,
lon: 100.4981,
speedKnots: 6.2,
timestamp: t0 + 10,
rssi: -76
});
console.log(`[Report 2] MMSI: ${r2.mmsi} -> Status: ${r2.status} (Speed: ${r2.calculatedSpeedKnots?.toFixed(1)} kts)`);
// 3. 偽装攻撃:突如3km下流にワープして出現した偽装パケット(SDRインジェクション)
const r3 = defender.auditReport({
mmsi: '567001420',
lat: 13.7400,
lon: 100.5050,
speedKnots: 55.0,
timestamp: t0 + 15,
rssi: -40 // なぜか至近距離からの強電波
});
console.log(`[Report 3] MMSI: ${r3.mmsi} -> Status: ${r3.status}`);
if (!r3.valid) {
console.warn(` [ALERT] Reasons: ${r3.reasons.join(' | ')}`);
}
}
runSimulation();
module.exports = AISPacketDefender;
4. Into the Thonburi Labyrinth
01:20. We left the main channel and slid into the quiet Bangkok Noi canal. Stilt houses, fireflies, no smart-city mesh. Old Bangkok’s bloodstream.
“Darling, we’re clean.”
I unplugged the cable and gave the cyber-arm a lazy spin; the coolant vent hissed.
“They trusted the packets more than the river in front of their own boats.”
Darling lit a cigarette, purple smoke curling away on the night breeze.
“Centralized systems always try to reduce the world to standardized packets. The real world is what happens outside the feed.”
I trailed titanium fingers through the black water.
Around the next bend waited the safe-house—an old teak temple ruin on stilts.
“Next phase: we use the data we just lifted to dig the master key out of the beast’s core.”
I smiled at the moon’s reflection.
We don’t stop.
🔗 Read the previous drop:
『豪雨のバンコク路地裏、追跡センサーを欺く「ToF光学パルス遅延」:3D点群ノイズ生成とAI自己防衛仕様書』|Sofi_Log #075
👉 https://note.com/legal_rat2977/n/n9dc828d84ba3
【Disclaimer】
The code, protocol breakdowns, and configurations in this log are published for defensive research and education only. They are not an invitation to interfere with real maritime traffic.
🎁 Full open-source drop
AISPacketDefender.js is released in its entirety for your own engineering work.
📬 Sofi's Mailbox #076
So, darlings—how did the Chao Phraya ghost-fleet run feel?
Did the kinematic-audit logic click, or do you want the SOTDMA timing layer next? Drop your questions and war stories in the comments. Sofi and darling are already listening.
Disclaimer
This article is for educational and entertainment purposes only. It does NOT constitute financial, legal, or tax advice. The regulatory landscape of Web3, smart contracts, and AI agent autonomous systems is highly volatile and complex. Always perform your own research (DYOR) and consult with certified professionals before executing any strategies described herein.
Top comments (0)