How to decrypt a file by using openssl – skuzzy

บทนำ (Overview)

บทความต่อไปนี้อธิบายวิธี การ decrypt ไฟล์ ที่ถูกเข้ารหัสโดยใช้อัลกลึมทึม AES

Setup the lab

  1. ดาวน์โหลด และติดตั้ง Skuzzy บน VirtualBoxVM https://www.vortex.id.au/ctf/Ew_Skuzzy.ova.tgz
    Download and install Skuzzy on VirtualBoxVM.
  1. ค้นหา IP เป้าหมาย โดยตัว VM คือ Ubantu
    Find the assigned IP.

Assess and Exploit the vulnerabilities

  1. ติดตามการเข้าถึงช่องโหว่ skuzzy ได้จากบทความ
    Pleases see more details of the skuzzy vulnerability from the article:

  2. เมื่อสามารถเข้าถึงไดเรกทอรีแล้วเราจะพบ 2 ไฟล์ อันแรก .enc ซึ่งเป็นไฟล์เข้ารหัสไว้ยังอ่านไม่ออก และ .eml ที่เป็นไฟล์อีเมล์ทดลองเข้าไปอ่านจะพบข้อมูลดังต่อไปนี้ (Flag 2)
    When successfully mount an image file, we also found 2 interesting files. The first one, .enc was encrypted file and next, .eml was an email file which we could be readable. Tried to open it by using cat command. We could discover the flag 2 here.

    cat ToAlice.eml
    

  3. จาก Mail ข้างต้นเราพยายามหาข้อมูลที่อาจเกี่ยวข้องกับการเปิดไฟล์ .enc และพบว่ามีคำบอกใบ้ดังนี้
    From the above e-mail, we could find the text could be implied to encryption technique as the followings:

    supercalifragilisticoespialidoso
    symmetric key crypto algorithm
    md sha256
    “those blocks chain together”  (cipher block chaining)
    
  4. เราสามารถ decrypted e-Mail โดยใช้คำสั่งดังนี้
    We could decrypt an e-mail by using commands:

    openssl enc -aes-256-cbc -d -md sha256 -in ToAlice.csv.enc -out ToAlice.csv
    supercalifragilisticoespialidoso
    

  5. ทดลองเปิดไฟล์ดังภาพ (Flag 3)
    Tried to open the decrypted file and we could discover the flag 3 in here.

ใส่ความเห็น