Tracer for buildroot qemu linux system

本文介绍了在QEMU Linux系统中选择和使用SystemTap、Ktap和Trace-cmd作为系统调用追踪工具的过程。尽管遇到了一些挑战,如SystemTap编译问题和ktap的段错误,但trace-cmd因其更好的兼容性和内置内核支持,成为了一个更优的选择。
摘要由CSDN通过智能技术生成

1. Tracer selection

1.1 SystemTap

What is System Tap and Why others chose System Tap?

Collecting syscall information is informative during dynamic analysis.

In computing, a system call (commonly abbreviated to syscall) is the programmatic way in which a computer program requests a service from the kernel of the operating system on which it is executed. This may include hardware-related services (for example, accessing a hard disk drive), creation and execution of new processes, and communication with integral kernel services such as process scheduling. System calls provide an essential interface between a process and the operating system. (from wiki)

Syscalls include:

	文件和设备访问类 比如open/close/read/write/chmod等
	进程管理类 fork/clone/execve/exit/getpid等
	信号类 signal/sigaction/kill 等
	内存管理 brk/mmap/mlock等
	进程间通信IPC shmget/semget * 信号量,共享内存,消息队列等
	网络通信 socket/connect/sendto/sendmsg 等
    etc

The paper, LiSa, introduced two kinds of tracing techniques including program tracing and kernel-level tracing.
For example, strace is a tool for program tracing.
But there exists some anti-debugging malware. Malware sample used:

ptrace(PTRACE_TRACEME, 0, 0, 0)

Some screenshot of this sandbox:
在这里插入图片描述

Thanks to -1 result of ptrace result, sample found out it was traced. What’s more, strace is slow.

Cross-Compile Linux Kernel

Follow the guidance in this website Deprecated
We found that buildroot is easier to use to build both kernel and rootfs.
Just follow several steps:

make qemu_ppc_e500mc_defconfig # defconfig lies on ./config dir
make menuconfig # Then configure anything you need, mainly choose the binary package you need and the external toolchain
# In the menuconfig, you can configure password and ban
make

A much more formal README:

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值