We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ea0ebf2 + e08c4a8 commit 6386d9dCopy full SHA for 6386d9d
lib/msf/core/post/windows/powershell.rb
@@ -30,6 +30,31 @@ def have_powershell?
30
return false
31
end
32
33
+ #
34
+ # Returns the Powershell version
35
36
+ def get_powershell_version
37
+ return nil unless have_powershell?
38
+
39
+ process, pid, c = execute_script('$PSVersionTable.PSVersion')
40
41
+ o = ''
42
43
+ while (d = process.channel.read)
44
+ if d == ""
45
+ if (Time.now.to_i - start < time_out) && (o == '')
46
+ sleep 0.1
47
+ else
48
+ break
49
+ end
50
51
+ o << d
52
53
54
55
+ o.scan(/[\d \-]+/).last.split[0,2] * '.'
56
57
58
#
59
# Get/compare list of current PS processes - nested execution can spawn many children
60
# doing checks before and after execution allows us to kill more children...
0 commit comments