From efa0e98547a7aaeefe92a6b00329314c78b12dc4 Mon Sep 17 00:00:00 2001 From: shadowabi <50265741+shadowabi@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:23:11 +0800 Subject: [PATCH 1/2] Update 3_cloud.sh for check_cvm Added connection timeout Settings and fixed wget syntax errors for check_cvm --- linPEAS/builder/linpeas_parts/3_cloud.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linPEAS/builder/linpeas_parts/3_cloud.sh b/linPEAS/builder/linpeas_parts/3_cloud.sh index e6ede29..6a69577 100644 --- a/linPEAS/builder/linpeas_parts/3_cloud.sh +++ b/linPEAS/builder/linpeas_parts/3_cloud.sh @@ -168,9 +168,9 @@ echo "" if [ "$is_tencent_cvm" = "Yes" ]; then tencent_req="" if [ "$(command -v curl)" ]; then - tencent_req='curl -sfkG' + tencent_req='curl --connect-timeout 2 -sfkG' elif [ "$(command -v wget)" ]; then - tencent_req='wget -q -O ' + tencent_req='wget -q --timeout 2 --tries 1 -O -' else echo "Neither curl nor wget were found, I can't enumerate the metadata service :(" fi From 8afc3528783edbdccb7401f250a56921387f1656 Mon Sep 17 00:00:00 2001 From: shadowabi <50265741+shadowabi@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:31:28 +0800 Subject: [PATCH 2/2] Update 3_cloud.sh add detect user data --- linPEAS/builder/linpeas_parts/3_cloud.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linPEAS/builder/linpeas_parts/3_cloud.sh b/linPEAS/builder/linpeas_parts/3_cloud.sh index 6a69577..ea1ccb5 100644 --- a/linPEAS/builder/linpeas_parts/3_cloud.sh +++ b/linPEAS/builder/linpeas_parts/3_cloud.sh @@ -237,6 +237,10 @@ if [ "$is_tencent_cvm" = "Yes" ]; then echo " Key: "$(eval $tencent_req "http://169.254.0.23/latest/meta-data/public-keys/${key}openssh-key") echo " ==============" done + + echo "" + print_3title "User Data" + eval $tencent_req http://169.254.0.23/latest/user-data; echo "" fi if [ "$is_aliyun_ecs" = "Yes" ]; then