CTF: Where Experts Play And Flags Fall | CTF Newbies

HackTheBox SRMIST
Publish Date: 2024-03-22

Capture The Flag (CTF) is a cybersecurity competition where participants solve the challenges of various categories to find the hidden “flag”. These flags are strings or code type that are strategically hidden inside the files, computer systems and networks.

Participants often works in teams, using their skills and knowledge to solve the challenge. Challenges may include tasks such as exploiting vulnerabilities in software, analyzing network traffic, deciphering encrypted messages, or reverse engineering software binaries.

There are two types of CTFs :-

1. Jeopardy-style CTF -

It is the most common format of CTF. The challenges are divided into categories, each representing different types of cybersecurity concepts and skill sets. These challenges are sub-categories as easy , medium and hard with different point ranges.

Categories that are there in Jeopardy-style CTFs are :-

  1. Cryptography — challenges are based on decrypting the encoded message and solving the cryptographic algorithm.

Type of challenges in crypto :-

  1. Cracking Classical Ciphers: These challenges often involve encrypted messages using well-known techniques like Caesar ciphers, Vigenere ciphers, or XOR. The key lies in recognizing the cipher type and using manual or automated methods to crack it.
  2. Exploiting Weak Implementations: CTFs might present scenarios where encryption algorithms are poorly implemented or use weak keys. Your job is to find these vulnerabilities and bypass the encryption to reveal the flag (the hidden message or data).
  3. Modern Crypto with a Twist: Challenges can involve modern encryption standards like AES or RSA, but with a twist. There might be hints about weaknesses in the configuration or key management, requiring you to think outside the box to exploit them.

2. Reverse Engineering — as the name suggests, reversing something that is already made, to learn its internals and working. It is the process of Analyzing and Understanding, A particular piece of code, software, electronics etc.

Challenges you will encounter :-

a. Disassembly and decompilation — The program you’re given will likely be obfuscated and difficult to read directly. Tools like IDA Pro or Ghidra will help you disassemble the code into assembly language, which is a low-level representation but still cryptic. Decompilers can try to turn assembly back into a higher-level language like C, but they might not always be perfect.

b. Understanding logic and control flow — You’ll need to analyze the assembly code to grasp how the program works. This involves tracing execution paths, identifying functions, and understanding conditional statements and loops.

3. Web Exploitation — finding the flag by finding and exploiting the vulnerabilities in web applications.

Common vulnerabilities :-

a. Injection Flaw — These vulnerabilities occur when user input is not properly sanitized before being used in database queries or system commands. This can allow attackers to inject malicious code (like SQL injection or command injection) to manipulate the application or steal data.

b. Broken Authentication — Challenges might involve weak login mechanisms, vulnerabilities in session management (like session hijacking), or lack of proper authorization checks. By exploiting these, you could potentially bypass logins or gain access to unauthorized areas.

c. cross-site scripting (XSS) — If the application allows users to inject malicious scripts into web pages, it might be vulnerable to XSS. This could allow attackers to steal user cookies, redirect users to malicious sites, or deface the website.

d. Hidden Functionalities — Sometimes, developers leave behind debug pages, test functionality, or hidden directories that contain sensitive information or functionalities useful for exploiting the application.

4. Forensics — analyzing and extracting hidden data from files, disk images or network traffic. typically involve analyzing digital artifacts or investigating simulated cybercrime scenarios to uncover hidden information, solve puzzles, or identify vulnerabilities. These challenges often require participants to utilize various forensic techniques, tools, and methodologies.

5. Binary Exploitation — Involves finding and exploiting vulnerabilities in compiled binary executables, typically written in languages like C or C++. Participants must analyze the binary, identify security flaws, and craft exploits to gain unauthorized access or control over the target system.

6. OSINT — Open Source Intelligence category typically involves challenges that require participants to gather information from publicly available sources on the internet to solve a given problem or find hidden flags.

7. Miscellaneous — challenges can encompass a wide range of topics, including steganography, programming, and logic puzzles.

2. Attack-defense style CTF —

It is another type of CTF where teams compete against each other in a shared network. In this CTF one team has to attack another team as well defending their own systems.

ENVIRONMENT —

Teams are provided with virtual machines that have vulnerabilities in them. With that machine they have to attack as well as defend it .

Teams are provided with tools and resources to launch attacks against the system of other teams. The goal is to exploit vulnerabilities, gain access and steal the flags.

Scoring is based on the successful attack and successful defense against other teams.

These competitions help participants develop practical skills in network defense, vulnerability analysis, exploit development, and incident response.

RESOURCES -

CONCLUSION -

Both types of CTFs enhance your skills in the field of cybersecurity. Solving challenges in jeopardy-based and exploiting machines in attack-defense based will give a brief knowledge on how things in cybersecurity work.

HAPPY HACKING :)

CONTRIBUTION —

Devansh Gupta


CTF: Where Experts Play And Flags Fall | CTF Newbies was originally published in InfoSec Write-ups on Medium, where people are continuing the conversation by highlighting and responding to this story.