Back to list
amattas

vm-interpreter

by amattas

0🍴 0📅 Jan 19, 2026

SKILL.md


name: vm-interpreter description: Exploiting custom interpreters and virtual machines

VM/Interpreter Exploitation

Concept: Turn VM semantics into arbitrary read/write primitives.


Recognition

Signals:

  • Custom interpreter for small language
  • Brainfuck-like instructions (>, <, +, -, ., ,)
  • Bytecode VM with opcodes manipulating memory
  • Memory tape/array with movable pointer

Goal

Convert VM operations into:

  • Arbitrary read: Leak addresses, secrets
  • Arbitrary write: Modify GOT, return addresses, pointers

Analysis Steps

1. Map memory layout:

Where does VM memory live?
- Stack (near return addresses)
- Heap (near malloc metadata)
- BSS/data (near GOT, globals)

2. Find neighbors:

What's adjacent to VM memory?
- GOT entries
- Function pointers
- Stack frames
- Global variables

3. Calculate distances:

distance = target_addr - vm_memory_base
moves = distance / pointer_step_size

Common VM Types

Brainfuck-style:

OpEffect
>Move pointer right
<Move pointer left
+Increment byte
-Decrement byte
.Output byte
,Input byte

Bytecode style:

  • LOAD, STORE - Memory access
  • ADD, SUB - Arithmetic
  • JMP, JZ - Control flow
  • PUSH, POP - Stack operations

Exploitation Patterns

Pattern A - Leak via output:

1. Calculate distance from VM memory to target
2. Move pointer to target location
3. Output bytes at pointer
4. Reconstruct leaked address

Pattern B - GOT/pointer overwrite:

1. Move pointer to writable target
2. Set bytes to desired value
3. Trigger overwritten function

Pattern C - Return address overwrite:

(Only if VM memory is on stack)
1. Find offset to saved return address
2. Navigate and overwrite

Pitfalls

IssueSolution
Off-by-one navigationVerify with known values first
Endiannessx86 is little-endian
Character restrictionsUse loops for encoding
Instruction limitsOptimize, use loops
Null bytes in targetWrite in pieces

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon