PageRenderTime 71ms CodeModel.GetById 66ms app.highlight 3ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://github.com/debbiemezyene/metasploit-framework
Ruby | 29 lines | 20 code | 8 blank | 1 comment | 0 complexity | d9048b7f02cee5ab6fe3ec7279b1df2b MD5 | raw file
 1# -*- coding:binary -*-
 2require 'spec_helper'
 3
 4require 'rex/exploitation/cmdstager'
 5
 6describe Rex::Exploitation::CmdStagerPrintf 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    it "returns an array of commands" do
22      result = cmd_stager.generate
23
24      expect(result).to be_kind_of(Array)
25      expect(result).to_not be_empty
26    end
27  end
28
29end