Home
%3CLINGO-SUB%20id%3D%22lingo-sub-432921%22%20slang%3D%22en-US%22%3ESecurity%20Investigation%20with%20Azure%20Sentinel%20and%20Jupyter%20Notebooks%20%E2%80%93%20Part%201%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-432921%22%20slang%3D%22en-US%22%3E%3CP%3E%3CFONT%20size%3D%222%22%3EFollow%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2Fianhellen%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eianhellen%3C%2FA%3E%20on%20twitter.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20is%20the%20first%20part%20of%20a%20three-part%20article%20about%20using%20Jupyter%20notebooks%20in%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Fazure-sentinel%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sentinel%3C%2FA%3E.%20In%20this%20series%20we%20will%20be%20using%20Jupyter%20and%20Python%20to%20trace%20the%20path%20of%20a%20security%20breach%20in%20a%20network.%20The%20article%20is%20accompanied%20by%20a%20Jupyter%20notebook%20that%20illustrates%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3Ehow%20to%20query%20and%20display%20Azure%20Sentinel%20log%20data%2C%3C%2FLI%3E%0A%3CLI%3Ehow%20to%20enhance%20the%20data%20using%20external%20threat%20intelligence%20and%20other%20network%20databases%20(such%20as%20GeoIP)%2C%3C%2FLI%3E%0A%3CLI%3Ecleaning%2C%20filtering%20and%20analyzing%20data%20using%20the%20pandas%20and%20scikit-learn%20packages%3C%2FLI%3E%0A%3CLI%3Evisualizing%20the%20data%20in%20tabular%20and%20graphical%20forms.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThe%20notebook%20contains%20all%20the%20code%20used%20in%20articles.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1704699612%22%20id%3D%22toc-hId-1704699612%22%3EThe%20Attack%20Scenario%3C%2FH2%3E%0A%3CP%3EWe%20will%20investigate%20a%20simulated%20attack%20using%20Jupyter%20and%20Python%20to%20query%2C%20analyze%20and%20interpret%20data%20from%20Azure%20Sentinel.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EPart%201%20starts%20from%20receipt%20of%20a%20threat%20intelligence%20report%20and%20looks%20at%20how%20to%20investigate%20the%20characteristics%20of%20an%20attacker%20IP%20address%20and%20view%20related%20alerts%20in%20Azure%20Sentinel.%3C%2FLI%3E%0A%3CLI%3EPart%202%20will%20look%20at%20the%20attacker%20activity%20on%20a%20Linux%20host%20and%20at%20the%20network%20traffic%20patterns%20that%20lead%20us%20to%20discover%20a%20second%20compromised%20host.%3C%2FLI%3E%0A%3CLI%3EPart%203%20will%20carry%20the%20investigation%20on%20to%20this%20secondary%20Windows%20host%20and%20the%20subsequent%20exfiltration%20of%20Office%20365%20documents.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThe%20attack%20scenario%20is%20illustrated%20in%20the%20following%20figure.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108318i4FCCA12043A483D1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Scenario.png%22%20title%3D%22Scenario.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--847457349%22%20id%3D%22toc-hId--847457349%22%3EBackground%3C%2FH2%3E%0A%3CP%3EBefore%20getting%20into%20our%20hunting%20scenario%2C%20it%20is%20worth%20pausing%20to%20ask%20why%20we%20would%20want%20to%20use%20Jupyter%20notebooks%20with%20Azure%20Sentinel%2C%20given%20that%20it%20has%20a%20lot%20of%20powerful%20query%2C%20investigation%2C%20data%20manipulation%20and%20visualization%20capabilities%20of%20its%20own.%20One%20of%20the%20principal%20reasons%20that%20we%20built%20Azure%20Sentinel%20with%20a%20powerful%20query%20API%20was%20to%20support%20its%20use%20with%20external%20tools%20such%20as%20Jupyter.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20are%20new%20to%20Jupyter%20notebooks%20you%20should%20review%20this%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2Fmsticpy%2Fblob%2Fmaster%2Fdocs%2Fsource%2FJupyterAndSecurity.rst%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Earticle%3C%2FA%3E%2C%20which%20gives%20a%20more%20detailed%20description%20of%20the%20additional%20capabilities%20that%20Jupyter%20brings.%20In%20brief%20these%20are%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EData%20persistence%2C%20repeatability%20and%20backtracking%20in%20a%20single%20shareable%20document%3C%2FLI%3E%0A%3CLI%3EFull%20scripting%20and%20programming%20environment%3C%2FLI%3E%0A%3CLI%3EAbility%20to%20join%20data%20from%20external%20sources%20(i.e.%20not%20only%20data%20stored%20in%20Azure%20Sentinel)%3C%2FLI%3E%0A%3CLI%3EAccess%20to%20a%20huge%20array%20of%20python%20libraries%20bringing%20capabilities%20such%20as%3A%20machine%20learning%20and%20deep%20learning%3B%20advanced%20data%20processing%20and%20analysis%3B%20graphing%20and%20visualization.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EFor%20more%20background%20on%20starting%20out%20with%20Azure%20Sentinel%20and%20Jupyter%20look%20at%20either%20of%20the%20following%20documents%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fsentinel%2Fnotebooks%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EUse%20notebooks%20to%20hunt%20for%20security%20threats%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2Fmsticpy%2Fblob%2Fmaster%2Fdocs%2Fsource%2FJupyterAndAzureSentinel.rst%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EJupyter%2C%20msticpy%20and%20Azure%20Sentinel%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-895352986%22%20id%3D%22toc-hId-895352986%22%3EThe%20Hunting%20Notebook%3C%2FH2%3E%0A%3CP%3EThe%20companion%20notebook%20to%20this%20article%20is%20(intentionally)%20long.%20It%20is%20meant%20to%20be%20illustrative%2Feducation%20rather%20than%20used%20as-is.%20For%20that%20reason%2C%20I%E2%80%99ve%20tried%20to%20leave%20as%20much%20code%20and%20commenting%20as%20possible%20in%20the%20notebook%20for%20those%20that%20want%20to%20delve%20under%20the%20covers.%20However%2C%20you%20don%E2%80%99t%20need%20to%20read%20any%20code%20to%20follow%20the%20blog%20and%20look%20at%20the%20results%20of%20the%20notebook.%20I%20do%20encourage%20you%20to%20keep%20the%20notebook%20open%20as%20you%20read%20this%20though%20%E2%80%93%20since%20there%20is%20a%20lot%20more%20data%20and%20visual%20content%20in%20the%20notebook%20than%20we%20can%20reasonably%20fit%20into%20a%20blog%20post.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20notebook%20used%20in%20this%20article%20is%20available%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FNotebooks%2FSample-Notebooks%2FExample%2520-%2520Step-by-Step%2520Linux-Windows-Office%2520Investigation.ipynb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E%20and%20has%20sample%20data%20saved%20with%20it.%20Viewing%20it%20with%20nbviewer.org%20(open%20in%20%3CA%20href%3D%22https%3A%2F%2Fnbviewer.jupyter.org%2Fgithub%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FNotebooks%2FSample-Notebooks%2FExample%2520-%2520Step-by-Step%2520Linux-Windows-Office%2520Investigation.ipynb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Enbviewer%3C%2FA%3E)%20will%20keep%20the%20rendering%20as%20close%20to%20the%20original%20as%20possible%20and%20I%20recommend%20using%20that%20over%20the%20native%20GitHub%20viewer.%20Feel%20free%20to%20copy%2Fpaste%20sections%20and%20snippets%20to%20use%20in%20your%20own%20notebooks%20if%20you%20find%20them%20useful.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--1460290470%22%20id%3D%22toc-hId--1460290470%22%3EInvestigation%20Starting%20Point%3C%2FH1%3E%0A%3CP%3EIn%20part%20one%20we%20will%20look%20at%20the%20attacker's%20first%20incursion%20into%20our%20network%20(step%201%20on%20the%20earlier%20Scenario%20diagram)%20and%20introduce%20some%20of%20the%20components%20for%20exploring%20Azure%20Sentinel%E2%80%99s%20notebook%20integration.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-86006360%22%20id%3D%22toc-hId-86006360%22%3EThreat%20Intelligence%20Report%3C%2FH2%3E%0A%3CP%3EOur%20investigation%20is%20triggered%20by%20a%20Threat%20Intelligence%20report.%20This%20could%20be%20part%20of%20a%20threat%20intelligence%20feed%20that%20you%20subscribe%20to%2C%20a%20CERT%20advisory%20email%2C%20or%20a%20result%20of%20ad%20hoc%20browsing%20of%20online%20reports.%20In%20each%20case%20you%20might%20see%20something%20like%20this%20as%20part%20of%20the%20report.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20666px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108194i733AB571992A1D1A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22A%20list%20of%20indicators%20of%20compromise%20from%20a%20threat%20intelligence%20report.%22%20title%3D%22FireEyeReport.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EIndicators%20of%20Compromise%20(courtesy%20FireEye)%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20see%20a%20mixture%20of%20IP%20Addresses%2C%20URLs%20and%20file%20hashes%20in%20the%20list%20%E2%80%93%20all%20of%20which%20might%20be%20the%20basis%20for%20searching%20your%20organization%E2%80%99s%20data%20to%20see%20if%20any%20show%20up.%20In%20our%20case%20we%20will%20start%20with%20a%20list%20of%20Command%20%26amp%3B%20Control%20(C2)%20IP%20Addresses%20identified%20in%20the%20report.%20The%20techniques%20shown%20later%20in%20the%20notebook%20are%20usable%20irrespective%20of%20your%20starting%20point.%20For%20example%2C%20it%20could%20be%20an%20unusual%20event%20identified%20in%20the%20Azure%20Sentinel%20Hunting%20Queries%20as%20shown%20below.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108195i985939DF98B55300%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Azure%20Sentinel%20hunting%20queries.%22%20title%3D%22HuntingPane.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EHunting%20Queries%20in%20Azure%20Sentinel%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1828816695%22%20id%3D%22toc-hId-1828816695%22%3ESearching%20for%20IP%20Address%20Use%3C%2FH2%3E%0A%3CP%3EWe%20want%20to%20know%20whether%20any%20of%20the%20C2%20IPs%20have%20been%20seen%20in%20our%20network.%20Obviously%2C%20you%20would%20want%20to%20search%20network%20logs%20for%20this%2C%20but%20using%20the%20Kusto%20Query%20Language%20(KQL)%20%3CEM%3Esearch%3C%2FEM%3E%20operator%20we%20can%20as%20easily%20search%20across%20%3CEM%3E%3CSTRONG%3Eall%3C%2FSTRONG%3E%3C%2FEM%3E%20our%20logs%20(this%20can%20take%20more%20time%20but%20will%20uncover%20more%20useful%20results).%3C%2FP%3E%0A%3CP%3EWe%20use%20the%20time-range%20selector%20to%20set%20the%20range%20for%20queries%20(using%20this%20makes%20it%20easier%20to%20change%20the%20time%20ranges%20and%20re-run%20the%20queries%20than%20typing%20in%20the%20dates%20each%20time).%20Here%20we%20are%2C%20somewhat%20artificially%2C%20searching%20over%20a%20single%20day%2C%20but%20searching%20one%20or%20more%20weeks%20would%20be%20typical.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20917px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108197iC087AE4A60B8B8BD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22TimeRangeSelector.png%22%20title%3D%22TimeRangeSelector.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3ETime-Range%20Selector%20Widget%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20762px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108201i73C6040C1E175C18%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22C2QueryResults.png%22%20title%3D%22C2QueryResults.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EResults%20of%20C2%20IP%20Query%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20can%20see%20that%20one%20of%20the%20IP%20Addresses%20shows%20up%20in%20several%20logs%20besides%20our%20network%20log%2C%20including%20the%20Security%20Alerts%20table.%20This%20is%20probably%20the%20first%20place%20we%20should%20look%20at.%20Hits%20in%20Syslog%20and%20Linux%20Audit%20log%20tables%20indicate%20that%20at%20least%20one%20of%20our%20Linux%20hosts%20knows%20something%20about%20this%20address.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108202iE4112945D2F00CC4%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22AlertCounts.png%22%20title%3D%22AlertCounts.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3EA%20closer%20look%20at%20the%20alerts%20seems%20to%20confirm%20this.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELooking%20at%20the%20alerts%2C%20we%20can%20see%20a%20series%20of%20SSH%20brute%20force%20(Anomalous%20Login)%20alerts%20followed%20by%20a%20Suspicious%20File%20Download%20alert.%20Scrolling%20down%20the%20details%20of%20the%20alert%20reveals%20our%20C2%20IP%20address%20being%20used%20as%20the%20source%20of%20a%20shell%20script%20download.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108203i0F56F11ED5EB6176%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22DownloadAlert.png%22%20title%3D%22DownloadAlert.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3ESuspicious%20File%20Download%20Alert%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108204i1AFB702C86BF6052%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AlertCommandline.png%22%20title%3D%22AlertCommandline.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EC2%20IP%20used%20in%20wget%20HTTP%20download%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20notebook%20makes%20use%20of%20a%20few%20tools%20from%20the%20%3CEM%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2Fmsticpy%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Emsticpy%20package.%3C%2FA%3E%3C%2FEM%3E%26nbsp%3BThis%20is%20an%20ongoing%20development%20project%20started%20by%20Microsoft%20security%20analysts%20to%20collect%20together%20tools%20that%20aid%20common%20investigation%20or%20hunting%20tasks%20(visit%20the%20GitHub%20for%20more%20details%20and%20documentation%20of%20the%20tools).%20We've%20seen%20a%20few%20of%20these%20used%20already%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EA%20widget%20to%20set%20the%20alert%20date%20range%20for%20the%20query%3C%2FLI%3E%0A%3CLI%3EBuilt-in%20query%20to%20fetch%20alerts%20for%20the%20specified%20time%20range%3C%2FLI%3E%0A%3CLI%3EAlertSelector%20and%20AlertDisplay%20to%20select%20and%20display%20the%20alert%20contents.%20The%20scrollbar%20in%20the%20alert%20pane%20lets%20you%20scroll%20to%20see%20all%20the%20alert%20properties%2C%20extended%20properties%20and%20entities.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EIn%20this%20section%20of%20the%20notebook%20you%20can%20also%20see%20the%20use%20of%20the%20IoCExtractor%20class%20to%20pull%20out%20useful%20items%20(like%20IP%20Addresses%2C%20hashes%20and%20URLs)%20from%20text%20strings%20or%20data%20sets.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EA%20note%20about%20Entities%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EEntities%3C%2FEM%3E%20are%20simple%20classes%20that%20define%20well-known%20set%20of%20properties%20for%20things%20like%20hosts%2C%20processes%2C%20accounts%20IP%20addresses%2C%20etc.%20Using%20these%20provides%20a%20useful%20abstraction%20from%20the%20way%20these%20items%20might%20be%20represented%20in%20different%20data%20sets%3B%20you'll%20see%20these%20appearing%20in%20the%20notebook%20code%2C%20in%20other%20contexts%20in%20Azure%20Sentinel%20and%20in%20the%20alerts%20generated%20by%20Azure%20Security%20Center.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--526826761%22%20id%3D%22toc-hId--526826761%22%3EIP%20Address%20Investigation%3C%2FH1%3E%0A%3CP%3EWhen%20you%20come%20across%20a%20suspicious%20IP%20address%20(or%20anything%20suspicious)%20you%20want%20to%20find%20out%20as%20much%20about%20it%20as%20you%20can.%20We%20can%20do%20a%20series%20of%20checks%20on%20the%20IP%20address%2C%20for%20example%20retrieving%20registration%20information%20from%20public%20WhoIs%20databases%20and%20finding%20its%20geographic%20location.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20945px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108206iFBE9DB0E993CAED6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22RevIPandWhoIs.png%22%20title%3D%22RevIPandWhoIs.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EReverse%20IP%20and%20WhoIs%20lookup%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENote%3C%2FSTRONG%3E%3A%20Since%20the%20%E2%80%9Cattacker%E2%80%9D%20in%20this%20case%20was%20a%20server%20of%20mine%2C%20I%E2%80%99m%20ok%20that%20Microsoft%20seems%20to%20be%20the%20owner%20of%20this%20C2%20address%20%3CIMG%20id%3D%22smileywink%22%20class%3D%22emoticon%20emoticon-smileywink%22%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Fi%2Fsmilies%2F16x16_smiley-wink.png%22%20alt%3D%22Smiley%20Wink%22%20title%3D%22Smiley%20Wink%22%20%2F%3E.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108207i564635FF5346186C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22GeoLocation.png%22%20title%3D%22GeoLocation.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EGeoIP%20Lookup%20and%20display%20of%20the%20original%20C2%20IPs%20with%20our%20attacker%20IP%20indicated%20in%20red.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-822956564%22%20id%3D%22toc-hId-822956564%22%3EThreat%20Intelligence%20and%20IP%20Reputation%20Lookup%3C%2FH3%3E%0A%3CP%3ESome%20of%20the%20more%20interesting%20lookups%20that%20we%20can%20do%20include%20checking%20whether%20the%20IP%20Address%20shows%20up%20in%20threat%20intelligence%20and%20IP%20reputation%20databases.%3C%2FP%3E%0A%3CP%3EThe%20following%20shows%20retrieval%20of%20a%20threat%20intel%20indicator%20from%20our%20Azure%20Sentinel%20workspace%20(assuming%20that%20you%20have%20on-boarded%20Threat%20Intel%20feeds%20into%20your%20subscription)%20and%20a%20query%20to%20the%20VirusTotal%20API.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20902px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108208i8EADE7DF3FA6BB47%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22BYOTI.png%22%20title%3D%22BYOTI.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EQuery%20from%20Azure%20Sentinel%20Bring-your-own-threat-intel%3C%2FEM%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108209i0995DD4F1C8B03CF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22VirusTotal.png%22%20title%3D%22VirusTotal.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3EVirus%20Total%20Lookup%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--1336173387%22%20id%3D%22toc-hId--1336173387%22%3EConclusion%3C%2FH1%3E%0A%3CP%3EIn%20this%20first%20part%20we%E2%80%99ve%20covered%20starting%20out%20with%20Azure%20Sentinel%20and%20using%20the%20power%20of%20Jupyter%20notebooks%20to%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3Esearch%20across%20data%20stored%20in%20Azure%20Sentinel%20to%20identify%20which%20datasets%20contain%20the%20items%20that%20we%E2%80%99re%20looking%20for%2C%3C%2FLI%3E%0A%3CLI%3Eview%20and%20manipulate%20Security%20Alerts%20and%20Entities%2C%3C%2FLI%3E%0A%3CLI%3Ecorrelate%20this%20data%20with%20external%20data%20sources%20such%20as%20threat%20intelligence%20sources%2C%20geo-ip%20and%20IP%20registration%20services.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EWe%E2%80%99ve%20also%20introduced%20some%20of%20the%20Python%20modules%20in%20the%20%3CEM%3Emsticpy%3C%2FEM%3E%20package%20that%20you%20can%20use%20to%20speed%20up%20the%20development%20of%20your%20own%20notebooks%20and%20gain%20insights%20from%20your%20Azure%20Sentinel%20data%20more%20quickly%20and%20more%20repeatably.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20next%20part%20we%E2%80%99ll%20continue%20to%20follow%20our%20attacker%E2%80%99s%20path%20on%20to%20a%20compromised%20Linux%20host%3A%20examining%20processes%20auditing%20and%20logon%20sessions%20on%20the%20host%20and%20looking%20at%20network%20traffic%20to%20see%20where%20else%20our%20guest%20might%20have%20roamed.%20As%20part%20of%20this%20we%E2%80%99ll%20look%20at%20another%20card%20that%20Python%20brings%20to%20the%20investigative%20table%20%E2%80%93%20the%20ability%20to%20re-process%20and%20decode%20log%20data%20to%20pull%20out%20additional%20information%20needed%20for%20our%20investigation.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-406636948%22%20id%3D%22toc-hId-406636948%22%3EReferences%3C%2FH1%3E%0A%3CUL%3E%0A%3CLI%3EThe%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2Fmsticpy%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CEM%3Emsticpy%3C%2FEM%3E%3C%2FA%3E%20Python%20package%20contains%20tools%20used%20in%20these%20notebooks%2C%20developed%20by%20engineers%20on%20the%20Microsoft%20Threat%20Intelligence%20team.%20It%20is%20available%20on%20%3CEM%3E%3CA%20href%3D%22https%3A%2F%2Fpypi.org%2Fproject%2Fmsticpy%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPyPi%3C%2FA%3E%26nbsp%3B%3C%2FEM%3Eand%20on%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2Fmsticpy%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CEM%3EGitHub%3C%2FEM%3E%3C%2FA%3E%20along%20with%20several%20notebooks%20documenting%20the%20use%20of%20the%20package.%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2Fjupyter-Kqlmagic%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EKqlmagic%3C%2FA%3E%20is%20a%20Jupyter-friendly%20package%20for%20querying%20Azure%20Sentinel%20and%20Log%20Analytics%20developed%20by%20Michael%20Binstock.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22toc-hId--1456756953%22%20id%3D%22toc-hId--1456756953%22%3EMore%20Notebooks%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FWindows-Defender-ATP%2FAutomating-Security-Operations-Using-Windows-Defender-ATP-APIs%2Fba-p%2F294434%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3E%3CEM%3EAutomating%20Security%20Operations%20Using%20Windows%20Defender%20ATP%20APIs%20with%20Python%20and%20Jupyter%20Notebooks%3C%2FEM%3E%3C%2FA%3E%20by%20John%20Lambert%3C%2FLI%3E%0A%3CLI%3EAzure%20Sentinel%20sample%20Jupyter%20notebooks%20can%20be%20found%20in%20the%20Azure%20Sentinel%20Community%20repository%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CEM%3Ehere%3C%2FEM%3E%3C%2FA%3E%20on%20GitHub.%3C%2FLI%3E%0A%3CLI%3EWindows%20Alert%20Investigation%20in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FNotebooks%2FSample-Notebooks%2FExample%2520-%2520Guided%2520Investigation%2520-%2520Process-Alerts.ipynb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CEM%3Egithub%3C%2FEM%3E%3C%2FA%3E%20or%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fnbviewer.jupyter.org%2Fgithub%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FNotebooks%2FSample-Notebooks%2FExample%2520-%2520Guided%2520Investigation%2520-%2520Process-Alerts.ipynb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CEM%3ENbViewer%3C%2FEM%3E%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EWindows%20Host%20Explorer%20in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FNotebooks%2FSample-Notebooks%2FExample%2520-%2520Guided%2520Hunting%2520-%2520Windows-Host-Explorer.ipynb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CEM%3Egithub%3C%2FEM%3E%3C%2FA%3E%20or%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fnbviewer.jupyter.org%2Fgithub%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FNotebooks%2FSample-Notebooks%2FExample%2520-%2520Guided%2520Hunting%2520-%2520Windows-Host-Explorer.ipynb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CEM%3ENbViewer%3C%2FEM%3E%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EOffice%20365%20Exploration%20in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FNotebooks%2FSample-Notebooks%2FExample%2520-%2520Guided%2520Hunting%2520-%2520Office365-Exploring.ipynb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CEM%3Egithub%3C%2FEM%3E%3C%2FA%3E%20or%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fnbviewer.jupyter.org%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FNotebooks%2FSample-Notebooks%2FExample%2520-%2520Guided%2520Hunting%2520-%2520Office365-Exploring.ipynb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CEM%3ENbViewer%3C%2FEM%3E%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3ECross-Network%20Hunting%20in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FNotebooks%2FSample-Notebooks%2FExample%2520-%2520Guided%2520Hunting%2520-%2520Linux-Windows-Office.ipynb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CEM%3Egithub%3C%2FEM%3E%3C%2FA%3E%20or%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fnbviewer.jupyter.org%2Fgithub%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FNotebooks%2FSample-Notebooks%2FExample%2520-%2520Guided%2520Hunting%2520-%2520Linux-Windows-Office.ipynb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CEM%3ENbViewer%3C%2FEM%3E%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-432921%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20is%20first%20of%20a%20three-part%20series%20about%20using%20Jupyter%20notebooks%20in%20Azure%20Sentinel%20to%20trace%20the%20path%20of%20a%20security%20breach%20in%20a%20organization's%20network.%20It%20is%20accompanied%20by%20the%20notebook%20and%20Python%20code.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108215iE07E495635981603%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22HeaderGraphic.png%22%20title%3D%22HeaderGraphic.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-432921%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EHunting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EInvestigation%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Enotebooks%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Follow ianhellen on twitter.

 

This is the first part of a three-part article about using Jupyter notebooks in Azure Sentinel. In this series we will be using Jupyter and Python to trace the path of a security breach in a network. The article is accompanied by a Jupyter notebook that illustrates:

  • how to query and display Azure Sentinel log data,
  • how to enhance the data using external threat intelligence and other network databases (such as GeoIP),
  • cleaning, filtering and analyzing data using the pandas and scikit-learn packages
  • visualizing the data in tabular and graphical forms.

The notebook contains all the code used in articles.

 

The Attack Scenario

We will investigate a simulated attack using Jupyter and Python to query, analyze and interpret data from Azure Sentinel.

  • Part 1 starts from receipt of a threat intelligence report and looks at how to investigate the characteristics of an attacker IP address and view related alerts in Azure Sentinel.
  • Part 2 will look at the attacker activity on a Linux host and at the network traffic patterns that lead us to discover a second compromised host.
  • Part 3 will carry the investigation on to this secondary Windows host and the subsequent exfiltration of Office 365 documents.

The attack scenario is illustrated in the following figure.Scenario.png

 

Background

Before getting into our hunting scenario, it is worth pausing to ask why we would want to use Jupyter notebooks with Azure Sentinel, given that it has a lot of powerful query, investigation, data manipulation and visualization capabilities of its own. One of the principal reasons that we built Azure Sentinel with a powerful query API was to support its use with external tools such as Jupyter.

 

If you are new to Jupyter notebooks you should review this article, which gives a more detailed description of the additional capabilities that Jupyter brings. In brief these are:

  • Data persistence, repeatability and backtracking in a single shareable document
  • Full scripting and programming environment
  • Ability to join data from external sources (i.e. not only data stored in Azure Sentinel)
  • Access to a huge array of python libraries bringing capabilities such as: machine learning and deep learning; advanced data processing and analysis; graphing and visualization.

For more background on starting out with Azure Sentinel and Jupyter look at either of the following documents:

 

The Hunting Notebook

The companion notebook to this article is (intentionally) long. It is meant to be illustrative/education rather than used as-is. For that reason, I’ve tried to leave as much code and commenting as possible in the notebook for those that want to delve under the covers. However, you don’t need to read any code to follow the blog and look at the results of the notebook. I do encourage you to keep the notebook open as you read this though – since there is a lot more data and visual content in the notebook than we can reasonably fit into a blog post.

 

The notebook used in this article is available here and has sample data saved with it. Viewing it with nbviewer.org (open in nbviewer) will keep the rendering as close to the original as possible and I recommend using that over the native GitHub viewer. Feel free to copy/paste sections and snippets to use in your own notebooks if you find them useful.

 

Investigation Starting Point

In part one we will look at the attacker's first incursion into our network (step 1 on the earlier Scenario diagram) and introduce some of the components for exploring Azure Sentinel’s notebook integration.

 

Threat Intelligence Report

Our investigation is triggered by a Threat Intelligence report. This could be part of a threat intelligence feed that you subscribe to, a CERT advisory email, or a result of ad hoc browsing of online reports. In each case you might see something like this as part of the report.

 

A list of indicators of compromise from a threat intelligence report.

Indicators of Compromise (courtesy FireEye)

 

You can see a mixture of IP Addresses, URLs and file hashes in the list – all of which might be the basis for searching your organization’s data to see if any show up. In our case we will start with a list of Command & Control (C2) IP Addresses identified in the report. The techniques shown later in the notebook are usable irrespective of your starting point. For example, it could be an unusual event identified in the Azure Sentinel Hunting Queries as shown below.

 

Azure Sentinel hunting queries.

Hunting Queries in Azure Sentinel

 

Searching for IP Address Use

We want to know whether any of the C2 IPs have been seen in our network. Obviously, you would want to search network logs for this, but using the Kusto Query Language (KQL) search operator we can as easily search across all our logs (this can take more time but will uncover more useful results).

We use the time-range selector to set the range for queries (using this makes it easier to change the time ranges and re-run the queries than typing in the dates each time). Here we are, somewhat artificially, searching over a single day, but searching one or more weeks would be typical.TimeRangeSelector.png

Time-Range Selector Widget

 

C2QueryResults.png

Results of C2 IP Query

 

We can see that one of the IP Addresses shows up in several logs besides our network log, including the Security Alerts table. This is probably the first place we should look at. Hits in Syslog and Linux Audit log tables indicate that at least one of our Linux hosts knows something about this address.AlertCounts.png

A closer look at the alerts seems to confirm this.

 

 

 

Looking at the alerts, we can see a series of SSH brute force (Anomalous Login) alerts followed by a Suspicious File Download alert. Scrolling down the details of the alert reveals our C2 IP address being used as the source of a shell script download.DownloadAlert.png

Suspicious File Download Alert

 

AlertCommandline.png

C2 IP used in wget HTTP download

 

The notebook makes use of a few tools from the msticpy package. This is an ongoing development project started by Microsoft security analysts to collect together tools that aid common investigation or hunting tasks (visit the GitHub for more details and documentation of the tools). We've seen a few of these used already:

  • A widget to set the alert date range for the query
  • Built-in query to fetch alerts for the specified time range
  • AlertSelector and AlertDisplay to select and display the alert contents. The scrollbar in the alert pane lets you scroll to see all the alert properties, extended properties and entities.

In this section of the notebook you can also see the use of the IoCExtractor class to pull out useful items (like IP Addresses, hashes and URLs) from text strings or data sets.

 

A note about Entities

Entities are simple classes that define well-known set of properties for things like hosts, processes, accounts IP addresses, etc. Using these provides a useful abstraction from the way these items might be represented in different data sets; you'll see these appearing in the notebook code, in other contexts in Azure Sentinel and in the alerts generated by Azure Security Center.

 

IP Address Investigation

When you come across a suspicious IP address (or anything suspicious) you want to find out as much about it as you can. We can do a series of checks on the IP address, for example retrieving registration information from public WhoIs databases and finding its geographic location.RevIPandWhoIs.png

Reverse IP and WhoIs lookup

 

Note: Since the “attacker” in this case was a server of mine, I’m ok that Microsoft seems to be the owner of this C2 address Smiley Wink.GeoLocation.png

GeoIP Lookup and display of the original C2 IPs with our attacker IP indicated in red.

 

Threat Intelligence and IP Reputation Lookup

Some of the more interesting lookups that we can do include checking whether the IP Address shows up in threat intelligence and IP reputation databases.

The following shows retrieval of a threat intel indicator from our Azure Sentinel workspace (assuming that you have on-boarded Threat Intel feeds into your subscription) and a query to the VirusTotal API.BYOTI.png

Query from Azure Sentinel Bring-your-own-threat-intelVirusTotal.png

Virus Total Lookup

 

Conclusion

In this first part we’ve covered starting out with Azure Sentinel and using the power of Jupyter notebooks to:

  • search across data stored in Azure Sentinel to identify which datasets contain the items that we’re looking for,
  • view and manipulate Security Alerts and Entities,
  • correlate this data with external data sources such as threat intelligence sources, geo-ip and IP registration services.

We’ve also introduced some of the Python modules in the msticpy package that you can use to speed up the development of your own notebooks and gain insights from your Azure Sentinel data more quickly and more repeatably.

 

In the next part we’ll continue to follow our attacker’s path on to a compromised Linux host: examining processes auditing and logon sessions on the host and looking at network traffic to see where else our guest might have roamed. As part of this we’ll look at another card that Python brings to the investigative table – the ability to re-process and decode log data to pull out additional information needed for our investigation.

 

References

  • The msticpy Python package contains tools used in these notebooks, developed by engineers on the Microsoft Threat Intelligence team. It is available on PyPi and on GitHub along with several notebooks documenting the use of the package.
  • Kqlmagic is a Jupyter-friendly package for querying Azure Sentinel and Log Analytics developed by Michael Binstock.

More Notebooks