Windows Sysinternals工具下载地址:

Sysinternals Suite-------https://technet.microsoft.com/en-us/sysinternals/bb842062.aspx

PsExec-------------------https://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

实用工具(如 Telnet)和远程控制程序(如 Symantec 的 PC Anywhere)使您可以在远程系统上执行程序,但安装它们非常困难,并且需要您在想要访问的远程系统上安装客户端软件。PsExec 是一个轻型的 telnet 替代工具,它使您无需手动安装客户端软件即可执行其他系统上的进程,并且可以获得与控制台应用程序相当的完全交互性。PsExec 最强大的功能之一是在远程系统和远程支持工具(如 IpConfig)中启动交互式命令提示窗口,以便显示无法通过其他方式显示的有关远程系统的信息。

用法:psexec [\\computer[,computer2[,...] | @file][-u user [-p psswd]][-n s][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-][-a n,n,...] cmd [arguments]

computer

指示 PsExec 在指定的一台或多台计算机上运行应用程序。如果省略计算机名称,则 PsExec 将在本地系统上运行应用程序;如果输入计算机名称“\\*”,则 PsExec 将在当前域中的所有计算机上运行应用程序。

@file

指示 PsExec 在指定的文本文件中列出的每台计算机上运行命令。

-a

用逗号分隔可以运行应用程序的处理器,CPU 编号最小为 1。例如,要在 CPU 2 和 CPU 4 上运行应用程序,请输入:“-a 2,4”

-c

将指定的程序复制到远程系统以便执行。如果省略此选项,则应用程序必须位于远程系统上的系统路径中。

-d

不等待应用程序终止。请只对非交互式应用程序使用此选项。

-e

不加载指定帐户的配置文件。

-f

将指定的程序复制到远程系统,即使远程系统中已存在该文件。

-i

运行程序,以便它与远程系统中指定会话的桌面进行交互。如果未指定会话,则进程将在控制台会话中运行。

-l

以受限用户身份(去除 Administrators 组的权限,并且只允许使用分配给 Users 组的权限)运行进程。在 Windows Vista 上,此进程将以“低完整性”运行。

-n

指定与远程计算机连接的超时(秒)。

-p

指定用户名的密码(可选)。如果省略此选项,系统将提示您输入隐藏密码。

-s

在系统帐户中运行远程进程。

-u

指定用于登录远程计算机的可选用户名。

-v

仅在指定文件具有更高版本号或该文件比远程系统上的文件新时复制该文件。

-w

设置进程的工作目录(相对于远程计算机)。

-x

在 Winlogon 桌面上显示 UI(仅限于本地系统)。

-priority

指定 –low、-belownormal、-abovenormal、-high 或 -realtime 按不同优先级运行进程。

program

要执行的程序的名称。

arguments

要传递的参数(请注意,文件路径必须是目标系统中的绝对路径)

对于其名称中含有空格的应用程序,可以在其两侧加引号,例如,psexec \\marklap "c:\long name\app.exe"。按下 Enter 键时,仅将输入内容传递到远程系统。键入 Ctrl-C 可终止远程进程。

如果省略用户名,则远程进程将以执行 PsExec 时所使用的相同帐户运行,但由于远程进程以模仿方式运行,因此它无权访问远程系统上的网络资源。指定用户名时,远程进程将以指定的帐户执行,并可访问该帐户有权访问的任何网络资源。请注意,密码是以明文形式传递到远程系统的。

当目标系统是本地系统时,由于 PsExec 不需要您具有管理员权限,因此您可以使用当前版本的 PsExec 来取代 Runas。

示例

编辑

以下命令可在 \\marklap 上启动交互式命令提示窗口:

psexec \\marklap cmd

此命令通过 /all 开关在远程系统上执行 IpConfig,并在本地显示输出结果:

psexec \\marklap ipconfig /all

此命令将程序 test.exe 复制到远程系统,并以交互方式执行此程序:

psexec \\marklap -c test.exe

如果远程系统中已经安装的程序不在系统路径中,请指定该程序的完整路径:

psexec \\marklap c:\bin\test.exe

在系统帐户中以交互方式运行 Regedit,以便查看 SAM 和 SECURITY 注册表项的内容:

psexec -i -d -s c:\windows\regedit.exe

要以受限用户权限运行 Internet Explorer,请使用此命令:

psexec -l -d "c:\program files\internet explorer\iexplore.exe"

执行普通系统命令:

psexec \\ip -u user -p passwd cmd /c dir D:\

--------------------------------------------------------------------------------------

(1)psexec
psexec是一个远程执行工具,你可以像使用telnet一样使用它。
它的使用格式为:
psexec \\远程机器ip [-u username [-p password]] [-c [-f]] [-i][-d] program [arguments]
它的参数有:
-u后面跟用户名 -p后面是跟密码的,如果建立ipc连接后这两个参数则不需要。(如果没有-p参数,则输入命令后会要求你输入密码)
-c <[路径]文件名>:拷贝文件到远程机器并运行(注意:运行结束后文件会自动删除)
-d 不等待程序执行完就返回,(比如要让远程机器运行tftp服务端的时候使用,不然psexec命令会一直等待tftp程序结束才会返回)
-i 在远程机器上运行一个名为psexesvc进程,(到底什么用弄不明白)
假设我在远程机器ip有一个账号,账号名是:abc   密码是:123
比如想要用telnet一样在远程系统上执行命令可以打:
psexec \\远程机器ip -u abc -p 123 cmd
如果想要远程机器执行本地c:\srm.exe文件可以打:
psexec \\远程机器ip -u abc -p 123 -c c:\srm.exe
如果想要让远程机器执行本地上tftp服务端,(假设tftp服务端在本地c:\tftp32.exe),可以打:
psexec \\远程机器ip -u abc -p 123 -c c:\tftp32.exe -d
(后面例子不再重复-u和-p的用法)

psexec \\远程机器ip -u abc -p 123 -c c:\a.bat  (让远程服务器执行本地写好的批处理)

(2)psservice
psservice是一个服务管理程序。
它的使用格式为:
psservice [\\远程机器ip [-u username] [-p password]] <command> <options>
它的参数只有:
-u 后面跟用户名 -p后面是跟密码的,如果建立ipc连接后这两个参数则不需要。(如果没有-p参数,则输入命令后会要求你输入密码)
它的command有:
query [服务名]:显示某一服务的状态,如不填服务名则显示所有服务的状态。
config <服务名>:显示某一服务的配置。
start <服务名>:启动某一服务。
stop <服务名>:停止某一服务。
testart <服务名>:停止某一服务并重新启动它。
pause <服务名>:暂停某一服务。
cont <服务名>:恢复暂停的服务。
depend <服务名>:显示某一服务依存关系。
find <服务名>:在网络种搜寻指定的服务。
比如你想查看在远程机器上的telnet服务的状态可以打:
psservice \\远程机器ip query tlntsvr     (tlntsvr为telnet服务的服务名)
比如你查看远程机器上的telnet服务的配置可以打:
psservice \\远程机器ip config tlntsvr
比如你想启动远程机器上的telnet服务可以打:
psservice \\远程机器ip start tlntsvr
其他用法以此类推。

(3)pssuspend
pssuspend是一个暂时停止进程的软件
它的使用格式为:
pssuspend [-r] [\\远程机器ip [-u username] [-p password]] <process name | process id>
它有三个参数:
-u:后面跟用户名 -p:后面是跟密码的,如果建立ipc连接后这两个参数则不需要。(如果没有-p参数,则输入命令后会要求你输入密码)
-r:恢复进程。
比如要暂时停止一个pid号为999,名称为srm.exe的进程可以打:
pssuspend \\远程机器ip 999   或   pssuspend \\远程机器ip srm
如果想要恢复它就可以打pssuspend -r \\远程机器ip 999 或   pssuspend -r \\远程机器ip srm

(4)psinfo
psinfo是一个搜集机器软硬件信息的工具,它可以获得操作系统信息,硬件信息和软件信息。
它的使用格式为:
psinfo [-h] [-s] [-d] [-c] [\\远程机器ip [-u username [-p password]]]
它的参数有:
-u:后面跟用户名 -p:后面是跟密码的,如果建立ipc连接后这两个参数则不需要。(如果没有-p参数,则输入命令后会要求你输入密码)
-h:是显示它安装了哪些补丁包
-s:是显示它装了哪些软件
-d:是显示磁盘信息。
比如我只想看远程机器的软硬件信息和只用打:
psinfo \\远程机器ip
假如我还想看看它装了哪些补丁包可以打
psinfo -h \\远程机器ip
假如我还想看看它磁盘信息可以打:
psinfo -d \\远程机器ip
如果我想看它装了哪些软件可以打:
psinfo -s \\远程机器ip
简单吧.

(5)pslist
pslist是一个查看进程的程序。
它的使用格式为:
pslist [-d] [-m] [-x][-t][-s [n] [-r n] [\\远程机器ip [-u username] [-p password]] [name | pid]
它的参数有:
-u:后面跟用户名 -p:后面是跟密码的,如果建立ipc连接后这两个参数则不需要。(如果没有-p参数,则输入命令后会要求你输入密码)
-s:是使用任务管理器模式实时查看进程,可以按ESC键退出。
-r <秒数>:是和-s连用的一个参数,它用来指定任务管理器模式是的刷新间隔。(默认的刷新间隔为1秒)
-d:示各个进程的cpu使用信息。
-m:显示各个进程的存储器使用信息。
-x:非常详细显示进程的所有信息。
-t:以树型方式显示进程。
比如要查看远程机器ip上的进程的cpu使用信息可以打:
pslist -d \\远程机器ip
比如要查看一个pid号为999,名称为srm.exe进程的存储器使用信息可以打:
pslist -m \\远程机器ip 999 或 pslist -m \\远程机器ip srm
比如要以任务管理器模式实时查看61.12.23.4上进程情况,并且刷新间隔为3秒可以打:
pslist -s -n 3 \\远程机器ip

(6)psuptime
psuptime是一个了解远程机器运行了多久的命令。
使用它只需要打:psuptime \\远程机器ip

(7)psshutdown
psshutdown是一个远程关机命令。
它的使用格式为:
psshutdown [[-s | -r | -k [-t nn][-m "消息"][-f]] -a | -l | -o] [\\远程机器ip]
它的参数有:
-a:取消以前执行的关机指令。
-t:离关机还有多少秒。(默认是20秒)
-s:关闭机器。
-m:是要显示的信息。
-f:是关机是不保存运行的程序。
-r:表示重启。
-l:表示锁定电脑。
-o:表示注销用户。
比如我想让远程机器30秒后关闭并显示(要关机了,请保存文件)则打:
psshutdown -t 30 -s -m "要关机了,请保存文件" \\远程机器ip
如果是要重起的话打:
psshutdown -t 30 -m "要关机了,请保存文件" -r \\远程机器ip
如果要取消刚才的指令可以打:
psshutdown -a \\远程机器ip
其他参数以此类推。

(8)psfile
psfile是一个显示机器上的会话和有什么文件被网络中的用户的打开的命令。
它的使用格式为:
psfile [\\远程机器ip [-u Username [-p Password]]] [[Id | path] [-c]]
它的参数有:
-u 后面跟用户名 -p后面是跟密码的,如果建立ipc连接后这两个参数则不需要。(如果没有-p参数,则输入命令后会要求你输入密码)
-c:关闭会话或文件
比如我想看看远程机器上的会话和被远程用户打开的文件可以打:
psfile \\远程机器ip
接着就会显示
[33] C:\WINNT
  User:   ADMINISTRATOR
  Locks: 0
  Access: Read
[63] \PIPE\srvsvc
  User:   ADMINISTRATOR
  Locks: 0
  Access: Read Write
接着我想关闭id为33,路径为c:\winnt的这个会话可以打
psfile \\远程机器ip 33 -c   或   psfile \\远程机器ip c:\winnt -c

(9)psloggedon
psloggedon是一个显示目前谁登陆的机器的命令。
它的参数只有:
-l只显示本地登陆用户而不显示其它的网络登陆用户
-x不显示登陆时间
比如说要显示远程机器现在登陆的用户可以打:
psloggedon \\远程机器ip

(10)psgetsid
psgetsid是一个远程获取账号sid信息的工具。
它的使用格式为:
psgetsid [\\远程机器ip [-u username [-p password]]] [account]
它的参数有
-u 后面跟用户名 -p后面是跟密码的,如果建立ipc连接后这两个参数则不需要。(如果没有-p参数,则输入命令后会要求你输入密码)
比如要看远程机器上账号名为abc的sid信息可以打:
psgetsid \\远程机器ip abc

(11)pskill
pskill是一个杀除进程的程序。
它的使用格式为:
pskill [\\远程机器ip [-u username] [-p password]] <process name | process id>
比如要杀除一个pid号为999,名称为srm.exe的进程可以打:
pskill \\远程机器ip 999   或   pskill \\远程机器ip srm

(12)psloglist
psloglist
psloglist是一个查看系统事件记录的程序。
它的使用格式为:
psloglist [\\远程机器ip [-u username [-p password]]] [-s [-t delimiter]] [-n # | -d #] [-c][-x][-r][-a mm/dd/yy][-b mm/dd/yy][-f filter] [-l event log file] <eventlog> 
它的参数有:
-u 后面跟用户名 -p后面是跟密码的,如果建立ipc连接后这两个参数则不需要。
-c:显示事件之后清理事件记录
-l <事件记录文件名>:用于查看事件记录文件
-n <n>:只显示最近的n条系统事件记录。
-d <n>:只显示n天以前的系统事件记录
-a mm/dd/yy:显示mm/dd/yy以后的系统事件记录
-b mm/dd/yy:显示mm/dd/yy以前的系统事件记录
-f <事件类型>:只显示指定的事件类型的系统事件记录。
-x:显示事件数据代码
-r:从旧到新排列(如不加则默认是从新到旧排列)
-s:以一个事件为一行的格式显示,中间默认以逗号格开各个信息。
-t <字符>:这个参数和-s连用,以来改变-s中默认的逗号。
如果我想看远程机器的系统事件记录只用打:
psloglist \\远程机器ip 123
比如我想看最近的10条error类型的记录可以打:
psloglist \\远程机器ip -n 10 -f error

---------------------------------------------------------------------------------

PsExec (PsTools)

Execute a command-line process on a remote machine.

Syntax

psexec \\computer[,computer[,..] [options] command [arguments]

psexec @run_file [options] command [arguments]

Options:

computer   The computer on which psexec will run command. Default = local system

To run against all computers in the current domain enter "\\*"

@run_file  Run command on every computer listed in the text file specified.

command    Name of the program to execute

arguments  Arguments to pass (file paths must be absolute paths on the target system)

-a n,n,... Set processor affinity to n. Processors are numbered as 1,2,3,4 etc

so to run the application on CPU 2 and CPU 4, enter: "-a 2,4"

-c         Copy the program (command)to the remote system for execution.

-c -f      Copy even if the file already exists on the remote system.

-c -v      Copy only if the file is a higher version or is newer than the remote copy.

If you omit the -c option then the application must be in the system path on the remote system.

-d         Don’t wait for the application to terminate.

Only use for non-interactive applications.

-e         Do NOT load the specified account’s profile.

(In early versions of PSEXEC: Load the user account's profile, don’t use with -s)

-f         Copy the specified program even if the file already exists on the remote system.

-h         Run with the account's elevated token, if available. (Vista or higher)

-i         Interactive - Run the program so that it interacts with the desktop on the remote system.

If no session is specified, the process runs in the console session.

-l         Limited - Run process as limited user.  Run with Low Integrity.

Strips the Administrators group and allows only privileges assigned to the Users group.

-n s       Specify a timeout (s seconds) for connecting to the remote computer.

-p psswd   Specify a password for user (optional). Passed as clear text.

If omitted, you will be prompted to enter a hidden password.

-r         The name of the remote service to create or interact with.

-s         Run remote process in the SYSTEM account (use with caution).

-u user    Specify a user name for login to remote computer(optional).

-v         Copy the specified file only if it has a higher version number or is newer

than the one on the remote system.

-w directory Set the working directory of the process (relative to the remote computer).

-x         Display the UI on the Winlogon desktop (local system only).

-low, -belownormal, -abovenormal, -high or -realtime

These options will run the process at a different priority.

also -background (Vista and above) will run at low memory and I/O priority.

-accepteula Suppress the display of the license dialog.

For PsExec to work, File and Printer sharing must be enabled on the remote computer.

PsExec can also be used to start GUI applications, but in that case the GUI will appear on the remote machine.

Input is passed to the remote system when you press the enter key - typing Ctrl-C will terminate the remote process.

When you specify a username the remote process will execute in that account, and will have access to that account's network resources.

If you omit username the remote process will run in the same account from which you execute PsExec, but because the remote process is impersonating it will not have access to network resources on the remote system.

If you do specify an alternative username/password, then PsExec will send the password in clear text. This can be a security risk if unauthorized network sniffers could intercept traffic between the local and remote system.

PsExec does not require you to be an administrator of the local filesystem, with the correct password psexec will allow UserA to run commands as UserB - a Runas replacement.

If you kill a PsExec process, you might also need to manually remove the background service:

sc.exe \\workstation64 delete psexesvc

PsExec can also be used to start a process (on a remote or local machine) as SYSTEM, this is a very privileged account similar to root on a UNIX machine ~ use with extreme caution.

Accept eula

When launched for the first time, PsExec will create the license registry key:

HKCU\Software\Sysinternals\PsExec\EulaAccepted=0x01

Psexec will swallow the first "-accepteula" on the commandline, no matter where it occurs, so when using psexec to run any other ps* utilities, you will have to pass "-accepteula" twice:

psexec -accepteula -s c:\utils\pslist.exe -accepteula

Surround any long filenames "with quotation marks"

Error codes returned by PsExec are specific to the applications you execute, not PsExec.

Internal commands

Internal commands (such as COPY, CD, DIR etc) are only available within the CMD shell. To run these commands from PsExec you must call CMD /C and then pass the commands as parameters - see the examples below.

Examples:

Launch an interactive command prompt on \\workstation64, the CMD prompt window will appear locally:

psexec \\workstation64 cmd

Execute a program that is already installed on the remote system:

psexec \\workstation64 "c:\Program Files\test.exe"

Connect to workstation64 and run IPCONFIG to display the remote PC's IP address:

psexec \\workstation64 ipconfig

Connect to workstation64 and list a directory:

psexec \\workstation64 -s cmd /c dir c:\work

Connect to workstation64 and copy a file from another server:

psexec \\workstation64 -s cmd /c copy \\server21\share45\file.ext c:\localpath

Execute IpConfig on the remote system, and display the output locally:

psexec \\workstation64 ipconfig /all

Copy the program test.exe to the remote system and execute it interactively, running under the account DannyGlover:

psexec \\workstation64 -c test.exe -u DannyGlover -p Pa55w0rd

Run Internet Explorer on the local machine but with limited-user privileges:

psexec -l -d "c:\program files\internet explorer\iexplore.exe"

Run Regedit on the local machine with SYSTEM privileges:

psexec -s -i regedit.exe

From PowerShell, run a VBscript on a remote workstation and pass some parameters:

PS C:> $script='C:\Program Files\demo.vbs'

PS C:> $args = "some more text"

PS C:> psexec -s \\workstation64 c:\windows\system32\cscript.exe $script $args

本文转自leonardos51CTO博客,原文链接:http://blog.51cto.com/leomars/1900528 ,如需转载请自行联系原作者

远程工具psexec相关推荐

  1. 1-6-Xmanager远程工具的使用

    Xmanager远程工具的使用   转载于:https://blog.51cto.com/clinux/1718916

  2. qpython3调用adb_Python实现的基于ADB的Android远程工具

    Python实现的基于ADB的Android远程工具,本工具为原创,涉及知识: - Python编程 - Tkinter GUI编程 - ADB通信机制 代码全文: #!/usr/bin/env py ...

  3. MySQL远程工具链接报错—1130

    1130 - Host '192.168.0.1' is not allowed to connect to this MySQL server 使用MySQL远程工具链接数据库报错,这个错误原因是没 ...

  4. 解决VS2005 远程工具无法通过同步软件连接S5pv210 样机的问题

    居然无法连接,记得以前遇到过的 1 分钟前 上传 下载附件 (58.21 KB) 后来还是看MSDN解决了 MSDN连接如下 http://msdn.microsoft.com/en-us/libra ...

  5. 手机mstsc远程工具_远程桌面连接,只需3步,轻松远程操控电脑!

    远程桌面的好处 远程桌面有很多好处的 1.对于运维技术人员来说,可以随时随地管理远程主机,查看系统信息和硬件信息等系统性能诊断,远程应用管理内存.CPU等敏感信息报警提醒,对远程主机的一切尽收眼 2. ...

  6. centos7网卡识别不到,无法远程工具连接

    这是在安装dhcp的时候遇到的问题,远程工具连接不上了.没IP地址没得玩 解决办法 直接在虚拟机打开终端,找到配置文件ifcfg-ens33 TYPE="Ethernet" PRO ...

  7. linux远程工具_【linux实操3.1】linux远程连接工具Secure的使用

    把自己的闲置笔记本用来做centos7服务器了,同时也出一期教程,记录自己同时也帮助需要的人:安排如下 1.[linux实操1]华硕笔记本安装centos7实战 2.[linux实操2]使用yum在命 ...

  8. linux下哪些软件能跑pin,Linux下4款常见远程工具比较

    Linux 远程可不像 Windows 下那么方便,主要是连接的速度.显示的画质不能令人满意(延迟.撕裂).本文只是说一下我用过的四款远程工具. 一.Anydesk 官网:https://anydes ...

  9. 手机mstsc远程工具_ToDesk — 免费不限速的远程控制软件

    TeamViewer和国产的向日葵算是非常知名的远程工具,还有之前老夜分享过的AnyDesk据说是TeamViewer开发小组人员自立门户的产品.当然了都是个人使用免费,一旦使用时连接的用户数过多或过 ...

  10. 【Linux】Linux的常用远程工具

    1.SecureCRT 快捷键:复制滚轮 粘贴:鼠标右键 2.notepad++:支持远程编辑的文本编辑器 3.Xmanager xshell:远程命令行 xftp:远程文件传输攻击 xbrowser ...

最新文章

  1. 【图论专题】BFS中的双向广搜 和 A-star
  2. android----HttpClient的get,post和图片上传服务器
  3. SAP Hybris Commerce product读取的调试截图
  4. imp命令导入指定表_Sqoop 使用shell命令的各种参数的配置及使用方法
  5. 设计灵感素材网站:美工设计者必备
  6. freeswitch php事件订阅,例子3:事件订阅,监听多个事件
  7. vscode 乱码_如何使用VS Code 编辑Keil项目(51/STM32)
  8. 试着开发chrome插件
  9. shell脚本批量创建用户
  10. nodejs脚本方式实现微信小程序代码自动上传生成体验版
  11. 获取代理IP的三种途径
  12. java递归遍历文件夹下所有文件
  13. 中国互联网发展状况报告:境内约 2.6 万网站被植入后门
  14. 汇编 - 实验 - 计算X+(Y-Z)=W
  15. 谁动了你的 MSN?—— MSN 帐号被盗原因的分析和解决办法,鄙视msnlivesn.com
  16. AOSP-AOKP-CM
  17. 什么是企业邮箱,如何申请企业邮箱,企业邮箱一年多少钱?
  18. 非管理员用户添加右键菜单(管理员也适用)
  19. Ubuntu 10.04 更新源(ubuntu yuan)
  20. 企业业务招待费的税前扣除,不要出现以下5个错误!

热门文章

  1. VM虚拟机安装WindowsXp_SP3全过程
  2. 小白科普:10Mb独享服务器相当于多少流量?一个月3500GB流量的服务器可以支持多少PV?多少IP访问?
  3. linux设置开机自启动网络,linux设置开机自启动
  4. 使用什么协议扫描服务器端口,服务器端口扫描
  5. python 预测分析_如何用Python来预测分析离职率呢
  6. 使用ffmpeg批量合并flv文件
  7. linux vi输入日历,linux下Vi编辑器命令大全(上)
  8. php 操作 PSD,PHP中怎么使用Imagick操作PSD文件
  9. MDK中编译报错 Error: L6218E: Undefined symbol SystemInit (referred from startup_cmsdk_cm0.o).
  10. 快速入门——深度学习理论解析与实战应用