This commit is contained in:
mgeeky 2020-06-19 14:23:11 +02:00
parent d4053463cc
commit 8e93e142bd
1 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ SERIAL_MFA=
# Duration in seconds. Values possible range: 900-43200 # Duration in seconds. Values possible range: 900-43200
# 1 hour - 3600, 2 hours - 7200, 3 hours - 10800, 6 hours - 21600, 12 hours - 43200 # 1 hour - 3600, 2 hours - 7200, 3 hours - 10800, 6 hours - 21600, 12 hours - 43200
DURATION=42000 DURATION=3600
# #
# -------------------------- # --------------------------
@ -70,8 +70,8 @@ if [ $? -eq 0 ]; then
echo "[+] Collected session credentials. They will be valid for: $valid. " echo "[+] Collected session credentials. They will be valid for: $valid. "
echo -e "\tPaste below lines to your '~/.aws/credentials' file:" echo -e "\tPaste below lines to your '~/.aws/credentials' file:"
echo echo
echo "[$PROFILE_NAME]" echo "[$PROFILE_NAME-$ROLE_NAME]"
echo "$out" | python33 -c 'import sys,json; foo=json.loads(sys.stdin.read()); print("aws_access_key_id={}\naws_secret_access_key={}\naws_session_token={}".format(foo["Credentials"]["AccessKeyId"],foo["Credentials"]["SecretAccessKey"],foo["Credentials"]["SessionToken"]))' echo "$out" | python3 -c 'import sys,json; foo=json.loads(sys.stdin.read()); print("aws_access_key_id={}\naws_secret_access_key={}\naws_session_token={}".format(foo["Credentials"]["AccessKeyId"],foo["Credentials"]["SecretAccessKey"],foo["Credentials"]["SessionToken"]))'
echo echo
else else
echo "[!] Could not obtain assume-role session credentials:" echo "[!] Could not obtain assume-role session credentials:"