ALL the CTFS of Crypto2025 finally
This commit is contained in:
1
crypto-hash/equality/HashPump
Submodule
1
crypto-hash/equality/HashPump
Submodule
Submodule crypto-hash/equality/HashPump added at 52d6172005
1
crypto-hash/equality/HashPump-partialhash
Submodule
1
crypto-hash/equality/HashPump-partialhash
Submodule
Submodule crypto-hash/equality/HashPump-partialhash added at b822764fa7
1
crypto-hash/equality/MD4-Collision
Submodule
1
crypto-hash/equality/MD4-Collision
Submodule
Submodule crypto-hash/equality/MD4-Collision added at ccbe5d3e05
17
crypto-hash/equality/attack.py
Normal file
17
crypto-hash/equality/attack.py
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
from pwn import *
|
||||
HOST = "130.192.5.212"
|
||||
PORT = 6631
|
||||
#Generate with MD4-Collision
|
||||
m1 = "c2a66ef939681a46895edbd696dec463691253412c051f4c147b955348bcb90d9721b08e22ee254c42f24fa7d6a946ca16a09caa7e71cc430c30f1448763b200"
|
||||
m2 = "c2a66ef939681ac6895edb4696dec463691253412c051f4c147b955348bcb90d9721b08e22ee254c42f24fa7d6a946ca16a09baa7e71cc430c30f1448763b200"
|
||||
server = remote(HOST,PORT)
|
||||
server.send(m1)
|
||||
server.send(b'\n')
|
||||
server.send(m2)
|
||||
server.send(b'\n')
|
||||
|
||||
print(server.recv(1024))
|
||||
|
||||
print(server.recv(1024))
|
||||
|
||||
27
crypto-hash/equality/chall.py
Normal file
27
crypto-hash/equality/chall.py
Normal file
@ -0,0 +1,27 @@
|
||||
from Crypto.Hash import MD4
|
||||
import hashlib
|
||||
from binascii import unhexlify
|
||||
from secret import flag
|
||||
|
||||
|
||||
def md4(data: bytes) -> str:
|
||||
h = MD4.new()
|
||||
h.update(data)
|
||||
return h.hexdigest()
|
||||
|
||||
|
||||
print("Find two strings that are both equal and different! I'll use _optimized algorithms_ to check.")
|
||||
|
||||
s1 = unhexlify(input("Enter the first string: "))
|
||||
s2 = unhexlify(input("Enter your second string: "))
|
||||
|
||||
md4_s1 = md4(s1)
|
||||
md4_s2 = md4(s2)
|
||||
|
||||
md5_s1 = hashlib.md5(s1).hexdigest()
|
||||
md5_s2 = hashlib.md5(s2).hexdigest()
|
||||
|
||||
if md4_s1 == md4_s2 and md5_s1 != md5_s2:
|
||||
print(f"Good job! {flag}")
|
||||
else:
|
||||
print("Try again!")
|
||||
Reference in New Issue
Block a user