ZYuC
    • 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

      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.
      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
    • 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 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

    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.
    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
    # CTF [![hackmd-github-sync-badge](https://hackmd.io/R5cRa6t1R8SZCj0Vtf_Fng/badge)](https://hackmd.io/R5cRa6t1R8SZCj0Vtf_Fng) ###### tags: `Information Security` > 參考資料: https://ithelp.ithome.com.tw/m/articles/10265748 --- [TOC] --- ## 「億」些指令 | 命令 | 說明 | 用法 | | ---- | ------------ | ------------ | | cat | 查看檔案內容 | cat `檔案名` | | wget | 下載檔案 | wget `網址` | | \-\-help | 查看命令使用說明 | `命令` --help | | grep | 在檔案中尋找符合條件的關鍵字或正規表示法 | grep `關鍵字` `檔案名` | | unzip | 解壓縮 | unzip '檔案名' | | nc(netcat) | 讓你直接連接一個遠方主機,它向你送訊息、你也向它送訊息,這樣一個溝通工具 | 超級無敵多用法 | | man | 查詢指令用法 | man `指令` | --- ## picoCTF例題 ### Obedient Cat **Description** This file has a flag in plain sight (aka "in-the-clear"). [Download flag](https://mercury.picoctf.net/static/a5683698ac318b47bd060cb786859f23/flag)). #### 解法 ![](https://i.imgur.com/yfijhGN.png) --- ### Python Wrangling **Description** Python scripts are invoked kind of like programs in the Terminal... Can you run [this Python script](https://mercury.picoctf.net/static/2ac2139344d2e734d5d638ac928f1a8d/ende.py) using [this password](https://mercury.picoctf.net/static/2ac2139344d2e734d5d638ac928f1a8d/pw.txt) to get [the flag](https://mercury.picoctf.net/static/2ac2139344d2e734d5d638ac928f1a8d/flag.txt.en)? #### 解法 **step1.** ![](https://i.imgur.com/daCim1T.png) cat `flag.txt.en`和`pw.txt`。 **step2.** ![](https://i.imgur.com/ILlYzOv.png) 執行`ende.py`, `Usage: ende.py (-e/-d) [file]`表示需要輸入一個檔案,參數選項 -e, -d,基本上就是encode和decode。 接著按照提示輸入指令`python3 ende.py -d flag.txt.en`(記得一定要python3!只打python不給過:D),會跑出`Please enter the password:`,此時輸入剛剛cat pw.txt的內容,就會跑出flag了。 --- ### Wave a flag **Description** Can you invoke help flags for a tool or binary? [This program](https://mercury.picoctf.net/static/fc1d77192c544314efece5dd309092e3/warm) has extraordinarily helpful information... #### 解法 **step1.** `wget`後,檔案為`warm` **step2.** ![](https://i.imgur.com/8BfJazh.png) 無法執行(權限不足) **step3.** ![](https://i.imgur.com/GKOd9E7.png) 輸入`chmod +x ./warm`,幫`warm`加上執行權限 (此處注意是`./warm`而非`warm`,`./warm` 代表「目前目錄下的`warm`檔案」) **step4.** ![](https://i.imgur.com/eqiVBQ6.png) 執行`warm`後,出現提示字! 按照提示,使用`-h`查詢`warm`的說明 **step5.** ![](https://i.imgur.com/m9gTbGM.png) 輸入`./warm -h`,即出現flag! --- ### Nice netcat... **Description** There is a nice program that you can talk to by using this command in a shell: `$ nc mercury.picoctf.net 49039`, but it doesn't speak English... #### 解法 **step1.** ![](https://i.imgur.com/KlTOIX2.png) 按照題目輸入`$ nc mercury.picoctf.net 49039`後,出現一大串數字 step2. ![](https://i.imgur.com/atDUKEd.png) 將其丟到十進制轉ASCII,轉換結果為flag --- ### Static ain't always noise **Description** Can you look at the data in this binary: [static](https://mercury.picoctf.net/static/e9dd71b5d11023873b8abe99cdb45551/static)? This [BASH script](https://mercury.picoctf.net/static/e9dd71b5d11023873b8abe99cdb45551/ltdis.sh) might help! #### 解法 **step1.** ![](https://i.imgur.com/OZtKBnh.png) 執行兩個下載下來的檔案,其中輸入`./ltdis.sh`時,輸出寫到`disassembly`(反組譯),它會將執行檔的二進位檔案內容,轉換成對應組合語言。 > wiki: 反組譯器(disassembler)是一種將機器語言轉換為組合語言的電腦程式——這與組譯器的目的相反。反組譯器與反編譯器不同,反編譯器的目標是高階語言而非組合語言。反組譯器的反組譯輸出通常格式化為適合人類閱讀,而非用作組譯器的輸入源,因此它主要是一個逆向工程工具。 **step2.** ![](https://i.imgur.com/jS5lIeg.png) 再來,看到執行`ltdis.sh`出現的`ltdis.sh <program-file>`,因此輸入`./ltdis.sh ./static`。 出現`Any strings found in ./static have been written to ./static.ltdis.strings.txt with file offset`,代表flag在`static.ltdis.strings.txt`裡。 **step3.** ![](https://i.imgur.com/CTRK9Nh.png) 接著,因為要找到在`static.ltdis.strings.txt`的flag,所以輸入`grep 'picoCTF' ./static.ltdis.strings.txt`(表示要在`static.ltdis.strings.txt`裡找到`picoCTF`關鍵字)。最終找到flag。 --- ### Tab, Tab, Attack **Description** Using tabcomplete in the Terminal will add years to your life, esp. when dealing with long rambling directory structures and filenames: [Addadshashanammu.zip](https://mercury.picoctf.net/static/a350754a299cb58988d6d47aed5be3ba/Addadshashanammu.zip) #### 解法 **step1.** ![](https://i.imgur.com/tjF6l2i.png) 先解壓縮檔案。 解壓縮出來的檔案路徑檔名很長,目錄也很多層。 **step2.** ![](https://i.imgur.com/p870x8k.png) 先進去`Addadshashanammu`資料夾之後,打`./`後爆按Tab,shell自動幫你補上所有路徑,最後到達`fang-of-haynekhtnamet`這個檔案,接著按Enter執行,即跑出flag。 --- ### what's a net cat? **Description** Using netcat (nc) is going to be pretty important. Can you connect to jupiter.challenges.picoctf.org at port 25103 to get the flag? #### 解法 ![](https://i.imgur.com/1P47gKd.png) 輸入`netcat(or nc) jupiter.challenges.picoctf.org 25103`即可。 --- ### strings it **Description** Can you find the flag in [file](https://jupiter.challenges.picoctf.org/static/94d00153b0057d37da225ee79a846c62/strings) without running it? #### 解法 **step1.** ![](https://i.imgur.com/Sv0qVbN.png) ![](https://i.imgur.com/JmRBlML.png) 題目提示你要用`strings`指令,那就先查查看`strings`要怎麼用。 輸入`man strings`查看用法,按`q`離開。 **step2.** ![](https://i.imgur.com/i9P7bb3.png) 輸入`strings strings`(`指令` `檔名`)後,跑出來一大串東西。 **step3.** ![](https://i.imgur.com/FiGy9cX.png) 此時使用大絕招`strings strings | grep "pico"`**(grep)**,成功找到flag。 --- ###

    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

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    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