当前位置:   article > 正文

BugKu-CTF(解密篇Crypto)--where is flag 5

where is flag 5

  1. Gx8EAA8SCBIfHQARCxMUHwsAHRwRHh8BEQwaFBQfGwMYCBYRHx4SBRQdGR8HAQ0QFQ==
  2. 得到一串密文,一看就是base64,但是工具解不出来,用python是可以的

  1. import base64
  2. str = "Gx8EAA8SCBIfHQARCxMUHwsAHRwRHh8BEQwaFBQfGwMYCBYRHx4SBRQdGR8HAQ0QFQ=="
  3. str =base64.b64decode(str)
  4. print(str)

  1. 得到一串看似十六进制的内容
  2. b'\x1b\x1f\x04\x00\x0f\x12\x08\x12\x1f\x1d\x00\x11\x0b\x13\x14\x1f\x0b\x00\x1d\x1c\x11\x1e\x1f\x01\x11\x0c\x1a\x14\x14\x1f\x1b\x03\x18\x08\x16\x11\x1f\x1e\x12\x05\x14\x1d\x19\x1f\x07\x01\r\x10\x15'
  3. 把x去掉(丢word里替换一下,比写脚本快)
  4. 1b 1f 04 00 0f 12 08 12 1f 1d 00 11 0b 13 14 1f 0b 00 1d 1c 11 1e 1f 01 11 0c 1a 14 14 1f 1b 03 18 08 16 11 1f 1e 12 05 14 1d 19 1f 07 01 10 15
  5. b、f不属于ascii码里的东西、字母前面只有10提取出来
  6. 110001011101011100111110101111101011111011110011
  7. 转ascii码 七位转一个
  8. b u g k u { c
  1. import base64
  2. str = "Gx8EAA8SCBIfHQARCxMUHwsAHRwRHh8BEQwaFBQfGwMYCBYRHx4SBRQdGR8HAQ0QFQ=="
  3. str = base64.b64decode(str)
  4. l = [bin(i).replace("0b", "") for i in str]
  5. print(l)

  1. 补全0
  2. import base64
  3. str = "Gx8EAA8SCBIfHQARCxMUHwsAHRwRHh8BEQwaFBQfGwMYCBYRHx4SBRQdGR8HAQ0QFQ=="
  4. str = base64.b64decode(str)
  5. l = [bin(i).replace("0b", "") for i in str]
  6. l = ["0"*(5-len(i))+i if(len(i) != 5) else i for i in l]
  7. print(l)

  1. 借鉴肖萧然大佬的博客
  2. import base64
  3. str = "Gx8EAA8SCBIfHQARCxMUHwsAHRwRHh8BEQwaFBQfGwMYCBYRHx4SBRQdGR8HAQ0QFQ=="
  4. str = base64.b64decode(str)
  5. l = [bin(i).replace("0b", "") for i in str]
  6. l = ["0"*(5-len(i))+i if(len(i) != 5) else i for i in l]
  7. for i in range(5):
  8. str = "".join([ii[i] for ii in l])
  9. print(*[chr(int(str[i:i+7], 2)) for i in range(0, len(str), 7)], sep="", end="")
bugku{ce26f61d40fea75fc0b980d7588e}

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号