#!/bin/bash # ./example_shutdown.sh # Israel Torres hakin9@israeltorres.org # Tue Aug 23 12:53:46 PDT 2011 # UUIDgenkey - For My Eyes Only" # sample UUIDgenkey saved password script (shutdown) # # SECRETBIND contains the UUIDgenkey generated and stored prior using AES-salted-256 # ... only the user with the matching 36 character UUID can use this script transparently without further authentication safely # ... the caveat being that their workstation is secured / and locked when the user is not using it. SECRETBIND='53616C7465645F5FF464E08BDACB80D3BD313863EF569ED5889A6B681808C52B98C521B28564099BB59FCFBE8D589B5DC30F62EF0AEEB45ABB388FD2FEB0D756' # Using UUIDgenkey.sh the script temporarily saves the decrypted password into the variable ACCTPASS for use in the next command ACCTPASS=$(./UUIDgenkey.sh -f $SECRETBIND) # Using the net rpc shutdown command to shutdown a Windows machine from a Mac with valid credentials stored in SECRETBIND net rpc shutdown -r -f -C "shutdown is imminent" -I 10.10.10.10 -U Administrator%$ACCTPASS # Changing the variable after use for the more paranoid at heart folks ACCTPASS=$(for i in {1..100}; do echo -n $RANDOM; done) #EOF