Module: PWN::Plugins::Sandbox

Defined in:
lib/pwn/plugins/sandbox.rb

Overview

Disposable no-network execution; never falls back to host execution.

Class Method Summary collapse

Class Method Details

.authorsObject



34
35
36
# File 'lib/pwn/plugins/sandbox.rb', line 34

public_class_method def self.authors
  'AUTHOR(S): 0day Inc. <[email protected]>'
end

.fuzz(opts = {}) ⇒ Object



14
15
16
# File 'lib/pwn/plugins/sandbox.rb', line 14

public_class_method def self.fuzz(opts = {})
  invoke(opts.merge(action: 'fuzz', binary: opts[:target]))
end

.helpObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/pwn/plugins/sandbox.rb', line 38

public_class_method def self.help
  puts "USAGE:
    # Execute a binary in a disposable no-network environment.
    #{self}.run(
      binary: 'required - local executable fixture path',
      argv: 'optional - argument string array',
      stdin: 'optional - target input text',
      backend: 'optional - docker default or explicit bwrap',
      timeout: 'optional - execution seconds budget',
      memory_mb: 'optional - memory budget in megabytes'
    )
    # Mutate stdin seeds with deterministic bit flips.
    #{self}.fuzz(
      target: 'required - executable target path',
      corpus: 'required - directory of seed inputs',
      minutes: 'required - fuzzing time budget'
    )
    # Preserve an integrity-checked immutable input copy.
    #{self}.snapshot(binary: 'required - local executable to preserve')
    # Start a fresh environment from a verified snapshot.
    #{self}.rollback(snapshot: 'required - snapshot directory returned earlier')
    # Print the module author information.
    #{self}.authors
  "
end

.rollback(opts = {}) ⇒ Object



22
23
24
# File 'lib/pwn/plugins/sandbox.rb', line 22

public_class_method def self.rollback(opts = {})
  invoke(opts.merge(action: 'rollback'))
end

.run(opts = {}) ⇒ Object



10
11
12
# File 'lib/pwn/plugins/sandbox.rb', line 10

public_class_method def self.run(opts = {})
  invoke(opts.merge(action: 'run'))
end

.snapshot(opts = {}) ⇒ Object



18
19
20
# File 'lib/pwn/plugins/sandbox.rb', line 18

public_class_method def self.snapshot(opts = {})
  invoke(opts.merge(action: 'snapshot'))
end