../
By Huntress Capture The Flag: baseFFFF+1
baseFFFF+1
Author: @JohnHammond
Maybe you already know about base64, but what if we took it up a notch?
Download the files below.
Attachments: baseffff1
เจอข้อนี้ครั้งแรกบอกเลย #อิหยังน้อ มันคืออะไร google ค้นหา baseFFFF ก็ไม่เจออะไร จนถึงบางอ้อ FFFF = 65535 งั้น FFFF+1 = 65536 จนหาเจอ อ้อเป็นเช่นนี้เอง ก็สามารถ decode ได้ ที่นี่
หรือ
เขียนโปรแกรมเพื่อ decode จะใช้อะไรก็ได้ตามสะดวก javascript,python แต่กำลังหัด rust อยู่ใช้ rust ล่ะกัน
#สร้าง bin application
$ cargo new baseFFFFplus1
#เข้าไปยัง application folder
$ cd baseFFFFplus1
#เพิ่ม crate library base65536
$ cargo add base65536
เพิ่มโค้ดในไฟล์ src/main.rs
use std::fs;
use base65536::decode;
fn main() {
let contents = fs::read_to_string("./baseffff1")
.expect("Should have been able to read the file");
println!("Encode baseffff1: {}",contents);
let contents = decode(&contents,false);
let contents = String::from_utf8(contents.unwrap());
println!("Decode baseffff1: {}",contents.unwrap());
}
รันดูซิ
$ cargo run
Encode baseffff1: 鹎驣𔔠𓁯噫谠啥鹭鵧啴陨驶𒄠陬驹啤鹷鵴𓈠𒁯ꔠ𐙡啹院驳啳驨驲挮售𖠰筆筆鸠啳樶栵愵欠樵樳昫鸠啳樶栵嘶谠ꍥ啬𐙡𔕹𖥡唬驨驲鸠啳𒁹𓁵鬠陬潧㸍㸍ꍦ鱡汻欱靡驣洸鬰渰汢饣汣根騸饤杦样椶𠌸
Decode baseffff1: Nice work! We might have played with too many bases here... 0xFFFF is 65535, 65535+1 is 65536! Well anyway, here is your flag:
flag{716abce880f09b7cdc7938eddf273648}
ว้าวโลกนี้มี base65536 ด้วยนะจ๊ะ
flag{716abce880f09b7cdc7938eddf273648}