PoshSec/PoshSecFramework

Some scripts don't work on Win7

Closed this issue · 5 comments

So I was testing out the project on my work machine (Win7 with PSv3) and it looks like some of the supplied scripts rely on some win8 functions (specifically it looks like monitorports.ps1 and many others rely on Get-NetIPAddress which is a function in the Win8 module NetTCPIP)...

We could wrap this with a test for that function (i.e. Test-Path function:Get-NetIPAddress) and then wrap either the C# function to get the IPAddresses, or wrap the output of ipconfig.

Not sure what path would be best.

I run this on win7 x64 with psv3 and it works fine.

What is the error you are getting?

Ah, I see. You're right. Get-NetIPAddress is for Win8. The reason that I didn't see an error was because it didn't show ipv6. That is in the Get-SecOpenPorts function. Great catch. We'll adjust that function appropriately.

  • Change line 15/16 to parse $item[1] if Test-Path fails to find function Get-NetIPAddress.

Again, great find and suggestion DBHeise.

Staged in Development 879dfa0

Undergoing testing now.

Function seems to work in Win7 v3 and Win2008R2 v2 (although the other issues with v2 remain)