nccgroup / azucar

Security auditing tool for Azure environments
GNU Affero General Public License v3.0
564 stars 112 forks source link

Powershell on Linux/Mac #2

Closed shivankar-madaan closed 6 years ago

shivankar-madaan commented 6 years ago

I tried installed powershell on my MAC using this doc. https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-powershell-core-on-macos?view=powershell-6

Getting this error when I try to run the Azucar.ps1

/git/azucar> ./Azucar.ps1
Get-ItemProperty : Cannot find drive. A drive with the name 'HKLM' does not exist.
At /Users/shivankarmadaan/git/azucar/Azucar.ps1:274 char:69
+ ... gumentList (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Internet Explo ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (HKLM:String) [Get-ItemProperty], DriveNotFoundException
+ FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand

New-Object : Exception calling ".ctor" with "4" argument(s): "Version's parameters must be greater than or equal to zero.
Parameter name: build"
At /Users/shivankarmadaan/git/azucar/Azucar.ps1:275 char:18
+     $ieVersion = New-Object -TypeName System.Version -ArgumentList (
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

[Exception][Main][286]:Internet Explorer 11 or later required. Current IE version is '0.0'.

Any idea where I'm wrong.

ulv1 commented 6 years ago

As it suggests it seems to rely on IE. Example would be on a Windows PC it'll set your browser default to IE and revert it to Chrome if Chrome was your default prior to running. "(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Internet Explo.." "[Exception][Main][286]:Internet Explorer 11 or later required. Current IE version is '0.0'."

shivankar-madaan commented 6 years ago

@ulv1 have you managed/tried to get running on Linux env, or windows system is mandatorily required?

ulv1 commented 6 years ago

@shivankar-madaan not tried, and in it's current iteration I do not see how it'd work on a Mac as one of the first things the script when called is to change your default to IE, as a Mac has no IE, it will throw the error you are getting:

[Exception][Main][286]:Internet Explorer 11 or later required. Current IE version is '0.0'.

shivankar-madaan commented 6 years ago

@ulv1 do you have any experience in powershell https://github.com/nccgroup/azucar/blob/20c9cc3e5250290c221d198e641d0291d2bca209/Azucar.ps1#L274

I guess the part of code needs to be changed. Possible could you help me out.

silverhack commented 6 years ago

Hi all,

Azucar uses ADAL (Active Directory Authentication Library) in order to authenticate against the Azure platform. It also takes advantage of user:password combination, MFA, etc..

Currently, Azucar has support only for Windows platforms.