• Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 8 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Uncovering Class Hierarchies in C++ Programs

Marx

Uncovering Class Hierarchies in C++ Programs

This repository holds the programs used for the NDSS 2017 paper MARX: Uncovering Class Hierarchies in C++ Programs.

Evaluation Data

The data used to evaluate Marx is available at zenodo.org.

Organization

Folder structure as follows:

  • include contains the header files,
  • src contains the source code itself,
  • patch contains a patch to enable manual memory management for VEX,
  • ida_export contains an IDA script creating a .dmp file,
  • scripts contains helper scripts.

Development Setup

Requires CMake, at least version 2.8. As for IDEs, QtCreator works pretty well for C++ development and contains an useful debugger.

When using QtCreator, simply click on "Open Project" and select CMakeLists.txt. It makes sense to let the build directory point to a directory called build inside the project's root directory (in case your IDE does not honor CMake's RUNTIME_OUTPUT_DIRECTORY variable).

Debug builds are considerably slower but are necessary for proper debugging behavior. Make sure to set CMAKE_BUILD_TYPE accordingly in CMakeLists.txt (you can do so from within QtCreator). In desperate cases, try the option "Run CMake" from the context menu.

When developing from the command line, issue the following commands from the project's root directory:

mkdir build && cd build
cmake ..
make -j{CPU_COUNT}

The project requires a patched version of Valgrind. To be more exact, only the VEX sub-project is actually used and patched.

Download Valgrind from the official project page. We recommend checking out the subversion repository. Revision 3203 of VEX is known to work:

svn co svn://svn.valgrind.org/valgrind/trunk@15732 valgrind
cd valgrind/VEX/
svn update -r 3203

Configure the project as per its installation instructions. Switch to the VEX directory and apply the patch found in folder patch:

cd VEX
patch -p0 < ../marx/patch/heap_allocation_patch.diff

First configure Valgrind by issuing ./autogen.sh and ./configure. Then issue make and make install inside the VEX directory to install the VEX components. The CMake project tries to include the library /usr/local/lib/valgrind/libvex-amd64-linux.a. Make sure it exists.

Usage

When developing on a new binary, the first step is to export data from an IDA database. The IDAPython script found in ida_export creates a dump file {BINARY_NAME}.dmp and exports all necessary data used for the analysis in the folder the binary lies in. Remember to set the pure_virtual_addr in the IDAPython script before executing it. In case of Windows, the function is called _purecall. In Linux, it is called __cxa_pure_virtual.

After exporting all data, a config file for Marx has to be created manually. A config file looks like the following:

MODULENAME filezilla
TARGETDIR ../tests/filezilla/
FORMAT ELF64
NEWOPERATORS 2 431F80 432C00
EXTERNALMODULES 8 ../tests/libwx_gtk2u_aui/libwx_gtk2u_aui-3.1.so.0.0.0 ../tests/libwx_gtk2u_xrc/libwx_gtk2u_xrc-3.1.so.0.0.0 ../tests/libwx_gtk2u_adv/libwx_gtk2u_adv-3.1.so.0.0.0 ../tests/libwx_gtk2u_core/libwx_gtk2u_core-3.1.so.0.0.0 ../tests/libwx_baseu_net/libwx_baseu_net-3.1.so.0.0.0 ../tests/libwx_baseu/libwx_baseu-3.1.so.0.0.0 ../tests/libwx_gtk2u_html/libwx_gtk2u_html-3.1.so.0.0.0 ../tests/libwx_baseu_xml/libwx_baseu_xml-3.1.so.0.0.0

Further examples of config files can be seen in the evaluation data at zenodo.org.

When the config file is created, Marx can be executed by issuing the following command:

./marx ../tests/filezilla/config.cfg

Afterwards, the IDAPython script found in ida_import can be used to import the analyzed data back to IDA.

NOTE: Windows binaries have to be loaded at base address 0x0 (or rebased) in IDA before exporting them. Also, the IDAPython script only supports Windows binaries which are compiled with RTTI. Furthermore, specific functions have to be blacklisted in Windows binaries (because of compiler optimizations which would cause a lot of false-positives during the analysis) that are in multiple vtables but do not belong together. This is the case for example for short functions that do just zero a register and do nothing more. See for further details the helper script ida_win_find_blacklist_functions.py.

More Repositories

1

DroneSecurity

DroneSecurity (NDSS 2023)
Python
945
star
2

kAFL

Code for the USENIX 2017 paper: kAFL: Hardware-Assisted Feedback Fuzzing for OS Kernels
Python
550
star
3

redqueen

Python
339
star
4

OMEN

OMEN: Ordered Markov ENumerator - Password Guesser
C
313
star
5

Microcode

Microcode Updates for the USENIX 2017 paper: Reverse Engineering x86 Processor Microcode
Python
297
star
6

syntia

Program synthesis based deobfuscation framework for the USENIX 2017 paper "Syntia: Synthesizing the Semantics of Obfuscated Code"
Python
296
star
7

mobile_sentinel

Python
187
star
8

nyx-net

Python
176
star
9

Nyx

USENIX 2021 - Nyx: Greybox Hypervisor Fuzzing using Fast Snapshots and Affine Types
C
169
star
10

ijon

C
164
star
11

GANDCTAnalysis

Code for the ICML 2020 paper: Leveraging Frequency Analysis for Deep Fake Image Recognition.
Python
161
star
12

nautilus

a grammar based feedback fuzzer
Rust
158
star
13

aurora

Usenix Security 2021 - AURORA: Statistical Crash Analysis for Automated Root Cause Explanation
Rust
146
star
14

grimoire

Python
125
star
15

loki

Hardening code obfuscation against automated attacks
Python
125
star
16

Password-Guessing-Framework

A Framework for Comparing Password Guessing Strategies
Python
120
star
17

antifuzz

AntiFuzz: Impeding Fuzzing Audits of Binary Executables
C
101
star
18

EthBMC

The code repository for the 2020 Usenix Security paper "EthBMC: A Bounded Model Checker for Smart Contracts"
Rust
91
star
19

WaveFake

Python
71
star
20

SiemensS7-Bootloader

Client utility for Siemens S7 bootloader special access feature
Python
55
star
21

NEMO

Modeling Password Guessability Using Markov Models
Python
54
star
22

gadget_synthesis

Esorics 2021 - Towards Automating Code-Reuse Attacks Using Synthesized Gadget Chains
Python
54
star
23

EvilCoder

Code for the paper EvilCoder: Automated Bug Insertion at ACSAC 2016
Java
42
star
24

JIT-Picker

Swift
34
star
25

cupid

Cupid: Automatic Fuzzer Selection for Collaborative Fuzzing
C
29
star
26

Probfuscator

An Obfuscation Approach using Probabilistic Control Flows
C#
28
star
27

Hypercube

NDSS 2020 - HYPER-CUBE: High-Dimensional Hypervisor Fuzzing
C
24
star
28

ijon-data

14
star
29

PrimGen

ACSAC 2018 paper: Towards Automated Generation of Exploitation Primitives for Web Browsers
HTML
13
star
30

adversarial-papers

TeX
12
star
31

DroneSecurity-Fuzzer

DroneSecurity Fuzzer (NDSS 2023)
11
star
32

dompteur

C++
10
star
33

we-value-your-privacy

Results and data from the paper "We Value Your Privacy ... Now Take Some Cookies: Measuring the GDPR’s Impact on Web Privacy"
9
star
34

VPS

VTable Pointer Separation
C++
7
star
35

APC

Android (Unlock) Pattern Classifier
Kotlin
6
star
36

WindowsVTV

MinGW for 32bit with Vtable pointer verification (VTV)
C++
6
star
37

nyx-net-profuzzbench

Shell
6
star
38

PriDi

Python
5
star
39

xTag-mtalloc

C
5
star
40

SUCI-artifacts

some PCAPs and logs
5
star
41

ASSS

Application-Specific Software Stacks
4
star
42

xTag

4
star
43

MiddleboxProtocolStudy

Auxiliary material for NDSS'20 paper: On Using Application-Layer Middlebox Protocols for Peeking Behind NAT Gateways
Python
4
star
44

Password-Strength-Meter-Accuracy

Measuring the Accuracy of Password Strength Meters
Python
3
star
45

uninformed-consent

Repo for material related to the CCS 2019 paper, "(Un)informed Consent: Studying GDPR Consent Notices in the Field"
3
star
46

be-the-phisher

Code related to the study presented in "Be the Phisher - Understanding Users’ Perception of Malicious Domains" @ AsiaCCS 2020
Jupyter Notebook
2
star
47

symtegrity

Code for the DIMVA 2018 paper "On the Weaknesses of Function Table Randomization"
2
star
48

MastersOfTime

2
star
49

libXSGS

Implementation of Delerablée and Pointcheval's eXtremely Short Group Signatures (XSGS)
Shell
2
star
50

xTag-llvm

C++
1
star
51

MachineCodeTimings

JavaScript
1
star
52

tropyhunter

TODO
Python
1
star
53

GDPR-fines

Supplemental Material for the PETS 2022 Paper "Investigating GDPR Fines in the Light of Data Flows"
Jupyter Notebook
1
star
54

GeneratedMediaSurvey

Jupyter Notebook
1
star