0
votes

In metasploit and using psexec.py (http://pen-testing.sans.org/blog/2013/03/27/psexec-python-rocks) i notice that there is a file created on the remote machine both times, does this always happen? even if i just do "psexec //remote-pc user password "cmd.exe"?

If so is there any to psexec from a linux computer to windows machines without any files being generated on the remote windows machiens?

1

1 Answers

2
votes

All the psexec approaches upload a binary that is a Windows Service that provides named pipes for stdin/stderr/stdout and a mini protocol to send commands to execute.

If you want to execute something at a target, you can do something similar to psexec.py using WMI. There are subtle differences but most probably it's gonna do the work you need.

Check out https://github.com/CoreSecurity/impacket/blob/master/examples/wmiexec.py

This script calls Win32_Process.Create() to execute commands at the target system.

If you use the semi-interactive shell, there will be a file created at the target system, but it's a text file, that has the output of the command you just executed (so you can see the output). If you're not interested in the output, call the script with -nooutput.

As of today you will need to check out trunk to make this script to work. I'm tagging a new version next month.