MCPcopy Create free account
hub / github.com/F12FLASH/CTF / MemStorage

Class MemStorage

4.Stackless Stack/server/storage.ts:31–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31export class MemStorage implements IStorage {
32 private challenges: Map<string, Challenge>;
33 private hints: Map<string, Hint>;
34 private submissions: Map<string, Submission>;
35 private writeupSections: Map<string, WriteupSection>;
36 private unlockedHints: Map<string, Set<string>>;
37
38 constructor() {
39 this.challenges = new Map();
40 this.hints = new Map();
41 this.submissions = new Map();
42 this.writeupSections = new Map();
43 this.unlockedHints = new Map();
44
45 this.seedData();
46 }
47
48 private seedData() {
49 const stacklessStackId = "stackless-stack";
50
51 const challenge: Challenge = {
52 id: stacklessStackId,
53 title: "Stackless Stack",
54 description: `Binary x86-64 không có stack (dùng mmap + syscall để thay thế).
55
56Lỗi buffer overflow nhưng không có ret.
57
58Bạn cần khai thác lỗ hổng này để lấy flag. Challenge này yêu cầu kiến thức sâu về ROP chain và kỹ thuật exploitation nâng cao.
59
60Điểm đặc biệt: Binary này không sử dụng stack truyền thống, thay vào đó dùng mmap để cấp phát vùng nhớ và syscall để thực thi. Điều này tạo ra một môi trường exploitation hoàn toàn khác biệt so với các binary thông thường.`,
61 category: "pwn",
62 difficulty: "master hacker",
63 points: 500,
64 flag: "VNFLAG{HUNG_VUONG_TO_QUOC_GIUP_NHAN_SI_VIETNAM_8R3b1K7p4M9q2L6z0F5yXc}",
65 author: "F12FLASH",
66 solves: 0,
67 };
68
69 this.challenges.set(stacklessStackId, challenge);
70
71 const hints: InsertHint[] = [
72 {
73 challengeId: stacklessStackId,
74 order: 1,
75 content: "Phân tích binary với 'nm' hoặc 'objdump' để tìm địa chỉ các hàm quan trọng. Đặc biệt chú ý đến hàm win_function tại 0x401390 và cấu trúc memory_region_t.",
76 pointsCost: 50,
77 },
78 {
79 challengeId: stacklessStackId,
80 order: 2,
81 content: "Cấu trúc memory_region_t có: data[256 bytes] + callback pointer[8 bytes] + magic[8 bytes]. Overflow buffer để ghi đè callback pointer tại offset 256.",
82 pointsCost: 100,
83 },
84 {
85 challengeId: stacklessStackId,
86 order: 3,
87 content: "Ghi đè callback pointer với địa chỉ win_function (0x401390) và giữ magic value = 0xdeadbeef. Binary sẽ tự động gọi win_function khi kiểm tra magic value.",
88 pointsCost: 150,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected