What it is
Static analysis inspects binary files without executing them, examining headers, strings, import tables, and decompiled control flow. Dynamic analysis runs the binary in a controlled environment, observing runtime memory, register values, system calls, and network traffic.
Why you need it
Static analysis gives broad structural visibility and works even on incomplete code, but can be hindered by obfuscation or packers. Dynamic analysis proves what actually happens at runtime, but only covers executed code paths. Combining both yields defensible findings.
How it works
- Start with rapid static triage: inspect file format, strings, and imported library functions.
- Formulate a specific question about program behavior or a sensitive operation.
- Set up an isolated execution environment with logging and breakpoints.
- Run under a debugger or tracer to observe real parameters and memory changes.
Static string extraction vs dynamic system call trace
# 1. Static extraction (inspect without running)
strings ./unknown_binary | grep -E "https?://"
readelf -d ./unknown_binary # Inspect dynamic dependencies
# 2. Dynamic tracing (observe actual OS interactions)
strace -e trace=openat,connect,write ./unknown_binaryStrings reveals potential endpoints or formatting strings embedded in the binary. Running under strace confirms which files and network sockets the binary actually attempts to access during execution.
Good practices and why
- Always perform static triage first to identify suspicious imports, URLs, and file operations before running unknown code.
- Document clear hypotheses before stepping into a debugger so you do not get lost in thousands of assembly instructions.
Common mistakes
- Executing an untrusted binary on your primary workstation without isolation.
- Assuming a string found in a binary is definitely executed or trustworthy evidence of behavior.
Try it yourself
Run strings on a utility on your system (like /bin/ls), find an error message, then use a debugger or strace to force or observe that code path being exercised.
What a successful result looks like
You can explain one observation made statically and one observation confirmed dynamically for the same utility.
0 / 6000 characters · Saved on this device. Do not include passwords or private data.
Check your understanding
Answer the understanding check correctly to record exercise completion.
Related interview practice
These scenarios add constraints and follow-up questions to the concepts you just learned.
Further reading
Selected primary references · reviewed 2026-10-09. Examples are educational; use your framework’s documented integration guidance when building a deployed system.