一、babyre
这题直接写个魔改的rc4算法计算s_box的值得到smc加密的异或值,然后进行patch操作即可还原出真实的judge加密逻辑:
1 | s_box = [0x83,0x24,0x84,0xcf,0x6c,0x8f,0x35,0x80,0x62,0xe6,0x3b,0x0c,0xc4,0x7c,0xad,0x1b,0xbe,0xbc,0x75,0x01,0x91,0x56,0xf5,0xb8,0x03,0xc9,0xcd,0xa8,0x85,0x56,0xdc,0xbb,0x5a,0xd4,0x52,0x09,0xd5,0xeb,0x8b,0x3c,0x24,0xfa,0xda,0x42,0x68,0xb4,0xf9,0x42,0x8a,0xd0,0x13,0x52,0xe4,0x87,0xf3,0x09,0xc2,0xcd,0x7e,0x17,0x53,0x72,0xfc,0x1b,0x53,0x99,0x77,0x86,0x10,0x7b,0x61,0x44,0x94,0xc2,0x00,0x5d,0x18,0x00,0xa9,0xb0,0x38,0xc5,0x12,0x51,0x2d,0xd5,0xa4,0x5e,0x3b,0xae,0xba,0x74,0x17,0xfa,0xc0,0xb4,0xad,0x38,0xd2,0xa2,0xf4,0x0e,0x5e,0xf9,0x2a,0x27,0x23,0x80,0x28,0x86,0x46,0x80,0x04,0x7d,0xb9,0xb6,0xb5,0x42,0xe1,0x38,0x3c,0x99,0xb4,0x14,0xe3,0xb9,0x8e,0x29,0x2c,0x97,0x5c,0x07,0xb9,0xb1,0xda,0xf6,0x3d,0x60,0x43,0x49,0x67,0x04,0x32,0xb5,0x65,0x4e,0x7f,0xa4,0xd4,0xf5,0x29,0x49,0x2e,0x83,0x6a,0x93,0x99,0x10,0xf8,0x96,0xa9,0xdf,0x7d,0xb6,0x1a,0x75,0x7a,0xdc,0xb5,0xec,0xf4,0x64,0x8e,0x09,0xf3,0xef,0x69,0x04,0x48,0xf5,0x35,0x98,0x61,0x0f,0x9b,0xe9,0xb8,0x24,0x57,0xcd,0xac,0xe5,0x1e,0x63,0x7d,0x6e,0x08,0x98,0xf2,0x55,0x78,0x57,0x0c,0xf7,0xac,0x38,0x44,0xfb,0xb7,0x37,0x9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eb,0x6a,0xa8,0x19,0x81,0x90,0xc0,0x65,0x58,0x74,0xc1,0x1e,0x86,0x81,0x10,0xf3,0x99,0xb1,0x34,0x4c,0x5e,0x10,0xc9,0x92,0x7e,0x61,0x8e,0x9e,0xb4,0x12,0x7b,0x70,0xab,0x20,0xba,0xaf,0x4c,0xba,0x2c,0x67,0x87,0x98,0xe0,0x87,0x0f,0x8e,0x4e,0x12,0x85,0xb7,0x17,0x98,0x4b,0xa4,0x53,0x2e,0x4f,0xb2,0x44,0x5d,0xed,0xde,0x1d,0xd7,0x3e,0x79,0xca,0xd3,0x06,0xed,0xdb,0x82,0xf8,0x70,0x62,0xc8,0xdb,0x16,0xca,0xcd,0xee,0x7b,0x6a,0x95,0xcd,0xc3,0x9b,0x1c,0xa1,0x47,0xa7,0x79,0x7a,0x46,0x9f,0x85,0x89,0x74,0xf7,0x9c,0x86,0xd5,0xcf,0x57,0xfa,0xf7,0xe8,0x57,0xe7,0x2f,0xd9,0x6f,0x3c,0xca,0x13,0xd0,0xb6,0xa4,0xb9,0x9a,0xb4,0x25,0x87,0xeb,0xa2,0x3e,0xf0,0x12,0xe1,0x42,0x6e,0x2b,0x76,0x3e,0x24,0xbe,0xbd,0x03,0x5e,0xb6,0x61] |
二、计算aes加密的key
直接将密文拖进去程序内存,改1为0即可得到key
1 | key=“th1s1sth3n1c3k3y” |
三、对最后一步进行爆破,能得到30多组解,只有一组能解出正确的flag,反向进一步逆向那个迭代异或,从而得到aes加密的密文,进行2段aes解密出flag:
1 | # -*- coding: utf-8 -*- |
Comments