Javi

AWS cli: create users from file in identity center and add to students group

Nov 20th, 2025
105
0
Never
12
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.42 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Script to create AWS Identity Center users from a file and add them to the "students" group
  4. # Usage: ./create_users.sh <emails_file>
  5.  
  6. set -e
  7.  
  8. # Check if filename is provided
  9. if [ $# -eq 0 ]; then
  10. echo "Usage: $0 <emails_file>"
  11. echo "Example: $0 emails.txt"
  12. exit 1
  13. fi
  14.  
  15. EMAILS_FILE="$1"
  16.  
  17. # Check if file exists
  18. if [ ! -f "$EMAILS_FILE" ]; then
  19. echo "Error: File '$EMAILS_FILE' not found!"
  20. exit 1
  21. fi
  22.  
  23. # Get the Identity Store ID
  24. echo "Fetching Identity Store ID..."
  25. IDENTITY_STORE_ID=$(aws sso-admin list-instances --query 'Instances[0].IdentityStoreId' --output text)
  26.  
  27. if [ -z "$IDENTITY_STORE_ID" ]; then
  28. echo "Error: Could not retrieve Identity Store ID"
  29. exit 1
  30. fi
  31.  
  32. echo "Identity Store ID: $IDENTITY_STORE_ID"
  33.  
  34. # Find the "students" group ID
  35. echo "Finding 'students' group..."
  36. GROUP_ID=$(aws identitystore list-groups \
  37. --identity-store-id "$IDENTITY_STORE_ID" \
  38. --filters AttributePath=DisplayName,AttributeValue=students \
  39. --query 'Groups[0].GroupId' \
  40. --output text)
  41.  
  42. if [ -z "$GROUP_ID" ] || [ "$GROUP_ID" == "None" ]; then
  43. echo "Error: 'students' group not found!"
  44. exit 1
  45. fi
  46.  
  47. echo "Students group ID: $GROUP_ID"
  48. echo ""
  49. echo "Starting user creation..."
  50. echo "=========================="
  51.  
  52. # Read emails from file and create users
  53. while IFS= read -r email || [ -n "$email" ]; do
  54. # Skip empty lines
  55. [ -z "$email" ] && continue
  56.  
  57. # Trim whitespace
  58. email=$(echo "$email" | xargs)
  59.  
  60. echo "Processing: $email"
  61.  
  62. # Extract username from email (part before @)
  63. username=$(echo "$email" | cut -d'@' -f1)
  64.  
  65. # Split username into first and last name
  66. # If username contains a dot, split by dot (e.g., javi.moreno)
  67. if [[ "$username" == *.* ]]; then
  68. FIRST_NAME=$(echo "$username" | cut -d'.' -f1 | sed 's/\b\(.\)/\u\1/g')
  69. LAST_NAME=$(echo "$username" | cut -d'.' -f2- | sed 's/\b\(.\)/\u\1/g')
  70. else
  71. # If no dot, use the whole username as first name and "User" as last name
  72. FIRST_NAME=$(echo "$username" | sed 's/\b\(.\)/\u\1/g')
  73. LAST_NAME="User"
  74. fi
  75.  
  76. # Create user
  77. echo " Creating user: $FIRST_NAME $LAST_NAME ($email)"
  78. USER_ID=$(aws identitystore create-user \
  79. --identity-store-id "$IDENTITY_STORE_ID" \
  80. --user-name "$username" \
  81. --display-name "$FIRST_NAME $LAST_NAME" \
  82. --name Formatted="$FIRST_NAME $LAST_NAME",FamilyName="$LAST_NAME",GivenName="$FIRST_NAME" \
  83. --emails Value="$email",Type=work,Primary=true \
  84. --query 'UserId' \
  85. --output text 2>&1)
  86.  
  87. if [ $? -eq 0 ] && [ -n "$USER_ID" ] && [ "$USER_ID" != "None" ]; then
  88. echo " ✓ User created with ID: $USER_ID"
  89.  
  90. # Add user to students group
  91. echo " Adding user to 'students' group..."
  92. aws identitystore create-group-membership \
  93. --identity-store-id "$IDENTITY_STORE_ID" \
  94. --group-id "$GROUP_ID" \
  95. --member-id UserId="$USER_ID" \
  96. --output text > /dev/null 2>&1
  97.  
  98. if [ $? -eq 0 ]; then
  99. echo " ✓ User added to 'students' group"
  100. else
  101. echo " ✗ Failed to add user to group"
  102. fi
  103. else
  104. echo " ✗ Failed to create user: $USER_ID"
  105. fi
  106.  
  107. echo ""
  108. done < "$EMAILS_FILE"
  109.  
  110. echo "=========================="
  111. echo "User creation completed!"
Advertisement
Comments
  • Lenbozon
    212 days
    # CSS 0.85 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 38% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from Swapzone — instant swap).
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Vargaduq
    33 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • Jundaren
    30 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • Jaxvasro
    15 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=spxrsenxkx
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment