-
Notifications
You must be signed in to change notification settings - Fork 133
Azurehound enhancement - Active Sessions #142
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
Open
manas-metron
wants to merge
35
commits into
SpecterOps:main
Choose a base branch
from
metron-labs:vishalk-active-session-monitoring-metronlabs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
af39e51
Updated to the latest commit of main branch on the original repo
vishalk-metron 848b218
Update .gitignore
vishalk-metron 62498f4
Partial code completion for fetching devices from intune
vishalk-metron 0d5c890
sample integration example (partial, may not work)
vishalk-metron 45f8965
Merge remote-tracking branch 'spectreops-ah-repo/main' into vishalk-m…
vishalk-metron a62a190
Intune basic APIs have been implemented
vishalk-metron 688ccf2
Added powershell script to get JWT Token from graph
vishalk-metron c6a476f
Update .gitignore
vishalk-metron 373cfc2
Updated the file 'list-intune-script-results.go' to get results from …
vishalk-metron c85f340
Added files for Registry values module - incomplete
vishalk-metron ab1d17b
Removed Registry Values Files to clean up the PR
vishalk-metron 8c4e2a8
Delete registry.go
vishalk-metron 6c20e19
Removed references for script execution module
vishalk-metron 14f9461
Removed Duplicate Code, Unused Code
vishalk-metron 5fcda19
Reduced Code Duplication
vishalk-metron 414247f
Working Unoptimised version
vishalk-metron a63b083
Implemented Real API instead of mock results
vishalk-metron 160a712
Delete cla.yml
vishalk-metron 97867d2
Removing Action / Checks
vishalk-metron fd673c1
test commit
vishalk-metron e1c2866
Revert "test commit"
vishalk-metron ba2d4f3
Revert "Removing Action / Checks"
vishalk-metron 8ebed47
Revert "Delete cla.yml"
vishalk-metron 5a48c7d
Delete intune_converter.go
vishalk-metron 39bdfca
Update list-intune-registry-analysis.go
vishalk-metron 5811b81
Delete get_token.ps1
vishalk-metron 6b0d8a9
Active sessions data fetching through Intune
vishalk-metron 65d402b
Updated with real API calls and to use existing config file
vishalk-metron 27aee2e
Completed/Corrected the Session Collection Module
vishalk-metron 229243c
Improved the module and added detailed analysis --verbose flag
vishalk-metron d68622a
PR Comment Resolution
vishalk-metron ff456f4
Code Cleaning
vishalk-metron 4c2e98e
CodeRabbit PR comments resolved
vishalk-metron d84286a
CodeRabbit PR comments resolved
vishalk-metron fda5092
Merge Conflict Resolution
vishalk-metron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| // File: client/intune_devices.go | ||
| // Copyright (C) 2022 SpecterOps | ||
| // Implementation of Intune device management API calls | ||
|
|
||
| package client | ||
|
|
||
| import ( | ||
| "context" | ||
| "fmt" | ||
|
|
||
| "github.com/bloodhoundad/azurehound/v2/client/query" | ||
| "github.com/bloodhoundad/azurehound/v2/constants" | ||
| "github.com/bloodhoundad/azurehound/v2/models/intune" | ||
| ) | ||
|
|
||
| // Maximum page size for Microsoft Graph API requests | ||
| const MaxGraphAPIPageSize = 999 | ||
|
|
||
| func setDefaultParams(params *query.GraphParams) { | ||
| if params.Top == 0 { | ||
| params.Top = MaxGraphAPIPageSize | ||
| } | ||
| } | ||
|
|
||
| // ListIntuneManagedDevices retrieves all managed devices from Intune | ||
| // GET /deviceManagement/managedDevices | ||
| func (s *azureClient) ListIntuneManagedDevices(ctx context.Context, params query.GraphParams) <-chan AzureResult[intune.ManagedDevice] { | ||
| var ( | ||
| out = make(chan AzureResult[intune.ManagedDevice]) | ||
| path = fmt.Sprintf("/%s/deviceManagement/managedDevices", constants.GraphApiVersion) | ||
| ) | ||
|
|
||
| setDefaultParams(¶ms) | ||
|
|
||
| go getAzureObjectList[intune.ManagedDevice](s.msgraph, ctx, path, params, out) | ||
| return out | ||
| } | ||
|
|
||
| // GetIntuneDeviceCompliance retrieves compliance information for a specific device | ||
| // GET /deviceManagement/managedDevices/{id}/deviceCompliancePolicyStates | ||
| func (s *azureClient) GetIntuneDeviceCompliance(ctx context.Context, deviceId string, params query.GraphParams) <-chan AzureResult[intune.ComplianceState] { | ||
| var ( | ||
| out = make(chan AzureResult[intune.ComplianceState]) | ||
| path = fmt.Sprintf("/%s/deviceManagement/managedDevices/%s/deviceCompliancePolicyStates", constants.GraphApiVersion, deviceId) | ||
| ) | ||
|
|
||
| setDefaultParams(¶ms) | ||
|
|
||
| go getAzureObjectList[intune.ComplianceState](s.msgraph, ctx, path, params, out) | ||
| return out | ||
| } | ||
|
|
||
| // GetIntuneDeviceConfiguration retrieves configuration information for a specific device | ||
| // GET /deviceManagement/managedDevices/{id}/deviceConfigurationStates | ||
| func (s *azureClient) GetIntuneDeviceConfiguration(ctx context.Context, deviceId string, params query.GraphParams) <-chan AzureResult[intune.ConfigurationState] { | ||
| var ( | ||
| out = make(chan AzureResult[intune.ConfigurationState]) | ||
| path = fmt.Sprintf("/%s/deviceManagement/managedDevices/%s/deviceConfigurationStates", constants.GraphApiVersion, deviceId) | ||
| ) | ||
|
|
||
| setDefaultParams(¶ms) | ||
|
|
||
| go getAzureObjectList[intune.ConfigurationState](s.msgraph, ctx, path, params, out) | ||
| return out | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.