学逆向论坛

找回密码
立即注册

只需一步,快速开始

发新帖

1378

积分

4

好友

24

主题
发表于 2020-3-9 13:46:23 | 查看: 3691| 回复: 2

相关题目:


[md]打开程序提示“由于找不到cygwin1.dl,无法继续执行代码。重新安装程序可能会解决此问题”

百度一下cygwin,发现是一个win下的命令行执行工具

下载安装该工具后运行此程序提示输入Authorize:

用IDA打开搜索字符串找到Authorize相关函数处,发现是一个简单运算比较,爆破即可

```
a=[17,8,6,10,15,20,42,59,47,3,47,4,16,72,62,0,7,16]
b=list("Rising_Hopper!")
for x in range(18):
    for i in range(0x20,0xff):
        if(a[x]==~(i & ord(b[x%14])) & (i | ord(b[x % 14]))):
            print(chr(i),end='')
            break
#Caucasus@s_ability
```

输入后又提示输入flag,但是没有找到相关运算,后来在sub_100401A6C函数中发现程序利用Authorize异或加密了一段16进制,于是写脚本提取

```python
b=[0x16, 0x29, 0xF4, 0x8F, 0x91, 0x72, 0x75, 0x73, 0x08, 0xFE,
  0xF3, 0x45, 0xE2, 0x69, 0x6C, 0x69, 0xB3, 0xFC, 0xD3, 0x61,
  0x75, 0x63, 0x13, 0xD1, 0x6B, 0x73, 0x87, 0xF6, 0xCB, 0x61,
  0x62, 0x69, 0xA8, 0x06, 0x54, 0x79, 0x84, 0xE4, 0xED, 0x63,
  0x61, 0x73, 0x76, 0x51, 0x5D, 0x73, 0x98, 0xE4, 0xFE, 0x69,
  0x6C, 0x69, 0x21, 0x96, 0x5D, 0x61, 0xB2, 0xE6, 0xC1, 0x73,
  0x75, 0x73, 0x51, 0x82, 0x7B, 0x61, 0xA5, 0xEC, 0xC8, 0x69,
  0x74, 0x79, 0x3F, 0x5B, 0x6C, 0x63, 0xA6, 0xF6, 0xDD, 0x73,
  0x40, 0x73, 0x67, 0x5D, 0x7D, 0x69, 0xAB, 0xEC, 0xD8, 0x79,
  0x43, 0x61, 0x18, 0x35, 0x40, 0x73, 0xB2, 0xF6, 0xF0, 0x73,
  0x5F, 0x61, 0xDD, 0x4A, 0x4F, 0x69, 0xB3, 0xFC, 0xF7, 0x61,
  0x75, 0x63, 0x98, 0xFA, 0x57, 0x73, 0x87, 0xF6, 0xE7, 0x61,
  0x62, 0x69, 0x6F, 0x4B, 0x69, 0x79, 0x84, 0xE4, 0xC9, 0x63,
  0x61, 0x73, 0xFF, 0x7A, 0x61, 0x73, 0x98, 0xE4, 0xA2, 0x69,
  0x6C, 0x69, 0xD8, 0x71, 0x5D, 0x61, 0xB2, 0xE6, 0xA5, 0x73,
  0x75, 0x73, 0x56, 0x4E, 0x7D, 0x61, 0xA5, 0xEC, 0xA4, 0x69,
  0x74, 0x79, 0x58, 0xE8, 0x6A, 0x63, 0xA6, 0xF6, 0xB9, 0x73,
  0x40, 0x73, 0xFD, 0x11, 0x41, 0x69, 0xAB, 0xEC, 0xA4, 0x79,
  0x43, 0x61, 0xFA, 0x36, 0x7F, 0x73, 0xB2, 0xF6, 0x94, 0x73,
  0x5F, 0x61, 0x74, 0x54, 0x4E, 0x69, 0xB3, 0xFC, 0x9B, 0x61,
  0x75, 0x63, 0x5C, 0xFB, 0x69, 0x73, 0x87, 0xF6, 0x83, 0x61,
  0x62, 0x69, 0x77, 0xE0, 0x6B, 0x79, 0x84, 0xE4, 0x95, 0x63,
  0x61, 0x73, 0x8C, 0xFA, 0x62, 0x73, 0x98, 0xE4, 0x86, 0x69,
  0x6C, 0x69, 0x49, 0xF1, 0x5F, 0x61, 0xB2, 0xE6, 0x89, 0x73,
  0x75, 0x73, 0x33, 0xC4, 0x51, 0x61, 0xA5, 0xEC, 0x80, 0x69,
  0x74, 0x79, 0xD3, 0x0B, 0x7B, 0x63, 0xA6, 0xF6, 0x85, 0x73,
  0x40, 0x73, 0xCF, 0x0B, 0x6C, 0x69, 0xAB, 0xEC, 0x80, 0x79,
  0x43, 0x61, 0xE5, 0x09, 0x6F, 0x73, 0xB2, 0xF6, 0xB8, 0x73,
  0x5F, 0x61, 0xAD, 0x75, 0x67, 0x69, 0xB3, 0xFC, 0xBF, 0x61,
  0x75, 0x63, 0x5C, 0xFB, 0x69, 0x73, 0x87, 0xF6, 0x5F, 0x60,
  0x62, 0x69, 0x95, 0xE0, 0x56, 0x79, 0x84, 0xE4, 0x71, 0x62,
  0x61, 0x73, 0xA9, 0xA5, 0x62, 0x73, 0x98, 0xE4, 0x6A, 0x68,
  0x6C, 0x69, 0x62, 0x44, 0x61, 0x61, 0xB2, 0xE6, 0x6D, 0x72,
  0x75, 0x73, 0x2D, 0x25, 0x7E, 0x61, 0xA5, 0xEC, 0x7C, 0x68,
  0x74, 0x79, 0xC9, 0x68, 0x54, 0x63, 0xA6, 0xF6, 0x61, 0x72,
  0x40, 0x73, 0x0A, 0x8E, 0x7C, 0x69, 0xAB, 0xEC, 0x6C, 0x78,
  0x43, 0x61, 0xFA, 0x36, 0x7F, 0x73, 0xB2, 0xF6, 0x5C, 0x72,
  0x5F, 0x61, 0x74, 0x54, 0x4E, 0x69, 0xB3, 0xFC, 0x63, 0x60,
  0x75, 0x63, 0x5C, 0xFB, 0x69, 0x73, 0x87, 0xF6, 0x7B, 0x60,
  0x62, 0x69, 0xB0, 0xBF, 0x56, 0x79, 0x84, 0xE4, 0x5D, 0x62,
  0x61, 0x73, 0x4D, 0x4F, 0x5F, 0x73, 0x98, 0xE4, 0x4E, 0x68,
  0x6C, 0x69, 0x77, 0x5B, 0x5E, 0x61, 0xB2, 0xE6, 0x51, 0x72,
  0x75, 0x73, 0xCA, 0x7A, 0x7E, 0x61, 0xA5, 0xEC, 0x58, 0x68,
  0x74, 0x79, 0x7E, 0xE9, 0x69, 0x63, 0xA6, 0xF6, 0x4D, 0x72,
  0x40, 0x73, 0x71, 0xC5, 0x46, 0x69, 0xAB, 0xEC, 0x48, 0x78,
  0x43, 0x61, 0xFA, 0x36, 0x7F, 0x73, 0xB2, 0xF6, 0x00, 0x72,
  0x5F, 0x61, 0x74, 0x54, 0x4E, 0x69, 0xB3, 0xFC, 0x07, 0x60,
  0x75, 0x63, 0x0C, 0x25, 0x54, 0x73, 0x87, 0xF6, 0x17, 0x60,
  0x62, 0x69, 0x8B, 0xEA, 0x79, 0x79, 0x84, 0xE4, 0x39, 0x62,
  0x61, 0x73, 0x18, 0x25, 0x61, 0x73, 0x98, 0xE4, 0x32, 0x68,
  0x6C, 0x69, 0xFE, 0x70, 0x62, 0x61, 0xB2, 0xE6, 0x35, 0x72,
  0x75, 0x73, 0xCF, 0x26, 0x41, 0x61, 0xA5, 0xEC, 0x34, 0x68,
  0x74, 0x79, 0x94, 0xEB, 0x50, 0x63, 0x29, 0xCB, 0x3C, 0x1D,
  0x30, 0x06, 0x2B, 0x41, 0x16, 0x01, 0x24, 0xD3, 0x11, 0x59,
  0x25, 0x0D, 0x14, 0x04, 0x41, 0x07, 0x3D, 0xFA, 0x05, 0x23,
  0x17, 0xE8, 0x37, 0x31, 0x24, 0xD1, 0x1B, 0x59, 0x2B, 0x08,
  0x1F, 0x02, 0x02, 0x18, 0x3D, 0xC9, 0x60, 0x07, 0x37, 0x04,
  0x42, 0x08, 0x0E, 0x00, 0x3C, 0xF0, 0x06, 0x01, 0x3D, 0xEA,
  0x34, 0x1B, 0x3D, 0xCB, 0x2C, 0x1A, 0x2B, 0x18, 0x42, 0x06,
  0x0A, 0x49, 0x3C, 0xC3, 0x0B, 0x08, 0x11, 0x06, 0x0F, 0x53,
  0x3C, 0x1D, 0x08, 0xFA, 0x1A, 0x11, 0x2A, 0xE0, 0x39, 0x11,
  0x3C, 0xC1, 0x37, 0x04, 0x19, 0x0F, 0x08, 0x14, 0x10, 0x1D,
  0x08, 0xFA, 0xDA, 0xE1, 0x62, 0x69, 0x6C, 0xAE, 0xF1, 0xF1,
  0x43, 0x61, 0x75, 0x00, 0x04, 0x49, 0x75, 0x3B, 0xF8, 0x23,
  0x2D, 0x0E, 0x05, 0x1B, 0x05, 0x1A, 0x11, 0x31, 0xF9, 0x41,
  0x3E, 0x06, 0x18, 0x53, 0x16, 0x1C, 0x2E, 0x3B, 0xD6, 0x24,
  0x42, 0x21, 0xE5, 0x3C, 0x5C, 0x31, 0xFB, 0x07, 0x1C, 0x11,
  0x0C, 0x16, 0x11, 0x5D, 0x60, 0x3B, 0xE5, 0x33, 0x07, 0x08,
  0x08, 0x10, 0x54, 0x0D, 0x2C, 0x29, 0xFC, 0x26, 0x51, 0x3B,
  0xFC, 0x26, 0x78, 0x3B, 0xE7, 0x41, 0x00, 0x1B, 0x09, 0x08,
  0x1F, 0x57, 0x49, 0x29, 0xFC, 0x26, 0x21, 0xB5, 0x30, 0x3B,
  0x40, 0x3B, 0xE7, 0x2B, 0x03, 0x0A, 0x07, 0x00, 0x1A, 0x1E,
  0x63, 0x29, 0xCF, 0x21, 0x13, 0x16, 0x14, 0x18, 0x61, 0x53,
  0x05, 0x29, 0xEB, 0x2C, 0x6C, 0x21, 0xFD, 0x2C, 0x4B, 0x29,
  0xCD, 0x02, 0x08, 0x12, 0x55, 0x36, 0x2E, 0x07, 0x3A, 0x29,
  0xD8, 0x1B, 0x1C, 0x1B, 0x1D, 0x0A, 0x26, 0x4F, 0x75, 0x2B,
  0xE8, 0x36, 0x65, 0x3B, 0xC9, 0x26, 0x47, 0xA6, 0x27, 0x92,
  0x49, 0x5C, 0x4D, 0x0A, 0x85, 0x24, 0x8A, 0x63, 0x07, 0xB4,
  0x30, 0x8B, 0x65, 0x00, 0x99, 0x24, 0x98, 0x69, 0x24, 0xD1,
  0x3A, 0x16, 0x37, 0x41, 0x03, 0x06, 0x13, 0x1A, 0x3D, 0xFA,
  0x05, 0x99, 0x98, 0x24, 0x90, 0x0F, 0x05, 0x0C, 0x10, 0x1F,
  0x84, 0x24, 0x83, 0x42, 0x61, 0xB4, 0xF0, 0x1B, 0x41, 0x73,
  0x5F, 0x6A, 0x62, 0x69, 0xEC, 0x21, 0xF9, 0x3C, 0x13, 0x29,
  0xFC, 0xA2, 0x89, 0x6D, 0x77, 0x73, 0x40, 0x3B, 0xD2, 0x34,
  0xC2, 0x21, 0xE1, 0x2C, 0x8F, 0x31, 0xCA, 0xA0, 0x9D, 0x5D,
  0x63, 0x73, 0x75, 0x3B, 0xCD, 0x36, 0x7F, 0x29, 0xEB, 0xA8,
  0x84, 0x6B, 0x76, 0x79, 0x43, 0x29, 0xF8, 0x26, 0xC1, 0x3B,
  0xFC, 0xB2, 0xA8, 0x45, 0x5D, 0x61, 0x62, 0x21, 0xEF, 0x91,
  0x47, 0x0D, 0x55, 0x29, 0xF8, 0x26, 0x8B, 0x3B, 0xFC, 0xB2,
  0xA8, 0x97, 0x5E, 0x61, 0x62, 0xD0, 0x6C, 0x69, 0x74, 0x79,
  0xAB, 0xDB, 0x74, 0x63, 0x61, 0xB4, 0xF0, 0x17, 0x41, 0x73,
  0x5F, 0x82, 0x2E, 0x69, 0x6C, 0xAE, 0xF1, 0x15, 0x42, 0x61,
  0x75, 0x63, 0x61, 0x73, 0x75, 0x98, 0x18, 0xF8, 0xDA, 0x0D,
  0x63, 0x69, 0x6C, 0x66, 0xC2, 0x3D, 0x46, 0xC1, 0x7A, 0xD5,
  0xA1, 0x7C, 0xDA, 0xF6, 0x24, 0x72, 0x5F, 0x61, 0xD8, 0x69,
  0x6C, 0x69, 0x74, 0x8E, 0xF6, 0x09, 0x74, 0x63, 0x61, 0xFA,
  0xE0, 0x13, 0x41, 0x73, 0x5F, 0xEA, 0xE7, 0x05, 0x6D, 0x69,
  0x74, 0xF2, 0xC7, 0xE4, 0xE5, 0x63, 0x61, 0x73, 0x4C, 0xF6,
  0x20, 0x72, 0x5F, 0x61, 0x16, 0x7F, 0x24, 0xE4, 0x31, 0x93,
  0x0B, 0xE8, 0xB4, 0x8B, 0x1C, 0x72, 0x75, 0x73, 0xF9, 0x73,
  0x5F, 0x61, 0x62, 0x81, 0x3F, 0x68, 0x74, 0x79, 0xC0, 0xE4,
  0x19, 0x62, 0x61, 0x73, 0x74, 0xF0, 0xFD, 0x1F, 0x5E, 0x61,
  0x62, 0x5B, 0x1A, 0xF6, 0x3C, 0xF0, 0xAB, 0x29, 0xFC, 0xA2,
  0x89, 0x2B, 0x74, 0x73, 0x40, 0x9B, 0x1C, 0x60, 0x62, 0x69,
  0x84, 0x57, 0x75, 0x79, 0x43, 0x90, 0x48, 0x81, 0xC4, 0xF0,
  0x01]
str=list("Caucasus@s_ability")
for i in range(1045):
    b^=ord(str[i%18])
with open("dec","wb") as f:
   f.write(bytes(b))
```

提取后用IDA打开,按C键分析读汇编代码,发现程序取最开始的一堆mov的数据和0x4CE3做除法运算后和输入进行比较

```python
a=[2007666, 2125764, 1909251, 2027349, 2421009, 1653372, 2047032, 2184813, 2302911, 2263545, 1909251, 2165130, 1968300, 2243862, 2066715, 2322594, 1987983, 2243862, 1869885, 2066715, 2263545, 1869885, 964467, 944784, 944784, 944784, 728271, 1869885, 2263545, 2283228, 2243862, 2184813, 2165130, 2027349, 1987983, 2243862, 1869885, 2283228, 2047032, 1909251, 2165130, 1869885, 2401326, 1987983, 2243862, 2184813, 885735, 2184813, 2165130, 1987983, 2460375]
for i in a:
    print(chr(i//0x4CE3),end='')
```

写脚本得flag{Thousandriver_is_1000%_stronger_than_zero-one}[/md]
游客,如果您要查看本帖隐藏内容请回复
温馨提示:
1.如果您喜欢这篇帖子,请给作者点赞评分,点赞会增加帖子的热度,评分会给作者加学币。(评分不会扣掉您的积分,系统每天都会重置您的评分额度)。
2.回复帖子不仅是对作者的认可,还可以获得学币奖励,请尊重他人的劳动成果,拒绝做伸手党!
3.发广告、灌水回复等违规行为一经发现直接禁言,如果本帖内容涉嫌违规,请点击论坛底部的举报反馈按钮,也可以在【投诉建议】板块发帖举报。
发表于 2020-3-9 15:03:20
这个格式感觉不太对
发表于 2020-3-9 15:04:24
xuenixiang 发表于 2020-3-9 15:03
这个格式感觉不太对

好了,没问题了,我浏览器有问题

小黑屋|手机版|站务邮箱|学逆向论坛 ( 粤ICP备2021023307号 )|网站地图

GMT+8, 2024-11-23 00:05 , Processed in 0.146651 second(s), 48 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表