Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import subprocess,time
  2.  
  3. psexecloc ="C:\Users\administrator\Desktop\sample\bin\psexec.exe"
  4. remotecmd="notepad.exe"
  5. username = "XXXr"
  6. password = "XXXXXXX"
  7. remotehostname = "XXXXXXXX"
  8. args =
  9. [psexecloc, "-u", username, "-p", password, remotehostname, remotecmd]
  10.  
  11. output = subprocess.Popen(args, shell=False, stdout=subprocess.PIPE)
  12. time.sleep(30)
  13. outstr=output.communicate()
  14. stdoutstr = outstr[0]
  15. stderrstr = outstr[1]
  16. print ("Output Tupple: ",outstr)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement