DEV Community

Peppa
Peppa

Posted on

CBJS: Path Traversal 3

Mục Tiêu

  • Chiếm quyền điều khiển server và đọc một tập tin bí mật ở thư mục gốc (đường dẫn /)

Attack

  • Website cho phép upload và đặt tên album

Image description

  • Nhấn download để read file

Image description

  • File sẽ được lưu trong thư mục document_root/upload/2_hex/album_name/file_name

Image description

  • Tên album không có bất kì filtering nào có thể dẫn đến path traversal

Image description

Khi upload file, php sẽ tự động bỏ đi ../ trong file name để tránh path traversal

Từ dữ liệu trên chỉ cần thay đổi album name thành ../../ giúp lùi về document_root sau đó upload file php -> có thể RCE

Image description

Image of Quadratic

Free AI chart generator

Upload data, describe your vision, and get Python-powered, AI-generated charts instantly.

Try Quadratic free

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay