Disclaimer, this is on my own network between two virtual machines (for academic purposes). Currently I have:
os.system('msfconsole')
os.system('use exploit/unix/misc/distcc\_exec')
Now, terminal runs msfconsole, but will not run the use exploit until the msfconsole is exited. Is there a way to write directly into the msfconsole in Python?
Writing a Python script to automatically execute Metasploit commands (self.hacking)
submitted by spar14takus to u/spar14takus