Reversing
Last updated
Last updated
Here are some tools for general evaluation of targets:
file --keep-going
auto-decodes strings using various methods
Several techniques exist to prevent dynamic analysis. This section needs more info on that.
/proc/self/status
Does strace
appear to show a different execution than the normal one? If the program reads /proc/self/status
, that's probably why. TracerPid in there is non-zero if any debugger is connected:
Instruction encodings may have some undefined/reserved bits. If these are garbled, the program may still be valid, but your disassembler might choke.
It can pay off, during bigger challenges, to write robust tools.
If you know what a binary is up to, you can set breakpoints at well-chosen locations and use a GDB script to pretty-print program state.
Macintosh apps can be both Intel and PPC (and presumably ARM now).
There are a few mechanisms to run code before main()
gets invoked. Look for _init_array
(called by __libc_start_main
) and the even sneakier _preinit_array
(invoked by the loader). Try LD_DEBUG=all
to see what ld
is up to.
JAR is zip and zip can be combined with all kinds of stuff.
Apparently it's pretty common to mess with the byte-to-opcode mapping of Python and then embed your custom interpreter.
(see article 19:04)
has excellent i/o facilities, on top of all the exploit development goodies. makes GDB a lot friendlier.
It's surprisingly easy to implement your own GDB commands using the :
of ghidra-python reference
Windows PE can have a windows portion and a DOS portion in the same .exe. Usually the DOS part just prints a helpful message, but nothing prevents a narnia door to another world... is an example of this in the wild.
can help map out files like this. Beware zip bombs, PDF bombs and the like, they can make output explode.
can generate 2-polyglots between a large number of formats
shows all kinds of info about binaries.
emulates the processor to safely let the binary unpack itself.
file
can identify UPX packing, and the can also unpack.
of DOS/Windows packers.
can identify several DOS/Windows packers.
has a bunch of small utilities