File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
spec/lib/rex/exploitation/powershell Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ # -*- coding:binary -*-
2
+ require 'spec_helper'
3
+
4
+ require 'rex/exploitation/powershell'
5
+
6
+ describe Rex ::Exploitation ::Powershell ::PshMethods do
7
+
8
+ describe "::download" do
9
+ it 'should return some powershell' do
10
+ script = Rex ::Exploitation ::Powershell ::PshMethods . download ( 'a' )
11
+ script . should be
12
+ script . include? ( 'WebClient' ) . should be_true
13
+ end
14
+ end
15
+ describe "::uninstall" do
16
+ it 'should return some powershell' do
17
+ script = Rex ::Exploitation ::Powershell ::PshMethods . uninstall ( 'a' )
18
+ script . should be
19
+ script . include? ( 'Win32_Product' ) . should be_true
20
+ end
21
+ end
22
+ describe "::secure_string" do
23
+ it 'should return some powershell' do
24
+ script = Rex ::Exploitation ::Powershell ::PshMethods . secure_string ( 'a' )
25
+ script . should be
26
+ script . include? ( 'AsPlainText' ) . should be_true
27
+ end
28
+ end
29
+ describe "::who_locked_file?" do
30
+ it 'should return some powershell' do
31
+ script = Rex ::Exploitation ::Powershell ::PshMethods . who_locked_file? ( 'a' )
32
+ script . should be
33
+ script . include? ( 'Get-Process' ) . should be_true
34
+ end
35
+ end
36
+ describe "::get_last_login" do
37
+ it 'should return some powershell' do
38
+ script = Rex ::Exploitation ::Powershell ::PshMethods . get_last_login ( 'a' )
39
+ script . should be
40
+ script . include? ( 'Get-QADComputer' ) . should be_true
41
+ end
42
+ end
43
+ end
44
+
You can’t perform that action at this time.
0 commit comments