Practical Reverse Engineering: A Hands-On Starter Guide
Learn the core workflow of reverse engineering binaries, from static analysis to dynamic debugging, with practical tool tips.
Reverse engineering compiled software को dissect करने की प्रक्रिया है ताकि आप source code के बिना इसके logic, behavior, और intent को समझ सकें। चाहे आप malware को analyze कर रहे हों, closed-source binaries को audit कर रहे हों, या CTF challenges का अध्ययन कर रहे हों, एक ही core workflow लागू होता है: जानकारी को statically gather करें, फिर अपनी hypotheses को dynamically confirm करें। यह guide उस workflow को practical, tool-agnostic steps के साथ walk करता है जिन्हें आप तुरंत apply कर सकते हैं।
Setting Up a Safe Analysis Environment
किसी भी unfamiliar binary को छूने से पहले, अपने workspace को isolate करें। एक dedicated virtual machine का उपयोग करें जिसके पास अपने host में कोई network access नहीं है, analysis से पहले इसे snapshot करें, और shared folders और clipboard sync को disable करें। radare2, Ghidra, gdb, और objdump जैसे tools के साथ एक Linux VM अधिकांश static और dynamic needs को cover करता है, जबकि x64dbg और Process Monitor के साथ एक Windows VM PE files के लिए essential है। कभी भी suspicious samples को अपने primary machine पर analyze न करें, और sessions के बीच हमेशा snapshots को revert करें ताकि cross-contamination से बचा जा सके।
Static Analysis: Reading Without Running
file और readelf -h (Linux) या एक PE header inspector (Windows) का उपयोग करके file type और architecture को identify करके शुरू करें। entropy analysis के साथ packing या obfuscation को check करें — Detect It Easy जैसे tools suspiciously high entropy sections को flag करते हैं जो compression या encryption suggest करते हैं।
अगला, binary को एक disassembler जैसे Ghidra या IDA Free में load करें। इन पर focus करें:
- Imports और exports — API calls जैसे
CreateRemoteThreadयाVirtualAllocExprocess injection hint देते हैं;WSAStartupnetworking suggest करता है। - Strings —
strings -n 8 binaryको run करके hardcoded URLs, file paths, या debug messages को surface करें जो functionality reveal करते हैं। - Control flow graphs — Ghidra का decompiler view raw assembly को readable pseudo-C में turn करता है, dramatically loops और conditionals की comprehension को speed up करता है।
जब आप उन्हें समझें तो function names को annotate करें। sub_401020 को decrypt_config में rename करना तुरंत अपने बाकी analysis को follow करना आसान बनाता है।
Dynamic Analysis: Watching It Run
Static analysis केवल आपको इतनी दूर तक लेकर जाता है, खासकर obfuscated या packed code के विरुद्ध। binary को एक debugger में load करें और पहले identify किए गए suspicious API calls पर breakpoints set करें। x64dbg में, VirtualAlloc या WriteProcessMemory पर breaking अक्सर unpacking routines को reveal करता है क्योंकि वे decrypted code को memory में execution से ठीक पहले write करते हैं।
Process Monitor या Linux पर strace/ltrace का उपयोग करके file, registry, और network activity को real time में log करें। यह external view debugger से internal view को complement करता है और अक्सर उस behavior को surface करता है जो disassembly में spot करना मुश्किल है, जैसे temporary file creation या DNS lookups।
Network-capable binaries के लिए, उन्हें Wireshark या INetSim जैसे fake internet simulator के साथ run करें ताकि command-and-control traffic को observe कर सकें बिना sample को actually internet तक पहुंचने दिए।
Dealing With Anti-Analysis Tricks
कई binaries — खासकर malware — में checks include होते हैं जो debuggers, virtual machines, या sandboxes को detect करने के लिए designed होते हैं। Common techniques में IsDebuggerPresent calling, VM-specific registry keys को check करना, या execution timing को measure करके single-stepping को detect करना शामिल है। जब आप static analysis के दौरान इन checks को spot करते हैं, तो आप debugger में conditional jump को patch करके forcefully
AI सहायता से लिखा गया, माइकल पिल्च (CISSP), Korra Studio द्वारा समीक्षित और प्रकाशित।
यह Korra Studio के ज्ञान आधार से एक नोट है — प्लेटफ़ॉर्म हर विषय को 1-टू-1 मेंटरिंग के साथ जोड़ता है।
मुफ़्त शुरू करेंarrow_forward