Home
%3CLINGO-SUB%20id%3D%22lingo-sub-220454%22%20slang%3D%22en-US%22%3EHunting%20tip%20of%20the%20month%3A%20Browser%20downloads%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-220454%22%20slang%3D%22en-US%22%3E%3CP%3EDownloads%20from%20browsers%20are%20often%20used%20to%20initiate%20cyberattacks.%20Targeted%20attacks%20may%20use%20watering%20holes%20or%20spear-phishing%20messages%20with%20links%2C%20while%20commodity%20threats%20often%20originate%20from%20malicious%20ad%20campaigns%20or%20are%20downloaded%20by%20software%20bundlers.%20With%20this%20being%20one%20of%20the%20most%20common%20entry%20points%20for%20malware%2C%20you%20might%20be%20excited%20to%20know%20that%20Windows%20Defender%20Advanced%20Threat%20Protection%20(%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fwindowsforbusiness%2Fwindows-atp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EWindows%20Defender%20ATP%3C%2FA%3E)%20tracks%20the%20origin%20of%20most%20files%20that%20are%20downloaded%20by%20Microsoft%20Edge%20or%20Google%20Chrome%2C%20and%20that%20you%20could%20use%20this%20information%20on%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fsecurity%2Fthreat-protection%2Fwindows-defender-atp%2Fadvanced-hunting-windows-defender-advanced-threat-protection%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAdvanced%20hunting%3C%2FA%3E%20to%20search%20for%20abnormal%20activities%20or%20pivot%20to%20related%20machines.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1704644800%22%20id%3D%22toc-hId-1704644800%22%3EExplaining%20the%20data%3A%20%3CEM%3EWhere%20is%20it%20from%20and%20what%20does%20it%20mean%3F%3C%2FEM%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20most%20cases%2C%20%3CEM%3EFileOriginUrl%3C%2FEM%3E%20and%20%3CEM%3EFileOriginIP%3C%2FEM%3E%20are%20the%20URLs%20and%20IPs%20from%20which%20the%20file%20was%20downloaded%2C%20while%20%3CEM%3EFileOriginReferrerUrl%3C%2FEM%3E%20is%20the%20URL%20that%20referred%20or%20linked%20to%20the%20download%20URL.%20This%20referrer%20URL%20is%20often%20the%20URL%20of%20a%20site%20page%20or%20a%20webmail%20page%20with%20a%20download%20link.%20Alternatively%2C%20this%20referrer%20URL%20might%20just%20be%20the%20previous%20link%20in%20a%20long%20chain%20of%20redirects%20used%20to%20proliferate%20malware.%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-left%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F38487iFC88D19901F2AE1E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22hunting%20tip%20downloads%20-%20raw%20results.png%22%20title%3D%22hunting%20tip%20downloads%20-%20raw%20results.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3BOur%20main%20source%20for%20this%20information%20is%20the%20%3CEM%3EZone.Identifier%3C%2FEM%3E%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fblogs.technet.microsoft.com%2Faskcore%2F2013%2F03%2F24%2Falternate-data-streams-in-ntfs%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ealternate%20data%20stream%3C%2FA%3E%3C%2FSPAN%3E%2C%20that%20is%20used%20by%20multiple%20applications%20to%20set%20the%20%E2%80%9Cmark%20of%20the%20web%E2%80%9D%20of%20downloaded%20files.%20Starting%20from%20Windows%2010%20version%201703%2C%20the%20Windows%20Defender%20ATP%20sensor%20collects%20this%20data%20for%20all%20the%20reported%20files.%20In%20Advanced%20hunting%2C%20we%20recently%20exposed%20a%20few%20fields%20that%20we%20parse%20from%20the%20stream%E2%80%94our%20%3CEM%3EFileOriginUrl%3C%2FEM%3E%20column%20is%20parsed%20from%20the%20%3CEM%3EHostUrl%3C%2FEM%3E%20field%2C%20%3CEM%3EFileOriginIP%3C%2FEM%3E%20is%20parsed%20from%20%3CEM%3EHostIpAddress%3C%2FEM%3E%2C%20and%20%3CEM%3EFileOriginReferrerUrl%3C%2FEM%3E%20is%20parsed%20from%20%3CEM%3EReferrerUrl%3C%2FEM%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMultiple%20Windows%20applications%20currently%20set%20a%20file%E2%80%99s%20origin%20details%20in%20that%20stream.%20Microsoft%20has%20enabled%20%3CEM%3EEdge%3C%2FEM%3E%20to%20set%20this%20information%2C%20so%20do%20Office%20programs%2C%20unzipping%20events%2C%20and%20more.%20Google%20has%20updated%20the%20%3CEM%3EChrome%3C%2FEM%3E%20browser%20accordingly%2C%20and%20so%20have%20multiple%20other%20products%20such%20as%20WinRar.%20When%20%3CEM%3Eexplorer.exe%3C%2FEM%3E%20copies%20files%20with%20this%20information%2C%20it%20sets%20this%20information%20for%20the%20new%20copies%20as%20well.%20All%20application%20developers%20can%20set%20this%20data%20for%20files%20that%20they%20create%E2%80%94see%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fbugzilla.mozilla.org%2Fshow_bug.cgi%3Fid%3D1433179%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethis%20Firefox%20bug%3C%2FA%3E%3C%2FSPAN%3E%20for%20more%20details.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20is%2C%20however%2C%20important%20to%20note%20that%20any%20program%20could%20set%20these%20fields%20in%20the%20%3CEM%3EZone.Identifier%3C%2FEM%3E%20alternate%20data%20stream%2C%20so%20the%20usage%20and%20actual%20meaning%20of%20values%20may%20vary.%20For%20example%2C%20during%20file%20extraction%2C%20many%20file%20compression%20apps%20use%20the%20path%20of%20the%20archive%20as%20the%20%3CEM%3EFileOriginReferrerUrl%3C%2FEM%3E%20of%20the%20extracted%20files.%20As%20a%20result%2C%20this%20field%20will%20contain%20a%20local%20path%20instead%20of%20the%20expected%20web%20page%20URL.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20some%20cases%2C%20we%20could%20get%20the%20file%20origin%20information%20from%20other%20sources%2C%20but%20would%20still%20upload%20it%20to%20use%20the%20above%20columns.%20Specifically%2C%20in%20Windows%20Defender%20Antivirus%20events%2C%20the%20file%20origin%20details%20are%20received%20from%20the%20%3CSPAN%3E%3CEM%3E%3CA%20href%3D%22https%3A%2F%2Fsocial.msdn.microsoft.com%2FForums%2Fvstudio%2Fen-US%2Fae8097c4-23e9-47a6-a4d3-24b3f2db3109%2Fhow-to-use-iofficeantivirus%3Fforum%3Dieextensiondevelopment%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EIOfficeAntiVirus%3C%2FA%3E%3C%2FEM%3E%3C%2FSPAN%3E%20API%2C%20which%20is%20used%20by%20browsers%2C%20Microsoft%20Office%2C%20file-sharing%20apps%2C%20and%20many%20other%20apps%20to%20request%20the%20enabled%20AV%20to%20scan%20downloaded%20files.%20In%20these%20events%2C%20%3CEM%3EFileOriginUrl%3C%2FEM%3E%20is%20set%20with%20the%20URL%20from%20which%20the%20detected%20file%20was%20downloaded.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENOTE%3A%3C%2FSTRONG%3E%20All%20data%20that%20is%20available%20through%20Advanced%20hunting%20is%20from%20your%20tenant.%20You%20can%20find%20more%20information%20on%20data%20privacy%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fsecurity%2Fthreat-protection%2Fwindows-defender-atp%2Fdata-storage-privacy-windows-defender-advanced-threat-protection%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E%3C%2FSPAN%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--847512161%22%20id%3D%22toc-hId--847512161%22%3EExample%201%3A%20Tracing%20footprints%E2%80%94find%20all%20files%20downloaded%20from%20a%20certain%20site%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20see%20a%20suspicious%20download%2C%20you%20may%20want%20to%20see%20which%20other%20files%20were%20downloaded%20from%20that%20URL%20or%20site.%20In%20this%20example%2C%20Windows%20Defender%20ATP%20raised%20an%20alert%20for%20malicious%20activity.%20As%20you%20can%20see%20in%20the%20process%20tree%20and%20its%20side-pane%2C%20a%20file%20was%20downloaded%20from%20a%20site%20called%20%3CEM%3Enapptayiyal%5B.%5Dcom%3C%2FEM%3E.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F38488i3F10DB38A1C0DF50%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22hunting%20tip%20downloads%20-%20process%20tree.PNG%22%20title%3D%22hunting%20tip%20downloads%20-%20process%20tree.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3BBy%20going%20to%20the%20URL%20page%20for%20%3CEM%3Enapptayiyal%5B.%5Dcom%3C%2FEM%3E%20in%20Windows%20Defender%20ATP%2C%20you%20can%20see%20that%20this%20site%20was%20recently%20registered%20through%20a%20privacy%20protection%20service%20and%20is%20hosted%20on%20AWS.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20975px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F38489i5F55A7A989B1ECB3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22hunting%20tip%20downloads%20-%20domain%20info.PNG%22%20title%3D%22hunting%20tip%20downloads%20-%20domain%20info.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3BThe%20URL%20page%20will%20show%20you%20all%20downloads%20from%20that%20site.%20However%2C%20let%E2%80%99s%20run%20a%20similar%20simple%20query%20in%20Advanced%20hunting%2C%20where%20we%20can%20continue%20to%20tweak%20the%20query%20to%20filter%20noise%20or%20expand%20our%20search%20as%20shown%20in%20the%20next%20few%20examples.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F38490i3C6D9ACFF6AB3ED8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22hunting%20tip%20downloads%20-%20query%201.png%22%20title%3D%22hunting%20tip%20downloads%20-%20query%201.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3BTo%20see%20what%20fields%20%3CEM%3Eparse_url()%3C%2FEM%3E%20can%20extract%2C%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs-analytics-eus.azurewebsites.net%2FqueryLanguage%2Fquery_language_parseurlfunction.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eread%20this%20documentation%3C%2FA%3E%3C%2FSPAN%3E.%3CBR%20%2F%3E%3CEM%3Eparse_url()%3C%2FEM%3E%20returns%20a%20%3CSPAN%3E%3CEM%3E%3CA%20href%3D%22https%3A%2F%2Fdocs-analytics-eus.azurewebsites.net%2Fconcepts%2Fconcepts_datatypes_dynamic.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Edynamic%20object%3C%2FA%3E%3C%2FEM%3E%3C%2FSPAN%3E%2C%20so%20in%20order%20to%20apply%20an%20endswith%20condition%20on%20it%2C%20we%20need%20to%20first%20convert%20it%20to%20a%20string%20using%20%3CEM%3Etostring()%3C%2FEM%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-895298174%22%20id%3D%22toc-hId-895298174%22%3EExample%202%3A%20Hunt%20for%20payloads%20hosted%20as%20user%20content%20in%20Dropbox%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOver%20the%20years%2C%20we%20have%20observed%20many%20malicious%20payloads%20being%20downloaded%20from%20popular%20online%20services%20like%20GitHub%2C%20Dropbox%2C%20Google%20Drive%2C%20OneDrive%2C%20Azure%20blob%20storage%2C%20and%20AWS%20storage.%20All%20these%20cloud%20vendors%2C%20including%20Microsoft%2C%20are%20committed%20to%20blocking%20and%20removing%20malicious%20payloads%2C%20but%20these%20services%20continue%20to%20be%20infection%20vectors.%20It%20is%20often%20easier%20for%20attackers%20to%20host%20files%20on%20public%20cloud%20infrastructure%20than%20to%20set%20up%20their%20own%20infrastructure.%20The%20good%20reputation%20and%20popularity%20of%20these%20services%20also%20make%20content%20they%20serve%20generally%20difficult%20for%20security%20providers%20and%20defenders%20to%20regulate.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20example%2C%20we%20focus%20on%20downloads%20from%20Dropbox%2C%20such%20as%20the%20one%20described%20in%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fwww.fireeye.com%2Fblog%2Fthreat-research%2F2018%2F04%2Ffake-software-update-abuses-netsupport-remote-access-tool.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethis%20post%3C%2FA%3E%3C%2FSPAN%3E%20by%20FireEye.%20Dropbox%20hosts%20user%20content%20under%20%3CEM%3Edl.dropboxusercontent.com%3C%2FEM%3E.%20As%20you%20can%20see%20in%20this%20query%2C%20most%20downloads%20have%20the%20referrer%20page%20within%20%3CA%20href%3D%22http%3A%2F%2Fwww.dropbox.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ewww.dropbox.com%3C%2FA%3E.%20For%20malware%2C%20however%2C%20this%20is%20usually%20not%20the%20case%E2%80%94attackers%20want%20the%20download%20to%20be%20seamless%2C%20without%20users%20seeing%20that%20dropbox.com%20is%20even%20involved.%3C%2FP%3E%0A%3CPRE%3E%3CFONT%20color%3D%22%23800080%22%3EFileCreationEvents%3C%2FFONT%3E%0A%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Ewhere%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EFileOriginUrl%3C%2FFONT%3E%20%3CFONT%20color%3D%22%230000FF%22%3Estartswith%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23800000%22%3E%22https%3A%2F%2Fdl.dropboxusercontent.com%2F%22%3C%2FFONT%3E%0A%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Eextend%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EReferrerHost%3D%3C%2FFONT%3E%3CFONT%20color%3D%22%23800000%22%3Etostring%3C%2FFONT%3E(%3CFONT%20color%3D%22%23800000%22%3Eparse_url%3C%2FFONT%3E%3CFONT%20color%3D%22%23000000%22%3E(FileOriginReferrerUrl).Host)%3C%2FFONT%3E%0A%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Esummarize%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23800000%22%3Ecount%3C%2FFONT%3E%3CFONT%20color%3D%22%23000000%22%3E()%2C%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23800000%22%3Eany%3C%2FFONT%3E%3CFONT%20color%3D%22%23000000%22%3E(FileName)%3C%2FFONT%3E%20%3CFONT%20color%3D%22%230000FF%22%3Eby%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EReferrerHost%3C%2FFONT%3E%26nbsp%3B%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20821px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F38692i1A9D09B5747377B4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22hunting%20tip%20downloads%20-%20dropbox%20stats.PNG%22%20title%3D%22hunting%20tip%20downloads%20-%20dropbox%20stats.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAfter%20filtering%20out%20downloads%20that%20start%20from%20%3CA%20href%3D%22http%3A%2F%2Fwww.dropbox.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ewww.dropbox.com%3C%2FA%3E%20we%20are%20left%20with%20little%20noise.%20Feel%20free%20to%20access%20the%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2FWindowsDefenderATP-Hunting-Queries%2Fblob%2Fmaster%2FDelivery%2FDropbox%2520downloads%2520linked%2520from%2520other%2520site.txt%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Efull%20query%3C%2FA%3E%3C%2FSPAN%3E%2C%20including%20this%20extra%20filter%2C%20on%20GitHub.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1656858787%22%20id%3D%22toc-hId--1656858787%22%3EExample%203%3A%20Pivot%20from%20Windows%20Defender%20AV%20detections%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWindows%20Defender%20Antivirus%20scans%20every%20file%20downloaded%20through%20the%20browser%20and%20reports%20both%20the%20details%20of%20the%20file%20that%20was%20detected%20and%20the%20URL%20it%20was%20downloaded%20from.%20In%20this%20query%2C%20we%20pivot%20from%20the%20download%20URLs%20of%20detected%20files%20to%20other%20downloads%20from%20the%20same%20hosts%2C%20specifically%20the%20downloads%20that%20were%20not%20detected.%20In%20this%20example%20we%20explicitly%20filter%20out%20threat%20categories%20that%20are%20less%20severe%2C%20such%20as%20software%20bundlers%20or%20Potentially%20Unwanted%20Applications%20(PUA)%2C%20so%20we%20could%20hunt%20for%20the%20more%20interesting%20stuff.%3C%2FP%3E%0A%3CPRE%3E%3CFONT%20color%3D%22%230000FF%22%3Elet%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23333399%22%3EdetectedDownloads%20%3C%2FFONT%3E%3D%0A%20%20%20%20%3CFONT%20color%3D%22%23800080%22%3EMiscEvents%3C%2FFONT%3E%0A%20%20%20%20%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Ewhere%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EActionType%20%3D%3D%20%3CFONT%20color%3D%22%23800000%22%3E%22AntivirusDetection%22%3C%2FFONT%3E%20and%20%3CFONT%20color%3D%22%23800000%22%3Eisnotempty%3C%2FFONT%3E(FileOriginUrl)%3C%2FFONT%3E%0A%20%20%20%20%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Eproject%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EEventTime%2C%20FileOriginUrl%2C%20FileName%2C%20MachineId%2C%3CBR%20%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20ThreatName%3D%3CFONT%20color%3D%22%23800000%22%3Etostring%3C%2FFONT%3E(%3CFONT%20color%3D%22%23800000%22%3Eparse_json%3C%2FFONT%3E(AdditionalFields).ThreatName)%3C%2FFONT%3E%0A%3CFONT%20color%3D%22%23008000%22%3E%20%20%20%20%2F%2F%20Filter%20out%20less%20severe%20threat%20categories%20on%20which%20we%20do%20not%20want%20to%20pivot%0A%3C%2FFONT%3E%20%20%20%20%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Ewhere%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EThreatName%3C%2FFONT%3E%20!%3CFONT%20color%3D%22%230000FF%22%3Estartswith%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23800000%22%3E%22PUA%22%3CBR%20%2F%3E%3C%2FFONT%3E%3CFONT%20color%3D%22%230000FF%22%3E%20%20%20%20%20%20%20%20%20%20%20%20and%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EThreatName%3C%2FFONT%3E%20!%3CFONT%20color%3D%22%230000FF%22%3Estartswith%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23800000%22%3E%22SoftwareBundler%3A%22%3C%2FFONT%3E%20%3CBR%20%2F%3E%3CFONT%20color%3D%22%230000FF%22%3E%20%20%20%20%20%20%20%20%20%20%20%20and%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EFileOriginUrl%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3E!%3D%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23800000%22%3E%22about%3Ainternet%22%3C%2FFONT%3E%3CFONT%20color%3D%22%23000000%22%3E%3B%3C%2FFONT%3E%0A%3CFONT%20color%3D%22%230000FF%22%3Elet%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23333399%22%3EdetectedDownloadsSummary%3C%2FFONT%3E%20%3D%0A%20%20%20%20%3CFONT%20color%3D%22%23000000%22%3EdetectedDownloads%3C%2FFONT%3E%0A%3CFONT%20color%3D%22%23008000%22%3E%20%20%20%20%2F%2F%20Get%20a%20few%20examples%20for%20each%20detected%20Host%3A%3CBR%20%2F%3E%20%20%20%20%2F%2F%20up%20to%204%20filenames%2C%20up%20to%204%20threat%20names%2C%20one%20full%20URL)%0A%3C%2FFONT%3E%20%20%20%20%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Esummarize%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EDetectedUrl%3D%3CFONT%20color%3D%22%23800000%22%3Eany%3C%2FFONT%3E(FileOriginUrl)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20DetectedFiles%3D%3CFONT%20color%3D%22%23800000%22%3Emakeset%3C%2FFONT%3E(FileName%2C%204)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ThreatNames%3D%3CFONT%20color%3D%22%23800000%22%3Emakeset%3C%2FFONT%3E(ThreatName%2C%204)%3CBR%20%2F%3E%3C%2FFONT%3E%3CFONT%20color%3D%22%230000FF%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20by%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EHost%3D%3CFONT%20color%3D%22%23800000%22%3Etostring%3C%2FFONT%3E(%3CFONT%20color%3D%22%23800000%22%3Eparse_url%3C%2FFONT%3E(FileOriginUrl).Host)%3B%3C%2FFONT%3E%0A%3CFONT%20color%3D%22%23008000%22%3E%2F%2F%20Query%20for%20downloads%20from%20sites%20from%20which%20other%20downloads%20were%20detected%20by%20Windows%20Defender%20Antivirus%0A%3C%2FFONT%3E%3CFONT%20color%3D%22%23800080%22%3EFileCreationEvents%3C%2FFONT%3E%0A%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Ewhere%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3E%3CFONT%20color%3D%22%23800000%22%3Eisnotempty%3C%2FFONT%3E(FileOriginUrl)%3C%2FFONT%3E%0A%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Eproject%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EFileName%2C%20FileOriginUrl%2C%20MachineId%2C%20EventTime%2C%3CBR%20%2F%3E%20%20%20%20%20%20%20%20%20%20Host%3D%3CFONT%20color%3D%22%23800000%22%3Etostring%3C%2FFONT%3E(%3CFONT%20color%3D%22%23800000%22%3Eparse_url%3C%2FFONT%3E(FileOriginUrl).Host)%3C%2FFONT%3E%0A%3CFONT%20color%3D%22%23008000%22%3E%2F%2F%20Filter%20downloads%20from%20hosts%20serving%20detected%20files%0A%3C%2FFONT%3E%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Ejoin%3C%2FFONT%3E%20%3CFONT%20color%3D%22%230000FF%22%3Ekind%3C%2FFONT%3E%3D%3CFONT%20color%3D%22%23000000%22%3Einner(detectedDownloadsSummary)%3C%2FFONT%3E%20%3CFONT%20color%3D%22%230000FF%22%3Eon%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EHost%3C%2FFONT%3E%0A%3CFONT%20color%3D%22%23008000%22%3E%2F%2F%20Filter%20out%20download%20file%20create%20events%20that%20were%20also%20detected.%0A%2F%2F%20This%20is%20needed%20because%20sometimes%20both%20of%20these%20events%20will%20be%20reported%2C%20%3CBR%20%2F%3E%2F%2F%20and%20sometimes%20only%20the%20AntivirusDetection%20event%20-%20depending%20on%20timing.%0A%3C%2FFONT%3E%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Ejoin%3C%2FFONT%3E%20%3CFONT%20color%3D%22%230000FF%22%3Ekind%3C%2FFONT%3E%3CFONT%20color%3D%22%23000000%22%3E%3Dleftanti(detectedDownloads)%3C%2FFONT%3E%20%3CFONT%20color%3D%22%230000FF%22%3Eon%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EMachineId%2C%20FileOriginUrl%3C%2FFONT%3E%0A%3CFONT%20color%3D%22%23008000%22%3E%2F%2F%20Summarize%20a%20single%20row%20per%20host%20-%20with%20the%20machines%20count%20%3CBR%20%2F%3E%2F%2F%20and%20an%20example%20event%20for%20a%20missed%20download%20(select%20the%20last%20event)%0A%3C%2FFONT%3E%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Esummarize%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EMachineCount%3D%3CFONT%20color%3D%22%23800000%22%3Edcount%3C%2FFONT%3E(MachineId)%2C%20%3CFONT%20color%3D%22%23800000%22%3Earg_max%3C%2FFONT%3E(EventTime%2C%20*)%3C%2FFONT%3E%20%3CFONT%20color%3D%22%230000FF%22%3Eby%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EHost%3C%2FFONT%3E%0A%3CFONT%20color%3D%22%23008000%22%3E%2F%2F%20Filter%20out%20common%20hosts%2C%20as%20they%20probably%20ones%20that%20also%20serve%20benign%20files%3CBR%20%2F%3E%3C%2FFONT%3E%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Ewhere%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EMachineCount%20%26lt%3B%2020%3C%2FFONT%3E%0A%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Eproject%3C%2FFONT%3E%3CFONT%20color%3D%22%23000000%22%3E%20Host%2C%20MachineCount%2C%20MachineId%2C%20FileName%2C%20DetectedFiles%2C%20%3CBR%20%2F%3E%20%20%20%20%20%20%20%20%20%20FileOriginUrl%2C%20DetectedUrl%2C%20ThreatNames%2C%20EventTime%2C%20SHA1%3C%2FFONT%3E%0A%7C%20%3CFONT%20color%3D%22%23FF6600%22%3Eorder%3C%2FFONT%3E%20%3CFONT%20color%3D%22%230000FF%22%3Eby%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000000%22%3EMachineCount%3C%2FFONT%3E%20%3CFONT%20color%3D%22%230000FF%22%3Edesc%3C%2FFONT%3E%26nbsp%3B%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F38494i0432A2BF26E0AC08%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22hunting%20tip%20downloads%20-%20pivot%20from%20detections.PNG%22%20title%3D%22hunting%20tip%20downloads%20-%20pivot%20from%20detections.PNG%22%20%2F%3E%3C%2FSPAN%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-85951548%22%20id%3D%22toc-hId-85951548%22%3EFamous%20last%20words%3C%2FH2%3E%0A%3CP%3EI%20apologize%20if%20this%20post%20was%20a%20bit%20long%2C%20but%20I%20hope%20you%20have%20found%20it%20interesting.%20You%20are%20more%20than%20welcome%20to%20visit%20the%20%3CSPAN%3E%3CA%20href%3D%22http%3A%2F%2Fgithub.com%2FMicrosoft%2FwindowsDefenderATP-Hunting-Queries%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGitHub%20repository%3C%2FA%3E%3C%2FSPAN%3E%20to%20find%20other%20interesting%20queries%20or%20contribute%20your%20own%20ideas.%20If%20all%20these%20seem%20new%20to%20you%2C%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fwindowsforbusiness%2Fwindows-atp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eexperience%20Windows%20Defender%20ATP%20for%20free%20now%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3EAlso%2C%20perhaps%20you%20would%20be%20interested%20in%20other%20posts%20on%20Advanced%20hunting.%20The%20next%20hunting%20tip%26nbsp%3Bdemoes%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FThreat-Intelligence%2FHunting-tip-of-the-month-Downloads-originating-from-email-links%2Ftd-p%2F239594%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Ehunting%20on%20top%20of%20downloads%20that%20originate%20from%20email%20links%3C%2FA%3E.%20You%20may%20also%20like%20this%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FWhat-s-New%2FGetting-Started-with-Windows-Defender-ATP-Advanced-Hunting%2Fm-p%2F215835%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Eentry-level%20tutorial%20for%20Advanced%20hunting%3C%2FA%3E%3C%2FSPAN%3E%20or%20an%20in-depth%20look%20into%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FThreat-Intelligence%2FHunting-tip-of-the-month-PowerShell-commands%2Fm-p%2F210898%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Ehunting%20on%20Powershell%20commands%3C%2FA%3E%3C%2FSPAN%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20really%20appreciate%20you%20reading%20this%20far.%20Honestly%2C%20mom%2C%20this%20means%20a%20lot%20to%20me.%20%3B)%3C%2Fimg%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

Downloads from browsers are often used to initiate cyberattacks. Targeted attacks may use watering holes or spear-phishing messages with links, while commodity threats often originate from malicious ad campaigns or are downloaded by software bundlers. With this being one of the most common entry points for malware, you might be excited to know that Windows Defender Advanced Threat Protection (Windows Defender ATP) tracks the origin of most files that are downloaded by Microsoft Edge or Google Chrome, and that you could use this information on Advanced hunting to search for abnormal activities or pivot to related machines.

 

Explaining the data: Where is it from and what does it mean?

 

In most cases, FileOriginUrl and FileOriginIP are the URLs and IPs from which the file was downloaded, while FileOriginReferrerUrl is the URL that referred or linked to the download URL. This referrer URL is often the URL of a site page or a webmail page with a download link. Alternatively, this referrer URL might just be the previous link in a long chain of redirects used to proliferate malware.

 

hunting tip downloads - raw results.png

 

 Our main source for this information is the Zone.Identifier alternate data stream, that is used by multiple applications to set the “mark of the web” of downloaded files. Starting from Windows 10 version 1703, the Windows Defender ATP sensor collects this data for all the reported files. In Advanced hunting, we recently exposed a few fields that we parse from the stream—our FileOriginUrl column is parsed from the HostUrl field, FileOriginIP is parsed from HostIpAddress, and FileOriginReferrerUrl is parsed from ReferrerUrl.

 

Multiple Windows applications currently set a file’s origin details in that stream. Microsoft has enabled Edge to set this information, so do Office programs, unzipping events, and more. Google has updated the Chrome browser accordingly, and so have multiple other products such as WinRar. When explorer.exe copies files with this information, it sets this information for the new copies as well. All application developers can set this data for files that they create—see this Firefox bug for more details.

 

It is, however, important to note that any program could set these fields in the Zone.Identifier alternate data stream, so the usage and actual meaning of values may vary. For example, during file extraction, many file compression apps use the path of the archive as the FileOriginReferrerUrl of the extracted files. As a result, this field will contain a local path instead of the expected web page URL.

 

In some cases, we could get the file origin information from other sources, but would still upload it to use the above columns. Specifically, in Windows Defender Antivirus events, the file origin details are received from the IOfficeAntiVirus API, which is used by browsers, Microsoft Office, file-sharing apps, and many other apps to request the enabled AV to scan downloaded files. In these events, FileOriginUrl is set with the URL from which the detected file was downloaded.

 

NOTE: All data that is available through Advanced hunting is from your tenant. You can find more information on data privacy here.

 

Example 1: Tracing footprints—find all files downloaded from a certain site

 

If you see a suspicious download, you may want to see which other files were downloaded from that URL or site. In this example, Windows Defender ATP raised an alert for malicious activity. As you can see in the process tree and its side-pane, a file was downloaded from a site called napptayiyal[.]com.

hunting tip downloads - process tree.PNG

 

 By going to the URL page for napptayiyal[.]com in Windows Defender ATP, you can see that this site was recently registered through a privacy protection service and is hosted on AWS.

hunting tip downloads - domain info.PNG

 

 The URL page will show you all downloads from that site. However, let’s run a similar simple query in Advanced hunting, where we can continue to tweak the query to filter noise or expand our search as shown in the next few examples.

hunting tip downloads - query 1.png

 To see what fields parse_url() can extract, read this documentation.
parse_url() returns a dynamic object, so in order to apply an endswith condition on it, we need to first convert it to a string using tostring().

 

Example 2: Hunt for payloads hosted as user content in Dropbox

 

Over the years, we have observed many malicious payloads being downloaded from popular online services like GitHub, Dropbox, Google Drive, OneDrive, Azure blob storage, and AWS storage. All these cloud vendors, including Microsoft, are committed to blocking and removing malicious payloads, but these services continue to be infection vectors. It is often easier for attackers to host files on public cloud infrastructure than to set up their own infrastructure. The good reputation and popularity of these services also make content they serve generally difficult for security providers and defenders to regulate.

 

In this example, we focus on downloads from Dropbox, such as the one described in this post by FireEye. Dropbox hosts user content under dl.dropboxusercontent.com. As you can see in this query, most downloads have the referrer page within www.dropbox.com. For malware, however, this is usually not the case—attackers want the download to be seamless, without users seeing that dropbox.com is even involved.

FileCreationEvents
| where FileOriginUrl startswith "https://dl.dropboxusercontent.com/"
| extend ReferrerHost=tostring(parse_url(FileOriginReferrerUrl).Host)
| summarize count(), any(FileName) by ReferrerHost 

hunting tip downloads - dropbox stats.PNG

After filtering out downloads that start from www.dropbox.com we are left with little noise. Feel free to access the full query, including this extra filter, on GitHub.

 

Example 3: Pivot from Windows Defender AV detections

 

Windows Defender Antivirus scans every file downloaded through the browser and reports both the details of the file that was detected and the URL it was downloaded from. In this query, we pivot from the download URLs of detected files to other downloads from the same hosts, specifically the downloads that were not detected. In this example we explicitly filter out threat categories that are less severe, such as software bundlers or Potentially Unwanted Applications (PUA), so we could hunt for the more interesting stuff.

let detectedDownloads =
    MiscEvents
    | where ActionType == "AntivirusDetection" and isnotempty(FileOriginUrl)
    | project EventTime, FileOriginUrl, FileName, MachineId,
ThreatName=tostring(parse_json(AdditionalFields).ThreatName)
// Filter out less severe threat categories on which we do not want to pivot | where ThreatName !startswith "PUA"
and ThreatName !startswith "SoftwareBundler:"
and FileOriginUrl != "about:internet"; let detectedDownloadsSummary = detectedDownloads // Get a few examples for each detected Host:
// up to 4 filenames, up to 4 threat names, one full URL)
| summarize DetectedUrl=any(FileOriginUrl), DetectedFiles=makeset(FileName, 4), ThreatNames=makeset(ThreatName, 4)
by Host=tostring(parse_url(FileOriginUrl).Host); // Query for downloads from sites from which other downloads were detected by Windows Defender Antivirus FileCreationEvents | where isnotempty(FileOriginUrl) | project FileName, FileOriginUrl, MachineId, EventTime,
Host=tostring(parse_url(FileOriginUrl).Host)
// Filter downloads from hosts serving detected files | join kind=inner(detectedDownloadsSummary) on Host // Filter out download file create events that were also detected. // This is needed because sometimes both of these events will be reported,
// and sometimes only the AntivirusDetection event - depending on timing.
| join kind=leftanti(detectedDownloads) on MachineId, FileOriginUrl // Summarize a single row per host - with the machines count
// and an example event for a missed download (select the last event)
| summarize MachineCount=dcount(MachineId), arg_max(EventTime, *) by Host // Filter out common hosts, as they probably ones that also serve benign files
| where MachineCount < 20 | project Host, MachineCount, MachineId, FileName, DetectedFiles,
FileOriginUrl, DetectedUrl, ThreatNames, EventTime, SHA1
| order by MachineCount desc 

hunting tip downloads - pivot from detections.PNG 

Famous last words

I apologize if this post was a bit long, but I hope you have found it interesting. You are more than welcome to visit the GitHub repository to find other interesting queries or contribute your own ideas. If all these seem new to you, experience Windows Defender ATP for free now.

Also, perhaps you would be interested in other posts on Advanced hunting. The next hunting tip demoes hunting on top of downloads that originate from email links. You may also like this entry-level tutorial for Advanced hunting or an in-depth look into hunting on Powershell commands.

 

I really appreciate you reading this far. Honestly, mom, this means a lot to me. ;)