Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1058244%22%20slang%3D%22en-US%22%3ERe%3A%20Hunting%20for%20Capital%20One%20Breach%20TTPs%20in%20AWS%20logs%20using%20Azure%20Sentinel%20-%20Part%20I%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1058244%22%20slang%3D%22en-US%22%3E%3CP%3EUhm%2C%20on%20step%202%20you%20did%26nbsp%3Baws%20configure%20--profile%20cloudgoat%20but%20later%20on%20after%20%22%3CSPAN%3Everify%20that%20config%20and%20credential%20files%20are%20%26nbsp%3Bcorrectly%20populated%22%26nbsp%3B%3C%2FSPAN%3Ewe%20can%20see%20only%20%5Bdefault%5D%2C%20are%20you%20using%20the%20profile%20or%20the%20default%20settings%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1014258%22%20slang%3D%22en-US%22%3EHunting%20for%20Capital%20One%20Breach%20TTPs%20in%20AWS%20logs%20using%20Azure%20Sentinel%20-%20Part%20I%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1014258%22%20slang%3D%22en-US%22%3E%3CH2%20id%3D%22toc-hId--1444050741%22%20id%3D%22toc-hId--1444050741%22%20id%3D%22toc-hId--1444050741%22%3EIntroduction%3C%2FH2%3E%0A%3CP%3EIn%20July%202019%2C%20Capital%20one%20suffered%20one%20of%20the%20biggest%20data%20breaches%20affecting%20more%20than%20100%20million%20customer%20accounts%20and%20credit%20card%20applications.%20Based%20on%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.justice.gov%2Fusao-wdwa%2Fpress-release%2Ffile%2F1188626%2Fdownload%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ecriminal%20complaint%20charging%20the%20accused%20hacker%3C%2FA%3E%26nbsp%3Band%20several%20technical%20analysis%20blogs%20published%20post%20breach%2C%20it%20involved%20exploiting%20a%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.owasp.org%2Findex.php%2FServer_Side_Request_Forgery%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EServer%20Side%20Request%20Forgery%3C%2FA%3E%20(SSRF)%20flaw%20in%20a%20web%20application%20to%20obtain%20Amazon%20Web%20Services%20(AWS)%20access%20keys%20for%20a%20highly%20permissive%20(S3FullAccess)%20Identity%20and%20Access%20management%20(IAM)%20role%20to%20access%20sensitive%20files%20on%20S3%20storage%20buckets%20and%20later%20exfiltrated%20the%20sensitive%20data%20to%20an%20attacker%20controlled%20local%20storage.%20This%20is%20the%20first%20part%20of%20two%20part%20article%20in%20which%20we%20will%20perform%20the%20attack%20simulation%20of%20Capital%20one%20Breach%20scenario%20using%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FRhinoSecurityLabs%2Fcloudgoat%2Fblob%2Fmaster%2Fscenarios%2Fcloud_breach_s3%2FREADME.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECloud%20Goat%20scenario%20-%20%3CSTRONG%3E%3CEM%3Ecloud_breach_s3%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FA%3E%20which%20is%20developed%20by%20%3CA%20href%3D%22https%3A%2F%2Frhinosecuritylabs.com%2Fblog%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ERhino%20Security%20Labs%3C%2FA%3E.%20In%20the%20second%20part%2C%20we%20will%20analyze%20logs%20generated%20from%20simulation%20and%20see%20how%20we%20can%20hunt%20for%20some%20of%20the%20attacker%20techniques%20from%20AWS%20data%20sources%20on%20boarded%20to%20Azure%20Sentinel.%20We%20will%20also%20walk-through%20how%20to%20ingest%20relevant%20data%20sources%2C%20develop%20detection%20or%20hunting%20queries%20using%20Kusto%20Query%20Language(KQL)%20and%20also%20use%20Azure%20Sentinel%20incident%20workflow%20and%20investigation%20features.%20If%20you%20want%20to%20check%20related%20detections%20before%20we%20publish%20second%20part%2C%20you%20can%20refer%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fpull%2F374%2Ffiles%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sentinel%20Pull%20Request%3C%2FA%3E%20containing%20Logstash%20config%20file%2C%20AWSS3Logparser%20and%20hunting%20queries.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBased%20on%20the%20available%20information%20about%20attack%2C%20let%60s%20start%20extracting%20and%20mapping%20the%20Tactics%2C%20Techniques%20and%20Procedures%20(TTPs)%20used%20by%20an%20attacker%20to%20the%20MITRE%E2%80%99s%20Tactic%20and%20Techniques%20which%20recently%20expanded%20to%20include%20%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Fresources%2Fupdates%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECloud%20ATT%26amp%3BCK%20Techniques%3C%2FA%3E.%20In%20the%20below%20table%2C%20we%20have%20mapped%20the%20attacker%20techniques%20and%20data%20sources%20to%20these%20techniques.%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-inline%22%20style%3D%22width%3A%20706px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157620iF063929DADDE214C%2Fimage-dimensions%2F706x198%3Fv%3D1.0%22%20width%3D%22706%22%20height%3D%22198%22%20alt%3D%22clipboard_image_0.png%22%20title%3D%22clipboard_image_0.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22text-align%3A%20center%3B%22%3E%3CEM%3EFigure%201%20-%20Attack%20activity%20mapped%20to%20ATT%26amp%3BCK%20tactics%20and%20techniques%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1043462092%22%20id%3D%22toc-hId-1043462092%22%20id%3D%22toc-hId-1043462092%22%3ECapital%20One%20Breach%20attack%20simulation%20using%20Cloudgoat%3C%2FH2%3E%0A%3CP%3EFor%20attack%20simulation%20purpose%2C%20we%20will%20use%20the%20cloudgoat%20scenario-%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FRhinoSecurityLabs%2Fcloudgoat%2Fblob%2Fmaster%2Fscenarios%2Fcloud_breach_s3%2FREADME.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ecloud_breach_s3%3C%2FA%3E.%20According%20to%20the%20summary%20page%20of%20the%20scenario%2C%20attacker%20starts%20with%26nbsp%3Banonymous%20outsider%20with%20no%20access%20or%20privileges.%20He%20further%20exploit%20a%20misconfigured%20reverse-proxy%20server%20to%20query%20the%20EC2%20metadata%20service%20and%20acquire%20instance%20profile%20keys.%20Then%2C%20he%20uses%20those%20keys%20to%20discover%2C%20access%2C%20and%20exfiltrate%20sensitive%20data%20from%20an%20S3%20bucket.%3C%2FP%3E%0A%3CP%3EYou%20can%20follow%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FRhinoSecurityLabs%2Fcloudgoat%23quick-start%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Equick%20start%20guide%3C%2FA%3E%20on%20cloudgoat%20GitHub%20to%20set%20up%20your%20environment%20or%20directly%20use%20the%20docker%20image%20with%20pre-configured%20environment.%20We%20have%20chosen%20the%20docker%20image.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1734023566%22%20id%3D%22toc-hId-1734023566%22%20id%3D%22toc-hId-1734023566%22%3E%3CFONT%20size%3D%224%22%20color%3D%22%230000FF%22%3E%3CU%3EStep-1%3A%20Run%20docker%20image.%3C%2FU%3E%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3EAfter%20completing%20execution%20of%20below%20command%2C%20it%20will%20drop%20into%20a%20bash%20shell%20which%20has%20all%20environment%20and%20pre-requisites%20set.%20At%20the%20first%20execution%2C%20it%20will%20download%20docker%20image%20locally.%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%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24docker%20run%20-it%20rhinosecuritylabs%2Fcloudgoat%3Alatest%3C%2FCODE%3E%3C%2FPRE%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%3E%26nbsp%3B%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-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157623i455F8BEFD3C1D004%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22step-1.png%22%20title%3D%22step-1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3E%3CU%3E%3CFONT%20color%3D%22%230000FF%22%3EStep-2%20Create%20AWS%20config%20and%20credential%20to%20be%20used%20by%20Cloudgoat%3C%2FFONT%3E%3C%2FU%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EThese%20will%20be%20credentials%20used%20to%20create%20and%20deploy%20the%20scenario%20by%20cloudgoat.%3C%2FP%3E%0A%3CP%3EGo%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fconsole.aws.amazon.com%2Fiam%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EIAM%20Console%3C%2FA%3E%20and%20select%20%3CSTRONG%3EUsers%3C%2FSTRONG%3E%20and%20then%20%3CSTRONG%3EAdd%20user.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157624i2F09C6E8B10A6AC0%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Step-2-01.png%22%20title%3D%22Step-2-01.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEnter%20the%20%3CSTRONG%3EUsername%3C%2FSTRONG%3E%20and%20%3CSTRONG%3ESelect%20AWS%20access%20type%3C%2FSTRONG%3E%20as%20%E2%80%93%20%3CSTRONG%3EProgrammatic%20access%3C%2FSTRONG%3E%20%E2%80%93%20as%20this%20will%20be%20used%20via%20the%20AWS%20CLI.%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-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157625i29D955D99E62660F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22step-2-02.png%22%20title%3D%22step-2-02.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20the%20next%20page%2C%20select%20%3CSTRONG%3EAttach%20existing%20policies%3C%2FSTRONG%3E%20directly%20and%20select%20%3CSTRONG%3EAdministrator%20Access%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157626i2AC74D36DB32C6D8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22step-2-03.png%22%20title%3D%22step-2-03.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20the%20last%20page%2C%20you%20can%20either%20%3CSTRONG%3EDownload%20.%3C%2FSTRONG%3E%3CSTRONG%3Ecsv%3C%2FSTRONG%3E%20with%20credentials%20to%20copy-paste%20the%20credentials%20to%20the%20Docker%20image%20in%20home%20directory%20under%20.aws%20folder%2C%20or%20simply%20execute%20%3CEM%3Eaws%20configure%20-profile%20cloudgoat%3C%2FEM%3E%20as%20mentioned%20below%20to%20allow%20you%20to%20enter%20the%20credentials%20manually.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157627i2E28242642F0C234%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22step-2-04.png%22%20title%3D%22step-2-04.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EYou%20can%20issue%20the%20following%20command%20in%20the%20docker%20image%20and%20enter%20values%20retrieved%20from%20previous%20steps%3A%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%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Ebash-5.0%23%20aws%20configure%20--profile%20cloudgoat%3C%2FCODE%3E%3C%2FPRE%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%3E%26nbsp%3B%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-inline%22%20style%3D%22width%3A%20729px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157628iDCBF6237025CC790%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22step-2-05.png%22%20title%3D%22step-2-05.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIn%20the%20next%20step%2C%20configure%20the%20whitelist%20so%20the%20vulnerable%20instance%20is%20only%20accessible%20from%20the%20host%20you%20are%20going%20to%20deploy.%20You%20can%20also%20add%20the%20attacker%20host%20to%20whitelist%20from%20which%20you%20are%20planning%20to%20execute%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FRhinoSecurityLabs%2Fcloudgoat%2Fblob%2Fmaster%2Fscenarios%2Fcloud_breach_s3%2Fcheat_sheet.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Escenario%20cheat%20sheet%20commands.%3C%2FA%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%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Ebash-5.0%23%20.%2Fcloudgoat.py%20config%20whitelist%3C%2FCODE%3E%3C%2FPRE%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%3E%26nbsp%3B%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-inline%22%20style%3D%22width%3A%20934px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157629i5DD5DFAD30A3542C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22step-2-06.png%22%20title%3D%22step-2-06.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFinally%2C%20verify%20that%20config%20and%20credential%20files%20are%20%26nbsp%3Bcorrectly%20populated%20and%20are%20located%20in%20the%20home%20directory%20under%20.aws%20folder.%3C%2FP%3E%0A%3CP%3E%3CU%3Econfig%3A%3C%2FU%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20326px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F160923i244DF2F7F2743DDF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22aws-profile-config.PNG%22%20title%3D%22aws-profile-config.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CU%3Ecredentials%3A%3C%2FU%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20656px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F160924i8C525D37F81A8081%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22aws-profile-credential.PNG%22%20title%3D%22aws-profile-credential.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EVerify%20both%20files%20are%20present%20in%20your%20home%20directory%20under%20.aws%20folder%20as%20shown%20below.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20449px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157632i0E27080FD7361FA3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22step-2-09.png%22%20title%3D%22step-2-09.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3E%3CU%3E%3CFONT%20color%3D%22%230000FF%22%3EStep-3%20Create%20and%20deploy%20the%20scenario-cloud_breach_s3%3C%2FFONT%3E%3C%2FU%3E%3C%2FFONT%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%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Ebash-5.0%23.%2Fcloudgoat.py%20create%20cloud_breach_s3%20--profile%20cloudgoat%3C%2FCODE%3E%3C%2FPRE%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%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20command%20will%20create%201%20Virtual%20Private%20Cloud%20(VPC)%20with%202%20resources%20-%201%20EC2%20instance%20and%201%20S3%20bucket.%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-inline%22%20style%3D%22width%3A%20945px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157633iDB660AAC4E98617A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Step-3-01.png%22%20title%3D%22Step-3-01.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAt%20successful%20completion%2C%20the%20output%20should%20appear%20similar%20to%20below%3A%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-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157634iA8B1F738346BF85E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Step-3-02.png%22%20title%3D%22Step-3-02.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20are%20mimicking%20the%20attacker%20from%20IP%20-%2051.141.184.127%20and%20issuing%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FRhinoSecurityLabs%2Fcloudgoat%2Fblob%2Fmaster%2Fscenarios%2Fcloud_breach_s3%2Fcheat_sheet.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ecloud_breach_s3%20scenario%20cheat%20sheet%20commands%3C%2FA%3E%20against%20the%20vulnerable%20resources%20created%20by%20cloudgoat%20scenario.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20completed%2C%20our%20set-up%20looks%20like%20below%20diagram.%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-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157635i217740FD4BAEF610%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%3CH3%20id%3D%22toc-hId--73430897%22%20id%3D%22toc-hId--73430897%22%20id%3D%22toc-hId--73430897%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--1880885360%22%20id%3D%22toc-hId--1880885360%22%20id%3D%22toc-hId--1880885360%22%3E%3CFONT%20size%3D%224%22%3E%3CU%3E%3CFONT%20color%3D%22%230000FF%22%3EStep-4%20Run%20the%20commands%20from%20the%20scenario%20cheat%20sheets%20to%20simulate%20the%20attack.%3C%2FFONT%3E%3C%2FU%3E%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%20color%3D%22%23000000%22%3EThe%20Attacker%20uses%20curl%20to%20send%20a%20request%20to%20a%20web%20server%20and%20set%20the%20host%20header%20to%20IP%20address%20of%20EC2%20metadata%20service%20which%20is%20169.254.169.254.%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%20color%3D%22%23000000%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20971px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157636i81AC0E818E018766%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Step-4-01.png%22%20title%3D%22Step-4-01.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%20color%3D%22%23000000%22%3EOnce%20the%20command%20is%20successful%2C%20it%20will%20return%20the%20Access%20Key%20ID%2C%20Secret%20Access%20Key%20and%20Session%20Token%20of%20IAM%20instance%20profile%20attached%20to%20the%20EC2%20instance%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%20color%3D%22%23000000%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157637i12B626192FDA085F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Step-4-02.png%22%20title%3D%22Step-4-02.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20the%20IAM%20role%60s%20credential%20is%20retrieved%2C%20the%20Attacker%20can%20now%20set%20their%20CLI%20profile%20to%20assume%20the%20IAM%20role%2C%20which%20has%20S3%20Full%20access.%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%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24aws%20configure%20--profile%20erratic%3C%2FCODE%3E%3C%2FPRE%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%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20872px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157638i1111DF04EC08B34F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Step-4-03.png%22%20title%3D%22Step-4-03.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEdit%20the%20credential%20file%20and%20enter%20the%20aws_session_token%20which%20is%20the%20%3CEM%3E%3CTOKEN%3E%20%3C%2FTOKEN%3E%3C%2FEM%3Evalue%20retrieved%20from%20output%20of%20curl%20request.%20We%20executed%20it%20via%20the%20echo%20command%20which%20appended%20the%20details%20to%20existing%20credential%20file%20such%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-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157641i1E2D9A27BC4B10E5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Step-4-04.png%22%20title%3D%22Step-4-04.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20the%20IAM%20role%20credentials%20set%20as%20CLI%20profile%2C%20the%20Attacker%20can%20then%20list%20all%20the%20buckets%20and%20identify%20or%20even%20access%20private%20S3%20bucket.%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%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24aws%20s3%20ls%20--profile%20erratic%3C%2FCODE%3E%3C%2FPRE%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%3E%26nbsp%3B%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-inline%22%20style%3D%22width%3A%20747px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157642i1A84473FC7B0B1BC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Step-4-05.png%22%20title%3D%22Step-4-05.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20the%20private%20S3%20bucket%20id%20has%20been%20identified%2C%20the%20attacker%20can%20enumerate%20and%20download%20sensitive%20files%20to%20their%20local%20machine.%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%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24aws%20s3%20sync%20s3%3A%2F%2Fcg-cardholder-data-bucket-cgidbqva8iyktl%20.%20--profile%20erratic%3C%2FCODE%3E%3C%2FPRE%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%3E%26nbsp%3B%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-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157643iF41E594744A57914%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Step-4-06.png%22%20title%3D%22Step-4-06.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20concludes%20our%20attack%20simulation%20and%20first%20part%20of%20the%20series.%20We%20will%20publish%20second%20part%20on%2020th%20Nov%20which%20will%20cover%20the%20on-boarding%20relevant%20data%20sources%20to%20Azure%20Sentinel%2C%20log%20ingestion%20pipeline%20and%20threat%20hunting%20on%20the%20logs%20generated%20from%20the%20attack%20simulation.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1891388464%22%20id%3D%22toc-hId--1891388464%22%20id%3D%22toc-hId--1891388464%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId-596124369%22%20id%3D%22toc-hId-596124369%22%20id%3D%22toc-hId-596124369%22%3EReferences%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3EThe%20Capital%20One%20Breach%20%26amp%3B%20%E2%80%9Ccloud_breach_s3%E2%80%9D%20CloudGoat%20Scenario%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Frhinosecuritylabs.com%2Faws%2Fcapital-one-cloud_breach_s3-cloudgoat%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Frhinosecuritylabs.com%2Faws%2Fcapital-one-cloud_breach_s3-cloudgoat%2F%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ECloudgoat%3A%20%22Vulnerable%20by%20Design%22%20AWS%20deployment%20tool%20by%20Rhino%20Security%20Labs.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20style%3D%22font-family%3A%20inherit%3B%20background-color%3A%20%23ffffff%3B%22%20href%3D%22https%3A%2F%2Fgithub.com%2FRhinoSecurityLabs%2Fcloudgoat%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FRhinoSecurityLabs%2Fcloudgoat%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EATT%26amp%3BCK%20for%20Cloud%20-%20Updates-%20October%202019%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fattack.mitre.org%2Fresources%2Fupdates%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fattack.mitre.org%2Fresources%2Fupdates%2F%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAzure%20Sentinel%20Pull%20Request%20%3A%20Logstash%20Parser%2C%20Sentinel%20hunting%20queries%20for%20AWS%20Cloudtrail%20and%20S3BucketAPILogs%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fcommit%2F083781f95c18e56a990df6751b04e6746e5bbba5%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fcommit%2F083781f95c18e56a990df6751b04e6746e5bbba5%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1014258%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20is%20the%20first%20part%20of%20two%20part%20article%20in%20which%20we%20will%20explain%20the%20attack%20simulation%20of%20Capital%20one%20Breach%20scenario%20using%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FRhinoSecurityLabs%2Fcloudgoat%2Fblob%2Fmaster%2Fscenarios%2Fcloud_breach_s3%2FREADME.md%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ECloud%20Goat%20scenario%20-%20%3CSTRONG%3E%3CEM%3Ecloud_breach_s3%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FA%3E%20which%20is%20developed%20by%20Rhino%20Security%20Lab.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F157621i00D7F949C4C07FCC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22clipboard_image_1.png%22%20title%3D%22clipboard_image_1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1014258%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Sentinel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHunting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1058384%22%20slang%3D%22en-US%22%3ERe%3A%20Hunting%20for%20Capital%20One%20Breach%20TTPs%20in%20AWS%20logs%20using%20Azure%20Sentinel%20-%20Part%20I%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1058384%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F484241%22%20target%3D%22_blank%22%3E%40cteodor%3C%2FA%3E%26nbsp%3B.%20the%20screenshots%20should%20show%20cloudgoat%20profile%20as%20i%20am%20using%20it%2C%20i%20have%20edited%20article%20with%20the%20correct%20screenshots.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

Introduction

In July 2019, Capital one suffered one of the biggest data breaches affecting more than 100 million customer accounts and credit card applications. Based on the criminal complaint charging the accused hacker and several technical analysis blogs published post breach, it involved exploiting a Server Side Request Forgery (SSRF) flaw in a web application to obtain Amazon Web Services (AWS) access keys for a highly permissive (S3FullAccess) Identity and Access management (IAM) role to access sensitive files on S3 storage buckets and later exfiltrated the sensitive data to an attacker controlled local storage. This is the first part of two part article in which we will perform the attack simulation of Capital one Breach scenario using Cloud Goat scenario - cloud_breach_s3 which is developed by Rhino Security Labs. In the second part, we will analyze logs generated from simulation and see how we can hunt for some of the attacker techniques from AWS data sources on boarded to Azure Sentinel. We will also walk-through how to ingest relevant data sources, develop detection or hunting queries using Kusto Query Language(KQL) and also use Azure Sentinel incident workflow and investigation features. If you want to check related detections before we publish second part, you can refer Azure Sentinel Pull Request containing Logstash config file, AWSS3Logparser and hunting queries.

 

Based on the available information about attack, let`s start extracting and mapping the Tactics, Techniques and Procedures (TTPs) used by an attacker to the MITRE’s Tactic and Techniques which recently expanded to include Cloud ATT&CK Techniques. In the below table, we have mapped the attacker techniques and data sources to these techniques.

 

clipboard_image_0.png

Figure 1 - Attack activity mapped to ATT&CK tactics and techniques

 

Capital One Breach attack simulation using Cloudgoat

For attack simulation purpose, we will use the cloudgoat scenario- cloud_breach_s3. According to the summary page of the scenario, attacker starts with anonymous outsider with no access or privileges. He further exploit a misconfigured reverse-proxy server to query the EC2 metadata service and acquire instance profile keys. Then, he uses those keys to discover, access, and exfiltrate sensitive data from an S3 bucket.

You can follow the quick start guide on cloudgoat GitHub to set up your environment or directly use the docker image with pre-configured environment. We have chosen the docker image.

 

Step-1: Run docker image.

After completing execution of below command, it will drop into a bash shell which has all environment and pre-requisites set. At the first execution, it will download docker image locally.

 

 

 

 

 

$docker run -it rhinosecuritylabs/cloudgoat:latest

 

 

 

 

 

step-1.png

 

Step-2 Create AWS config and credential to be used by Cloudgoat

These will be credentials used to create and deploy the scenario by cloudgoat.

Go to the IAM Console and select Users and then Add user.

 

Step-2-01.png

 

Enter the Username and Select AWS access type as – Programmatic access – as this will be used via the AWS CLI.

 

step-2-02.png

 

On the next page, select Attach existing policies directly and select Administrator Access.

step-2-03.png

 

On the last page, you can either Download .csv with credentials to copy-paste the credentials to the Docker image in home directory under .aws folder, or simply execute aws configure -profile cloudgoat as mentioned below to allow you to enter the credentials manually.

step-2-04.png

You can issue the following command in the docker image and enter values retrieved from previous steps:

 

 

 

 

 

bash-5.0# aws configure --profile cloudgoat

 

 

 

 

 

step-2-05.png

In the next step, configure the whitelist so the vulnerable instance is only accessible from the host you are going to deploy. You can also add the attacker host to whitelist from which you are planning to execute scenario cheat sheet commands.

 

 

 

 

bash-5.0# ./cloudgoat.py config whitelist

 

 

 

 

 

step-2-06.png

 

Finally, verify that config and credential files are  correctly populated and are located in the home directory under .aws folder.

config:

aws-profile-config.PNG

credentials:

aws-profile-credential.PNG

Verify both files are present in your home directory under .aws folder as shown below.

step-2-09.png

 

Step-3 Create and deploy the scenario-cloud_breach_s3

 

 

 

 

 

bash-5.0#./cloudgoat.py create cloud_breach_s3 --profile cloudgoat

 

 

 

 

 

This command will create 1 Virtual Private Cloud (VPC) with 2 resources - 1 EC2 instance and 1 S3 bucket.

 

Step-3-01.png

 

At successful completion, the output should appear similar to below:

 

Step-3-02.png

 

We are mimicking the attacker from IP - 51.141.184.127 and issuing cloud_breach_s3 scenario cheat sheet commands against the vulnerable resources created by cloudgoat scenario. 

Once completed, our set-up looks like below diagram.

 

Scenario.png

 

Step-4 Run the commands from the scenario cheat sheets to simulate the attack.

The Attacker uses curl to send a request to a web server and set the host header to IP address of EC2 metadata service which is 169.254.169.254. 

 

Step-4-01.png

 

Once the command is successful, it will return the Access Key ID, Secret Access Key and Session Token of IAM instance profile attached to the EC2 instance

 

Step-4-02.png

 

Once the IAM role`s credential is retrieved, the Attacker can now set their CLI profile to assume the IAM role, which has S3 Full access.

 

 

 

 

$aws configure --profile erratic

 

 

 

 

Step-4-03.png

 

Edit the credential file and enter the aws_session_token which is the <Token> value retrieved from output of curl request. We executed it via the echo command which appended the details to existing credential file such as shown below.

 

Step-4-04.png

 

With the IAM role credentials set as CLI profile, the Attacker can then list all the buckets and identify or even access private S3 bucket.

 

 

 

 

$aws s3 ls --profile erratic

 

 

 

 

 

Step-4-05.png

 

Once the private S3 bucket id has been identified, the attacker can enumerate and download sensitive files to their local machine.

 

 

 

 

$aws s3 sync s3://cg-cardholder-data-bucket-cgidbqva8iyktl . --profile erratic

 

 

 

 

 

Step-4-06.png

 

This concludes our attack simulation and first part of the series. We will publish second part on 20th Nov which will cover the on-boarding relevant data sources to Azure Sentinel, log ingestion pipeline and threat hunting on the logs generated from the attack simulation.

 

References

  • The Capital One Breach & “cloud_breach_s3” CloudGoat Scenario

https://rhinosecuritylabs.com/aws/capital-one-cloud_breach_s3-cloudgoat/

  • Cloudgoat: "Vulnerable by Design" AWS deployment tool by Rhino Security Labs.

https://github.com/RhinoSecurityLabs/cloudgoat

  • ATT&CK for Cloud - Updates- October 2019

https://attack.mitre.org/resources/updates/

  • Azure Sentinel Pull Request : Logstash Parser, Sentinel hunting queries for AWS Cloudtrail and S3BucketAPILogs

https://github.com/Azure/Azure-Sentinel/commit/083781f95c18e56a990df6751b04e6746e5bbba5

2 Comments
Occasional Visitor

Uhm, on step 2 you did aws configure --profile cloudgoat but later on after "verify that config and credential files are  correctly populated" we can see only [default], are you using the profile or the default settings?

Microsoft

Thanks @cteodor . the screenshots should show cloudgoat profile as i am using it, i have edited article with the correct screenshots.