CTF: QuickBox 2024 — Reverse pwn

Tools: Ghidra, pwntools, gdb

Step 1: Initial Setup

QuickBox 2024 Step 1

Step 2: Minimum Requirements

System Requirements

Check the minimum requirements for running Ubuntu on your PC.
If everything is fine, you will see green tick marks. You can also select to download updates and install third-party software. Then click Forward.


Step 3: Partitioning

You can choose either:

  • Erase disk – if you want Ubuntu to use the entire disk.
  • Specify partitions manually – if you want custom partitions.

Manual partitioning steps:

  1. Select free space and click Add.
  2. Create a primary partition (~70% of free space) with ext3 journaling file system, mount point /.
  3. Select free space again, create a /boot partition (~300MB, ext3).
  4. Create swap partition (~2× RAM size).
Partition Setup

Step 4: Installing Ubuntu

Click Install Now. Select your location and click Forward.

Installation Progress

Step 5: Keyboard Layout

Select your desired keyboard layout and click Forward.

Keyboard Layout

Step 6: User Details

Fill in your personal details:

  • Name
  • Computer name
  • Username
  • Password

Click Forward to let Ubuntu copy essential files.

User Details

Step 7: Login

After installation, restart your PC and remove the CD.
Ubuntu will display the login screen. Choose your user and enter your password.

Login Screen

Step 8: Essential Linux Commands

Some useful Linux commands:

  • ddrescue – data recovery tool
  • declare – declare variables and attributes
  • df – display free disk space
  • diff – compare files
  • dig – DNS lookup
  • echo – display message on screen
  • grep – search files
  • ls – list directory contents

For a complete list, see SS64 Linux Commands


Step 9: Shell Script Example

Experiment 2a: Shell script to check files

Algorithm:

  1. Check if at least one argument is provided.
  2. For each argument:
    • If it’s a directory → print “is directory”
    • If it’s a file → print “is file” and number of lines
    • Else → print “not a file or directory”

Script (4.sh):

#!/bin/bash

if [ $# -lt 1 ]; then
    echo "Enter at least one input file name"
else
    for i in "$@"; do
        if [ -d "$i" ]; then
            echo "$i is a directory"
        elif [ -f "$i" ]; then
            echo "$i is a file: $i"
            echo "No of lines: $(wc -l < "$i")"
        else
            echo "$i is not a file or directory"
        fi
    done
fi