intelligence_src_f9879f264b7a8ec1d7
- Source-provided label
- Publisher RSS metadata
- Evidence class
- mentioned in report
- Confidence
- Not reported
- Observed
- Oct 26, 2026 22:31 UTC
- Retrieved
- Oct 27, 2026 11:36 UTC
﷽ Introduction to Malware Binary Triage (IMBT) Course Looking to level up your skills? Get 10% off using coupon code: MWNEWS10 for any flavor. Enroll Now and Save 10%: Coupon Code MWNEWS10 Note: Affiliate link – your enrollment helps support this platform at no extra cost to you. Hello, cybersecurity enthusiasts and white hackers! In the previous part, we looked at redirecting a function call through the GOT/PLT. This time, let’s return to LD_PRELOAD and look more closely at function interposition: a shared library can provide a function with the same name as one used by a dynamically linked program. We will build a small directory-listing program and a library that wraps readdir(). The wrapper will log every entry and then return it unchanged. We will compare that log with the program output and with the getdents64 system call shown by strace. The lab demonstrates where an interposed function sits in the call path without changing files or hiding entries. concept The dynamic linker loads shared objects before starting a dynamically linked program. LD_PRELOAD asks it to load a specified shared object before the program’s ordinary dependencies, which lets symbols in that object take part in symbol resolution. LD_PRELOAD is ignored or restricted in secure-execution mode, so the behavior depends on how the program is started. See ld.so(8). An interposer can call dlsym(RTLD_NEXT, "readdir") to find the next definition of readdir() after its own. It can then inspect the result and pass it back to the application. RTLD_NEXT is specifically meant for this kind of wrapper. See dlsym(3). A user-space rootkit can abuse the same boundary to filter what a selected application receives. That changes the application’s view of directory entries; comparing it with evidence from a lower layer can help reveal the difference. In this lab, the wrapper only records entries and forwards them unchanged. readdir() is a C library interface that returns one directory entry at a time. At the system-call layer, Linux uses getdents64() to return a buffer containing directory entries. strace can show that system call and its results. See readdir(3), getdents(2), and strace(1). practical example 1 First, let’s create a tiny program that lists a directory. It calls opendir() once and then repeatedly calls readdir() until there are no more entries. The important part is the loop: struct dirent *entry; while ((entry = readdir(dir)) != NULL) { printf(“%s\n”, entry->d_name); } Now we can add a wrapper library. It resolves the next readdir() implementation in a constructor, before main() starts: __attribute__((constructor)) static void audit_init(void) { dlerror(); next_readdir = (struct dirent *(*)(DIR *))dlsym(RTLD_NEXT, "readdir"); if (dlerror() != NULL) { next_readdir = NULL; } } Our wrapper calls the original function and logs the entry it returned. It does not modify the entry or suppress it: struct dirent *readdir(DIR *dir) { if (next_readdir == NULL) { errno = ENOSYS; return NULL; } struct dirent *entry = next_readdir(dir); if (entry != NULL) { int saved_errno = errno; fprintf(stderr, “[audit] readdir returned: %s\n”, entry->d_name); errno = saved_errno; } return entry; } We preserve errno around the log call so that writing the audit message does not alter the caller’s view of the readdir() result. If the original function could not be resolved, the wrapper returns an error instead of calling a null pointer. Now the complete program (meow.c): /* * meow.c * lists the contents of a directory * author: @cocomelonc */ #include <dirent.h> #include <errno.h> #include <stdio.h> int main(int argc, char **argv) { const char *path = argc > 1 ? argv[1] : “.”; DIR *dir = opendir(path); if (dir == NULL) { perror(“opendir”); return 1; } int result = 0; for (; { errno = 0; struct dirent *entry = readdir(dir); if (entry == NULL) { if (errno != 0) { perror(“readdir”); result =
439c19af0851d4ece564b9182b3b6c6c81c400737cc0cfbc60c892e010b8f2b7Network indicators are visibly defanged. This page does not make them clickable or send them to another service.
No validated file hashes or network indicators are stored for this record.
This record contains metadata and attribution only. It does not host, download, unpack, render, or execute malware samples.
Sources represented on this page. Publication and observation dates describe the content; successful batch dates describe local collection. A recent batch does not certify complete coverage or current provider availability.
1 sources: 0 stale, 0 needing attention, 0 paused, 0 unverified.
Stale means older than twice the recorded collection interval, with a minimum of one hour; without an interval, the threshold is 24 hours. Cached content remains available while a feed is stale, paused, or unverified.