Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Creates an empty file
- echo. 2> secret.txt
- # Restricts access to the file to only the owner
- icacls secret.txt /remove "BUILTIN\Administrators" "NT AUTHORITY/SYSTEM" /inheritance:r
- # Redirects the keyboard to text file, suppressing prompt to overwrite
- copy con secret.txt /y
- # Everything the user types from this point up to the CTRL-Z (^Z) is saved in the file
- THIS IS MY TOP SECRET PASSWORD^Z
- # The Secrets Manager command takes the --plain-text parameter from the contents of the file
- aws secretsmanager put-secret --secret-id TestSecret --plain-text file://secret.txt
- # The file is destroyed so it can no longer be accessed.
- sdelete secret.txt
Add Comment
Please, Sign In to add comment