File tree Expand file tree Collapse file tree 1 file changed +0
-37
lines changed
lib/msf/core/post/windows Expand file tree Collapse file tree 1 file changed +0
-37
lines changed Original file line number Diff line number Diff line change @@ -30,43 +30,6 @@ def have_powershell?
30
30
return false
31
31
end
32
32
33
- #
34
- # Returns the .Net version
35
- #
36
- def get_dotnet_version
37
- case sysinfo [ 'OS' ]
38
- when /Windows 8|10/
39
- cmd = 'wmic /namespace:\\\\root\\cimv2 path win32_optionalfeature where "caption like \'.NET Framework%\' and InstallState = 1" get caption'
40
- else
41
- cmd = 'wmic /namespace:\\\\root\\cimv2 path win32_product where "name like \'%%.NET%%\'" get version'
42
- end
43
-
44
- if have_powershell?
45
- process , pid , c = execute_script ( cmd )
46
- cmd_out = ''
47
- while ( d = process . channel . read )
48
- if d == ""
49
- if ( Time . now . to_i - start < time_out ) && ( cmd_out == '' )
50
- sleep 0.1
51
- else
52
- break
53
- end
54
- else
55
- cmd_out << d
56
- end
57
- end
58
- else
59
- begin
60
- cmd_out = cmd_exec ( cmd )
61
- rescue Rex ::TimeoutError
62
- return nil
63
- end
64
- end
65
-
66
- cmd_out . scan ( /(\d \. [\d \. ]+)/ ) . flatten . first
67
- end
68
-
69
-
70
33
#
71
34
# Returns the Powershell version
72
35
#
You can’t perform that action at this time.
0 commit comments