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
Dùng tshark
trích xuất nó chỉ mình response
hoặ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)
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
flag: R3CTF{Eglise-Notre-Dame-de-Chine-Cyril-David}