This work shows the modifications applied to the Qemu emulator in "single process emulation" mode (user mode) for Linux and its porting for FreeBSD operating system. The modifications are developed with the aim of performing malware analysis through transparent debugging and tracing technology. Some key concepts and issues regarding malicious software are introduced, and in particular the problem of understanding and contrasting it, highlighting the need of malware analysis. This thesis deeply analyzes the different technologies and types of malware analysis, the topics and problems related to it, and the state of art of the research in the field. The focus is on debugging techniques for malware inspection, used in an emulation environment in order to counteract the malware that has anti-debugging features. Furthermore there is the description of the various existing emulators in order to find the one that better matches these needs. The work uses a debugger provided by the Qemu user mode, which is the emulator that has been chosen for this tool. In this modality it is possible to perform only CPU emulation instead of operating system emulation, thus creating an interface between the malware and the real CPU. This work deeply describes the Qemu in all its significant characteristics and it shows the Qemu user mode porting work from Linux to FreeBSD operating system and all the modifications made for both operating systems. Moreover, it illustrates the debugging tool and the two tracing tools used inside Qemu. Eventually, this work shows the results obtained with the above-mentioned program by analyzing complex binaries. It is initially shown the correct emulation of a binary that performs network downloads under the FreeBSD OS. Some of these executables contain anti-debugging code and are chosen to check the emulation transparence. Finally others are used in order to evaluate the tool’s performance.

Questo lavoro di tesi presenta le modifiche apportate al software di emulazione Qemu, in modalità "emulazione di singoli processi" (user mode) per Linux, e il suo porting su sistema operativo FreeBSD. Le modifiche sono state sviluppate al fine di eseguire analisi del malware in modo tale da essere trasparente utilizzando tecnologie di debugging e tracing. Sono stati innanzitutto presentati concetti e problemi chiave riguardanti il malware e, in particolare, le problematiche riguardanti la sua comprensione, il suo studio ed il modo in cui contrastarlo, sottolineando la necessità di una analisi del malware (malware analysis). Questa tesi propone un'accurata analisi delle differenti tecnologie e tipologie di analisi dei malware, i principali argomenti e problematiche ad esse collegate e lo stato dell'arte dei lavori di ricerca nel campo. Il lavoro si é focalizzato sull’utilizzo di un debugger per l’ispezione malware utilizzato all’interno di un ambiente d’emulazione, contrastando in questo modo quelle tipologie di malware che utilizzano delle tecniche di anti-debugging. Vengono in seguito descritti i vari tipi di emulatori esistenti, in modo tale da trovare quello che meglio corrisponde a queste esigenze. Il lavoro si serve di un debugger fornito da Qemu in modalità user mode, che é l'emulatore scelto. Con questa modalità é possibile effettuare l’emulazione della sola CPU invece che dell’intero sistema operativo, la CPU emulata diviene quindi un’interfaccia tra il malware e la vera CPU. Viene descritto accuratamente Qemu con tutte le sue caratteristiche significative. Viene quindi mostrato il lavoro di porting di Qemu user mode da Linux a FreeBSD e tutte le modifiche effettuate per entrambi i sistemi operativi. Sono inoltre stati illustrati il debugger e i due strumenti di tracing utilizzati in Qemu. Sono infine esposti i risultati ottenuti analizzando vari binari con il programma sviluppato. Si é inizialmente voluto far vedere la corretta emulazione di un binario che effettua connessioni con la download dalla rete. Alcuni di questi eseguibili contenenti codice di anti-debugging sono stati impiegati per verificare la trasparenza dell’emulazione. Altri infine sono stati utilizzati per la valutazione delle perfomance.

Single process emulation with Qemu to support dynamic analysis

GIOVANAZZI, ANTONIO
2009/2010

Abstract

This work shows the modifications applied to the Qemu emulator in "single process emulation" mode (user mode) for Linux and its porting for FreeBSD operating system. The modifications are developed with the aim of performing malware analysis through transparent debugging and tracing technology. Some key concepts and issues regarding malicious software are introduced, and in particular the problem of understanding and contrasting it, highlighting the need of malware analysis. This thesis deeply analyzes the different technologies and types of malware analysis, the topics and problems related to it, and the state of art of the research in the field. The focus is on debugging techniques for malware inspection, used in an emulation environment in order to counteract the malware that has anti-debugging features. Furthermore there is the description of the various existing emulators in order to find the one that better matches these needs. The work uses a debugger provided by the Qemu user mode, which is the emulator that has been chosen for this tool. In this modality it is possible to perform only CPU emulation instead of operating system emulation, thus creating an interface between the malware and the real CPU. This work deeply describes the Qemu in all its significant characteristics and it shows the Qemu user mode porting work from Linux to FreeBSD operating system and all the modifications made for both operating systems. Moreover, it illustrates the debugging tool and the two tracing tools used inside Qemu. Eventually, this work shows the results obtained with the above-mentioned program by analyzing complex binaries. It is initially shown the correct emulation of a binary that performs network downloads under the FreeBSD OS. Some of these executables contain anti-debugging code and are chosen to check the emulation transparence. Finally others are used in order to evaluate the tool’s performance.
VIGNA, GIOVANNI
ING V - Facolta' di Ingegneria dell'Informazione
21-lug-2010
2009/2010
Questo lavoro di tesi presenta le modifiche apportate al software di emulazione Qemu, in modalità "emulazione di singoli processi" (user mode) per Linux, e il suo porting su sistema operativo FreeBSD. Le modifiche sono state sviluppate al fine di eseguire analisi del malware in modo tale da essere trasparente utilizzando tecnologie di debugging e tracing. Sono stati innanzitutto presentati concetti e problemi chiave riguardanti il malware e, in particolare, le problematiche riguardanti la sua comprensione, il suo studio ed il modo in cui contrastarlo, sottolineando la necessità di una analisi del malware (malware analysis). Questa tesi propone un'accurata analisi delle differenti tecnologie e tipologie di analisi dei malware, i principali argomenti e problematiche ad esse collegate e lo stato dell'arte dei lavori di ricerca nel campo. Il lavoro si é focalizzato sull’utilizzo di un debugger per l’ispezione malware utilizzato all’interno di un ambiente d’emulazione, contrastando in questo modo quelle tipologie di malware che utilizzano delle tecniche di anti-debugging. Vengono in seguito descritti i vari tipi di emulatori esistenti, in modo tale da trovare quello che meglio corrisponde a queste esigenze. Il lavoro si serve di un debugger fornito da Qemu in modalità user mode, che é l'emulatore scelto. Con questa modalità é possibile effettuare l’emulazione della sola CPU invece che dell’intero sistema operativo, la CPU emulata diviene quindi un’interfaccia tra il malware e la vera CPU. Viene descritto accuratamente Qemu con tutte le sue caratteristiche significative. Viene quindi mostrato il lavoro di porting di Qemu user mode da Linux a FreeBSD e tutte le modifiche effettuate per entrambi i sistemi operativi. Sono inoltre stati illustrati il debugger e i due strumenti di tracing utilizzati in Qemu. Sono infine esposti i risultati ottenuti analizzando vari binari con il programma sviluppato. Si é inizialmente voluto far vedere la corretta emulazione di un binario che effettua connessioni con la download dalla rete. Alcuni di questi eseguibili contenenti codice di anti-debugging sono stati impiegati per verificare la trasparenza dell’emulazione. Altri infine sono stati utilizzati per la valutazione delle perfomance.
Tesi di laurea Magistrale
File allegati
File Dimensione Formato  
tesi.pdf

non accessibile

Descrizione: Thesis text
Dimensione 1.87 MB
Formato Adobe PDF
1.87 MB Adobe PDF   Visualizza/Apri

I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10589/2241