Skip to content

Commit

Permalink
add more azure metadata info
Browse files Browse the repository at this point in the history
  • Loading branch information
carlospolop committed Dec 3, 2024
1 parent ae49e7f commit 3559a62
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@


printf "${YELLOW}Learn and practice cloud hacking techniques in ${BLUE}training.hacktricks.xyz\n"$NC
echo ""

print_list "GCP Virtual Machine? ................. $is_gcp_vm\n"$NC | sed "s,Yes,${SED_RED}," | sed "s,No,${SED_GREEN},"
print_list "GCP Cloud Funtion? ................... $is_gcp_function\n"$NC | sed "s,Yes,${SED_RED}," | sed "s,No,${SED_GREEN},"
Expand Down
14 changes: 14 additions & 0 deletions linPEAS/builder/linpeas_parts/3_cloud/7_Azure_VM.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,35 @@ if [ "$is_az_vm" = "Yes" ]; then
if [ "$az_req" ]; then
print_3title "Instance details"
exec_with_jq eval $az_req "$URL/instance?api-version=$API_VERSION"
echo ""

print_3title "Load Balancer details"
exec_with_jq eval $az_req "$URL/loadbalancer?api-version=$API_VERSION"
echo ""

print_3title "User Data"
exec_with_jq eval $az_req "$URL/instance/compute/userData?api-version=$API_VERSION\&format=text" | base64 -d 2>/dev/null
echo ""

print_3title "Custom Data and other configs (root needed)"
(cat /var/lib/waagent/ovf-env.xml || cat /var/lib/waagent/CustomData/ovf-env.xml) 2>/dev/null | sed "s,CustomData.*,${SED_RED},"
echo ""

print_3title "Management token"
exec_with_jq eval $az_req "$URL/identity/oauth2/token?api-version=$API_VERSION\&resource=https://management.azure.com/"
echo ""

print_3title "Graph token"
exec_with_jq eval $az_req "$URL/identity/oauth2/token?api-version=$API_VERSION\&resource=https://graph.microsoft.com/"
echo ""

print_3title "Vault token"
exec_with_jq eval $az_req "$URL/identity/oauth2/token?api-version=$API_VERSION\&resource=https://vault.azure.net/"
echo ""

print_3title "Storage token"
exec_with_jq eval $az_req "$URL/identity/oauth2/token?api-version=$API_VERSION\&resource=https://storage.azure.com/"
echo ""
fi
echo ""
fi
3 changes: 1 addition & 2 deletions linPEAS/builder/linpeas_parts/functions/check_aliyun_ecs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
# Small linpeas: 1



check_aliyun_ecs() {
check_aliyun_ecs(){
is_aliyun_ecs="No"
if [ -f "/etc/cloud/cloud.cfg.d/aliyun_cloud.cfg" ]; then
is_aliyun_ecs="Yes"
Expand Down

0 comments on commit 3559a62

Please sign in to comment.