cscg24-for2

CSCG 2024 Challenge 'Intro Forensics 2'
git clone https://git.sinitax.com/sinitax/cscg24-for2
Log | Files | Refs | sfeed.txt

commit aa75093e0e43ece27948812c0cecf46894c846a2
Author: Louis Burda <quent.burda@gmail.com>
Date:   Mon,  1 Apr 2024 20:39:11 +0200

Add solution

Diffstat:
Achall/description | 1+
Achall/intro-forensics-2.zip | 0
Asolve/flag | 1+
Asolve/intro-forensics-2.pcapng | 0
Asolve/solve | 12++++++++++++
5 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/chall/description b/chall/description @@ -0,0 +1 @@ +We were able to capture a hidden service. Could you recover the secret order? diff --git a/chall/intro-forensics-2.zip b/chall/intro-forensics-2.zip Binary files differ. diff --git a/solve/flag b/solve/flag @@ -0,0 +1 @@ +CSCG{kn0cking_on_heavens_d000r} diff --git a/solve/intro-forensics-2.pcapng b/solve/intro-forensics-2.pcapng Binary files differ. diff --git a/solve/solve b/solve/solve @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +from base64 import b64decode +import subprocess +import requests +import re + +packet_filter = "ip.src_host == 192.168.178.21 && ip.dst_host == 45.142.177.160 && tcp.flags.syn == 1" +cmd = f"tshark -nr intro-forensics-2.pcapng -Y '{packet_filter}' -T fields -e tcp.dstport" +ports = subprocess.check_output(cmd, shell=True).decode().split("\n") +ports = b"".join([int.to_bytes(int(p), 2, "big") for p in ports if p.strip() != ""]) +print(ports.decode())