PicoCTF - Easy Peasy Or Bad Questions
[TOC]
Challenge: logon🍰
Exploit - Set cookie

Challenge: where are the robots🍰
Exploit - robots.txt
Payload: https://jupiter.challenges.picoctf.org/problem/56830/robots.txt
Payload: https://jupiter.challenges.picoctf.org/problem/56830/1bb4c.html

Challenge: Packets Primer🍰
Exploit - search { string directly

Challenge: Disk, disk, sleuth!🍰
Exploit - Strings search
1 |
|
Challenge: Sleuthkit Apprentice🍰
Exploit - FTK Imager

Challenge: St3g0🍰
Exploit - zsteg

Challenge: The Numbers🍰
Exploit - Alphabetic Sequence
A $\to$ 1
B $\to$ 2
…
Z $\to$ 26
Flag: PICOCTF{THENUMBERSMASNO}
Challenge: b00tl3gRSA2🍰
Very similar to Dachshund Attacks
Exploit - Large e in RSA
:::spoiler Exploit Script
1 |
|
:::
Challenge: Sum-O-Primes🍰
Source Code
:::spoiler Source Code
1 |
|
:::
Exploit - Easy
題目給了$x=p+q$,而我們的目標是求出$(p-1)*(q-1)=pq-p-q+1=n-x+1$ :::spoiler Exploit Script
1 |
|
:::
Challenge: b00tl3gRSA3🍰
Recon
- Description: Why use p and q when I can use more?
- Hint: There’s more prime factors than p and q, finding d is going to be different. 和這題幾乎一樣
Exploit - Smooth Value
- 先用online tool
1
n = 9391862407×9430502773×10075292329×11026721677×11040417907×11226344687×11251922861×11323087873×11823788947×11956868381×11988198241×12275776127×12481146047×12665684987×12913613113×13994049331×14050490287×14654363873×15023405711×15220261411×15307561417×15368817697×15407160677×15542678147×15597563977×15670906213×15937323977×16033412617×16069849819×16364771063×16708525877×16824901871×16945613717×16989252559 - 寫Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14from Crypto.Util.number import bytes_to_long, long_to_bytes, inverse p_q_factor = [9391862407,9430502773,10075292329,11026721677,11040417907,11226344687,11251922861,11323087873,11823788947,11956868381,11988198241,12275776127,12481146047,12665684987,12913613113,13994049331,14050490287,14654363873,15023405711,15220261411,15307561417,15368817697,15407160677,15542678147,15597563977,15670906213,15937323977,16033412617,16069849819,16364771063,16708525877,16824901871,16945613717,16989252559] c = 205177004615238731351591289040361532005323127359264835947822740716983136768854567377695810379804519529001108024493036086993996665747898010286174708794831060625006137526368615944348139474971845237186225728575712792546002359378966044221352721991288514552994761886718307832529541998738515780841823857133357743562860987020334737036728017641876582542 n = 325639898609361998216675485356547029510334941438608718141166837901883899013721165219381706028192734268885029193084232593567285725019760847868933043664019031900580901169223676044511691181256188001312697240016796398130516789089663998776488278420247724141996094725183171258977283897111350310752334184134343620555307982038647996863698517917545473309 e = 65537 phi = 1 for i in range(len(p_q_factor)): phi = (p_q_factor[i] - 1) * phi d = inverse(e, phi) print(long_to_bytes(pow(c, d, n)))Flag:
b'picoCTF{too_many_fact0rs_8606199}'
Challenge: SOAP🍰
Exploit - The simplest XXE
Payload:
1 |
|
Challenge: picobrowser🍰
Exploit
才剛寫完Who are you?就覺得案情不單純,只要把header User-Agent變成picobrowser就可以了
Flag: picoCTF{p1c0_s3cr3t_ag3nt_84f9c865}
Challenge: Client-side-again🍰
Exploit - Reverse Script
一開始先recon一下,我用burp抓了一下packet,發現他是把密碼在local端做驗證,所以要做的就只是要有耐心的分析一下source code :::spoiler Source Code
1 |
|
:::
Flag: picoCTF{not_this_again_ef49bf}
Challenge: Forbidden Paths🍰
Description:
We know that the website files live in /usr/share/nginx/html/ and the flag is at /flag.txt but the website is filtering absolute file paths. Can you get past the filter to read the flag?
Exploit - Easy LFI

Payload: filename=../../../../flag.txt&read=
Flag: picoCTF{7h3_p47h_70_5ucc355_e5a6fcbc}
Challenge: keygenme🍰
Source
:::spoiler IDA Main Function
1 |
|
::: :::spoiler IDA Check Flag Function
1 |
|
:::
Exploit
直接動態跑到最後看memory就會知道key是picoCTF{br1ng_y0ur_0wn_k3y_19836cd8}

Challenge: basic-file-exploit
Background
Source Code
:::spoiler Source Code
1 |
|
:::
Recon
這一題感覺真的不像PWN題,比較像是reverse
- 注意讀取flag的地方是在
data_read()的地方,且entry要是零 我一開始的想法是往回推,所以要進到data_read()一開始的input就要選2,但會得到No data yet的結果,原因是input變數還是零(一開始的global variable有定義initia l value) - 所以現在必須要想如何才能改變input variable的變數,答案就是
data_write(),當寫入字串成功時會在這個function的最後給予一個entry,其實就是input++得來的,所以我們要做的事情就是 先寫任意的數值的database $\to$ 進入data_read()讀取entry 0的data
Exploit - Reverse Carefully
1 |
|
Challenge: buffer overflow 0🍰
Source Code
:::spoiler Source Code
1 |
|
:::
Recon
這一題比想像中簡單,算是給新手認識BoF的機會,可以看到source code中寫到只要觸發segmentation fault就會轉給sigsegv_handler這個function把flag印出來,而會遇到segmentation fault的地方就是第18行的strcpy function,只要給的input length大於buf2就會產生
Exploit - Simple BoF
1 |
|
實測需要輸入20個字元才會觸發
Challenge: clutter-overflow🍰
Recon
應該算是最簡單的BoF,可以用靜態或是動態的方式觀察offset有多少,然後把code的地方蓋成0xdeadbeef就可以拿到flag了
Exploit
1 |
|
Flag: picoCTF{c0ntr0ll3d_clutt3r_1n_my_buff3r}
Challenge: wine
Recon
這題很爛的原因是明明很簡單,但是用pwntools寫script卻沒辦法成功,但payload是一樣的,我有想過要用python -c的方式pipe out給server但一樣不成功,不知道為甚麼,看了其他人的WP也有提到一樣的問題,搞得我好亂啊啊啊啊啊啊啊!!!
(23/8/4)更新:打windows的題目要把new line改成\r\n,所以才會沒有成功
Exploit
:::spoiler
1 |
|
::: (23/8/4)更新:New Exploit
1 |
|
Flag: picoCTF{Un_v3rr3_d3_v1n_dcc38bed}
Challenge: Local Target🍰
Recon
這一題超簡單,不知道為啥超少人解,就只是蓋掉原本的num變成65而已
Exploit - Array Bound
1 |
|
Flag: picoCTF{l0c4l5_1n_5c0p3_fee8ef05}
Challenge: Picker IV🍰
Recon
這一題也是超簡單但是不知道為啥也很少人解,單純的return 2 series
1 |
|
Exploit - Ret2Funcntion
1 |
|
Flag: picoCTF{n3v3r_jump_t0_u53r_5uppl13d_4ddr35535_01672a61}
Challenge: Hurry up! Wait!🍰
Recon & Prepare
1 |
|
這一題唯一要注意的是可能會遇到
1 |
|
這個問題,所以只要安裝libgnat-7就可以了
1 |
|
安裝完之後先執行看看,發現沒有任何output或是其他提示,所以用ida看了一下會發現他在main->sub_298A()->ada__calendar__delays__delay_for(1000000000000000LL);有檔一個delay,預期只要跳過這個地方就可以完成後續的step
Exploit
1 |
|
這樣就可以拿到flag
Flag: picoCTF{d15a5m_ftw_87e5ab1}
Challenge: droid0
Recon & Prepare
這一題簡單到不可思議,難的地方是要想辦法把他run起來,不是指用android studio而是進入android studio之後,不確定是不是版本太舊或是其他原因他會一直噴錯,再加上是第一次使用這個工具,所以也不確定要看哪邊解決問題,所以如果有人遇到模擬器開不起來的狀況,可以看一下最右邊的notification,他會告訴你缺了甚麼,要不要安裝之類的簡單排除問題

Exploit
在emulator上隨便打一些字,然後click button,只要查看底下的log就會看到flag了

Flag: picoCTF{a.moose.once.bit.my.sister}
Challenge: WebNet1🍰
Exploit - Import TLS Key / String Seach
承接WebNet0,先import題目提供的private key解密中間所有的通訊,然後會看到中間有query一個網站,他提供了一張禿鷹的圖片,把圖片dump下來後直接string search就可以拿到flag
1 |
|
Flag: picoCTF{honey.roasted.peanuts}