- Currently SPI depends on a customized dyninstAPI
- build dyninst with arch-x86.h exposed to public
- build dyninst with OpenMP disabled
- Dynamically linked functions may appear twice during instrumentation, because these functions exist in .plt sections too.
- Inter-host propel
- Solve the arch-x86.h dependency problem
- A possible solution is to expose codegenAPI in dyninst
- OpenMP hangs during parsing
- Test suite
- Update MIST and SecStar
- Copy example-make.config to be
config.mk
. - Edit
config.mk
to define each macro variable.
- DYNINST_DIR: absolute path of Dyninst's lib directory
- SP_DIR: absolute path of this package (the output of
pwd
), because this file is also used by Makefile, I don't putpwd
in it. - DYNLINK: true for building shared library for agent, otherwise for building static library
- Run
make spi
to build injector and libagent.so. - Run
make test_agent
to build example user agents - For more make options, see Make Arguments
- Export Runtime environment variables, see Environment Variable section for detail:
SP_DIR
PLATFORM
SP_AGENT_DIR
- Make sure that your system does not block non-child ptrace
- To temporarily disable this measure (until a reboot), execute the following command:
echo 0 > /proc/sys/kernel/yama/ptrace_scope
- To permanently disable this measure, edit the file
/etc/sysctl.d/10-ptrace.conf
and follow the directions in that file. - For more information, see https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening
- There are two ways to kick start the Self-Propel
- To use the environment variable LD_PRELOAD when starting the user process.
Ex:LD_PRELOAD=$SP_DIR/PLATFORM/test_agent/print_test_agent.so [EXECUTABLE]
- To use the injector to force a running process to load agent library, note that injector has two modes, pid injection and port injection
Ex:$SP_DIR/PLATFORM/injector.exe pid [PID]
or$SP_DIR/PLATFORM/injector.exe port [PORT NUMBER]
- To use the environment variable LD_PRELOAD when starting the user process.
- Local Machine
- Interprocess propelling relies on the following environment variables:
SP_DIR
,PLATFORM
,SP_AGENT_DIR
- Interprocess propelling relies on the following environment variables:
- Inter-host
- Export desired environment variables in your .bashrc file. Following environment variables are necessary:
- SP_DIR
- PLATFORM
- SP_AGENT_DIR
- Add
DYNINST_ROOT/lib
,SP_DIR/PLATFORM
to your LD_LIBRARY_PATH
- Export desired environment variables in your .bashrc file. Following environment variables are necessary:
- FOR DEBUGGING
- SP_COREDUMP: enables core dump when segfault happens
- SP_DEBUG: enables printing out debugging messages
- SP_TEST_RELOCINSN: only uses instruction relocation instrumentation worker
- SP_TEST_RELOCBLK: only uses call block relocation instrumentation worker
- SP_TEST_SPRING: only uses sprint block instrumentation worker
- SP_TEST_TRAP: only uses trap instrumentation worker
- SP_NO_TAILCALL: don't instrument tail calls
- SP_LIBC_MALLOC: will always use libc malloc
- SP_NO_LIBC_MALLOC: will never use libc malloc
- FOR RUNTIME
- PLATFORM: 'i386-unknown-linux2.4' for x86 or 'x86_64-unknown-linux2.4' for x86-64
- SP_DIR: the root directory of self-propelled instrumentation.
- SP_AGENT_DIR: the directory path of agent shared library that will be injected.
- 1986+[user_process_pid]: for communication between injector process and user process
- make unittest: build unittests
- make mutatee: build simple mutatees
- make external_mutatee: build real world mutatees
- make test: unittest + mutatee + external_mutatee
- make injector_exe
- make agent_lib
- make spi: agent_lib + injector_exe
- make / make all: spi + test
- make clean_test: clean test stuffs
- make clean: only clean core self-propelled stuffs, excluding dependency
- make clean_all: clean everything, including dependency
- make clean_objs: clean core self-propelled objs