Created
November 28, 2017 15:09
-
-
Save vector-sec/9caa8e14b2adba7ab0c215a6bf856953 to your computer and use it in GitHub Desktop.
Revisions
-
fightincanary created this gist
Nov 28, 2017 .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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ $APIKey = 'KEY' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $url = "https://www.example.com/api/v1/process?q=process_name:certutil.exe" $hdrs = @{} $hdrs.Add("X-Auth-Token",$APIKey) $response = Invoke-RestMethod -Uri $url -Headers $hdrs for($i =0; $i -lt $response.total_results; $i++) { $ProcessId = $response.results[$i].id $SegmentId = $response.results[$i].segment_id if( $response.results[$i].filemod_count -gt 0) { $url = "https://www.example.com/api/v2/process/$ProcessId/$SegmentId/event" $resp = Invoke-RestMethod -Uri $url -Headers $hdrs #$resp.process.filemod_complete | Format-List $filemods = $resp.process.filemod_complete $filemods } }