---
# System prepended metadata

title: picoCTF writeup（持續更新中）

---

# picoCTF writeup（分類都以picoCTF分類為主）
## General Skill
### Time Machine - easy
[https://play.picoctf.org/practice/challenge/425?page=2](https://)

題目敘述給了我們一個`.zip`，我們先把它用`wget`方式下載下來：

```
chiehhhhh-picoctf@webshell:/tmp$ wget https://artifacts.picoctf.net/c_titan/68/challenge.zip
--2025-04-14 11:48:34--  https://artifacts.picoctf.net/c_titan/68/challenge.zip
Resolving artifacts.picoctf.net (artifacts.picoctf.net)... 3.160.22.16, 3.160.22.92, 3.160.22.43, ...
Connecting to artifacts.picoctf.net (artifacts.picoctf.net)|3.160.22.16|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 17738 (17K) [application/octet-stream]
Saving to: 'challenge.zip'

challenge.zip                             100%[====================================================================================>]  17.32K  --.-KB/s    in 0.006s  

2025-04-14 11:48:34 (2.77 MB/s) - 'challenge.zip' saved [17738/17738]
```
然後用`unzip`解壓縮：
```
chiehhhhh-picoctf@webshell:/tmp$ unzip challenge.zip
Archive:  challenge.zip
   creating: drop-in/
  inflating: drop-in/message.txt     
   creating: drop-in/.git/
   creating: drop-in/.git/branches/
  inflating: drop-in/.git/description  
   creating: drop-in/.git/hooks/
  inflating: drop-in/.git/hooks/applypatch-msg.sample  
  inflating: drop-in/.git/hooks/commit-msg.sample  
  inflating: drop-in/.git/hooks/fsmonitor-watchman.sample  
  inflating: drop-in/.git/hooks/post-update.sample  
  inflating: drop-in/.git/hooks/pre-applypatch.sample  
  inflating: drop-in/.git/hooks/pre-commit.sample  
  inflating: drop-in/.git/hooks/pre-merge-commit.sample  
  inflating: drop-in/.git/hooks/pre-push.sample  
  inflating: drop-in/.git/hooks/pre-rebase.sample  
  inflating: drop-in/.git/hooks/pre-receive.sample  
  inflating: drop-in/.git/hooks/prepare-commit-msg.sample  
  inflating: drop-in/.git/hooks/update.sample  
   creating: drop-in/.git/info/
  inflating: drop-in/.git/info/exclude  
   creating: drop-in/.git/refs/
   creating: drop-in/.git/refs/heads/
 extracting: drop-in/.git/refs/heads/master  
   creating: drop-in/.git/refs/tags/
 extracting: drop-in/.git/HEAD       
  inflating: drop-in/.git/config     
   creating: drop-in/.git/objects/
   creating: drop-in/.git/objects/pack/
   creating: drop-in/.git/objects/info/
   creating: drop-in/.git/objects/43/
 extracting: drop-in/.git/objects/43/246218ab4fc7b30e9a9dff073e012316851469  
   creating: drop-in/.git/objects/25/
 extracting: drop-in/.git/objects/25/16effb8d70e33bdd0023629b164a77225e1ec2  
   creating: drop-in/.git/objects/70/
 extracting: drop-in/.git/objects/70/5ff639b7846418603a3272ab54536e01e3dc43  
  inflating: drop-in/.git/index      
 extracting: drop-in/.git/COMMIT_EDITMSG  
   creating: drop-in/.git/logs/
  inflating: drop-in/.git/logs/HEAD  
   creating: drop-in/.git/logs/refs/
   creating: drop-in/.git/logs/refs/heads/
  inflating: drop-in/.git/logs/refs/heads/master  
```

因為沒有很多所以~~我直接用看的~~，發現需要進到`drop-in`這個directory裡，所以先用`cd`進去：
```
chiehhhhh-picoctf@webshell:/tmp$ cd drop-in
```
然後我看到`message.txt`就想看一下裡面寫什麼，所以用`cat`把它印出來：
```
chiehhhhh-picoctf@webshell:/tmp/drop-in$ cat message.txt
This is what I was working on, but I'd need to look at my commit history to know why...
```
到這裡`drop-in`裡的東西都看完了因為只有一個，所以就進到`.git`裡用`ls`看看裡面東西有什麼：
```
chiehhhhh-picoctf@webshell:/tmp/drop-in$ cd .git
chiehhhhh-picoctf@webshell:/tmp/drop-in/.git$ ls
COMMIT_EDITMSG  HEAD  branches  config  description  hooks  index  info  logs  objects  refs
```

綜合`message.txt`的提示跟`COMMIT_EDITMSG`莫名其妙是大寫，所以我用`cat`把`COMMIT_EDITMSG`印出來看有什麼：
```
chiehhhhh-picoctf@webshell:/tmp/drop-in/.git$ cat COMMIT_EDITMSG
picoCTF{t1m3m@ch1n3_b476ca06}
```
蛤拿到flag了

### Super SSH - easy
[https://play.picoctf.org/practice/challenge/424?page=2](https://)
使用工具：picoCTF的webshell

這題主要是問ssh（Secure Shell Protocol）連線的語法：
```
ssh [options] [user@]hostname [command]
```
然後連線前要輸入金鑰

題目敘述已經給我們`user`、`hostname`、`port`跟`password`的部分，直接按語法組起來就好：
```
chiehhhhh-picoctf@webshell:~$ ssh -p 61606 ctf-player@titan.picoctf.net
```
或是`-p 61606`也能放後面像這樣：
```
chiehhhhh-picoctf@webshell:~$ ssh ctf-player@titan.picoctf.net -p 61606
```
它會詢問你是否確定繼續連線，直接回yes就好：
```
Are you sure you want to continue connecting (yes/no/[fingerprint])?yes
```

然後它就會向你索取金鑰：
```
ctf-player@titan.picoctf.net's password:
```
輸入密碼是完全不會顯示的不要慌，就照敘述給的密碼輸入就好，連線成功會有這行：
```
Welcome ctf-player, here's your flag: picoCTF{s3cur3_c0nn3ct10n_3e293eea}
Connection to titan.picoctf.net closed.
```
然後就拿到flag+被關閉連線了

### Magikarp Ground Mission - easy
[https://play.picoctf.org/practice/challenge/189?page=5](https://)

題目敘述直接給我們連線指令了，所以我們先用`ssh`進行連線：
```
chiehhhhh-picoctf@webshell:~$ ssh ctf-player@venus.picoctf.net -p 58674
```
它一樣會詢問你是否確定要繼續連線，直接回yes就好：
```
Are you sure you want to continue connecting (yes/no/[fingerprint])?yes
```
然後它會向你索取金鑰：
```
ctf-player@venus.picoctf.net's password: 
```
直接輸入就好，連線後用`ls`列出現在裡面有什麼：
```
ctf-player@pico-chall$ ls
1of3.flag.txt  instructions-to-2of3.txt
```
可以看到裡面有兩個`.txt`，一個是flag一個是提示，透過`1of3.flag.txt`可以知道flag被分成三個部分了，先用`cat`印出`1of3.flag.txt`：
```
ctf-player@pico-chall$ cat 1of3.flag.txt
picoCTF{xxsh_
```
再印出`instructions-to-2of3.txt`看flag第二部分的提示：
```
ctf-player@pico-chall$ cat instructions-to-2of3.txt
Next, go to the root of all things, more succinctly `/`
```
它提示我們去`root`，所以用`cd /`進到`root`裡然後用`ls`看裡面有哪些檔案：
```
ctf-player@pico-chall$ cd /
ctf-player@pico-chall$ ls 
2of3.flag.txt  bin  boot  dev  etc  home  instructions-to-3of3.txt  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
```
用`cat`印出`2of3.flag.txt`：
```
ctf-player@pico-chall$ cat 2of3.flag.txt
0ut_0f_\/\/4t3r_
```
再印出`instructions-to-3of3.txt`看flag第三部分的提示：
```
ctf-player@pico-chall$ cat instructions-to-3of3.txt
Lastly, ctf-player, go home... more succinctly `~`
```
它叫我們回到`home`，所以用`cd ~`回到`home`再用`ls`看裡面有哪些檔案：
```
ctf-player@pico-chall$ cd ~
ctf-player@pico-chall$ ls
3of3.flag.txt  drop-in
```
用`cat`印出`3of3.flag.txt`：
```
ctf-player@pico-chall$ cat 3of3.flag.txt 
c1754242}
```
最後把flag的三個部分組起來就可以得到完整的flag：
```
picoCTF{xxsh_0ut_0f_\/\/4t3r_c1754242}
```

### First Grep - easy
[https://play.picoctf.org/practice/challenge/85?page=6](https://)
題目給了一個`file`，我們先用`wget`下載下來：
```
chiehhhhh-picoctf@webshell:/tmp$ wget https://jupiter.challenges.picoctf.org/static/495d43ee4a2b9f345a4307d053b4d88d/file
--2025-04-15 04:18:15--  https://jupiter.challenges.picoctf.org/static/495d43ee4a2b9f345a4307d053b4d88d/file
Resolving jupiter.challenges.picoctf.org (jupiter.challenges.picoctf.org)... 3.131.60.8
Connecting to jupiter.challenges.picoctf.org (jupiter.challenges.picoctf.org)|3.131.60.8|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14551 (14K) [application/octet-stream]
Saving to: 'file'

file                                      100%[====================================================================================>]  14.21K  --.-KB/s    in 0s      

2025-04-15 04:18:15 (457 MB/s) - 'file' saved [14551/14551]
```

然後用`cat`印出來看看：
```
chiehhhhh-picoctf@webshell:/tmp$ cat file
yQE:Z:y?9U@Z    Pl6lA%KO0TGr@9#mc`O;zWQePqFFyrZ+dzqMx`I*33T_gNm7[P|_)y8P9=EM8kn$4r/9M$~mG,UD=p2L /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MD排版所以flag很明顯~~
這個時候直接用`grep`抓關鍵字就好：
```
grep  關鍵字 [file]
```
已知picoCTF的flag開頭都是`picoCTF`，所以直接輸入命令：
```
chiehhhhh-picoctf@webshell:/tmp$ grep picoCTF file
```
或是可以用這個：
```
strings [file] | grep 關鍵字
```
然後你就會得到flag：
```
picoCTF{grep_is_good_to_find_things_dba08a45}
```

### what's a netcat? - easy
https://play.picoctf.org/practice/challenge/34?page=6
題目敘述直接給了要運作的程式名稱跟埠口，直接用nc的命令語法就好：
```
nc hostname [command]
```
```
chiehhhhh-picoctf@webshell:~$ nc jupiter.challenges.picoctf.org 25103
```
蛤然後就拿到flag了：
```
You're on your way to becoming the net cat master
picoCTF{nEtCat_Mast3ry_d0c64587}
```
### Static ain't always noise - easy
https://play.picoctf.org/playlists/14?m=105
題目給了我們兩個檔案，我們先下載下來：
```
chiehhhhh-picoctf@webshell:~$ wget https://mercury.picoctf.net/static/ec4dbd8898ade34e1d60d5b70c1b8c8c/static
--2025-04-18 18:11:44--  https://mercury.picoctf.net/static/ec4dbd8898ade34e1d60d5b70c1b8c8c/static
Resolving mercury.picoctf.net (mercury.picoctf.net)... 18.189.209.142
Connecting to mercury.picoctf.net (mercury.picoctf.net)|18.189.209.142|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8376 (8.2K) [application/octet-stream]
Saving to: 'static'

static                                                     100%[========================================================================================================================================>]   8.18K  --.-KB/s    in 0s      

2025-04-18 18:11:44 (262 MB/s) - 'static' saved [8376/8376]
```

```
chiehhhhh-picoctf@webshell:~$ wget https://mercury.picoctf.net/static/ec4dbd8898ade34e1d60d5b70c1b8c8c/ltdis.sh
--2025-04-18 18:12:01--  https://mercury.picoctf.net/static/ec4dbd8898ade34e1d60d5b70c1b8c8c/ltdis.sh
Resolving mercury.picoctf.net (mercury.picoctf.net)... 18.189.209.142
Connecting to mercury.picoctf.net (mercury.picoctf.net)|18.189.209.142|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 785 [application/octet-stream]
Saving to: 'ltdis.sh'

ltdis.sh                                                   100%[========================================================================================================================================>]     785  --.-KB/s    in 0s      

2025-04-18 18:12:01 (272 MB/s) - 'ltdis.sh' saved [785/785]
```

然後因為檔案後面沒有屬性所以我先用`file`確認static是什麼屬性的：
```
chiehhhhh-picoctf@webshell:~$ file static
```
然後回傳長這樣：
```
static: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=639391a8b15c579d69659462d3c935fa61693f17, not stripped
```
~~這一看就很適合用`strings`抓flag~~
所以我直接用`strings [file] | grep 關鍵字`抓flag：
```
chiehhhhh-picoctf@webshell:~$ strings static | grep picoCTF
```
然後就拿到flag了：
```
picoCTF{d15a5m_t34s3r_98d35619}
```
ok但另一個檔案照理來說他給了就是可以用得上的，所以我們用`cat`看看能不能把裡面的東西印出來：
```
chiehhhhh-picoctf@webshell:~$ cat ltdis.sh 
```
然後就得到了以下程式碼：
```
#!/bin/bash



echo "Attempting disassembly of $1 ..."


#This usage of "objdump" disassembles all (-D) of the first file given by 
#invoker, but only prints out the ".text" section (-j .text) (only section
#that matters in almost any compiled program...

objdump -Dj .text $1 > $1.ltdis.x86_64.txt


#Check that $1.ltdis.x86_64.txt is non-empty
#Continue if it is, otherwise print error and eject

if [ -s "$1.ltdis.x86_64.txt" ]
then
        echo "Disassembly successful! Available at: $1.ltdis.x86_64.txt"

        echo "Ripping strings from binary with file offsets..."
        strings -a -t x $1 > $1.ltdis.strings.txt
        echo "Any strings found in $1 have been written to $1.ltdis.strings.txt with file offset"



else
        echo "Disassembly failed!"
        echo "Usage: ltdis.sh <program-file>"
        echo "Bye!"
fi
```
既然是程式那我們就讓它執行看看：
```
chiehhhhh-picoctf@webshell:~$ ./ltdis.sh
```
結果沒有權限：
```
-bash: ./ltdis.sh: Permission denied
```
那我們就開權限讓它可以執行：
```
chiehhhhh-picoctf@webshell:~$ chmod +x ./ltdis.sh
chiehhhhh-picoctf@webshell:~$ ./ltdis.sh
```
執行程式後會出現：
```
Attempting disassembly of  ...
objdump: 'a.out': No such file
objdump: section '.text' mentioned in a -j option, but not found in any input file
Disassembly failed!
Usage: ltdis.sh <program-file>
Bye!
```
它提示我們用法了那我們無腦丟`static`進去：
```
chiehhhhh-picoctf@webshell:~$ ./ltdis.sh static
```
會看到它生成兩個`.txt`：
```
Attempting disassembly of static ...
Disassembly successful! Available at: static.ltdis.x86_64.txt
Ripping strings from binary with file offsets...
Any strings found in static have been written to static.ltdis.strings.txt with file offset
```
如果不確定的話可以用`ls`看一下：
```
chiehhhhh-picoctf@webshell:~$ ls
README.txt  ltdis.sh  static  static.ltdis.strings.txt  static.ltdis.x86_64.txt
```
我們用`cat`把`static.ltdis.strings.txt`印出來，然後會發現有點多行，
~~我懶得看所以直接用`grep`抓flag了~~：
```
chiehhhhh-picoctf@webshell:~$ cat static.ltdis.strings.txt | grep pico
```
然後就抓到flag了：
```
1020 picoCTF{d15a5m_t34s3r_98d35619}
```
### strings it - easy
https://play.picoctf.org/practice/challenge/37?page=6
題目問我們能不能不執行檔案找出flag，並給了一個`file`，先用`wget`下載下來：
```
chiehhhhh-picoctf@webshell:/tmp$ wget https://jupiter.challenges.picoctf.org/static/5bd86036f013ac3b9c958499adf3e2e2/strings
--2025-04-15 04:58:12--  https://jupiter.challenges.picoctf.org/static/5bd86036f013ac3b9c958499adf3e2e2/strings
Resolving jupiter.challenges.picoctf.org (jupiter.challenges.picoctf.org)... 3.131.60.8
Connecting to jupiter.challenges.picoctf.org (jupiter.challenges.picoctf.org)|3.131.60.8|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 776032 (758K) [application/octet-stream]
Saving to: 'strings'

strings                                   100%[====================================================================================>] 757.84K  1.86MB/s    in 0.4s    

2025-04-15 04:58:12 (1.86 MB/s) - 'strings' saved [776032/776032]
```
~~天性反骨的我不信邪地用`cat`印出了檔案然後眼睛被星爆了~~
這題一樣是抓關鍵字但比較不一樣的是~~只用`grep`眼睛也會被小星爆一下~~
所以我選擇用：
```
strings [file] | grep 關鍵字
```
```
chiehhhhh-picoctf@webshell:/tmp$ strings strings | grep picoCTF
```
然後就拿到flag了：
```
picoCTF{5tRIng5_1T_827aee91}
```

### plumbing - medium
https://play.picoctf.org/practice/challenge/48

題目敘述給了我們要運作的程式名稱與埠口，~~反正我是很開心直接`nc`下去了~~：
```
nc jupiter.challenges.picoctf.org 7480
```
然後出現了一堆There is no flag但實在太多了丟上來會洗版XD，綜合題目敘述寫的在程式運行時尋找字串，不難猜到應該是要用`grep`：
```
chiehhhhh-picoctf@webshell:~$ nc jupiter.challenges.picoctf.org 7480 | grep picoCTF
```
然後就抓到flag了：
```
picoCTF{digital_plumb3r_06e9d954}
```


## Forensics
### Sleuthkit Intro - medium
https://play.picoctf.org/playlists/16?m=119

題目給了一個`.gz`，一樣先用`wget`下載下來：
```
chiehhhhh-picoctf@webshell:/tmp$ wget https://artifacts.picoctf.net/c/164/disk.img.gz
--2025-04-15 12:36:16--  https://artifacts.picoctf.net/c/164/disk.img.gz
Resolving artifacts.picoctf.net (artifacts.picoctf.net)... 3.160.22.16, 3.160.22.128, 3.160.22.43, ...
Connecting to artifacts.picoctf.net (artifacts.picoctf.net)|3.160.22.16|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 29714372 (28M) [application/octet-stream]
Saving to: 'disk.img.gz'

disk.img.gz                               100%[====================================================================================>]  28.34M  1.82MB/s    in 16s     

2025-04-15 12:36:32 (1.82 MB/s) - 'disk.img.gz' saved [29714372/29714372]
```
但要注意的是如果是使用picoCTF給的webshell，要先用`cd`進去`/tmp`裡，不然它會說空間不夠，沒辦法下載。

接下來我們用`gunzip`解壓縮：
```
chiehhhhh-picoctf@webshell:/tmp$ gunzip disk.img.gz
```
解完壓縮後會得到一個`disk.img`，然後我們就可以用`mmls`查看分割表的分配：
```
chiehhhhh-picoctf@webshell:/tmp$ mmls disk.img   
```

會得到以下酷東西：
```
DOS Partition Table
Offset Sector: 0
Units are in 512-byte sectors

      Slot      Start        End          Length       Description
000:  Meta      0000000000   0000000000   0000000001   Primary Table (#0)
001:  -------   0000000000   0000002047   0000002048   Unallocated
002:  000:000   0000002048   0000204799   0000202752   Linux (0x83)
```
這個時候就可以直接用`nc`執行它給的程式了：
```
chiehhhhh-picoctf@webshell:/tmp$  nc saturn.picoctf.net 59137
```
進去之後它會問你：
```
What is the size of the Linux partition in the given disk image?
Length in sectors:
```
很顯而易見地在問Length，直接對和`Linux (0x83)`的數字就好：
```
Length in sectors: 0000202752
```

然後就拿到flag了：
```
0000202752
Great work!
picoCTF{mm15_f7w!}
```

### Disk, disk, sleuth! - medium
https://play.picoctf.org/playlists/16?m=120

題目給了一個`.gz`，我們先用`wget`下載下來：
```
chiehhhhh-picoctf@webshell:/tmp$ wget https://mercury.picoctf.net/static/626ea9c275fbd02dd3451b81f9c5e249/dds1-alpine.flag.img.gz
--2025-04-15 13:48:28--  https://mercury.picoctf.net/static/626ea9c275fbd02dd3451b81f9c5e249/dds1-alpine.flag.img.gz
Resolving mercury.picoctf.net (mercury.picoctf.net)... 18.189.209.142
Connecting to mercury.picoctf.net (mercury.picoctf.net)|18.189.209.142|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 29768910 (28M) [application/octet-stream]
Saving to: 'dds1-alpine.flag.img.gz'

dds1-alpine.flag.img.gz                   100%[====================================================================================>]  28.39M  1.82MB/s    in 16s     

2025-04-15 13:48:43 (1.82 MB/s) - 'dds1-alpine.flag.img.gz' saved [29768910/29768910]
```

然後用`gunzip`解壓縮：
```
chiehhhhh-picoctf@webshell:/tmp$ gunzip dds1-alpine.flag.img.gz
```

題目提示我們用`srch_strings`去抓flag：
```
chiehhhhh-picoctf@webshell:/tmp$ srch_strings dds1-alpine.flag.img | grep picoCTF
```

等了大概幾秒就拿到flag了：
```
 SAY picoCTF{f0r3ns1c4t0r_n30phyt3_a6f4cab5}
```

### Disk, disk, sleuth! II - medium
https://play.picoctf.org/playlists/16?m=121

題目給了一個`.gz`，先用`wget`下載下來：
```
chiehhhhh-picoctf@webshell:/tmp$ wget https://mercury.picoctf.net/static/626abf12c976b994999f77eec3138a22/dds2-alpine.flag.img.gz
--2025-04-15 17:46:45--  https://mercury.picoctf.net/static/626abf12c976b994999f77eec3138a22/dds2-alpine.flag.img.gz
Resolving mercury.picoctf.net (mercury.picoctf.net)... 18.189.209.142
Connecting to mercury.picoctf.net (mercury.picoctf.net)|18.189.209.142|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 29770589 (28M) [application/octet-stream]
Saving to: 'dds2-alpine.flag.img.gz'

dds2-alpine.flag.img.gz                   100%[====================================================================================>]  28.39M  1.83MB/s    in 16s     

2025-04-15 17:47:01 (1.82 MB/s) - 'dds2-alpine.flag.img.gz' saved [29770589/29770589]
```
一樣用`gunzip`解壓縮：
```
chiehhhhh-picoctf@webshell:/tmp$ gunzip dds2-alpine.flag.img.gz
```
然後用`mmls`看一下分割表分配：
```
chiehhhhh-picoctf@webshell:/tmp$ mmls dds2-alpine.flag.img
```
會出現這個分割表：
```
DOS Partition Table
Offset Sector: 0
Units are in 512-byte sectors

      Slot      Start        End          Length       Description
000:  Meta      0000000000   0000000000   0000000001   Primary Table (#0)
001:  -------   0000000000   0000002047   0000002048   Unallocated
002:  000:000   0000002048   0000262143   0000260096   Linux (0x83)
```
可以看到除了`Primary Table (#0)`是主區以外有`Unallocated`、`Linux (0x83)`兩個分割區，因為`Unallocated`是未分配區，所以我們先把重點放在`Linux (0x83)`，用`fls -o <offset> [file]`看一下裡面有什麼：
```
chiehhhhh-picoctf@webshell:/tmp$ fls -o 2048 dds2-alpine.flag.img 
```
然後會得到裡面有這些東西：
```
d/d 26417:      home
d/d 11: lost+found
r/r 12: .dockerenv
d/d 20321:      bin
d/d 4065:       boot
d/d 6097:       dev
d/d 2033:       etc
d/d 8129:       lib
d/d 14225:      media
d/d 16257:      mnt
d/d 18289:      opt
d/d 16258:      proc
d/d 18290:      root
d/d 16259:      run
d/d 18292:      sbin
d/d 12222:      srv
d/d 16260:      sys
d/d 18369:      tmp
d/d 12223:      usr
d/d 14229:      var
V/V 32513:      $OrphanFiles
```
這種題目的flag通常不是在`home`就是`root`，所以~~我直接無腦丟這兩個的inode~~：
```
chiehhhhh-picoctf@webshell:/tmp$ fls -o 2048 dds2-alpine.flag.img 26417
```
然後會發現`home`裡沒東西，換`root`看看：
```
chiehhhhh-picoctf@webshell:/tmp$ fls -o 2048 dds2-alpine.flag.img 18290
```
然後在`root`裡看到有這個檔案：
```
r/r 18291:      down-at-the-bottom.txt
```
剛好是題目敘述要我們找的檔案，這個時候直接用`icat -o <offset> [file] <inode>`把`.txt`印出來就好：
```
chiehhhhh-picoctf@webshell:/tmp$ icat -o 2048 dds2-alpine.flag.img 18291
   _     _     _     _     _     _     _     _     _     _     _     _     _  
  / \   / \   / \   / \   / \   / \   / \   / \   / \   / \   / \   / \   / \ 
 ( p ) ( i ) ( c ) ( o ) ( C ) ( T ) ( F ) ( { ) ( f ) ( 0 ) ( r ) ( 3 ) ( n )
  \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/ 
   _     _     _     _     _     _     _     _     _     _     _     _     _  
  / \   / \   / \   / \   / \   / \   / \   / \   / \   / \   / \   / \   / \ 
 ( s ) ( 1 ) ( c ) ( 4 ) ( t ) ( 0 ) ( r ) ( _ ) ( n ) ( 0 ) ( v ) ( 1 ) ( c )
  \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/ 
   _     _     _     _     _     _     _     _     _     _     _  
  / \   / \   / \   / \   / \   / \   / \   / \   / \   / \   / \ 
 ( 3 ) ( _ ) ( 0 ) ( d ) ( 9 ) ( d ) ( 9 ) ( e ) ( c ) ( b ) ( } )
  \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/   \_/ 
```
~~可惡不能複製貼上~~

### Sleuthkit Apprentice - medium
https://play.picoctf.org/playlists/16?m=122

題目只給`.gz`檔其他什麼提示都沒講，雖然我記得好像是[https://primer.picoctf.org/#_disk_analysis](https://)
帶著讀者一步一步解的酷題目，不過這題蠻直覺的所以我們一樣能解。先用`wget`把`.gz`下載下來：
```
chiehhhhh-picoctf@webshell:/tmp$ wget https://artifacts.picoctf.net/c/136/disk.flag.img.gz
--2025-04-16 11:57:39--  https://artifacts.picoctf.net/c/136/disk.flag.img.gz
Resolving artifacts.picoctf.net (artifacts.picoctf.net)... 3.160.22.16, 3.160.22.43, 3.160.22.92, ...
Connecting to artifacts.picoctf.net (artifacts.picoctf.net)|3.160.22.16|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 47534571 (45M) [application/octet-stream]
Saving to: 'disk.flag.img.gz'

disk.flag.img.gz                          100%[====================================================================================>]  45.33M  1.82MB/s    in 25s     

2025-04-16 11:58:04 (1.82 MB/s) - 'disk.flag.img.gz' saved [47534571/47534571]
```
一樣是熟悉的`gunzip`解壓縮：
```
chiehhhhh-picoctf@webshell:/tmp$ gunzip disk.flag.img.gz
```
然後用mmls看一下分割表：
```
chiehhhhh-picoctf@webshell:/tmp$ mmls disk.flag.img
DOS Partition Table
Offset Sector: 0
Units are in 512-byte sectors

      Slot      Start        End          Length       Description
000:  Meta      0000000000   0000000000   0000000001   Primary Table (#0)
001:  -------   0000000000   0000002047   0000002048   Unallocated
002:  000:000   0000002048   0000206847   0000204800   Linux (0x83)
003:  000:001   0000206848   0000360447   0000153600   Linux Swap / Solaris x86 (0x82)
004:  000:002   0000360448   0000614399   0000253952   Linux (0x83)
```
可以看到有五個區域，一個主區`Primary Table (#0)`和四個分割區`Unallocated`、`Linux (0x83)`、`Linux Swap / Solaris x86 (0x82)`、`Linux (0x83)`，其中`Linux (0x83)`出現了兩次，我偏向先看`<offset>`大的，也就是004那一個分割區：
```
chiehhhhh-picoctf@webshell:/tmp$ fls -o 360448 disk.flag.img
```
然後就可以看到裡面有這些東西：
```
d/d 451:        home
d/d 11: lost+found
d/d 12: boot
d/d 1985:       etc
d/d 1986:       proc
d/d 1987:       dev
d/d 1988:       tmp
d/d 1989:       lib
d/d 1990:       var
d/d 3969:       usr
d/d 3970:       bin
d/d 1991:       sbin
d/d 1992:       media
d/d 1993:       mnt
d/d 1994:       opt
d/d 1995:       root
d/d 1996:       run
d/d 1997:       srv
d/d 1998:       sys
d/d 2358:       swap
V/V 31745:      $OrphanFiles
```
我一樣是先看`home`才看`root`：
```
chiehhhhh-picoctf@webshell:/tmp$ fls -o 360448 disk.flag.img 451
```
可惜的是`home`一樣沒東西，所以看`root`：
```
chiehhhhh-picoctf@webshell:/tmp$ fls -o 360448 disk.flag.img 1995
r/r 2363:       .ash_history
d/d 3981:       my_folder
```
這個時候看到`root`裡有一個directory`my_folder`，進去看一下有什麼：
```
chiehhhhh-picoctf@webshell:/tmp$ fls -o 360448 disk.flag.img 3981
```
看到裡面有以下兩個`.txt`：
```
chiehhhhh-picoctf@webshell:/tmp$ fls -o 360448 disk.flag.img 3981
r/r * 2082(realloc):    flag.txt
r/r 2371:       flag.uni.txt
```
但`flag.txt`有`＊`，代表這個檔案被刪除了而且inode被重新指派給其他檔案，所以只剩`flag.uni.txt`能用`icat`印出來：
```
chiehhhhh-picoctf@webshell:/tmp$ icat -o 360448 disk.flag.img 2371
picoCTF{by73_5urf3r_3497ae6b}
```
然後就拿到flag了
## Web Exploitation
### Unminify - easy
https://play.picoctf.org/practice/challenge/426?category=1&page=1
題目給了我們網頁，直接進去就好
進去會看到提示寫瀏覽器已經成功拿到flag了：
![截圖 2025-04-16 下午9.10.05](https://hackmd.io/_uploads/r1iN3XpAke.png)
所以直接`f12`看網頁原始碼：
![截圖 2025-04-16 下午9.25.15](https://hackmd.io/_uploads/Bk2pJ4aRJx.png)
很多picoCTF很難找，眼睛會痛，所以直接`ctrl`+`f`找字串：
![截圖 2025-04-16 下午9.20.07](https://hackmd.io/_uploads/SJPq0mpRJe.png)
已知字串格式是picoCTF{......}，直接輸入picoCTF就好：
![截圖 2025-04-16 下午9.22.01](https://hackmd.io/_uploads/rycbJ4aCkg.png)
然後把搜尋結果一筆一筆看就能找到flag了

### head-dump - easy
[https://play.picoctf.org/practice/challenge/476?category=1&page=1](https://)

題目提示我們flag在伺服器記憶體裡，我們先進去web裡：
![截圖 2025-04-18 下午2.15.00](https://hackmd.io/_uploads/HkDZCwkJlx.png)

有超連結的地方都點過一遍之後發現只有`#API documentation`會連到`/api-docs/`，進去之後簡單瀏覽一下會發現最底下有`/headdump`，點進去詳細查看：

![截圖 2025-04-18 下午2.13.07](https://hackmd.io/_uploads/HyWtTvykeg.png)

會發現給了`curl`的命令示範，直接把全部命令複製下來然後丟到shell裡：
```
chiehhhhh-picoctf@webshell:~$ curl -X 'GET' \
>   'http://verbal-sleep.picoctf.net:49282/heapdump' \
>   -H 'accept: */*' 
```
~~然後眼睛就被星爆了~~
所以我們用`grep`抓抓看：
```
chiehhhhh-picoctf@webshell:~$ curl -X 'GET' \
>   'http://verbal-sleep.picoctf.net:49282/heapdump' \
>   -H 'accept: */*' | grep pico
```
最後順利得到flag（直接放程式碼有點不好找所以附上圖片）：
![截圖 2025-04-18 下午2.27.23](https://hackmd.io/_uploads/HJt0edJJxl.png)

```
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 29 8769k   29 2607k    0     0   478k      0  0:00:18  0:00:05  0:00:13  522kpicoCTF{Pat!3nt_15_Th3_K3y_ad7ea5ae}
 72 8769k   72 6328k    0     0   849k      0  0:00:10  0:00:07  0:00:03 1516k"Welcome to the picoCTF News API documentation! This documentation provides a detailed overview of the available API endpoints for managing and retrieving news posts.",
"picoCTF News API",
"\nwindow.onload = function() {\n  // Build a system\n  var url = window.location.search.match(/url=([^&]+)/);\n  if (url && url.length > 1) {\n    url = decodeURIComponent(url[1]);\n  } else {\n    url = window.location.origin;\n  }\n  var options = {\n  \"swaggerDoc\": {\n    \"openapi\": \"3.0.0\",\n    \"info\": {\n      \"title\": \"picoCTF News API\",\n      \"version\": \"1.0.0\",\n      \"description\": \"Welcome to the picoCTF News API documentation! This documentation provides a detailed overview of the available API endpoints for managing and retrieving news posts.\"\n    },\n    \"paths\": {\n      \"/\": {\n        \"get\": {\n          \"tags\": [\n            \"Free\"\n          ],\n          \"summary\": \"Welcome page\",\n          \"responses\": {\n            \"200\": {\n              \"description\": \"Returns a welcome message.\"\n            }\n          }\n        }\n      },\n      \"/about\": {\n        \"get\": {\n          \"tags\": [\n            \"Free\"\n          ],\n          \"summary\": \"About Us\",\n          \"responses\": {\n            \"200\": {\n              \"desc",
 93 8769k   93 8195k    0     0   969k      0  0:00:09  0:00:08  0:00:01 1864k"verbal-sleep.picoctf.net:49282",
100 8769k  100 8769k    0     0  1000k      0  0:00:08  0:00:08 --:--:-- 1864k
```

## Binary Exploitation
## Cryptography
## Reverse Engineering
