mirror of
https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite.git
synced 2025-12-29 19:29:00 +00:00
Big linpeas update
This commit is contained in:
27
linPEAS/builder/linpeas_parts/functions/check_gcp.sh
Normal file
27
linPEAS/builder/linpeas_parts/functions/check_gcp.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
# Title: Cloud - check_gcp
|
||||
# ID: check_gcp
|
||||
# Author: Carlos Polop
|
||||
# Last Update: 22-08-2023
|
||||
# Description: Check if the script is running in GCP
|
||||
# License: GNU GPL
|
||||
# Version: 1.0
|
||||
# Functions Used:
|
||||
# Global Variables:
|
||||
# Initial Functions:
|
||||
# Generated Global Variables: $is_gcp_vm, $is_gcp_function
|
||||
# Fat linpeas: 0
|
||||
# Small linpeas: 1
|
||||
|
||||
|
||||
check_gcp(){
|
||||
is_gcp_vm="No"
|
||||
is_gcp_function="No"
|
||||
if grep -q metadata.google.internal /etc/hosts 2>/dev/null || (curl --connect-timeout 2 metadata.google.internal >/dev/null 2>&1 && [ "$?" -eq "0" ]) || (wget --timeout 2 --tries 1 metadata.google.internal >/dev/null 2>&1 && [ "$?" -eq "0" ]); then
|
||||
is_gcp_vm="Yes"
|
||||
fi
|
||||
# CHeck if /workspace exists
|
||||
if [ -d "/workspace" ] && [ -d "/layers" ]; then
|
||||
is_gcp_vm="No"
|
||||
is_gcp_function="Yes"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user