picoCTF2023
前言
没怎么做,有空就打打。score:1700
一些太简单的就不写了
一些难题待学
web
cancri-sp
msfroggenerator2
forensics
UnforgottenBits
Invisible WORDs
web
解决
MatchTheRegex
function send_request() { |
^p…..F!?
最后的!?表示匹配!0次或者一次
SOAP
抓包,然后看到xml的信息
改一下
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE test [<!ENTITY test SYSTEM "file:///etc/passwd" >]><data><ID>&test;</ID></data> |
More SQLi
passwd处用万能密码登录
未解决
findme
不知什么问题,没有重定向。抓不到,还是过后扫到了/home,但是也没啥进展。。结果wp说有重定向。。不明所以。(坑)
Java Code Analysis!?!
一开始看很少人做出来就不做了。后面没想到越来越多人做出来,还给了好多hint
hint1
Maybe try to find the JWT Signing Key (“secret key”) in the source code? Maybe it’s hardcoded somewhere? Or maybe try to crack it?
hint2
The ‘role’ and ‘userId’ fields in the JWT can be of interest to you!
hint3
The ‘controllers’, ‘services’ and ‘security’ java packages in the given source code might need your attention. We’ve provided a README.md file that contains some documentation.
hint4
Upgrade your ‘role’ with the new (cracked) JWT. And re-login for the new role to get reflected in browser’s localStorage.
登录之后,有一本PDF叫flag,但是权限不够,抓包,发现有jwttoken。
法一:试试jwt-cracker 爆破出密码1234
法二:审计代码
在源码中security下的jwtservice中找到了jwt的组成部分

然后看到了secret_key= secretGenerator.getServerSecret();
那么进入这个类secretGenerator看看怎么构成的,右键选择find in files 找到了定义的地方在同目录下的secretGenerator.java,然后看到


这个函数getServerSecret,尝试打开了同目录下的server_secret.txt,但是没有这个文件,所以进入第一个catch此时newSecret获得一个值为1234,后面的没什么关系,最后返回newSecret即1234,所以这就是密钥。
密码爆破出来后,根据提示,改改token就可以了。
cancri-sp 8解
没找到wp
msfroggenerator2 39解(坑)
https://rorical.blue/2023/03/picoCTF%202023%20msfroggenerator2%20writeup/#Overview
Forensics
解决
Findme
将图片分离即可。
PcapPoisoning
wireshark ctrl f
Who is it
查ip,找到所属人
https://zh-hans.ipshu.com/whois_ipv4/173.249.33.206
https://www.whois.com/whois/173.249.33.206
MSB
stegsolve发现rgb7通道有东西。搞完ctrl f就行
未解出
FindAndOpen
pcap找到一段base64,解码后得到一部分”This is the secret: picoCTF{R34DING_LOKd_”。然后另外一个zip需要密码,提示在pcap找,找半天找不到。结果wp说是解出来的base64。。。。。。
Invisible WORDs
bmp文件(坑)
就找到一个wp写的。题目也说的也不知道什么,提示也是不明白。
主要是剔除无关的数据,然后改为zip
https://blog.csdn.net/mochu7777777/article/details/129755676
https://blackanon22.github.io/posts/CTF%20Competitions/picoCTF_2023.html
UnforgottenBits
https://github.com/0xPlatinum/Unforgotten-Bits
https://blackanon22.github.io/posts/CTF%20Competitions/picoCTF_2023.html
General Skills
已解决
chrono
How to automate tasks to run at intervals on linux servers?
Additional details will be available after launching your challenge instance.
我是找不到flag,在/etc/hosts里面看到了个challenge,联想到了/下面有个challenge,进去里面把那个metadata.json给cat了就看到了。。
本来想提权的,但是没能成功。
wp:题目描述提示定时执行,查看下crontab发现了flag
ls -lha /etc/crontab |
Permissions
根据提示,flag在root下,然后还要用vi提权。
SUID提权find / -perm -u=s -type f 2>/dev/null
然后看到vi
利用sudo提:sudo vi -c ‘:!/bin/sh’ /dev/null
文件在/root下的.flag.txt 被隐藏了。
我的做法:同样是vi提权,然后还是读取challenge下的metadata.json
提权
ssh给的账号密码,就是登上去的账号密码(废话,就是sudo 时候填的密码。。)
先passwd改个密码,方便输入
Linux 提权总结 - 腾讯云开发者社区-腾讯云 (tencent.com)
Linux通过第三方应用提权实战总结 - FreeBuf网络安全行业门户
https://cloud.tencent.com/developer/article/1544037
未解出
money-ware
直接搜bitcoin地址就有了。。
useless
sh脚本,加减乘除。本来还以为是要考sh编写过程的漏洞。
然后脚本有个else提示说查看手册。直接man useless 就有了
Special
一种做法是发现可以拼接执行命令:
A=’id’;$A
就执行了id命令
A='ls';$A |
或者
((ls)) |
或者
"$('pwd')" |
Specialer
很多命令被ban了,然后发现echo可以用。
echo /root/*可以打印目录 |
或者
echo * 查看当前目录下所有东西 |
Reverse Engineering
未解出
timer
说是反编译就可以出来了 用apktool编译或者如下
一个安卓apk是一个压缩包 |
Cryptography
未解出
HideToSee
steghide extract -sf xxx.bmp 空密码
然后得到一个TXT文件,根据图片提示,在线网站进行atbash解码
https://www.dcode.fr/atbash-cipher
Binary Exploitation
未解出
hijacking
题目说有个Python文件。还有说要root权限。查看root权限的
sudo -l 发现
User picoctf may run the following commands on challenge: |
那么可以通过vi来写.server.py文件
sudo vi .server.py
import os |
或者只有vi命令,可以跟之前permission那道题一样vi提权。
VNE
题目倒过来就是env。题目描述说有个bin文件可以以root权限list directories,链接上去,还是Ls 、ls -al看一下,发现当前目录下有个Bin,直接./bin,发现报错说SECRET_DIR未设置,应该就是目录还没有设置。设置就用export SECRET_DIR="/" export SECRET_DIR=/root,然后看到root下面有flag,怎么读,既然可以root执行命令,那么尝试命令拼接:export SECRET_DIR='/&cat /root/flag.txt' 然后继续./bin就行了
这道题学的就是设置环境变量了。
wplink:
https://blog.csdn.net/mochu7777777/article/details/129755676
https://github.com/khanzjob/PICOCTF-2023 这个有挺多题目的
https://github.com/EuJin03/PicoCTF2023-Writeup/tree/main/General%20Skills 只有general skill
https://github.com/DanArmor/picoCTF-2023-writeup
https://le1a.github.io/post/picoCTF2023Writeup/#findme
https://github.com/snwau/picoCTF-2023-Writeup/ 这个也挺多的
https://elfile4138.moe/2023/03/picoCTF-2023-WriteUp/#Special
https://blackanon22.github.io/posts/CTF%20Competitions/picoCTF_2023.html 这个也很多


