- 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.
- Internet of Things with Intel Galileo
- jQuery開發基礎教程
- Working with Odoo
- Apache Spark 2.x for Java Developers
- Getting Started with Hazelcast(Second Edition)
- Cocos2d-x Game Development Blueprints
- uni-app跨平臺開發與應用從入門到實踐
- Java Web開發實例大全(基礎卷) (軟件工程師開發大系)
- Visual Basic 程序設計實踐教程
- INSTANT JQuery Flot Visual Data Analysis
- Python深度學習:基于PyTorch
- Maya Programming with Python Cookbook
- Server Side development with Node.js and Koa.js Quick Start Guide
- Python從入門到項目實踐(超值版)
- Python服務端測試開發實戰