misc

Your GitHub, mine

  1. 根据链接,创建一个自己的仓库
  2. 连接nc,发现有工作量证明
python
 1import hashlib
 2def find_hashcash_challenge(prefix, difficulty=6):
 3    """
 4    Find a string X where SHA256(prefix + X) has `difficulty` leading zeros.
 5    Args:
 6        prefix: The string to prepend to X
 7        difficulty: Number of leading zeros required (default: 6)
 8    Returns:
 9        tuple: (found_string, hash_result, attempts)
10    """
11    target = '0' * difficulty
12    nonce = 0
13    while True:
14        candidate = prefix + str(nonce)
15        hash_result = hashlib.sha256(candidate.encode()).hexdigest()
16        if hash_result[:difficulty] == target:
17            return candidate, hash_result, nonce
18        nonce += 1
19# Solve the challenge
20prefix = 'nE3ysYM4HN'
21candidate, hash_result, attempts = find_hashcash_challenge(prefix, difficulty=6)
22print(f"Prefix: {prefix}")
23print(f"Found: {candidate}")
24print(f"SHA256: {hash_result}")
25print(f"Attempts: {attempts}")
  1. 创建一个issue:
  2. 在GitHub上修改这个issue(因为自己是owner,所以可以修改别人的issue)
    在内容中@lilacctf-tech
  3. 再次连接nc,得flag