DEV Community

Peppa
Peppa

Posted on

CBJS: SSRF 6

Detail

  • Mục tiêu: Đọc nội dung file /etc/passwd của server hiện tại
  • Trong hàm file_get_content() có thể nhận trực tiếp absolute path

Image description

  • Nhưng nếu truyền trực tiếp absolute path thì không thể đi qua điều kiện là input phải thỏa mãn là url
    Image description

  • Ta có thể sử dụng file:// để cho absolute path nhìn giống 1 url, hàm file_get_content hỗ trợ giao thức này
    Image description

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

👋 Kindness is contagious

Please show some love ❤️ or share a kind word in the comments if you found this useful!

Got it!