All Projects → woodruffw → Steg86

woodruffw / Steg86

Licence: other
Hiding messages in x86 programs using semantic duals

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Steg86

S2e
S2E: A platform for multi-path program analysis with selective symbolic execution.
Stars: ✭ 102 (-25%)
Mutual labels:  x86
Keystone
Keystone assembler framework: Core (Arm, Arm64, Hexagon, Mips, PowerPC, Sparc, SystemZ & X86) + bindings
Stars: ✭ 1,654 (+1116.18%)
Mutual labels:  x86
Build
Armbian Linux build framework
Stars: ✭ 1,827 (+1243.38%)
Mutual labels:  x86
Stegonline
A web-based, accessible and open-source port of StegSolve.
Stars: ✭ 105 (-22.79%)
Mutual labels:  steganography
Information Security Tasks
This repository is created only for infosec professionals whom work day to day basis to equip ourself with uptodate skillset, We can daily contribute daily one hour for day to day tasks and work on problem statements daily, Please contribute by providing problem statements and solutions
Stars: ✭ 108 (-20.59%)
Mutual labels:  steganography
Xray 16
Improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World. Join OpenXRay! ;)
Stars: ✭ 1,806 (+1227.94%)
Mutual labels:  x86
Inline Hook
simple inline-hook framework works for x86, x64, arm and thumb
Stars: ✭ 102 (-25%)
Mutual labels:  x86
Stegbrute
Fast Steganography bruteforce tool written in Rust useful for CTF's
Stars: ✭ 134 (-1.47%)
Mutual labels:  steganography
Stego Toolkit
Collection of steganography tools - helps with CTF challenges
Stars: ✭ 1,693 (+1144.85%)
Mutual labels:  steganography
Asm
Assembly Tutorial for DOS
Stars: ✭ 125 (-8.09%)
Mutual labels:  x86
Minios
Simple DIY OS
Stars: ✭ 106 (-22.06%)
Mutual labels:  x86
Jingos
JingOS - The World’s First Linux-based OS design for Tablets
Stars: ✭ 101 (-25.74%)
Mutual labels:  x86
Microx
Safely execute an arbitrary x86 instruction
Stars: ✭ 120 (-11.76%)
Mutual labels:  x86
Steganographer
Steganograpy in Python | Hide files or data in Image Files
Stars: ✭ 104 (-23.53%)
Mutual labels:  steganography
Asmtk
Assembler toolkit based on AsmJit
Stars: ✭ 131 (-3.68%)
Mutual labels:  x86
Bap
Binary Analysis Platform
Stars: ✭ 1,385 (+918.38%)
Mutual labels:  x86
Sacara
Sacara VM
Stars: ✭ 114 (-16.18%)
Mutual labels:  x86
V86
x86 virtualization in your browser, recompiling x86 to wasm on the fly
Stars: ✭ 12,765 (+9286.03%)
Mutual labels:  x86
Asm Cli Rust
interative assembly shell written in rust
Stars: ✭ 133 (-2.21%)
Mutual labels:  x86
Steganogan
SteganoGAN is a tool for creating steganographic images using adversarial training.
Stars: ✭ 124 (-8.82%)
Mutual labels:  steganography

steg86

license Build Status

steg86 is a format-agnostic steganographic tool for x86 and AMD64 binaries. You can use it to hide information in compiled programs, regardless of executable format (PE, ELF, Mach-O, raw, &c). It has no performance or size impact on the files that it modifies (adding a message does not increase binary size or decrease execution speed).

For more details on how steg86 works, see the Theory of Operation section.

Installation

steg86 can be installed via cargo:

$ cargo install steg86

Alternatively, you can build it in this repository with cargo build:

$ cargo build

Usage

See steg86 --help for a full list of flags and subcommands.

Profiling

To profile a binary for steganographic suitability:

$ steg86 profile /bin/bash
Summary for /bin/bash:
  175828 total instructions
  27957 potential semantic pairs
  27925 bits of information capacity (approx. 3KB)

Embedding

To embed a message into a binary:

$ steg86 embed /bin/bash ./bash.steg <<< "here is my secret message"

By default, steg86 embed writes its output to $input.steg. For example, /lib64/ld-linux-x86-64.so.2 would become /lib64/ld-linux-x86-64.so.2.steg.

steg86 embed will exit with a non-zero status if the message cannot be embedded (e.g., if it's too large).

Extraction

To extract a message from a binary:

$ steg86 extract bash.steg > my_message
$ cat message
here is my secret message

steg86 extract will exit with a non-zero status if a message cannot be extracted (e.g., if it can't find one).

Theory of Operation

steg86 takes advantage of one of x86's encoding peculiarities: the R/M field of the ModR/M byte:

  7  6  5  4  3  2  1  0
 -------------------------
 | MOD |  REG  |   R/M   |
 -------------------------

The ModR/M byte is normally used to support both register-to-memory and memory-to-register variants of the same instruction. For example, the MOV instruction has the following variants (among many others):

opcode mnemonic
89 /r MOV r/m32,r32
8B /r MOV r32,r/m32

Because the ModR/M field can encode either a memory addressing operation or a bare register, opcodes that support both register-to-memory and memory-to-register operations also support multiple encodings of register-to-register operations.

For example, mov eax, ebx can be encoded as either 89 d8 or 8b c3 without any semantic changes. This gives us one bit of information per duplicated instruction semantic. Given enough register-to-register instructions with multiple encodings, we can hide entire messages with those bits.

Additionally, because these semantically identical encodings are frequently the same size, we can modify preexisting binaries without having to fix relocations or RIP-relative addressing.

steg86 does primitive binary translation to accomplish these goals. It uses iced-x86 for encoding and decoding, and goblin for binary format wrangling.

Prior work

The inspiration for steg86 came from @inventednight, who described it as an adaptation of a similar idea (also theirs) for RISC-V binaries.

The technique mentioned above is discussed in detail in Hydan: Hiding Information in Program Binaries (2004).

steg86 constitutes a separate discovery of Hydan's technique and was written entirely independently; the refinements discussed in the paper may or may not be more optimal than the ones implemented in steg86.

Future improvements

  • steg86 currently limits the embedded message to 16KB. This is a purely artificial limitation that could be resolved with some small format changes.

  • x86 (and AMD64) both have multi-byte NOPs, for alignment purposes. Additional information can be hidden in these in a few ways:

    • The OF 1F /0 multi-byte NOP can be up to 9 bytes, of which up to 5 are free (SIB + 4-byte displacement).
    • There are longer NOPs (11, 15 bytes) that may also be usable.
  • Going beyond register-to-register duals and rewriting add/sub, as Hydan does.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].