458 words
2 minutes
[write-up] R3CTF 2025

Web#

Evalgelist#

$filtered = str_replace(['$', '(', ')', '`', '"', "'", "+", ":", "/", "!", "?"], '', $_GET['input']);
$cmd = $filtered . '();';

Về cơ bản thì chỉ dùng được các hàm không có tham số như phpinfo time những hàm cần tham số thì không có cách nào truyền được. Vì ; không bị cấm, nhiều câu lệnh có thể được viết và include, echo và các tình huống khác không yêu cầu dấu ngoặc cũng có thể được xem xét. Chúng ta có thể dùng include và cần có dấu / những hằng số khác có thể sử dụng trực tiếp. Để có được dấu / một số hàm có thể dùng để lấy các kí tự như PHP_BINARY hay PHP_MANNDIR bằng cách PHP_BINARY[số thứ tự của kí tự]

include PHP_MANDIR[0].flag; phpinfo

Nó sẽ thành

include "/flag"; phpinfo();

Forensics#

The R3 Pig Problem#

R3GIRL opened the resulting text, for the first time, a human being read a message from the r3kapig world. There was a warning repeated three times: “Do not answer! Do not answer!! Do not answer!!!” The message revealed a huge secret, and the fate of the entire human race was now tied to her fingers!

Thử thách cho ta 1 file pig.pcapng mở ra thấy rất nhiều luồng TCP và dấu thời gian của các luồng này có mẫu rất sát nhau từng gói tin

image

Dùng tshark trích xuất nó chỉ mình responsehoặc chỉ mình request và tính toán chênh lệch thời gian. Giá trị gần 0.02 được ghi là 0 và giá trị gần 0.1 được ghi là 1

tshark -r pig.pcapng -Y "tcp && ip.src == 192.168.0.24" -T fields -e frame.time_epoch > output.txt
def classify_time_diff(diff):
if abs(diff - 0.02) < abs(diff - 0.1):
return '0'
else:
return '1'
def process_file(filename):
with open(filename, 'r') as f:
lines = f.readlines()
result = []
i = 1
while i < len(lines) - 1:
current = float(lines[i + 1].strip())
previous = float(lines[i].strip())
diff = current - previous
bit = classify_time_diff(diff)
result.append(bit)
i += 1
return ''.join(result)
if __name__ == '__main__':
input_file = 'output.txt'
binary_string = process_file(input_file)
print(binary_string)

image

Mics#

R3GIRL in Paris#

While enjoying her vacation, R3GIRL wanders into a neighborhood and gets lost. But wait, she spots something familiar … Can you identify the name of the building and the artist(s) who created the graffiti seen in the photo? Flag format R3CTF{Place-Name-FirstnameN} Note: Please use the building’s original name, and preserve the original casing (uppercase/lowercase). Remove any accents from letters, and use hyphens to separate words. List only the first names of the artist(s), in the order they appear or are best known. If the place is Montmartre Museum (Musée de Montmartre), and the three artists’ first names are Alice, Bob, and Carol, then the flag is R3CTF{Musee-de-Montmartre-Alice-Bob-Carol}

Không khó để tìm được chỗ này

Screenshot 2025-07-07 225156-min

Thông tin 1

Thông tin 2

flag: R3CTF{Eglise-Notre-Dame-de-Chine-Cyril-David}
[write-up] R3CTF 2025
https://minlouiscyber.github.io/posts/r3ctf-2025/
Author
Lưu Tuấn Minh
Published at
2025-07-07
License
CC BY-NC-SA 4.0