Title content: Here is a lost MD5 ciphertext e9032??? Da??? ???? 911513?0??? A2 asks you to restore him and add nctf{} to commit the known clue in plaintext: TASC? O3rjmv? Wdjkx? ZM Topic Source: Anheng Cup
Simple MD5 password collisions, by comparing ciphertext e9032 with encrypted data location related information
The problem code is as follows
Go language version
Package Mainimport ("crypto/md5" "io" "Encoding/hex" "Strings" "FMT") var Enable = []rune{' A ', ' B ', ' C ', ' D ', ' E ', ' F ', ' G ', ' H ', ' I ', ' J ', ' K ', ' L ', ' M ', ' N ', ' O ', ' P ', ' Q ', ' R ', ' S ', ' T ', ' U ', ' V ', ' W ', ' X ', ' Y ', ' Z ', ' 1 ', ' 2 ', ' 3 ', ' 4 ', ' 5 ', ' 6 ' , ' 7 ', ' 8 ', ' 9 ', ', '! ', ' "', ' # ', ' $ ', '% ', ' & ', ' \ ', ' (', ') ', ' * ', ' + ', ', ', '-', '. ', '/', ': ', '; ', ' < ', ' = ', ' > ', '? ', ' @ ', ' [', ' \ \ ', '] ', ' ^ ', ' _ ', ' ', ' a ', ' B ', ' C ', ' d ', ' e ', ' f ', ' g ', ' h ', ' I ', ' j ', ' K ', ' l ', ' m ', ' n ', ' O ', ' P ', ' Q ', ' R ', ' s ', ' t ', ' u ', ' V ', ' w ', ' x ', ' y ', ' z ', ' {', ' | ', '} ', ' ~ '}func main () {var (rune1 rune R Une2 Rune Rune3 rune) for i:=0; i< len (enable); i++ {rune1 = enable[i] for j:=0; j< len (enable); J + + {Rune2 = Enable[j] For k:=0; k< Len (Enable); k++ {rune3 = enable[k] Strtodecode: = "TASC" +string (rune1) + "O3RJMV" +stri Ng (rune2) + "Wdjkx" +string (rune3) + "ZM" str: = MD5. New () Io. WriteString (str, strtodecode) hexstr: = str. Sum (nil) Code: = Hex. Encodetostring (hexstr) Result: = "e9032" COM01: = Strings. Contains (code,result) If com01 = = true {fmt. Println (Strtodecode,code)}}}}
PHP version
<?php $list = array( 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','1','2','3','4','5','6','7','8','9',' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@','[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~' ); for ($i=0;$i<count($list);$i++){ $str1 = $list[$i]; for ($j=0;$j<count($list);$j++){ $str2 = $list[$j]; for ($k=0;$k<count($list);$k++){ $str3 = $list[$k]; $str = "TASC".$str1."O3RJMV".$str2."WDJKX".$str3."ZM"; $md5 = md5($str); if(strstr($md5,"e9032")){ echo $str."---".$md5."\n"; } } } }