AWS - CloudFront Post Exploitation

Tip

Učite i vežbajte AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Učite i vežbajte GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE) Učite i vežbajte Azure Hacking: HackTricks Training Azure Red Team Expert (AzRTE)

Podržite HackTricks

CloudFront

Za više informacija pogledajte:

AWS - CloudFront Enum

cloudfront:Delete*

Napadač kome je dodeljeno cloudfront:Delete* može izbrisati distribucije, politike i druge kritične CDN konfiguracione objekte — na primer distribucije, cache/origin policies, key groups, origin access identities, functions/configs i povezane resurse. To može dovesti do prekida usluge, gubitka sadržaja i uklanjanja konfiguracije ili forenzičkih artefakata.

Za brisanje distribucije napadač može koristiti:

aws cloudfront delete-distribution \
--id <DISTRIBUTION_ID> \
--if-match <ETAG>

Man-in-the-Middle

This blog post predlaže nekoliko različitih scenarija gde bi se Lambda mogla dodati (ili izmeniti ako se već koristi) u komunikaciju kroz CloudFront sa ciljem krađe korisničkih informacija (kao što je session cookie) i modifikovanja response (injektovanjem malicioznog JS skripta).

scenario 1: MitM where CloudFront is configured to access some HTML of a bucket

  • Kreirajte zlonamernu function.
  • Povežite je sa CloudFront distribution.
  • Postavite event type na “Viewer Response”.

Pristupanjem response-u možete ukrasti korisnički cookie i ubaciti maliciozni JS.

scenario 2: MitM where CloudFront is already using a lambda function

  • Modify the code of the Lambda function to steal sensitive information

You can check the tf code to recreate this scenarios here.

Tip

Učite i vežbajte AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Učite i vežbajte GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE) Učite i vežbajte Azure Hacking: HackTricks Training Azure Red Team Expert (AzRTE)

Podržite HackTricks