Reverse Engineering and Malware Analysis Questions
Analyzing malicious code and unknown binaries. Covers static and dynamic malware analysis, behavioral analysis and indicator extraction, reverse engineering of binaries and firmware, and code obfuscation and deobfuscation. The deep-technical capability to understand what a piece of hostile or unknown code actually does.
A messaging app stores its database in SQLite with several columns encrypted using a static key that's embedded somewhere in the app binary. Walk me through the forensic workflow you'd use to find that key, decrypt the columns, and verify that what you recovered is actually correct.
Sample Answer
Direct answer
Find the key through static analysis first, since a static key has to be embedded somewhere in the binary and is often locatable without ever running the app, then confirm it with dynamic instrumentation by hooking the actual cipher call at runtime and reading its arguments directly, which is far more reliable than guessing from disassembly alone. Verify the decrypted output by checking it parses as the expected data type, not just that decryption "succeeded" without an error, since a wrong key can still produce output that looks superficially like ciphertext turned into bytes.
Structured elaboration
Static analysis
Unpack the application (decompile the APK with jadx, or the equivalent for the target platform) and search for cryptographic API usage and likely key material: calls into standard crypto libraries, constant byte arrays passed to a key-construction function, and strings suggestive of key derivation (AES, PBKDF2, SecretKeySpec). A constant byte array passed directly into a key constructor, with no derivation step, is exactly what "static key embedded in the binary" looks like in disassembly.
Dynamic instrumentation to confirm the key at runtime
Static reading can misidentify which constant is actually the key versus an unrelated buffer; hooking the cipher initialization call and reading its real arguments at the moment the app uses it removes that ambiguity. A representative hook (illustrative Frida script, requires an attached device or emulator to actually run):
Java.perform(function () {
// Frida has no built-in bytes-to-hex helper, so define one. A Java byte[]
// arrives on the JavaScript side as an array of signed numbers, hence the & 0xff.
function toHex(bytes) {
var out = '';
for (var i = 0; i < bytes.length; i++) {
out += ('0' + (bytes[i] & 0xff).toString(16)).slice(-2);
}
return out;
}
var SecretKeySpec = Java.use('javax.crypto.spec.SecretKeySpec');
SecretKeySpec.$init.overload('[B', 'java.lang.String').implementation = function (keyBytes, algorithm) {
send('recovered key (' + algorithm + '): ' + toHex(keyBytes));
return this.$init(keyBytes, algorithm);
};
});
Reproduce whatever app action triggers a database read or write to force the hook to fire, and capture the key (and the initialization vector, if it's passed separately) from the intercepted call rather than from a guess about which constant in the disassembly is the right one.
Decrypting the columns
Once you have the confirmed key and initialization vector (IV), apply the same algorithm and mode the app itself uses. The example below uses AES in CBC (Cipher Block Chaining) mode, the common block-cipher mode in which each plaintext block is mixed with the previous block's ciphertext before it is encrypted, which is what the IV is for: it seeds that chain for the very first block, where there is no previous block to borrow from. Here is a complete, runnable example (uses the cryptography package: pip install cryptography) showing the mechanism end-to-end, standing in for the real recovered key with a deterministically-derived one so the example is fully reproducible:
import hashlib
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.primitives import padding
# In a real case, `key` and `iv` come from the Frida hook above, not from a
# seed string. They're derived deterministically here only so this example
# is reproducible without hand-typed hex.
key = hashlib.sha256(b"recovered-static-key-seed").digest() # 32 bytes -> AES-256
iv = hashlib.md5(b"recovered-iv-seed").digest() # 16 bytes
# Stand-in for the app's own encryption, used only to produce a ciphertext to
# decrypt. In a real case this ciphertext already sits in the SQLite BLOB
# column; you never generate it yourself.
plaintext = b"meet at 9pm, bring the package"
padder = padding.PKCS7(algorithms.AES.block_size).padder()
padded = padder.update(plaintext) + padder.finalize()
encryptor = Cipher(algorithms.AES(key), modes.CBC(iv)).encryptor()
ciphertext = encryptor.update(padded) + encryptor.finalize()
print("ciphertext as stored in the SQLite column (hex):", ciphertext.hex())
# The actual forensic step: decrypt the column using the recovered key/IV.
decryptor = Cipher(algorithms.AES(key), modes.CBC(iv)).decryptor()
padded_recovered = decryptor.update(ciphertext) + decryptor.finalize()
unpadder = padding.PKCS7(algorithms.AES.block_size).unpadder()
recovered_plaintext = unpadder.update(padded_recovered) + unpadder.finalize()
print("recovered plaintext:", recovered_plaintext.decode())
assert recovered_plaintext == plaintext
print("verification: recovered plaintext matches the expected message, key/IV confirmed correct")
Output:
ciphertext as stored in the SQLite column (hex): a33fbd2a3dcf0bddecaea81699de61220208e1c67e61aa20fcfb3f3dd0c0570b
recovered plaintext: meet at 9pm, bring the package
verification: recovered plaintext matches the expected message, key/IV confirmed correct
Verifying the recovered content is actually correct
Confirm the decrypted bytes parse as the expected structure, valid readable text, a well-formed JSON blob, or a recognizable header, rather than just checking that decryption ran without throwing an error, since a wrong key under CBC with padding still frequently "succeeds" and produces garbage bytes with valid-looking padding by coincidence. The reason is that the padding check is structural rather than semantic: PKCS7 unpadding reads the final byte as a pad length and only verifies that that many trailing bytes all carry that same value, so a wrong key whose garbage output happens to end in a single 0x01 byte clears the check outright, which is roughly a 1 in 256 chance on any given block. Across a table of a few thousand encrypted rows that is enough for a handful to unpad without error under a key that is completely wrong, so a clean unpad tells you only that the last byte looked plausible, never that you recovered the right plaintext. Cross-check decrypted values against other, unencrypted columns in the same row (a timestamp or a sender identifier that should logically match) as an independent sanity check that you decrypted the right thing correctly.
Trade-offs and pitfalls
Static analysis alone risks decrypting with the wrong constant if the binary contains more than one plausible-looking byte array, always confirm dynamically before treating a static guess as final. Dynamic instrumentation modifies the running app's behavior even if only by injecting a hook, document exactly what was hooked and why, and prefer running on a cloned device or emulator over the original evidence device wherever the investigation allows it. Finally, keep your recovery scripts and their exact inputs as part of the case record, since a reviewer or opposing expert needs to be able to reproduce your result from your own documented steps, not just trust your stated conclusion.
In a SOC, you often don't know upfront what kind of malware you're dealing with. What behavioral differences would tell you whether an alert is a trojan, a worm, ransomware, a rootkit, or fileless malware, and why does nailing that classification early change how you respond and what you go looking for next?
Sample Answer
Direct answer
The fastest signal is what the alert is doing and to what layer of the system, not what file type triggered it: does it spread on its own across the network, does it demand payment, does it hide itself from the operating system's own view, or is there no file on disk at all. Trojans, worms, ransomware, rootkits, and fileless malware differ mainly in propagation behavior, persistence layer, and objective, and each of those differences points you at a different next evidence source. Nailing the classification early is what stops you from imaging a disk when you should have captured memory first, or watching for lateral movement when the real threat has already finished encrypting.
Structured elaboration
| Family | Propagation | Objective | Where it persists | First alert signature |
|---|---|---|---|---|
| Trojan | Does not self-spread; delivered once via a user or another vector | Varies: credential theft, backdoor access, or a dropper for a later stage | Registry Run keys, scheduled tasks, dropped executables | Unknown binary running from a user-writable path, unusual parent-child process relationship |
| Worm | Self-propagates by exploiting a vulnerability or weak credentials, no user interaction needed | Often propagation itself, or a delivery mechanism for a payload | Reinstalls on every host it reaches; may not need host persistence at all | Sudden spike of identical outbound connection attempts to internal ports (e.g., file-sharing or remote-desktop ports) from a host that doesn't normally scan |
| Ransomware | Increasingly worm-like in modern strains, but spread is a means, not the goal | Extortion: encrypt or threaten to leak data | Often none needed; the damage is largely done by the time it's noticed | Mass file rename/rewrite activity, shadow-copy deletion, a ransom note dropped in many directories at once |
| Rootkit | Does not self-spread; arrives via privilege escalation or as another compromise's payload | Concealment, usually as a persistence layer for something else | Kernel-mode driver, hooked operating-system functions, sometimes firmware | A mismatch between what the operating system reports and what raw memory or disk actually shows |
| Fileless malware | Rides in via a malicious document or exploit, does not self-spread | Initial access or execution without ever writing a scannable file | Registry Run keys or event-subscription mechanisms that re-invoke a script interpreter | Script-interpreter activity (encoded or obfuscated command lines) with no corresponding new file on disk |
Why the label changes what you do next:
- Worm suspected: network containment (isolating the segment) becomes the immediate priority, ahead of deep analysis, because every minute of delay means more infected hosts.
- Ransomware suspected: the priority is stopping the encryption process and checking what backups survived, not reverse-engineering the binary first.
- Rootkit suspected: the priority shifts to capturing memory before any reboot, since a reboot can lose volatile evidence, and to distrusting whatever the live operating system on that host reports about itself.
- Fileless malware suspected: the priority is command-line and script-block logging plus memory capture, since a disk image alone will be nearly empty of evidence.
Worked example
Suppose an endpoint detection alert fires: a script interpreter was spawned as a child of a document-editing application, ran a base64-encoded command, and made an outbound encrypted web connection to an unfamiliar domain every sixty seconds. No new executable file appears anywhere in the alert's file-event telemetry.
Working through the families: it isn't ransomware (no file-encryption or shadow-copy-deletion activity), it isn't showing worm-like behavior (no scanning attempts against other internal hosts), and there's no evidence yet of kernel-level concealment (no driver-load events, no mismatch between what's visible in memory and what the process list reports). That leaves trojan and fileless malware as candidates, and the pattern (document app spawning a script interpreter directly, encoded command line, nothing written to disk) points at fileless: a macro launched the interpreter as the payload instead of dropping a binary first.
That classification changes the next move. Instead of hunting for a dropped file to hash and detonate in a sandbox, the priority becomes: pull the full decoded command line and script-block log, check for a registry Run key or an event-subscription mechanism that re-invokes the interpreter (fileless malware still needs some persistence hook, it just isn't a file), and capture process memory before anything reboots, since the payload may exist only there. If the telemetry had instead shown driver-load events and a memory-versus-process-list mismatch, the call would flip to rootkit, and the priority would flip to memory acquisition before touching the disk at all.
Trade-offs and pitfalls
- Families blend in real incidents: modern ransomware often propagates worm-style over internal file-sharing protocols, and rootkits are frequently just the persistence stage riding on top of a trojan dropper. Treat the first classification as a working hypothesis, not a final label, and keep revising it as evidence arrives.
- Anchoring on the first label too early causes tunnel vision. Decide it's "just a trojan" and stop looking, and you can miss that the dropper also installed a kernel-mode component, then be surprised when the "cleaned" host reinfects itself.
- Absence of a signal is not proof of absence: a rootkit actively hiding its own artifacts from the tool you're using to check for it will simply not show anomalies on a naive check. Look for a cross-view discrepancy (comparing raw memory or disk against what the operating system's own interface reports), specifically because a competent rootkit defeats the naive check by design.
There's a memory dump you suspect contains malware-generated strings hidden behind XOR or some other simple obfuscation scheme, but you don't have the key. Walk me through how you'd go about finding and decoding them, how you'd automate the search across a large dump, and how you'd be confident that what you recovered is real plaintext and not noise.
Sample Answer
Direct answer
Scan the dump for byte runs that look like they could be obfuscated text, then brute-force every single-byte XOR key against each candidate and score the result by how English-like it looks, not just how "printable" it looks, since printable-but-wrong is the trap that produces false positives. Extend the same idea to multi-byte keys by splitting the dump into interleaved streams, and validate every hit against known markers before trusting it.
Structured elaboration
Heuristic scans
Extract candidate byte runs above a minimum length (roughly 8 bytes) using a strings-like pass that doesn't require the bytes to already be printable, since obfuscated text by definition isn't. Tools like Volatility for memory-region extraction and bulk_extractor or a targeted YARA scan (YARA rules describe a known sample or family as a set of byte patterns and strings, so the scan tells you which regions are even worth opening) help narrow down which regions of a large dump are worth brute-forcing at all, rather than running the full search across the entire image.
Frequency analysis and key-length guesses
For single-byte XOR, you don't need to guess a key length, you brute-force all 256 possible keys directly. For longer repeating-key XOR, split the ciphertext into interleaved streams by candidate key length (try 1 through roughly 8 bytes) and solve each stream independently as its own single-byte XOR problem, since each stream was encoded with just one byte of the repeating key.
Sliding-XOR brute force with proper scoring
The scoring function is where naive implementations go wrong: scoring purely on "printable ASCII ratio" often mistakes noise for text, because printable ASCII covers 95 different byte values and a lot of garbage decodes into something printable by chance. The fix is to score against actual English letter frequency, not just printability, and to penalize non-printable bytes heavily rather than just excluding them.
Validation of recovered plaintext
Once you have a top-scoring candidate, corroborate it: does it contain a recognizable marker (http, a domain-looking string, the MZ executable header), does it match known indicators from other parts of the investigation, and does the printable ratio plus letter-frequency score both agree it's real text rather than a coincidental garbage match.
Automating and verifying at scale
Wrap the scan in a pipeline that records offset, key, and score for every candidate above some threshold, not just the single best guess, since a dump can contain multiple independently-encoded strings with different keys. Keep the search bounded (limit key length, cap candidate windows) so it stays practical on a multi-gigabyte image.
Worked example
Here is a working single-byte sliding-XOR decoder with a real scoring function, run against a synthetic memory dump containing one obfuscated string buried in random noise:
ENGLISH_FREQ = {
'a': .08167, 'b': .01492, 'c': .02782, 'd': .04253, 'e': .12702, 'f': .02228,
'g': .02015, 'h': .06094, 'i': .06966, 'j': .00153, 'k': .00772, 'l': .04025,
'm': .02406, 'n': .06749, 'o': .07507, 'p': .01929, 'q': .00095, 'r': .05987,
's': .06327, 't': .09056, 'u': .02758, 'v': .00978, 'w': .02360, 'x': .00150,
'y': .01974, 'z': .00074,
}
def xor_bytes(data: bytes, key: int) -> bytes:
return bytes(b ^ key for b in data)
def score(candidate: bytes) -> float:
total = 0.0
for b in candidate:
if b < 0x20 or b > 0x7e:
total -= 1.0 # heavily penalize non-printable bytes
else:
total += ENGLISH_FREQ.get(chr(b).lower(), 0.0)
return total / len(candidate)
import random
random.seed(42)
secret_key = 0x5A
plaintext = b"http://update-check.example-c2.net/beacon"
encoded = xor_bytes(plaintext, secret_key)
noise_before = bytes(random.randrange(256) for _ in range(80))
noise_after = bytes(random.randrange(256) for _ in range(30))
memory_dump = noise_before + encoded + noise_after
best_key, best_score, best_text, best_offset = None, float("-inf"), b"", -1
n = len(plaintext)
for offset in range(0, len(memory_dump) - n + 1):
chunk = memory_dump[offset:offset + n]
for key in range(256):
decoded = xor_bytes(chunk, key)
s = score(decoded)
if s > best_score:
best_key, best_score, best_text, best_offset = key, s, decoded, offset
print(f"best key: 0x{best_key:02X}")
print(f"score: {best_score:.4f}")
print(f"recovered text: {best_text.decode('ascii', errors='replace')}")
print(f"offset in dump: {best_offset}")
Output:
best key: 0x5A
score: 0.0495
recovered text: http://update-check.example-c2.net/beacon
offset in dump: 80
Note the scoring function deliberately does not use a raw "printable ratio." Re-running this exact search with the score replaced by "fraction of bytes that are printable ASCII" produces 44 candidates tied at a perfect 1.0, and every one of them sits at the correct offset 80 but under a different key, including key 0x00. The reason is that printable plaintext XORed with a small key usually stays printable, so the encoded region decodes to something printable under dozens of wrong keys and the ciphertext itself scores as well as the plaintext does. A printable-ratio scorer can therefore tell you where an encoded string sits but not which key decodes it, and an unattended pipeline would report whichever of those 44 ties it happened to see first. Scoring against real letter frequency, and penalizing non-printable bytes explicitly, breaks the tie and selects 0x5A uniquely, which is what makes the search reliable. Scoring against real letter frequency, and penalizing non-printable bytes explicitly, is what makes the search reliable.
Trade-offs and pitfalls
Brute force over long key lengths gets expensive fast, roughly 256 to the power of the key length for a naive full-keyspace search, so the interleaved-stream trick (solving each byte position of the repeating key independently) is what keeps multi-byte XOR tractable instead of exponential. Don't trust a single scoring metric in isolation: combine printable-ratio, letter-frequency, and marker-string checks, since any one of them alone can be fooled by the right kind of noise. And always keep the top few candidates, not just the single best score, since a repeating-key search over a long dump can occasionally rank a partial or overlapping match above the true one.
Outline a forensic workflow to identify and analyze mobile malware on an Android device: what you'd look at through static analysis of the APK, what you'd want to observe by running it dynamically, what on-device signs would tip you off that something's compromised, and where you'd look to build a case for persistence and data exfiltration.
Sample Answer
Direct answer
Preserve the device first (isolate it from any network so a remote-wipe or command can't reach it), then work outward: static analysis of the installed app package (APK), dynamic observation of what it actually does when run, on-device signs that something is currently compromised, and finally the specific artifact locations that prove persistence and data exfiltration happened, not just that they were technically possible.
Structured elaboration
Preservation and acquisition
Isolate the device (a radio-frequency-shielded bag, or airplane mode plus removing the SIM and disabling Wi-Fi) before anything else, since a live device can receive a remote wipe or self-destruct command. Acquire a filesystem-level image where possible (via the Android Debug Bridge, or a dedicated mobile-forensics tool) rather than relying on a logical backup alone, since a backup can omit exactly the app-private data you need. Document device state (locked or unlocked, timestamps, exact model and OS version) as part of chain of custody, the unbroken documented record of who has held the device and what was done to it from seizure onward.
Static analysis of the APK
Unpack the application package with a decompilation tool (apktool for resources and the manifest, jadx for readable Java-like source) and check the manifest for permissions that are disproportionate to the app's stated purpose (sending SMS, reading contacts, drawing over other apps), any exported components that could be triggered externally, and broadcast receivers registered for events like device boot, since those are common persistence hooks. Flag native libraries, hardcoded network addresses, and any obviously obfuscated strings or reflection-heavy code that resists straightforward reading. Run known-signature scanning (an established mobile-malware scanning platform, plus YARA rules) to check quickly whether this matches a known family before spending analyst time on manual reverse engineering.
Dynamic behavior monitoring
Run the app in an isolated emulator or a dedicated test device, instrumented with a runtime hooking framework (Frida) so you can observe API calls as they happen rather than only their eventual side effects. Capture network traffic through a proxy so you can see destinations and payloads even over encrypted connections you control the trust chain for, and monitor runtime activity (the running-process and service list, log output) alongside a check for unusual wakelocks, a partial wakelock kept unusually long is a common sign of a background process working hard to avoid being killed by the OS's power management.
On-device indicators of compromise
- Persistent or unusual foreground services, and any accessibility service registered by a package you don't recognize as legitimate, accessibility permissions are a common privilege-escalation vector on Android.
- Network behavior: frequent connections to uncommon destinations, or non-standard protocols layered inside what looks like ordinary traffic.
- Unusual wakelocks visible in the device's power-management diagnostics, preventing the device from sleeping normally.
- Files in unexpected locations: hidden files under the app's external storage directory, or unusually large cache and database files for what the app claims to do.
Building a case for persistence and exfiltration
Persistence artifacts: a boot-triggered broadcast receiver, a scheduled background job, or evidence the app modified startup behavior beyond its own package. Exfiltration artifacts: local databases or shared-preference files holding staged data, temporary files matching a pattern of collect-then-upload, and network logs showing outbound transfers (particularly ones with attachments or large payloads) that correlate in time with when the sensitive data was accessed on-device. Correlating the manifest's declared permissions, the static analysis's identified capabilities, and the dynamic run's actual observed behavior into one timeline is what turns a pile of individually-plausible artifacts into a coherent case.
Worked example
Concretely: a flashlight app requests SMS and contacts permissions in its manifest, permissions with no plausible connection to its stated function. Static analysis finds a BOOT_COMPLETED broadcast receiver and a hardcoded domain in a native library string table. Running it under Frida shows it registering a background service on install and periodically reading the contacts database. A proxy capture shows periodic HTTPS POST requests to that same hardcoded domain, with a request size that scales with contact-list length. That chain, unjustified permission, boot persistence, periodic access to the exact data type the permission unlocked, and outbound traffic sized proportionally to that data, is what a defensible exfiltration finding looks like, not any single item alone.
Trade-offs and pitfalls
Never execute a suspect APK on your own daily-use phone, always use an isolated emulator or a dedicated, wipeable device. A permission being present doesn't prove misuse by itself, a genuinely poorly-designed but non-malicious app can also over-request permissions, so tie the permission to actual observed behavior before calling it malicious. And be aware that some mobile malware detects emulation and behaves differently (or not at all) under a virtual device, if dynamic analysis on an emulator comes back clean but static analysis raised real concerns, consider running on a real, isolated device before clearing the app.
A server you're investigating might have UEFI or BIOS-level malware persistence that survived a full OS reimage. How would you go about confirming that, and what would extracting and analyzing the firmware to find the implant actually involve, given you can't just pull the drive and image it the normal way?
Sample Answer
Direct answer
Firmware lives in a SPI (Serial Peripheral Interface) flash chip that is physically separate from the boot disk, so wiping and reimaging the operating system drive never touches it, which is exactly why a UEFI (Unified Extensible Firmware Interface, the modern replacement for legacy BIOS) or BIOS-level implant can survive a full reimage. Confirming it means acquiring the actual firmware image, ideally without trusting the live, possibly-compromised operating system to read it for you, and then extracting that image's internal module structure to look for anything that doesn't belong.
Structured elaboration
Why the normal process misses it. An OS reimage or reinstall only touches the storage volume; the SPI flash holding UEFI/BIOS code sits on the motherboard (or inside the chipset) and is never written by an OS installer. Firmware-level implants documented in the wild by security researchers are built specifically to exploit this gap and outlive every OS-level remediation.
Confirming persistence, from cheapest to most trustworthy:
- Non-destructive first look: check the UEFI variable state (whether Secure Boot is enabled, and what's in its signature databases) and, if the platform has a TPM (Trusted Platform Module, a hardware chip that records boot-stage measurements), compare its PCR (Platform Configuration Register) values and boot event log against what's expected for a known-good boot chain. A mismatch here is a strong early signal without touching the flash at all.
- Software-based flash read: a platform security assessment tool can dump the SPI flash contents from the running operating system. This is fast, but it trusts the operating system's own path to the flash controller, which is exactly the layer a sophisticated implant, especially one running in SMM (System Management Mode, a CPU privilege level below the operating system and any hypervisor), can intercept and lie about.
- Hardware-based acquisition, the trustworthy option: physically read the flash chip with a dedicated SPI programmer clipped onto the chip package while the system is powered off. This bypasses the operating system, the firmware, and any SMM handler entirely, so what you read is what's actually on the chip rather than what a compromised layer wants you to see. It's slower, needs physical access, and needs the right hardware for that chip's package, but it's the one acquisition method an implant can't talk you out of.
Extracting and analyzing the image:
- Parse the acquired image with a UEFI-aware parsing tool to unpack it into its firmware volumes and individual modules: DXE (Driver Execution Environment) drivers, option ROMs, and pre-boot initialization modules.
- Compare the module list and per-module hashes against the vendor's officially published image for the exact model and firmware version, not just "a recent one," since even a legitimate customization looks anomalous against the wrong reference.
- Focus on the known implant surfaces: unsigned or unrecognized drivers in the boot dispatch chain, SMM handlers (a documented target for firmware implants precisely because SMM code runs beneath the operating system's visibility), and the Secure Boot key databases, since an implant that adds its own signing key can make its own malicious driver look legitimately signed to the platform.
- Any module that doesn't match the vendor baseline gets disassembled and triaged like any other unknown binary: entry points, imported functions, embedded strings, and any network- or persistence-relevant calls.
Worked example
Say the hardware acquisition and firmware-parsing pass on a suspect server turns up this shape of finding: every firmware volume and module hash matches the vendor's published image for that exact model and firmware revision, except for one driver whose identifier doesn't appear anywhere in the vendor's manifest and isn't signed by the vendor's key. That single mismatch is the finding: everything else matching is what tells you the reference comparison is valid, meaning you're not just looking at ordinary build noise, and the one unexplained, unsigned module sitting in the boot dispatch chain is exactly the kind of artifact a firmware implant leaves, since it needs some entry point the platform will actually execute during boot. From there, the next step is disassembling that one module specifically rather than the entire multi-megabyte image, because the hash comparison already told you where to look.
Trade-offs and pitfalls
- Never write to the suspect flash before you've captured and hashed the original read; any destructive validation, such as re-flashing to test something, has to come after preservation, the same evidence-integrity discipline that applies to any other exhibit.
- A live, software-based read can be lied to by exactly the kind of implant you're hunting for. Treat a clean software-based read as one data point, not proof of absence, when SMM-level tampering is on the table.
- The SPI flash isn't the only firmware surface: an add-in card's option ROM, a management engine, or a baseboard management controller each carry their own separate, independently updatable firmware, and none of them are touched by imaging the "main" UEFI/BIOS flash either. Scope the investigation to the specific firmware surface the evidence actually implicates.
- A generic known-good reference from a different hardware revision or firmware build produces false positives; get the exact match from the vendor before drawing conclusions from a diff.
Unlock Full Question Bank
Get access to all 22 Reverse Engineering and Malware Analysis interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.