Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1279037%22%20slang%3D%22en-US%22%3EEnabling%20security%20research%20%26amp%3B%20hunting%20with%20open%20source%20IoT%20attack%20data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1279037%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAt%20Microsoft%20the%20data%20from%20attacks%20that%20we%20see%20against%20our%20cloud%20services%20informs%20our%20security%20research%20and%20investments.%20Microsoft%20uses%20this%20data%2C%20and%20other%20sources%2C%20to%20track%20emerging%20threats%20as%20well%20as%20to%20improve%20the%20detection%20coverage%20of%20our%20security%20offerings.%20The%20results%20of%20this%20benefits%20customers%20through%20products%20such%20as%20Azure%20Security%20Center%20and%20Azure%20Sentinel.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20order%20to%20support%20security%20research%20Microsoft%20has%20open%20source%20tools%20like%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%3EmsticPy%3C%2FA%3E%2C%20a%20set%20of%20utilities%20for%20threat%20hunting%20and%20investigation%20as%20well%20as%20a%20%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%3Elarge%20set%20of%20queries%26nbsp%3B%3C%2FA%3Eand%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel-Notebooks%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EJuypter%20notebooks%3C%2FA%3E%20for%20Azure%20Sentinel.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20researching%20and%20developing%20detection%20techniques%2C%20sourcing%20attack%20data%3A%20to%20train%20machine%20learning%20models%20and%20for%20use%20as%20test%20data%2C%20can%20be%20a%20challenge.%20To%20help%20drive%20pro-defence%20research%20and%20innovation%20in%20this%20area%2C%20Microsoft%20is%20releasing%20data%20from%20attacks%20against%20our%20IoT%20honeypot%20sensor%20network%20from%20a%20four-month%20period%20in%202019.%20We%20are%20releasing%20this%20under%20the%20in%20the%20hope%20that%20this%20enabled%20further%20academic%20research%20in%20this%20area.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1381103501%22%20id%3D%22toc-hId--1381103501%22%3EThe%20data%3C%2FH2%3E%0A%3CP%3EThis%20dataset%20comprises%20of%20over%20125%20thousand%20different%20Unix%2FLinux%20command%20sequences.%20We%20have%20seen%20these%20over%20150%20million%20times%20across%20Microsoft%E2%80%99s%20vast%20attack%20collection%20network.%20These%20attacks%20range%20widely%20in%20complexity.%20In%20some%20cases%2C%20we%E2%80%99ve%20caught%20malware%20under%20development%2C%20other%20times%20robust%20attacks.%20This%20dataset%20details%20all%20the%20commands%20executed%2C%20ranging%20from%20just%20a%20single%20command%20to%20over%20700.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20data%20we%20are%20releasing%20is%20JSON%20formatted%2C%20like%20the%20sample%20below%3C%2FP%3E%0A%3CTABLE%20style%3D%22margin-left%3A%20auto%3B%20margin-right%3A%20auto%3B%20border-style%3A%20hidden%3B%22%20border%3D%221%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22100%25%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22robeving_0-1585922155601.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F181890i2726D1CDB0C60683%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22robeving_0-1585922155601.png%22%20alt%3D%22robeving_0-1585922155601.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3EAside%20from%20the%20commands%20issued%20by%20the%20malware%20itself%2C%20each%20sample%20has%3A%20a%20SHA256%20ID%2C%20the%20number%20of%20times%20the%20sample%20was%20seen%20on%20our%20sensor%20network%20as%20well%20as%20the%20first%20and%20last%20seen%20times.%20Due%20to%20the%20potentially%20malicious%20URLs%20in%20the%20data%20we%20are%20releasing%20the%20ZIP%20file%20with%20the%20password%20of%20%E2%80%98infected%E2%80%99.%20Please%20handle%20with%20care.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20load%20this%20data%20into%20any%20database%20that%20can%20accept%20JSON%20blobs.%20In%20the%20rest%20of%20this%20post%20I%E2%80%99ll%20show%20how%20you%20can%20import%20this%20data%20into%20Azure%20Sentinel%20for%20faster%20analysis.%20If%20you%20are%20not%20an%20Azure%20customer%20the%20data%20is%20still%20available%20to%20you%20from%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethe%20Azure%20Sentinel%20Github%20repository%3C%2FA%3E%20within%20the%20%E2%80%98Sample%20Data%E2%80%99%20directory.%20There%20are%20also%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sentinel%2Fazure-sentinel-to-go-sentinel-lab-w-prerecorded-data-amp-a%2Fba-p%2F1260191%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Eseveral%20programs%20for%20developers%20and%20students%3C%2FA%3E%20that%20allow%20you%20to%20you%20to%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Feducation%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Eexperiment%20with%20Azure%20for%20free%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1106409332%22%20id%3D%22toc-hId-1106409332%22%3EGetting%20the%20data%20into%20Sentinel%3C%2FH2%3E%0A%3CP%3ETo%20import%20this%20data%20(or%20any%20JSON%20data%20for%20that%20matter)%20into%20Azure%20Sentinel%20there%20is%20a%20tool%20under%20%3CEM%3E%E2%80%98DataConnectors%2FJSON-Import%2Fdotnet_loganalytics_json_import%E2%80%99%3C%2FEM%3E.%20The%20README.md%20in%20this%20directory%20has%20simple%20build%20instructions%20to%20follow.%20Once%20built%2C%20run%20the%20executable%20with%20your%20Azure%20Sentinel%20workspace%20ID%2C%20key%2C%20and%20name%20for%20the%20table.%20The%20data%20file%20will%20be%20uploaded.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--701045131%22%20id%3D%22toc-hId--701045131%22%3EExploring%20the%20data%3C%2FH2%3E%0A%3CP%3EOnce%20the%20data%20is%20in%20Azure%20Sentinel%20you%20can%20write%20queries%20in%20a%20language%20called%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fkusto%2Fquery%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EKusto%3C%2FA%3E.%20Kusto%20suits%20security%20related%20data%20well%20and%20is%20used%20extensively%20in%20Azure%20Sentinel%20to%20query%20data%20and%20build%20analytics.%20You%20can%20correlate%20this%20source%20of%20known%20bad%20data%20with%20your%20own%20logs%20to%20discover%20potential%20security%20issues%20in%20your%20environment.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EThe%20query%20below%20extracts%20IP%20addresses%20and%20DNS%20names%20from%20the%20malicious%20commands%20that%20we%E2%80%99ve%20collected.%20It%20does%20this%20by%20processing%20each%20command%20for%20what%20looks%20like%20the%20start%20and%20end%20of%20a%20URL%20or%20IP%20address.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3EMSTICIoTBotnet_CL%0A%7C%20extend%20Cmds%3Dparse_json(Commands_s)%0A%7C%20mvexpand%20Cmds%0A%7C%20extend%20CommandStr%3Dtostring(Cmds)%0A%7C%20where%20CommandStr%20contains%20%22%3A%2F%2F%22%20or%20CommandStr%20contains%20%22wget%20%22%20or%20CommandStr%20contains%20%22curl%20%22%0A%7C%20extend%20StartOfHttp%20%3D%20indexof_regex(CommandStr%2C%20%22http%3A%2F%2F%22)%0A%7C%20extend%20StartOfCmd%20%3D%20indexof_regex(CommandStr%2C%20%22(wget%7Ccurl)%5C%5Cs.%2B%22)%0A%7C%20where%20StartOfHttp%20!%3D%20-1%20and%20StartOfCmd%20!%3D%20-1%0A%7C%20extend%20RealStartOfUrl%20%3D%20iff(StartOfHttp%20%3D%3D%20-1%2C%20StartOfCmd%2B%204%2C%20StartOfHttp%20%2B%207)%0A%7C%20extend%20EndOfIP%20%3D%20indexof_regex(CommandStr%2C%20%22%5B%5C%5Cs%5D%7C%5B%3B%5D%7C%3A%5B0-9%5D%2B%7C%2F%22%2C%20RealStartOfUrl)%0A%7C%20extend%20Indicator%3Dsubstring(CommandStr%2C%20RealStartOfUrl%2C%20EndOfIP%20-%20RealStartOfUrl%20)%0A%7C%20summarize%20Frequency%3Dcount()%20by%20Indicator%0A%7C%20order%20by%20Frequency%20desc%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20join%20this%20table%20of%20data%20on%20other%20sources%20such%20as%3A%20firewall%2C%20DNS%20logs%20or%20even%20Linux%20audit%20logs%20to%20create%20analytics%20in%20Azure%20Sentinel%20based%20on%20such%20queries.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1786467702%22%20id%3D%22toc-hId-1786467702%22%3EBuilding%20detections%3C%2FH2%3E%0A%3CP%3ETo%20enable%20alert%20generation%20for%20when%20any%20honeypot%20command%20lines%20are%20seen%20on%20a%20host%2C%20you%E2%80%99ll%20need%20to%20pull%20the%20Linux%20Audit%20events%20into%20Syslog%20which%20the%20OMS%20agent%20will%20consume%20and%20make%20available%20in%20the%20Syslog%20table%20in%20Azure%20Sentinel.%3CBR%20%2F%3EAn%20easy%20way%2C%20but%20not%20production%20ready%2C%20is%20it%20to%20use%20some%20bash-fu.%20Running%20the%20following%20commands%20in%20the%20background%20on%20your%20Linux%20host%20will%20take%20the%20auditd%20entries%2C%20decode%20them%20and%20then%20add%20them%20to%20Syslog.%20You%E2%80%99ll%20need%20both%20entries%20to%20handle%20the%20two%20different%20formats%20auditd%20produces.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-ruby%22%3E%3CCODE%3Etail%20-F%20%2Fvar%2Flog%2Faudit%2Faudit.log%20%7C%20grep%20%22%5Bp%5Droctitle%3D%5C%22.*%5C%22%24%22%20%7C%20awk%20'%7B%20FS%3D%22%5C%22%22%3B%20print%20%242%20%7D'%20%7C%20grep%20-v%20msg%20%7C%20awk%20'%7Bprint%20%22CMDLINE%3D%22%240%7D'%20%7C%20logger%20-t%20audit%20-p%20syslog.info%3C%2FCODE%3E%3C%2FPRE%3E%3CPRE%20class%3D%22lia-code-sample%20language-ruby%22%3E%3CCODE%3Etail%20-F%20%2Fvar%2Flog%2Faudit%2Faudit.log%20%7C%20grep%20%22%5Bp%5Droctitle%3D%5BA-Z0-9%5D*%24%22%20%7C%20awk%20'%7B%20FS%3D%22proctitle%3D%22%3B%20print%20%242%20%220A%22%7D'%20%7C%20xxd%20-r%20-p%20%7C%20tr%20-c%20'%5B%3Aprint%3A%5D%5Ct%5Cr%5Cn'%20'%5B%20*%5D'%20%7C%20awk%20'%7Bprint%20%22CMDLINE%3D%22%240%7D'%20%7C%20logger%20-t%20audit%20-p%20syslog.info%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20these%20commands%20are%20running%2C%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsentinel%2Fconnect-syslog%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Eturn%20on%20Syslog%20integration%20in%20the%20Advanced%20Settings%20of%20your%20Sentinel%20workspace%3C%2FA%3E.%3C%2FP%3E%0A%3CTABLE%20style%3D%22margin-left%3A%20auto%3B%20margin-right%3A%20auto%3B%20border-style%3A%20hidden%3B%22%20border%3D%221%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22100%25%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22robeving_2-1585922155611.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F181889i0023E73A20BC86D3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22robeving_2-1585922155611.png%22%20alt%3D%22robeving_2-1585922155611.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20you%E2%80%99ll%20be%20able%20to%20query%20Linux%20command%20lines%20in%20Azure%20Sentinel.%3C%2FP%3E%0A%3CP%3EThe%20following%20Kusto%20query%20takes%20all%20the%20command%20lines%20we%20extracted%20earlier%20and%20compares%20them%20to%20the%20audit%20records%20added%20to%20Syslog.%3C%2FP%3E%0A%3CTABLE%20class%3D%22lia-align-left%22%20style%3D%22width%3A%20100%25%3B%20border-style%3A%20hidden%3B%22%20border%3D%221%22%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2239.64088397790055%25%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3Elet%20BadCommands%3DMSTICIoTBotnet_CL%0A%7C%20where%20TimeGenerated%20%20%26gt%3B%3D%20ago(30d)%0A%7C%20extend%20Cmds%3Dparse_json(Commands_s)%0A%7C%20mvexpand%20Cmds%0A%7C%20extend%20CommandStr%3Dtostring(Cmds)%0A%7C%20where%20CommandStr%20!%3D%20%22%22%0A%7C%20summarize%20by%20CommandStr%3B%0ASyslog%0A%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(7d)%0A%7C%20where%20SyslogMessage%20startswith%20%22CMDLINE%3D%22%0A%7C%20extend%20CmdLine%3Dsubstring(SyslogMessage%2C%208)%0A%7C%20summarize%20by%20CmdLine%2C%20HostName%0A%7C%20where%20CmdLine%20in%20(BadCommands)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FTD%3E%0A%3CTD%20width%3D%2260.35911602209945%25%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-right%22%20image-alt%3D%22robeving_3-1585922155618.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F181892iDF189D1B4C33DB02%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22robeving_3-1585922155618.png%22%20alt%3D%22robeving_3-1585922155618.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3EConfiguring%20such%20a%20query%20as%20an%20Azure%20Sentinel%20analytic%20will%20result%20in%20an%20incident%20being%20raised%20if%20a%20match%20occurs%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CTABLE%20class%3D%22lia-align-center%22%20style%3D%22border-style%3A%20hidden%3B%20margin-left%3A%20auto%3B%20margin-right%3A%20auto%3B%22%20border%3D%221%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22100%25%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22robeving_4-1585922155621.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F181891i5FC76A09730BCE8F%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22robeving_4-1585922155621.png%22%20alt%3D%22robeving_4-1585922155621.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20another%20example%20of%20the%20kind%20of%20query%20you%20can%20do%2C%20the%20next%20query%20will%20look%20across%20all%20the%20data%20and%20calculate%20the%20longest%20and%20shortest%20attacks.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3EMSTICIoTBotnet_CL%0A%7C%20where%20TimesSeen_d%20%26gt%3B%205%20%2F%2F%20only%20track%20bots%0A%7C%20extend%20totalTime%3DLastSeen_t%20-%20FirstSeen_t%0A%7C%20extend%20seconds%3Dformat_timespan(totalTime%2C%20's')%0A%7C%20extend%20minutes%3Dformat_timespan(totalTime%2C%20'm')%0A%7C%20extend%20hours%3Dformat_timespan(totalTime%2C%20'h')%0A%7C%20extend%20days%3Dformat_timespan(totalTime%2C%20'ddd')%0A%7C%20extend%20totalSeconds%3Dtoint(seconds)%20%2B%20(toint(minutes)%20%20*%2060)%20%2B%20(toint(hours)%20*%2060%20*%2060)%20%2B%20(toint(days)%20*%2024%20*%2060%20*%2060)%0A%7C%20summarize%20LongestCampaign_days%3Dmax(totalSeconds)%2F60%2F60%2F24%2C%20AverageCampaign_days%3Davg(totalSeconds)%2F60%2F60%2F24%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMicrosoft%E2%80%99s%20Threat%20Intelligence%20Center%20proactively%20uses%20data%20sources%20and%20techniques%20such%20as%20those%20described%20here%20to%20discover%20emerging%20threats%2C%20as%20well%20as%20to%20ensure%20that%20our%20detection%20coverage%20is%20relevant%20to%20the%20attacks%20facing%20both%20Microsoft%20and%20its%20customers.%20You%20can%20use%20data%20sources%20like%20the%20one%20described%20here%2C%20your%20cloud-based%20assets%20and%20Azure%20Sentinel%20to%20hunt%20for%20and%20investigate%20your%20own%20threats.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1279037%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EIn%20this%20blog%20post%2C%20we%20will%20share%20real%20attacks%20from%20Microsoft's%20Honeypot%20network%20and%20show%20how%20you%20can%20use%20this%20in%20Azure%20Sentinel.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1279037%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Sentinel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDetection%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHunting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EInvestigation%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

 

At Microsoft the data from attacks that we see against our cloud services informs our security research and investments. Microsoft uses this data, and other sources, to track emerging threats as well as to improve the detection coverage of our security offerings. The results of this benefits customers through products such as Azure Security Center and Azure Sentinel.

 

In order to support security research Microsoft has open source tools like msticPy, a set of utilities for threat hunting and investigation as well as a large set of queries and Juypter notebooks for Azure Sentinel.

 

When researching and developing detection techniques, sourcing attack data: to train machine learning models and for use as test data, can be a challenge. To help drive pro-defence research and innovation in this area, Microsoft is releasing data from attacks against our IoT honeypot sensor network from a four-month period in 2019. We are releasing this under the in the hope that this enabled further academic research in this area.

 

The data

This dataset comprises of over 125 thousand different Unix/Linux command sequences. We have seen these over 150 million times across Microsoft’s vast attack collection network. These attacks range widely in complexity. In some cases, we’ve caught malware under development, other times robust attacks. This dataset details all the commands executed, ranging from just a single command to over 700.

 

The data we are releasing is JSON formatted, like the sample below

robeving_0-1585922155601.png

Aside from the commands issued by the malware itself, each sample has: a SHA256 ID, the number of times the sample was seen on our sensor network as well as the first and last seen times. Due to the potentially malicious URLs in the data we are releasing the ZIP file with the password of ‘infected’. Please handle with care.

 

You can load this data into any database that can accept JSON blobs. In the rest of this post I’ll show how you can import this data into Azure Sentinel for faster analysis. If you are not an Azure customer the data is still available to you from the Azure Sentinel Github repository within the ‘Sample Data’ directory. There are also several programs for developers and students that allow you to you to experiment with Azure for free.

 

Getting the data into Sentinel

To import this data (or any JSON data for that matter) into Azure Sentinel there is a tool under ‘DataConnectors/JSON-Import/dotnet_loganalytics_json_import’. The README.md in this directory has simple build instructions to follow. Once built, run the executable with your Azure Sentinel workspace ID, key, and name for the table. The data file will be uploaded.

 

Exploring the data

Once the data is in Azure Sentinel you can write queries in a language called Kusto. Kusto suits security related data well and is used extensively in Azure Sentinel to query data and build analytics. You can correlate this source of known bad data with your own logs to discover potential security issues in your environment.


The query below extracts IP addresses and DNS names from the malicious commands that we’ve collected. It does this by processing each command for what looks like the start and end of a URL or IP address.

 

 

MSTICIoTBotnet_CL
| extend Cmds=parse_json(Commands_s)
| mvexpand Cmds
| extend CommandStr=tostring(Cmds)
| where CommandStr contains "://" or CommandStr contains "wget " or CommandStr contains "curl "
| extend StartOfHttp = indexof_regex(CommandStr, "http://")
| extend StartOfCmd = indexof_regex(CommandStr, "(wget|curl)\\s.+")
| where StartOfHttp != -1 and StartOfCmd != -1
| extend RealStartOfUrl = iff(StartOfHttp == -1, StartOfCmd+ 4, StartOfHttp + 7)
| extend EndOfIP = indexof_regex(CommandStr, "[\\s]|[;]|:[0-9]+|/", RealStartOfUrl)
| extend Indicator=substring(CommandStr, RealStartOfUrl, EndOfIP - RealStartOfUrl )
| summarize Frequency=count() by Indicator
| order by Frequency desc

 

 

You can join this table of data on other sources such as: firewall, DNS logs or even Linux audit logs to create analytics in Azure Sentinel based on such queries.

 

Building detections

To enable alert generation for when any honeypot command lines are seen on a host, you’ll need to pull the Linux Audit events into Syslog which the OMS agent will consume and make available in the Syslog table in Azure Sentinel.
An easy way, but not production ready, is it to use some bash-fu. Running the following commands in the background on your Linux host will take the auditd entries, decode them and then add them to Syslog. You’ll need both entries to handle the two different formats auditd produces.

 

 

tail -F /var/log/audit/audit.log | grep "[p]roctitle=\".*\"$" | awk '{ FS="\""; print $2 }' | grep -v msg | awk '{print "CMDLINE="$0}' | logger -t audit -p syslog.info
tail -F /var/log/audit/audit.log | grep "[p]roctitle=[A-Z0-9]*$" | awk '{ FS="proctitle="; print $2 "0A"}' | xxd -r -p | tr -c '[:print:]\t\r\n' '[ *]' | awk '{print "CMDLINE="$0}' | logger -t audit -p syslog.info

 

 

Once these commands are running, turn on Syslog integration in the Advanced Settings of your Sentinel workspace.

robeving_2-1585922155611.png

 

Now you’ll be able to query Linux command lines in Azure Sentinel.

The following Kusto query takes all the command lines we extracted earlier and compares them to the audit records added to Syslog.

let BadCommands=MSTICIoTBotnet_CL
| where TimeGenerated  >= ago(30d)
| extend Cmds=parse_json(Commands_s)
| mvexpand Cmds
| extend CommandStr=tostring(Cmds)
| where CommandStr != ""
| summarize by CommandStr;
Syslog
| where TimeGenerated >= ago(7d)
| where SyslogMessage startswith "CMDLINE="
| extend CmdLine=substring(SyslogMessage, 8)
| summarize by CmdLine, HostName
| where CmdLine in (BadCommands)
robeving_3-1585922155618.png

Configuring such a query as an Azure Sentinel analytic will result in an incident being raised if a match occurs:

robeving_4-1585922155621.png

 

As another example of the kind of query you can do, the next query will look across all the data and calculate the longest and shortest attacks.

 

 

MSTICIoTBotnet_CL
| where TimesSeen_d > 5 // only track bots
| extend totalTime=LastSeen_t - FirstSeen_t
| extend seconds=format_timespan(totalTime, 's')
| extend minutes=format_timespan(totalTime, 'm')
| extend hours=format_timespan(totalTime, 'h')
| extend days=format_timespan(totalTime, 'ddd')
| extend totalSeconds=toint(seconds) + (toint(minutes)  * 60) + (toint(hours) * 60 * 60) + (toint(days) * 24 * 60 * 60)
| summarize LongestCampaign_days=max(totalSeconds)/60/60/24, AverageCampaign_days=avg(totalSeconds)/60/60/24

 

 

Microsoft’s Threat Intelligence Center proactively uses data sources and techniques such as those described here to discover emerging threats, as well as to ensure that our detection coverage is relevant to the attacks facing both Microsoft and its customers. You can use data sources like the one described here, your cloud-based assets and Azure Sentinel to hunt for and investigate your own threats.