Linux code injection paint-by-numbers.
Can we launch a process that looks one way to (superficial) auditors but is, in fact, entirely different? (Think process hollowing and the like on Windows).
Firstly, how are processes created and what does related auditing look like?
Control will return from fork() to both process instances. In the child process, the return value will simply by 0, in the parent it will hold the pid of the child.
By default, this will happen on exit of the execve() syscall.
The options here are numerous. In this example, we want to chose a strategy that doesn’t require us doing any image/reloc fix-up foo.
We can use dlopen() to do all the heavy lifting.
We’ve created a child process and halted execution prior to anything too process-specific having been run but after basic setup has taken place.
But how to locate dlopen()?
A cursory glance shows that dlopen() is exported by libdl. But alas this library is not loaded in our process address space.
dlopen(libc) → dlsym(__libc_dlopen_mode)
We will account for this offset skew shortly.
x86_64 calling convention dictates that we’ll be using registers rdi (library path), rsi (mode), rdx (dl caller).
The easy choice here is just to dump it somewhere on the stack (we’re not interested in a sane return from __libc_dlopen_mode() after all).
This is a great outcome as it’ll trap back into the parent process and allow us to redirect control to our injected code.
More from Internet
Are you a web developer or a designer?
These websites will help you create professional mockups for your applications:
🧵👇🏻
1. Shot Snap:
Create beautiful device mockup images for your app or website
2. Smart Mockups:
Create stunning product mockups (free & premium)
https://t.co/1RmIQhAreS
3. Screely:
Instantly turn your screenshot into a mockup
https://t.co/riAzf7CioH
4. Screenshot .rocks:
Create beautiful browser & mobile mockups in seconds.
https://t.co/EpxLukHg8T
These websites will help you create professional mockups for your applications:
🧵👇🏻
1. Shot Snap:
Create beautiful device mockup images for your app or website
2. Smart Mockups:
Create stunning product mockups (free & premium)
https://t.co/1RmIQhAreS
3. Screely:
Instantly turn your screenshot into a mockup
https://t.co/riAzf7CioH
4. Screenshot .rocks:
Create beautiful browser & mobile mockups in seconds.
https://t.co/EpxLukHg8T
You May Also Like
This is NONSENSE. The people who take photos with their books on instagram are known to be voracious readers who graciously take time to review books and recommend them to their followers. Part of their medium is to take elaborate, beautiful photos of books. Die mad, Guardian.
THEY DO READ THEM, YOU JUDGY, RACOON-PICKED TRASH BIN
If you come for Bookstagram, i will fight you.
In appreciation, here are some of my favourite bookstagrams of my books: (photos by lit_nerd37, mybookacademy, bookswrotemystory, and scorpio_books)
Beautifully read: why bookselfies are all over Instagram https://t.co/pBQA3JY0xm
— Guardian Books (@GuardianBooks) October 30, 2018
THEY DO READ THEM, YOU JUDGY, RACOON-PICKED TRASH BIN
If you come for Bookstagram, i will fight you.
In appreciation, here are some of my favourite bookstagrams of my books: (photos by lit_nerd37, mybookacademy, bookswrotemystory, and scorpio_books)