Skip to content

Proof of concept for injecting simple shellcode via ptrace into a running process.

License

Notifications You must be signed in to change notification settings

0x4b564b/linux-process-injection

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux process injection

Proof of concept for injecting simple shellcode via ptrace into a running process.

Description

With ptrace() we can attach to any running process, allowing us to play with the current state. By looking at the /proc/PID/maps file we can find a memory region containing permission to execute, for example r-xp.

If we find such region, we can overwrite it's content using PTRACE_POKETEXT, with our shellcode. After that, we can modify the registers and set the value of rip register with the address of that memory region found in maps file.

In the end we have to continue execution with PTRACE_CONT.

POC

Proof Of Concept

About

Proof of concept for injecting simple shellcode via ptrace into a running process.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 96.8%
  • Makefile 3.2%