官术网_书友最值得收藏!

Chapter 3. Linux Process Tracing

In the last chapter, we covered the internals of the ELF format and explained its internal workings. In Linux and other Unix-flavored OSes that use ELF, the ptrace system call goes hand in glove with analyzing, debugging, reverse engineering, and modifying programs that use the ELF format. The ptrace system call is used to attach to a process and access the entire range of code, data, stack, heap, and registers.

Since an ELF program is completely mapped in a process address space, you can attach to the process and parse or modify the ELF image very similarly to how you would do this with the actual ELF file on disk. The primary difference is that we use ptrace to access the program instead of using the open/mmap/read/write calls that would be used for the ELF file.

With ptrace, we can have full control over a program's execution flow, which means that we can do some very interesting things, ranging from memory virus infection and virus analysis/detection to userland memory rootkits, advanced debugging tasks, hotpatching, and reverse engineering. Since we have entire chapters in this book dedicated to some of these tasks, we will not cover each of these in depth just yet. Instead, I will provide a primer for you to learn about some of the basic functionality of ptrace and how it is used by hackers.

主站蜘蛛池模板: 昂仁县| 仁怀市| 崇左市| 城口县| 宜兰县| 成武县| 平和县| 罗田县| 山东省| 故城县| 壶关县| 长治市| 阜平县| 洛浦县| 道真| 吐鲁番市| 大庆市| 会同县| 正定县| 大荔县| 新津县| 密山市| 温宿县| 昆明市| 玉屏| 广安市| 华亭县| 临汾市| 东乡族自治县| 神木县| 且末县| 孟州市| 分宜县| 安庆市| 朝阳县| 永丰县| 西乡县| 封丘县| 吴忠市| 香格里拉县| 无棣县|