rapid7/metasploit-framework — pull request #2673 by OJ (2013-11-22 09:28:21+00:00)
Title: Add -x and -s parameters to uploadexec

Added `-x` parameter to the script which indicates that the underlying meterpreter session should be terminated when the execution has finished.

Added `-s` parameter which takes a floating point number as an arg which indicates the number of seconds to sleep between uploading and executing. This helps in the case where http(s) payloads are used for meterpreter and a time delay is needed to make sure that the file has been written to disk and the lock released prior to attempting to executing it.

Sample command line that uploads calc.exe, waits 2 seconds and exits after invocation is:

msf > set AutoRunScript uploadexec -e /tmp/calc.exe -s 2.0 -x