NCS Competition 2021 Writeup
  • HHousen National Cyber Scholarship Competition 2021 Writeup
  • Forensics
    • FE02 - 100pts
    • FE03 - 100pts
    • FH01 - 500pts
    • FE04 - 100pts
    • FM01 - 250pts
    • FM02 - 250pts
    • FM03 - 250pts
    • FE01 - 100pts
  • Crypto
    • CM01 - 250pts
    • CM02 - 250pts
    • CX01 - 1000pts
    • CH01 - 500pts
    • CH02 - 500pts
  • Binary
    • BM01 - 250pts
    • BM02 - 250pts
    • BM03 - 250pts
    • BX01 - 1000pts
    • BX02 - 100pts
    • BE01 - 100pts
    • BE02 - 100pts
    • BH01 - 500pts
  • Networking
    • NM01 - 250pts
    • NE01 - 100pts
  • Web
    • WX01 - 1000pts
    • WE01 - 100pts
    • WE02 - 100pts
    • WH01 - 500pts
    • WH02 - 500pts
    • WM01 - 250pts
    • WM02 - 250pts
    • WM03 - 250pts
    • WM04 - 250pts
    • WM05 - 250pts
  • Challenge Name
Powered by GitBook
On this page
  • Briefing
  • Solution
  • Flag

Was this helpful?

Edit on Git
  1. Web

WM05 - 250pts

PreviousWM04 - 250ptsNextChallenge Name

Last updated 4 years ago

Was this helpful?

Briefing

Access the site at , then find and read the contents of the flag file, to get the flag.

Solution

  1. Note that using Burp Suite's repeater functionality makes editing and sending the requests for this challenge much easier.

  2. This is a challenge. 's page about Command Injection is very helpful here.

  3. Sending an &&ls command to list the current directory works and shows us that there is a file called lambda_function.py that likely contains the logic of the AWS lambda function. However, trying to use cat to display the file by running cat lambda_function.py doesn't work and instead returns Error: Invalid Character Detected.

  4. Assuming the script filters spaces we can use the "Bypass without space" section from 's page about Command Injection and format our command like so &&{cat,lambda_function.py}. This successfully leaks the server logic, which we saved to .

  5. Pass &&{ls,-a} as the path argument in the JSON request to print all files, including hidden files in the current directory. There is a folder called ....

  6. Use &&{ls,-a,...} to list the contents of the ... folder, which contains a file named .flag.txt.

  7. Run &&cat<.../.flag.txt to get the flag.

Flag

bh%3kx9j75%3k2*7!n

https://cfta-wm05.allyourbases.co
command injection
swisskyrepo/PayloadsAllTheThings
swisskyrepo/PayloadsAllTheThings
lambda_function.py