AAU Student Projects - visit Aalborg University's student projects portal
An executive master's programme thesis from Aalborg University
Book cover


A Dual-Model Detection Framework Based on Address Validation and Boolean Control Flow: Runtime Software Attacks

Authors

;

Term

4. semester

Publication year

2025

Submitted on

Pages

118

Abstract

Softwareangreb, der sker, mens et program kører, er en voksende risiko for indlejrede systemer og IoT-enheder, også i sikkerhedskritiske områder som medicinsk udstyr. I stedet for at tilføje ny skadelig kode kan angribere overtage et programs kontrolflow—rækkefølgen af instruktioner—ved at genbruge eksisterende kodebidder; denne teknik kaldes Return-Oriented Programming (ROP). Denne afhandling undersøger både, hvordan sådanne angreb udføres, og hvordan de kan stoppes, med en sårbar insulinpumpe-controller som praktisk case. Først bygger vi et fungerende ROP-udnyttelsesangreb på et selvstændigt program for at vise, hvordan en modstander kan omgå godkendelse og udløse uautoriserede systemkald ved at kæde små instruktionssekvenser ("gadgets") sammen. Derefter præsenterer vi to letvægts metoder til runtime-detektion, målrettet enheder med begrænsede CPU- og hukommelsesressourcer. Address-based ROP Detection (ARD) kontrollerer under kørsel, at hvert funktionsretur går til en tilladt destination på en statisk hvidliste over legitime mål. Boolean State Validator (BSVD) beskriver programmets tilsigtede logik som boolske tilstande og overgange, så systemet kan markere adfærd, der afviger fra den forventede semantik. Vi implementerer og evaluerer begge teknikker med værktøjer til analyse af binær kode—dynamisk binær instrumentering (Intel PIN) og statisk analyse (Ghidra, angr). Resultaterne viser pålidelig detektering af kapring af kontrolflow med lav ekstra belastning, uden krav om adgang til kildekode eller ændringer af hardware.

Software attacks that happen while a program is running are a growing risk for embedded and Internet-of-Things (IoT) devices, including safety-critical ones like medical equipment. Instead of adding new malicious code, attackers can take over a program’s control flow—the order in which it executes instructions—by reusing existing code snippets, a technique called Return-Oriented Programming (ROP). This thesis examines how such attacks work and how to stop them, using a vulnerable insulin pump controller as a practical case. We first build a working ROP exploit on a standalone program to show how an adversary can bypass authentication and trigger unauthorized system calls by chaining small instruction sequences (“gadgets”). Then we introduce two lightweight, runtime detection methods designed for devices with limited CPU and memory. Address-based ROP Detection (ARD) checks, at run time, that each function return goes to an allowed destination from a static whitelist of legitimate targets. The Boolean State Validator (BSVD) represents the program’s intended logic as true/false states and transitions, allowing the system to flag behavior that violates expected semantics. We implement and evaluate both techniques using binary analysis tools—dynamic binary instrumentation (Intel PIN) and static analysis (Ghidra, angr). The results show reliable detection of control-flow hijacking with low overhead, and the approach works without access to source code or any hardware changes.

[This abstract was generated with the help of AI]