- Learning Linux Binary Analysis
- Ryan “elfmaster” O'Neill
- 208字
- 2021-07-16 12:56:55
ptrace requests
The ptrace
system call has a libc
wrapper like any other system call, so you may include ptrace.h
and simply call ptrace
while passing it a request and a process ID. The following details are not a replacement for the main pages of ptrace(2)
, although some descriptions were borrowed from the main pages.
Here's the synopsis:
#include <sys/ptrace.h> long ptrace(enum __ptrace_request request, pid_t pid, void *addr, void *data);
ptrace request types
Here is a list of requests that are most commonly used when using ptrace
to interact with a process image:
The term tracer refers to the process that is doing the tracing (the one that is invoking ptrace
), and the term tracee or the traced means the program that is being traced by the tracer (with ptrace
).
Note
The default behavior overrides any mmap or mprotect permissions. This means that a user can write to the text segment with ptrace
(even though it is read-only). This is not true if the kernel is pax or grsec and patched with mprotect restrictions, which enforce segment permissions so that they apply to ptrace
as well; this is a security feature.
My paper on ELF runtime infection at http://vxheavens.com/lib/vrn00.html discusses some methods to bypass these restrictions for code injection.
- 流量的秘密:Google Analytics網站分析與優化技巧(第2版)
- 程序員面試白皮書
- 算法零基礎一本通(Python版)
- Learn to Create WordPress Themes by Building 5 Projects
- Visual Basic 6.0程序設計計算機組裝與維修
- Unity Shader入門精要
- Nexus規模化Scrum框架
- Node.js全程實例
- Python機器學習:預測分析核心算法
- Emgu CV Essentials
- Building Serverless Architectures
- Deep Learning with R Cookbook
- Vue.js 3應用開發與核心源碼解析
- Keil Cx51 V7.0單片機高級語言編程與μVision2應用實踐
- 你好!Java