weoptions 2023-12-03 01:34 采纳率: 0%
浏览 7

CTF题中010和脚本输出不一样

010Eitor直方图输出的和词频统计脚本统计的不一样,有没有师傅看出来是哪里出了问题
010:ctfshow{a1b2d3e4g56i7j8k9l0}
脚本:chfwos{ta12de45gb36ijk879l}

010:

img

脚本:

img

脚本源码:

char1 = input("请输入要统计的字符串:\n")
dic1 = {}
char2 = ''
for i in char1:
    if i in dic1.keys():
        dic1[i] += 1
    elif i not in dic1.keys():
        dic1[i] = 1

dic1 = dict(sorted(dic1.items(), key=lambda x: x[1], reverse=True))
print('\n', dic1)

char2 = ''.join(dic1.keys())
print('\n', char2)
  • 写回答

2条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2023-12-03 04:03
    关注

    【相关推荐】



    • 这篇博客: CTF出题脚本中的 压缩包套娃脚本 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
      import os
      import random
      import time
      name_list = []
      def zip_file():
          zip_before_file = 'flag.txt'
          for i in range(486):
              # password = random.randint(1000,9999)
              password = name_list[i]
              print(password)
              zip_last_file = str(password) + ".zip"
      
              zip_command = f"7z a -tzip {zip_last_file} {zip_before_file} -p{password}"
              os.system(zip_command)
              time.sleep(1)
              os.remove(zip_before_file)
      
              zip_before_file = zip_last_file
      
      zip_file()
      

    如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^
    评论

报告相同问题?

问题事件

  • 创建了问题 12月3日