如何用smb运行文件 [英] How to run file with smb
问题描述
我如何使用 smb.py
和 smbConnection.py
从 impacket 运行文件?我正在寻找类似的东西:
How can I use smb.py
and smbConnection.py
from impacket to run a file? I'm looking for something like:
dir = smbConn.connectTree('C$')
smbConn.openFile(dir, '/picture.jpg')
推荐答案
SMB 协议(在其所有版本中)不提供在远程系统上执行文件的功能.其主要目标是支持机器间文件和打印资源的共享.
The SMB Protocol (in all its version) doesn't provide functionality to execute files at the remote systems. Its main objective is to support the sharing of file and print resource between machines.
有几种方法可以在 Windows 机器上远程执行文件.其中一些方法包括以下技术:
There are several approaches for executing files remotely on Windows machines. Some of these approaches include the following techniques:
1) https://github.com/CoreSecurity/impacket/blob/master/examples/wmiexec.py:调用 WMI Win32_Process.Create()
1) https://github.com/CoreSecurity/impacket/blob/master/examples/wmiexec.py: Calling WMI Win32_Process.Create()
2) https://github.com/CoreSecurity/impacket/blob/master/examples/atexec.py:远程使用 Windows 任务计划程序.
2) https://github.com/CoreSecurity/impacket/blob/master/examples/atexec.py: Using the Windows Task Scheduler remotely.
3) https://github.com/CoreSecurity/impacket/blob/master/examples/smbexec.py:使用要执行的命令字符串创建 Windows 服务.
3) https://github.com/CoreSecurity/impacket/blob/master/examples/smbexec.py: Creates a Windows Service with the command string to execute.
4) https://github.com/CoreSecurity/impacket/blob/master/examples/psexec.py:上传提供远程 shell 功能的 Windows 服务.
4) https://github.com/CoreSecurity/impacket/blob/master/examples/psexec.py: Uploads a Windows Service that provides a remote shell capability.
5) https://github.com/CoreSecurity/impacket/blob/master/examples/mmcexec.py:通过 MMC DCOM 对象远程执行文件.
5) https://github.com/CoreSecurity/impacket/blob/master/examples/mmcexec.py: Executes files remotely through the MMC DCOM Object.
尽管还有更多(并且不断发现更新的).
Although there are several more (and constantly newer ones discovered).
这篇关于如何用smb运行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!