PageRenderTime 30ms CodeModel.GetById 17ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

/spec/lib/rex/exploitation/cmdstager/debug_write_spec.rb

https://github.com/debbiemezyene/metasploit-framework
Ruby | 35 lines | 25 code | 9 blank | 1 comment | 0 complexity | 2a52db6eaaebe3b41ba4505d2c1267d3 MD5 | raw file
 1# -*- coding:binary -*-
 2require 'spec_helper'
 3
 4require 'rex/exploitation/cmdstager'
 5
 6describe Rex::Exploitation::CmdStagerDebugWrite do
 7
 8  let(:exe) { "MZ" }
 9
10  subject(:cmd_stager) do
11    described_class.new(exe)
12  end
13
14  describe '#cmd_concat_operator' do
15    it "returns &" do
16      expect(cmd_stager.cmd_concat_operator).to eq(" & ")
17    end
18  end
19
20  describe '#generate' do
21    let(:opts) do
22      {
23        :decoder => File.join(Msf::Config.data_directory, "exploits", "cmdstager", "debug_write")
24      }
25    end
26
27    it "returns an array of commands" do
28      result = cmd_stager.generate(opts)
29
30      expect(result).to be_kind_of(Array)
31      expect(result).to_not be_empty
32    end
33  end
34
35end