[BJDCTF 2020]Easy

文章讲述了作者使用IDA进行代码逆向分析,发现que函数中负责字符输出,没有外部调用。作者随后直接修改代码,初始化时调用que函数,展示了在IT技术中的调试和代码动态修改过程。

运行之后是这个东西

我们直接IDA暴力打开

结果main函数啥也不是

(看其他人的wp知道了照que函数)

我也不知道咋找的,可能真要硬找吧

int ques()
{
  int v0; // edx
  int result; // eax
  int v2[50]; // [esp+20h] [ebp-128h] BYREF
  int v3; // [esp+E8h] [ebp-60h]
  int v4[10]; // [esp+ECh] [ebp-5Ch]
  int j; // [esp+114h] [ebp-34h]
  __int64 v6; // [esp+118h] [ebp-30h]
  int v7; // [esp+124h] [ebp-24h]
  int v8; // [esp+128h] [ebp-20h]
  int i; // [esp+12Ch] [ebp-1Ch]

  v3 = 2147122737;
  v4[0] = 140540;
  v4[1] = -2008399303;
  v4[2] = 141956;
  v4[3] = 139457077;
  v4[4] = 262023;
  v4[5] = -2008923597;
  v4[6] = 143749;
  v4[7] = 2118271985;
  v4[8] = 143868;
  for ( i = 0; i <= 4; ++i )
  {
    memset(v2, 0, sizeof(v2));
    v8 = 0;
    v7 = 0;
    v0 = v4[2 * i];
    LODWORD(v6) = v4[2 * i - 1];
    HIDWORD(v6) = v0;
    while ( v6 > 0 )
    {
      v2[v8++] = v6 % 2;
      v6 /= 2i64;
    }
    for ( j = 50; j >= 0; --j )
    {
      if ( v2[j] )
      {
        if ( v2[j] == 1 )
        {
          putchar(42);
          ++v7;
        }
      }
      else
      {
        putchar(32);
        ++v7;
      }
      if ( !(v7 % 5) )
        putchar(32);
    }
    result = putchar(10);
  }
  return result;
}

这是que函数,但是你可以发现没有任何调用

que函数里面有putchar 

就是输出函数

好嘛那

我直接爆改

开局就调用que函数

然后就...

下班拉!

### BJDCTF2020 Easy MD5 Challenge Solution For the BJDCTF2020 competition's Easy MD5 challenge, participants were tasked with exploiting weaknesses within the MD5 hashing algorithm. Typically, these types of challenges involve finding collisions or reversing hashes under specific circumstances. To solve this particular challenge: 1. **Understanding the Problem**: The task often involves generating two distinct inputs that produce the same MD5 hash output or identifying an original input from its hashed value given certain constraints. 2. **Exploiting Weaknesses in MD5**: Since MD5 is known to be vulnerable to collision attacks due to its design flaws[^4], one approach could involve leveraging precomputed tables (rainbow tables) or utilizing algorithms designed specifically for creating collisions efficiently. 3. **Code Implementation Example**: Below demonstrates a simple Python script which might have been used during such CTF events to find potential collisions through brute force methods: ```python import hashlib def md5_hash(text): return hashlib.md5(text.encode()).hexdigest() target_hash = "d41d8cd98f00b204e9800998ecf8427e" # Replace with actual target hash provided by challenge organizers for i in range(1000000): # Adjust based on expected complexity test_string = str(i).zfill(6) if md5_hash(test_string)[:len(target_hash)] == target_hash[:len(md5_hash(test_string))]: print(f"Collision found at {test_string}") break else: print("No collision found.") ``` This example assumes a scenario where partial matches suffice; adjustments would need to be made depending on exact requirements set forth by the challenge creators.
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

name_name123

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值