-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prompt for password for user/password authentication #9
Comments
@faustocarramate This functionality hasn't been implemented but you are more than welcome to submit a PR. In the meantime, you can pass in the password using the Examples: # For POSIX compliant systems
stty -echo; read AZUREHOUND_PASSWORD; stty echo
azurehound list -u '[email protected]' -t 'mytenant.onmicrosoft.com' # For PowerShell
$password = Read-Host -assecurestring "Please enter your password"
$AZUREHOUND_PASSWORD = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($password))
azurehound list -u '[email protected]' -t 'mytenant.onmicrosoft.com' |
Hi @ddlees , |
@faustocarramate Currently we don't handle MFA but you can get around this limitation by using a refresh token. Fortunately, obtaining a refresh token isn't all that difficult.
$body = @{
"client_id" = "1950a258-227b-4e31-a9cf-717495945fc2"
"resource" = "https://graph.microsoft.com"
}
$UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
$Headers=@{}
$Headers["User-Agent"] = $UserAgent
$authResponse = Invoke-RestMethod `
-UseBasicParsing `
-Method Post `
-Uri "https://login.microsoftonline.com/common/oauth2/devicecode?api-version=1.0" `
-Headers $Headers `
-Body $body
$authResponse
$body=@{
"client_id" = "1950a258-227b-4e31-a9cf-717495945fc2"
"grant_type" = "urn:ietf:params:oauth:grant-type:device_code"
"code" = $authResponse.device_code
}
$a = Invoke-RestMethod `
-UseBasicParsing `
-Method Post `
-Uri "https://login.microsoftonline.com/Common/oauth2/token?api-version=1.0" `
-Headers $Headers `
-Body $body
$a
azurehound --refresh-token <refresh_token> <subcommand> |
When executing without password flag AzureHound should interactively prompt for password but it is not. Affected version v1.1.3.
Executing:
.\azurehound.exe list -u '[email protected]' -t '123-123-123' -b 'abc-abc-abc' --json --log-file 'C:\output'
Output:
The text was updated successfully, but these errors were encountered: